albums sort by date instead of alphabetically
This commit is contained in:
parent
ec89df7a88
commit
38808dba67
5
musik.py
5
musik.py
|
@ -187,8 +187,9 @@ class Selection(Resource):
|
|||
found.append(track)
|
||||
if not found:
|
||||
abort(404, message="Artist does not exist.")
|
||||
found = list(set(t.album for t in found))
|
||||
return sorted(found)
|
||||
seen = {track.album: track.date for track in found}
|
||||
found = sorted(seen.keys(), key=lambda album: seen[album])
|
||||
return found
|
||||
|
||||
|
||||
class RandomSelection(Resource):
|
||||
|
|
Loading…
Reference in New Issue
Block a user