mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
add routes for getting recently added items
This commit is contained in:
@@ -3,7 +3,10 @@ from app.models import Album
|
||||
|
||||
|
||||
def album_serializer(album: Album, to_remove: set[str]) -> dict:
|
||||
album_dict = asdict(album)
|
||||
try:
|
||||
album_dict = asdict(album)
|
||||
except TypeError:
|
||||
return {}
|
||||
|
||||
to_remove.update(key for key in album_dict.keys() if key.startswith("is_"))
|
||||
for key in to_remove:
|
||||
|
||||
@@ -4,7 +4,10 @@ from app.models.artist import Artist
|
||||
|
||||
|
||||
def serialize_for_card(artist: Artist):
|
||||
artist_dict = asdict(artist)
|
||||
try:
|
||||
artist_dict = asdict(artist)
|
||||
except TypeError:
|
||||
return {}
|
||||
|
||||
props_to_remove = {
|
||||
"is_favorite",
|
||||
|
||||
Reference in New Issue
Block a user