summaryrefslogtreecommitdiffstats
path: root/src/invidious.cr
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-03-05 07:17:29 -0600
committerOmar Roth <omarroth@hotmail.com>2019-03-05 07:17:29 -0600
commit2a1befb41a7fa2bc8f15bff704761a79847b51ba (patch)
treeb6200b5d28973a3e92764fab758227c20e81627c /src/invidious.cr
parent2840d98fd425b78dbe336b4c806f95c286b9f6e3 (diff)
downloadinvidious-2a1befb41a7fa2bc8f15bff704761a79847b51ba.tar.gz
invidious-2a1befb41a7fa2bc8f15bff704761a79847b51ba.tar.bz2
invidious-2a1befb41a7fa2bc8f15bff704761a79847b51ba.zip
Fix sorting for latest_only
Diffstat (limited to 'src/invidious.cr')
-rw-r--r--src/invidious.cr4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 0bf07cf0..9c3248ab 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -1964,7 +1964,7 @@ get "/feed/subscriptions" do |env|
# Show latest video from each channel
videos = PG_DB.query_all("SELECT DISTINCT ON (ucid) * FROM #{view_name} \
- ORDER BY ucid, published", as: ChannelVideo)
+ ORDER BY ucid, published DESC", as: ChannelVideo)
end
videos.sort_by! { |video| video.published }.reverse!
@@ -2210,7 +2210,7 @@ get "/feed/private" do |env|
if latest_only
videos = PG_DB.query_all("SELECT DISTINCT ON (ucid) * FROM #{view_name} \
- ORDER BY ucid, published", as: ChannelVideo)
+ ORDER BY ucid, published DESC", as: ChannelVideo)
videos.sort_by! { |video| video.published }.reverse!
else