diff --git a/migrations/154_user_watch_progress_hide_from_continue.down.sql b/migrations/154_user_watch_progress_hide_from_continue.down.sql new file mode 100644 index 00000000..a8de870e --- /dev/null +++ b/migrations/154_user_watch_progress_hide_from_continue.down.sql @@ -0,0 +1,2 @@ +ALTER TABLE public.user_watch_progress + DROP COLUMN IF EXISTS hide_from_continue; diff --git a/migrations/154_user_watch_progress_hide_from_continue.up.sql b/migrations/154_user_watch_progress_hide_from_continue.up.sql new file mode 100644 index 00000000..962a997b --- /dev/null +++ b/migrations/154_user_watch_progress_hide_from_continue.up.sql @@ -0,0 +1,7 @@ +-- Toggle for hiding an in-progress book from the Continue Listening +-- shelf without affecting the progress row itself. Used by the +-- ABS-compat /me/progress/{itemId}/remove-from-continue-listening + +-- /readd-to-continue-listening endpoints. + +ALTER TABLE public.user_watch_progress + ADD COLUMN IF NOT EXISTS hide_from_continue boolean NOT NULL DEFAULT false; diff --git a/migrations/155_abs_rss_feeds.down.sql b/migrations/155_abs_rss_feeds.down.sql new file mode 100644 index 00000000..76c5c761 --- /dev/null +++ b/migrations/155_abs_rss_feeds.down.sql @@ -0,0 +1,3 @@ +DROP INDEX IF EXISTS public.abs_rss_feeds_user_profile_idx; +DROP INDEX IF EXISTS public.abs_rss_feeds_slug_uniq; +DROP TABLE IF EXISTS public.abs_rss_feeds; diff --git a/migrations/155_abs_rss_feeds.up.sql b/migrations/155_abs_rss_feeds.up.sql new file mode 100644 index 00000000..644e7f70 --- /dev/null +++ b/migrations/155_abs_rss_feeds.up.sql @@ -0,0 +1,25 @@ +-- Audiobookshelf-style RSS podcast feeds. Each row exposes one +-- audiobook (library_item_id) as a public RSS XML feed reachable at +-- /feed/{slug}.xml — slug is the unguessable capability token. +-- closed_at is NULL while the feed is active; closing soft-deletes +-- so re-opening creates a new row with a new slug. + +CREATE TABLE IF NOT EXISTS public.abs_rss_feeds ( + id text PRIMARY KEY, + user_id integer NOT NULL REFERENCES public.users(id) ON DELETE CASCADE, + profile_id uuid, + library_item_id text NOT NULL REFERENCES public.media_items(content_id) ON DELETE CASCADE, + slug text NOT NULL, + minified boolean NOT NULL DEFAULT false, + created_at timestamptz NOT NULL DEFAULT now(), + closed_at timestamptz +); + +CREATE UNIQUE INDEX IF NOT EXISTS abs_rss_feeds_slug_uniq + ON public.abs_rss_feeds (slug); + +CREATE INDEX IF NOT EXISTS abs_rss_feeds_user_profile_idx + ON public.abs_rss_feeds ( + user_id, + COALESCE(profile_id, '00000000-0000-0000-0000-000000000000'::uuid) + );