feat(notifications): announce new audiobooks and ebooks on server channels (#260)

Audiobook and ebook libraries previously never entered the Recently
Added pipeline: availability detection only ran for TV/movie/mixed
libraries and release_events only knew episode/movie kinds, so server
channels (Discord/generic webhooks) could not announce new audiobooks
or ebooks.

Generalize the movie path into a flat-item-kind registry
(internal/notifications/item_kind.go) driving availability detection,
recording, channel toggles, payload rendering, test fixtures, and the
admin backfill seeder. New kinds share a kind-discriminated
item_availability table; movie_availability stays as-is. Channels gain
notify_new_audiobooks/notify_new_ebooks toggles (default on, additive
API fields) and embeds carry the author from item_people. Flood-safe by
construction: existing libraries seed silently on their first
post-upgrade full scan.

Extract internal/librarykind to replace the is*LibraryType helper
copies that had drifted across scanner, libraryingest, and metadata
(metadata's movie check silently included mixed; now spelled
explicitly).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Quick
2026-07-02 11:42:28 -04:00
committed by GitHub
co-authored by Claude Fable 5
parent 287ff3658f
commit 866392fecd
25 changed files with 889 additions and 349 deletions
+4
View File
@@ -2521,6 +2521,8 @@ export interface ServerNotificationChannel {
enabled: boolean;
notify_new_movies: boolean;
notify_new_episodes: boolean;
notify_new_audiobooks: boolean;
notify_new_ebooks: boolean;
notify_request_submitted: boolean;
notify_request_approved: boolean;
notify_request_declined: boolean;
@@ -2543,6 +2545,8 @@ export interface ServerNotificationChannelInput {
enabled?: boolean;
notify_new_movies?: boolean;
notify_new_episodes?: boolean;
notify_new_audiobooks?: boolean;
notify_new_ebooks?: boolean;
notify_request_submitted?: boolean;
notify_request_approved?: boolean;
notify_request_declined?: boolean;