mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Store continuation so that it can be used on the next matching request.
This is done because the continuation created for videos sorted by 'oldest' doesn't work after the first 30 videos. The same 30 videos are returned again. The only way to get the next 30 videos, and onwards, is to use the continuation returned in the initial API call. Storing the returned continuation in the db saves having to request each page from 1 to the currently wanted page each time a page other than the first is wanted.
This commit is contained in:
parent
12c219ee6c
commit
f34f06bca5
5 changed files with 98 additions and 5 deletions
23
config/sql/channel_continuations.sql
Normal file
23
config/sql/channel_continuations.sql
Normal file
|
@ -0,0 +1,23 @@
|
|||
-- Table: public.channel_continuations
|
||||
|
||||
-- DROP TABLE public.channel_continuations;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.channel_continuations
|
||||
(
|
||||
id text NOT NULL,
|
||||
page integer,
|
||||
sort_by text,
|
||||
continuation text,
|
||||
CONSTRAINT channel_continuations_id_page_sort_by_key UNIQUE (id, page, sort_by)
|
||||
);
|
||||
|
||||
GRANT ALL ON TABLE public.channel_continuations TO default_user;
|
||||
|
||||
-- Index: public.channel_continuations_id_idx
|
||||
|
||||
-- DROP INDEX public.channel_continuations_id_idx;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS channel_continuations_id_idx
|
||||
ON public.channel_continuations
|
||||
USING btree
|
||||
(id COLLATE pg_catalog."default");
|
Loading…
Add table
Add a link
Reference in a new issue