diff --git a/musik.py b/musik.py index 58039ff..d8464f4 100755 --- a/musik.py +++ b/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):