Allow users to delete or move their requested songs down.

This commit is contained in:
Jim Driessen
2017-01-24 17:42:35 +01:00
parent b04a547b34
commit 6601aaeffd
2 changed files with 4 additions and 3 deletions

View File

@ -19,11 +19,12 @@ def song_to_dict(song, hash=False, user=False):
return data
def playlist_song_to_dict(playlist_song, hash=False):
def playlist_song_to_dict(playlist_song, hash=False, user=None):
return {
'id': playlist_song.id,
'requested_by': 'Marietje' if playlist_song.user is None else playlist_song.user.name,
'song': song_to_dict(playlist_song.song, hash=hash)
'song': song_to_dict(playlist_song.song, hash=hash),
'can_move_down': playlist_song.user is not None and playlist_song.user == user
}