mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
inlcude album duration in album info
This commit is contained in:
@@ -172,3 +172,16 @@ def extract_colors(image) -> list:
|
|||||||
formatted_colors.append(color)
|
formatted_colors.append(color)
|
||||||
|
|
||||||
return formatted_colors
|
return formatted_colors
|
||||||
|
|
||||||
|
|
||||||
|
def get_album_duration(album: List[models.Track]) -> int:
|
||||||
|
"""
|
||||||
|
Gets the duration of an album.
|
||||||
|
"""
|
||||||
|
|
||||||
|
album_duration = 0
|
||||||
|
|
||||||
|
for track in album:
|
||||||
|
album_duration += track.length
|
||||||
|
|
||||||
|
return album_duration
|
||||||
Reference in New Issue
Block a user