mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-10-29 11:34:42 +00:00
attach favorites to logged in user
This commit is contained in:
1 parent
300c8eb30b
commit
0b8a5e92f5
14 files changed
+128
-38
No files matched your search
@@ -5,6 +5,9 @@ from app.models.track import Track
|
||||
|
||||
def serialize_track(track: Track, to_remove: set = {}, remove_disc=True) -> dict:
|
||||
album_dict = asdict(track)
|
||||
# is_favorite @property is not included in asdict
|
||||
album_dict["is_favorite"] = track.is_favorite
|
||||
|
||||
props = {
|
||||
"date",
|
||||
"genre",
|
||||
@@ -16,6 +19,7 @@ def serialize_track(track: Track, to_remove: set = {}, remove_disc=True) -> dict
|
||||
"track",
|
||||
"artist_hashes",
|
||||
"created_date",
|
||||
"fav_userids",
|
||||
}.union(to_remove)
|
||||
|
||||
if not remove_disc:
|
||||
|
||||
Reference in new issue
Block a user