0.2.64 update
This commit is contained in:
@@ -217,10 +217,24 @@ CREATE TABLE IF NOT EXISTS user_notification_preferences (
|
||||
emby_user_id TEXT PRIMARY KEY,
|
||||
enabled BOOLEAN NOT NULL DEFAULT true,
|
||||
show_return_alerts BOOLEAN NOT NULL DEFAULT true,
|
||||
sonarr_alerts BOOLEAN NOT NULL DEFAULT true,
|
||||
radarr_alerts BOOLEAN NOT NULL DEFAULT true,
|
||||
update_alerts BOOLEAN NOT NULL DEFAULT true,
|
||||
library_alerts BOOLEAN NOT NULL DEFAULT true,
|
||||
system_alerts BOOLEAN NOT NULL DEFAULT true,
|
||||
lead_days INT NOT NULL DEFAULT 7 CHECK (lead_days BETWEEN 1 AND 30),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
-- CREATE TABLE IF NOT EXISTS does not add fields to an existing installation. These
|
||||
-- additive, permissive defaults make the feature safe to roll out without changing what
|
||||
-- any current viewer receives.
|
||||
ALTER TABLE user_notification_preferences ADD COLUMN IF NOT EXISTS sonarr_alerts BOOLEAN NOT NULL DEFAULT true;
|
||||
ALTER TABLE user_notification_preferences ADD COLUMN IF NOT EXISTS radarr_alerts BOOLEAN NOT NULL DEFAULT true;
|
||||
ALTER TABLE user_notification_preferences ADD COLUMN IF NOT EXISTS update_alerts BOOLEAN NOT NULL DEFAULT true;
|
||||
ALTER TABLE user_notification_preferences ADD COLUMN IF NOT EXISTS library_alerts BOOLEAN NOT NULL DEFAULT true;
|
||||
ALTER TABLE user_notification_preferences ADD COLUMN IF NOT EXISTS system_alerts BOOLEAN NOT NULL DEFAULT true;
|
||||
|
||||
-- Notifications are materialised so read/dismissed state follows the user to every TV.
|
||||
-- source_key is deterministic, preventing the same return date from being announced
|
||||
-- again whenever the app refreshes.
|
||||
@@ -696,3 +710,33 @@ CREATE TABLE IF NOT EXISTS media_report_actions (
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS media_report_actions_report_idx
|
||||
ON media_report_actions (report_id, created_at ASC);
|
||||
|
||||
-- Where an episode's closing credits begin, for the small number of episodes a household is
|
||||
-- actually about to watch. Written by internal/credits.
|
||||
--
|
||||
-- The primary key is the whole design. Keyed on the media *version* rather than on the item,
|
||||
-- so a file Sonarr replaces stops matching its old marker and becomes a scan candidate again
|
||||
-- with nothing having to notice the swap — no invalidation pass, no staleness check, and no
|
||||
-- possibility of a Skip Credits button positioned against a file that no longer exists.
|
||||
--
|
||||
-- Deliberately the only durable output of that subsystem. Queue state, candidate priorities
|
||||
-- and scan progress are all held in RAM and rebuilt from Tracearr on restart, because a
|
||||
-- persistent job scheduler would cost more writes than the scanning it coordinates.
|
||||
CREATE TABLE IF NOT EXISTS credits_markers (
|
||||
item_id TEXT NOT NULL,
|
||||
media_fingerprint TEXT NOT NULL,
|
||||
credits_start_ms BIGINT NOT NULL,
|
||||
confidence REAL NOT NULL DEFAULT 0,
|
||||
detection_method TEXT NOT NULL DEFAULT '',
|
||||
-- Only so a season can be read back in one query. That read is what narrows the next
|
||||
-- episode's scan from ten minutes of file to two.
|
||||
series_id TEXT NOT NULL DEFAULT '',
|
||||
season_number INT NOT NULL DEFAULT 0,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
PRIMARY KEY (item_id, media_fingerprint)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS credits_markers_season_idx
|
||||
ON credits_markers (series_id, season_number, confidence DESC)
|
||||
WHERE series_id <> '';
|
||||
|
||||
Reference in New Issue
Block a user