mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-06-06 03:05:35 +00:00
14 lines
283 B
Python
14 lines
283 B
Python
from dataclasses import asdict
|
|
from app.models.playlist import Playlist
|
|
|
|
|
|
def serialize_for_card(playlist: Playlist, to_remove=set()):
|
|
p_dict = asdict(playlist)
|
|
|
|
props = {"trackhashes"}.union(to_remove)
|
|
|
|
for key in props:
|
|
p_dict.pop(key, None)
|
|
|
|
return p_dict
|