summaryrefslogtreecommitdiffstats
path: root/src/invidious.cr
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-08-27 13:46:50 -0500
committerOmar Roth <omarroth@hotmail.com>2018-08-27 13:46:50 -0500
commitb57176d7ef5fe5230bfedf3428e54df70ef4ff56 (patch)
treeed0f3736c16b0b63223837e356ceefcb0eaf0227 /src/invidious.cr
parent0dbef6ab9fb47d486883f0cb0a28d717b54c5a6f (diff)
downloadinvidious-b57176d7ef5fe5230bfedf3428e54df70ef4ff56.tar.gz
invidious-b57176d7ef5fe5230bfedf3428e54df70ef4ff56.tar.bz2
invidious-b57176d7ef5fe5230bfedf3428e54df70ef4ff56.zip
Fix notification count in subscription feed
Diffstat (limited to 'src/invidious.cr')
-rw-r--r--src/invidious.cr15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index ede2dcf6..bcbdcc6d 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -766,7 +766,6 @@ post "/preferences" do |env|
volume = env.params.body["volume"]?.try &.as(String).to_i?
volume ||= 100
- puts env.params.body
comments_0 = env.params.body["comments_0"]?.try &.as(String) || "youtube"
comments_1 = env.params.body["comments_1"]?.try &.as(String) || ""
comments = [comments_0, comments_1]
@@ -1249,21 +1248,21 @@ get "/feed/subscriptions" do |env|
if preferences.notifications_only && !notifications.empty?
args = arg_array(notifications)
- videos = PG_DB.query_all("SELECT * FROM channel_videos WHERE id IN (#{args})
+ notifications = PG_DB.query_all("SELECT * FROM channel_videos WHERE id IN (#{args})
ORDER BY published DESC", notifications, as: ChannelVideo)
- notifications = [] of ChannelVideo
+ videos = [] of ChannelVideo
- videos.sort_by! { |video| video.published }.reverse!
+ notifications.sort_by! { |video| video.published }.reverse!
case preferences.sort
when "alphabetically"
- videos.sort_by! { |video| video.title }
+ notifications.sort_by! { |video| video.title }
when "alphabetically - reverse"
- videos.sort_by! { |video| video.title }.reverse!
+ notifications.sort_by! { |video| video.title }.reverse!
when "channel name"
- videos.sort_by! { |video| video.author }
+ notifications.sort_by! { |video| video.author }
when "channel name - reverse"
- videos.sort_by! { |video| video.author }.reverse!
+ notifications.sort_by! { |video| video.author }.reverse!
end
else
if preferences.latest_only