mirror of
https://github.com/iv-org/invidious.git
synced 2026-01-28 07:48:31 -06:00
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
44e700c7ae
commit
7b48da6802
@ -235,8 +235,8 @@ def fetch_channel(ucid, pull_all_videos : Bool)
|
||||
.select(SearchVideo)
|
||||
.select(&.id.== video_id)[0]?
|
||||
|
||||
# Not a video, either a short of a livestream
|
||||
# Fetch invididual for info
|
||||
# Not a video, either a short or a livestream
|
||||
# Fetch individual for info
|
||||
if channel_video.nil?
|
||||
short_or_live = fetch_video(video_id, "")
|
||||
video_type = short_or_live.video_type
|
||||
|
||||
@ -438,7 +438,7 @@ module Invidious::Routes::Feeds
|
||||
live_now: video.live_now,
|
||||
premiere_timestamp: video.premiere_timestamp,
|
||||
views: video.views,
|
||||
video_type: VideoType::Video
|
||||
video_type: video.video_type
|
||||
})
|
||||
|
||||
was_insert = Invidious::Database::ChannelVideos.insert(video, with_premiere_timestamp: true)
|
||||
|
||||
@ -33,6 +33,8 @@ def get_subscription_feed(user, max_results = 40, page = 1)
|
||||
if user.preferences.hide_shorts
|
||||
types_to_fetch.delete(VideoType::Short)
|
||||
end
|
||||
# Note: hide_livestreams also hides scheduled/premiere videos (VideoType::Scheduled),
|
||||
# since they are typically upcoming livestreams.
|
||||
if user.preferences.hide_livestreams
|
||||
[VideoType::Livestream, VideoType::Scheduled].each { |v| types_to_fetch.delete(v) }
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user