Mark playlist rows played in db
This commit is contained in:
parent
747f28f4f9
commit
c61df17dd5
11
app/ds.py
11
app/ds.py
@ -1034,6 +1034,17 @@ def playlistrow_update_note(playlistrow_id: int, note: str) -> PlaylistRowDTO:
|
|||||||
|
|
||||||
return new_plr
|
return new_plr
|
||||||
|
|
||||||
|
|
||||||
|
def playlistrow_played(playlistrow_id: int, status: bool) -> None:
|
||||||
|
"""Update played status of row"""
|
||||||
|
|
||||||
|
with db.Session() as session:
|
||||||
|
session.execute(
|
||||||
|
update(PlaylistRows).where(PlaylistRows.id == playlistrow_id).values(played=status)
|
||||||
|
)
|
||||||
|
session.commit()
|
||||||
|
|
||||||
|
|
||||||
# Playdates
|
# Playdates
|
||||||
# @log_call
|
# @log_call
|
||||||
def playdates_get_last(track_id: int, limit: int = 5) -> str:
|
def playdates_get_last(track_id: int, limit: int = 5) -> str:
|
||||||
|
|||||||
@ -166,6 +166,10 @@ class PlaylistRow:
|
|||||||
def played(self):
|
def played(self):
|
||||||
return self.dto.played
|
return self.dto.played
|
||||||
|
|
||||||
|
@played.setter
|
||||||
|
def played(self, value: bool) -> None:
|
||||||
|
ds.playlistrow_played(self.playlistrow_id, value)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def playlist_id(self):
|
def playlist_id(self):
|
||||||
return self.dto.playlist_id
|
return self.dto.playlist_id
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user