mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-20 00:33:36 +00:00
Add backwards-compatible specialist overview style metadata
This commit is contained in:
@@ -104,6 +104,7 @@ CREATE TABLE IF NOT EXISTS jellyfin_overview_drafts (
|
||||
jellyfin_item_id TEXT NOT NULL,
|
||||
overview TEXT NOT NULL,
|
||||
model TEXT NOT NULL,
|
||||
style TEXT NOT NULL DEFAULT 'general',
|
||||
caption_fingerprint TEXT NOT NULL,
|
||||
sampled_captions INTEGER NOT NULL,
|
||||
original_overview TEXT,
|
||||
@@ -179,11 +180,25 @@ def _ensure_frame_caption_columns(con: sqlite3.Connection) -> None:
|
||||
)
|
||||
|
||||
|
||||
def _ensure_overview_columns(con: sqlite3.Connection) -> None:
|
||||
"""Upgrade existing overview drafts without dropping publish/restore backups."""
|
||||
columns = {
|
||||
row["name"]
|
||||
for row in con.execute("PRAGMA table_info(jellyfin_overview_drafts)")
|
||||
}
|
||||
if "style" not in columns:
|
||||
con.execute(
|
||||
"ALTER TABLE jellyfin_overview_drafts "
|
||||
"ADD COLUMN style TEXT NOT NULL DEFAULT 'general'"
|
||||
)
|
||||
|
||||
|
||||
def init_db(path: Path) -> None:
|
||||
with connect(path) as con:
|
||||
con.executescript(SCHEMA)
|
||||
_ensure_media_jellyfin_columns(con)
|
||||
_ensure_frame_caption_columns(con)
|
||||
_ensure_overview_columns(con)
|
||||
|
||||
|
||||
def pack_vector(vector: np.ndarray) -> bytes:
|
||||
|
||||
Reference in New Issue
Block a user