SPB Git

Repository Public

002_lyrics.sql 1.2 KB 18 lines sql

1-- Synchronised lyrics (karaoke view). Generated on the node by a local speech-to-text model from the track's own2-- audio, or typed/corrected by an administrator. Nothing is fetched from or sent to an external lyrics service.3CREATE TABLE lyrics (4  track_id   uuid PRIMARY KEY REFERENCES tracks(id) ON DELETE CASCADE,5  -- queued → working → ready | empty (no words found: instrumental) | error6  state      text NOT NULL CHECK (state IN ('queued', 'working', 'ready', 'empty', 'error')),7  language   text,                                   -- language of the stored lines (ISO 639-1)8  requested_language text,                           -- hint given when queued; NULL = detect9  source     text NOT NULL DEFAULT 'whisper' CHECK (source IN ('whisper', 'manual')),10  model      text,11  -- [{ "t": startMs, "e": endMs, "text": "…", "w": [[startMs, endMs, "word"], …] }]  ("w" absent on hand-typed lines)12  lines      jsonb NOT NULL DEFAULT '[]',13  edited     boolean NOT NULL DEFAULT false,         -- corrected by hand: never overwritten without an explicit request14  error      text,15  updated_at timestamptz NOT NULL DEFAULT now()16);17CREATE INDEX lyrics_queue ON lyrics (updated_at) WHERE state = 'queued';18
Files main
Menu

Theme