Pàgines llista de reproducció

This commit is contained in:
marc
2025-12-20 23:29:11 +01:00
parent 5428d49e89
commit 56ab91bd42
11 changed files with 291 additions and 20 deletions

View File

@@ -55,3 +55,17 @@ def get_playlist_entries(
cur = con.cursor()
_ = cur.execute(query, data)
return map(conversion.row_to_playlist_entry, cur.fetchall())
def get_playlist_name(playlist_id: int, con: Connection | None = None) -> str | None:
query = """
SELECT name
FROM playlists
WHERE id = :playlist_id
"""
data = dict(playlist_id=playlist_id)
with get_connection(con) as con:
cur = con.cursor()
_ = cur.execute(query, data)
row = cur.fetchone()
return row[0] if row else None