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)
|
found.append(track)
|
||||||
if not found:
|
if not found:
|
||||||
abort(404, message="Artist does not exist.")
|
abort(404, message="Artist does not exist.")
|
||||||
found = list(set(t.album for t in found))
|
seen = {track.album: track.date for track in found}
|
||||||
return sorted(found)
|
found = sorted(seen.keys(), key=lambda album: seen[album])
|
||||||
|
return found
|
||||||
|
|
||||||
|
|
||||||
class RandomSelection(Resource):
|
class RandomSelection(Resource):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user