0.3.49
This commit is contained in:
@@ -615,6 +615,22 @@ ALTER TABLE media_requests ADD COLUMN IF NOT EXISTS last_status TEXT NOT NULL DE
|
||||
CREATE INDEX IF NOT EXISTS media_requests_user_requested_idx
|
||||
ON media_requests (emby_user_id, requested_at DESC);
|
||||
|
||||
-- The arrival is announced once as a notification, and then pinned to the front of that
|
||||
-- viewer's Continue Watching row with a REQUEST READY tag until they start watching it.
|
||||
-- These three columns are the memory of that pin: ready_surfaced_at is when the sweep first
|
||||
-- saw the title become watchable (and only then, when the library also had an item id to
|
||||
-- open); ready_item_id is what the row pins and dedupes against; ready_cleared_at is set the
|
||||
-- moment playback starts or the 14-day age-out fires, and a non-null value stops the request
|
||||
-- ever being surfaced again — asking afresh after a delete is a new row, which is the case
|
||||
-- where the pin is genuinely new.
|
||||
ALTER TABLE media_requests ADD COLUMN IF NOT EXISTS ready_surfaced_at TIMESTAMPTZ;
|
||||
ALTER TABLE media_requests ADD COLUMN IF NOT EXISTS ready_item_id TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE media_requests ADD COLUMN IF NOT EXISTS ready_cleared_at TIMESTAMPTZ;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS media_requests_user_surfaced_idx
|
||||
ON media_requests (emby_user_id)
|
||||
WHERE ready_surfaced_at IS NOT NULL AND ready_cleared_at IS NULL;
|
||||
|
||||
-- Every sign-in attempt, successful or not.
|
||||
--
|
||||
-- The sessions table above holds one row per television and is overwritten by the next
|
||||
|
||||
Reference in New Issue
Block a user