Pàgines llista de reproducció
This commit is contained in:
@@ -41,10 +41,18 @@ def add_tema_to_tema_in_set(tema_in_set: playlists.TemaInSet) -> playlists.TemaI
|
||||
|
||||
|
||||
def get_playlist(playlist_id: int, con: Connection | None = None) -> playlists.Playlist:
|
||||
return playlists.Playlist.from_playlist_entries(
|
||||
playlist_id=playlist_id,
|
||||
entries=list(query.get_playlist_entries(playlist_id=playlist_id, con=con))
|
||||
)
|
||||
with get_connection(con) as playlist_con:
|
||||
playlist_name = query.get_playlist_name(playlist_id=playlist_id, con=playlist_con)
|
||||
return playlists.Playlist.from_playlist_entries(
|
||||
playlist_id=playlist_id,
|
||||
name=playlist_name,
|
||||
entries=list(query.get_playlist_entries(playlist_id=playlist_id, con=playlist_con))
|
||||
)
|
||||
|
||||
|
||||
def update_name(playlist_id: int, name: str | None) -> playlists.Playlist:
|
||||
write.update_playlist_name(playlist_id=playlist_id, name=name)
|
||||
return get_playlist(playlist_id=playlist_id)
|
||||
|
||||
|
||||
def add_set(playlist_id: int, con: Connection | None = None) -> playlists.Set:
|
||||
|
||||
Reference in New Issue
Block a user