Feeds: Get rid of feed_needs_update() since it appears to be unused

This commit is contained in:
Fijxu 2024-10-09 18:09:23 -03:00
parent cf6c3a7b5b
commit 3111158a7c
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4
3 changed files with 16 additions and 14 deletions

View file

@ -251,8 +251,8 @@ def fetch_channel(ucid, pull_all_videos : Bool)
LOGGER.trace("fetch_channel: #{ucid} : video #{video_id} : Inserted, updating subscriptions") LOGGER.trace("fetch_channel: #{ucid} : video #{video_id} : Inserted, updating subscriptions")
if CONFIG.enable_user_notifications if CONFIG.enable_user_notifications
Invidious::Database::Users.add_notification(video) Invidious::Database::Users.add_notification(video)
else # else
Invidious::Database::Users.feed_needs_update(video) # Invidious::Database::Users.feed_needs_update(video)
end end
else else
LOGGER.trace("fetch_channel: #{ucid} : video #{video_id} : Updated") LOGGER.trace("fetch_channel: #{ucid} : video #{video_id} : Updated")
@ -287,8 +287,8 @@ def fetch_channel(ucid, pull_all_videos : Bool)
if was_insert if was_insert
if CONFIG.enable_user_notifications if CONFIG.enable_user_notifications
Invidious::Database::Users.add_notification(video) Invidious::Database::Users.add_notification(video)
else # else
Invidious::Database::Users.feed_needs_update(video) # Invidious::Database::Users.feed_needs_update(video)
end end
end end
end end

View file

@ -154,15 +154,17 @@ module Invidious::Database::Users
# Update (misc) # Update (misc)
# ------------------- # -------------------
def feed_needs_update(video : ChannelVideo) # Feeds never need update. PubSubHubBub is the one that sends videos to
request = <<-SQL # invidious.
UPDATE users # def feed_needs_update(video : ChannelVideo)
SET feed_needs_update = true # request = <<-SQL
WHERE $1 = ANY(subscriptions) # UPDATE users
SQL # SET feed_needs_update = true
# WHERE $1 = ANY(subscriptions)
# SQL
PG_DB.exec(request, video.ucid) # PG_DB.exec(request, video.ucid)
end # end
def update_preferences(user : User) def update_preferences(user : User)
request = <<-SQL request = <<-SQL

View file

@ -450,8 +450,8 @@ module Invidious::Routes::Feeds
if was_insert if was_insert
if CONFIG.enable_user_notifications if CONFIG.enable_user_notifications
Invidious::Database::Users.add_notification(video) Invidious::Database::Users.add_notification(video)
else # else
Invidious::Database::Users.feed_needs_update(video) # Invidious::Database::Users.feed_needs_update(video)
end end
end end
end end