Rettelsaer

This commit is contained in:
2026-04-13 07:23:37 +02:00
parent 45dcedaed4
commit bbd5690d72
22 changed files with 2026 additions and 538 deletions

View File

@@ -251,6 +251,11 @@ MIGRATIONS: dict[int, list[str]] = {
"""ALTER TABLE playlist_songs ADD COLUMN is_workshop INTEGER NOT NULL DEFAULT 0""",
"""ALTER TABLE playlist_songs ADD COLUMN dance_override TEXT NOT NULL DEFAULT ''""",
],
7: [
# Linkede server-playlister
"""ALTER TABLE playlists ADD COLUMN is_linked INTEGER NOT NULL DEFAULT 0""",
"""ALTER TABLE playlists ADD COLUMN server_permission TEXT NOT NULL DEFAULT 'view'""",
],
}
@@ -481,6 +486,20 @@ def create_playlist(name: str, description: str = "", tags: str = "") -> int:
return cur.lastrowid
def create_linked_playlist(name: str, api_project_id: str,
permission: str = "view",
description: str = "", tags: str = "") -> int:
"""Opret en playliste der er linket til en server-playliste."""
with get_db() as conn:
cur = conn.execute(
"""INSERT INTO playlists
(name, description, tags, api_project_id, is_linked, server_permission)
VALUES (?,?,?,?,1,?)""",
(name, description, tags, api_project_id, permission)
)
return cur.lastrowid
def update_playlist_tags(playlist_id: int, tags: str):
with get_db() as conn:
conn.execute(