From 188a7dd9e620d227ece9ef4534bc693b74bb42ba Mon Sep 17 00:00:00 2001 From: 0x24d Date: Sat, 20 Nov 2021 12:47:25 +0000 Subject: [PATCH] Remove storing continuations when fetching channel. Videos here are sorted by 'newest' and continuations should only be stored when sorting by 'oldest'. --- src/invidious/channels/channels.cr | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/invidious/channels/channels.cr b/src/invidious/channels/channels.cr index 7d89c1a8..37868475 100644 --- a/src/invidious/channels/channels.cr +++ b/src/invidious/channels/channels.cr @@ -216,18 +216,6 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil) page = 1 - channel_continuation = ChannelContinuation.new({ - id: ucid, - page: page, - sort_by: "newest", - continuation: produce_channel_videos_continuation(ucid, auto_generated: auto_generated, v2: true) - }) - - LOGGER.trace("fetch_channel: #{ucid} : page #{page} : Updating or inserting continuation") - - db.exec("INSERT INTO channel_continuations VALUES ($1, $2, $3, $4) \ - ON CONFLICT (id, page, sort_by) DO UPDATE SET continuation = $4", *channel_continuation.to_tuple) - LOGGER.trace("fetch_channel: #{ucid} : Downloading channel videos page") initial_data = get_channel_videos_response(ucid, page, auto_generated: auto_generated) videos = extract_videos(initial_data, author, ucid) @@ -293,15 +281,6 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil) initial_data = get_channel_videos_response(ucid, page, auto_generated: auto_generated) videos = extract_videos(initial_data, author, ucid) - channel_continuation = ChannelContinuation.new({ - id: ucid, - page: page, - sort_by: "newest", - continuation: fetch_continuation_token(initial_data) || "" - }) - db.exec("INSERT INTO channel_continuations VALUES ($1, $2, $3, $4) \ - ON CONFLICT (id, page, sort_by) DO UPDATE SET continuation = $4", *channel_continuation.to_tuple) - count = videos.size videos = videos.map { |video| ChannelVideo.new({ id: video.id,