Sync playlister
This commit is contained in:
@@ -266,9 +266,33 @@ def pull(
|
||||
]
|
||||
})
|
||||
|
||||
# Egne playlister
|
||||
my_playlists = []
|
||||
for p in db.query(Project).filter_by(owner_id=me.id).all():
|
||||
songs_out = []
|
||||
for ps in p.project_songs:
|
||||
song = db.query(Song).filter_by(id=ps.song_id).first()
|
||||
if not song:
|
||||
continue
|
||||
songs_out.append({
|
||||
"title": song.title,
|
||||
"artist": song.artist,
|
||||
"position": ps.position,
|
||||
"status": ps.status,
|
||||
"is_workshop": ps.is_workshop,
|
||||
"dance_override": ps.dance_override or "",
|
||||
})
|
||||
my_playlists.append({
|
||||
"server_id": p.id,
|
||||
"name": p.name,
|
||||
"description": p.description or "",
|
||||
"songs": sorted(songs_out, key=lambda x: x["position"]),
|
||||
})
|
||||
|
||||
return {
|
||||
"levels": levels,
|
||||
"dances": dances,
|
||||
"community": community,
|
||||
"shared": shared,
|
||||
"levels": levels,
|
||||
"dances": dances,
|
||||
"community": community,
|
||||
"shared": shared,
|
||||
"my_playlists": my_playlists,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user