mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Remove storing continuations when fetching channel.
Videos here are sorted by 'newest' and continuations should only be stored when sorting by 'oldest'.
This commit is contained in:
parent
8e3b8da285
commit
188a7dd9e6
1 changed files with 0 additions and 21 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue