Rettelsaer
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user