feat(audiobooks): migrations 154 + 155 for Phase 1 close-out

154 adds hide_from_continue to user_watch_progress (backs the
ABS remove/readd-to-continue-listening endpoints). 155 creates
abs_rss_feeds for the upcoming RSS surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
RXWatcher
2026-05-26 21:46:21 +02:00
co-authored by Claude Opus 4.7
parent b83155d7de
commit cae5fb03b3
4 changed files with 37 additions and 0 deletions
@@ -0,0 +1,2 @@
ALTER TABLE public.user_watch_progress
DROP COLUMN IF EXISTS hide_from_continue;
@@ -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;
+3
View File
@@ -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;
+25
View File
@@ -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)
);