mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
check if album colors have contrast
- remove albumid field from album class - set accent color to $red
This commit is contained in:
committed by
Mungai Geoffrey
parent
a23b6200eb
commit
5acb8cb84d
+10
-2
@@ -41,20 +41,28 @@ def get_album():
|
||||
"""Returns all the tracks in the given album."""
|
||||
data = request.get_json()
|
||||
albumhash = data["hash"]
|
||||
error_msg = {"error": "Album not created yet."}
|
||||
|
||||
tracks = instances.tracks_instance.find_tracks_by_hash(albumhash)
|
||||
|
||||
if len(tracks) == 0:
|
||||
return error_msg, 204
|
||||
|
||||
tracks = [models.Track(t) for t in tracks]
|
||||
tracks = helpers.RemoveDuplicates(tracks)()
|
||||
|
||||
album = instances.album_instance.find_album_by_hash(albumhash)
|
||||
|
||||
if not album:
|
||||
return {"error": "Album not created yet."}, 204
|
||||
return error_msg, 204
|
||||
|
||||
album = models.Album(album)
|
||||
|
||||
album.count = len(tracks)
|
||||
album.duration = albumslib.get_album_duration(tracks)
|
||||
try:
|
||||
album.duration = albumslib.get_album_duration(tracks)
|
||||
except AttributeError:
|
||||
album.duration = 0
|
||||
|
||||
if (
|
||||
album.count == 1
|
||||
|
||||
Reference in New Issue
Block a user