inlcude album duration in album info

This commit is contained in:
geoffrey45
2022-03-02 10:19:36 +03:00
parent fb744fcbbd
commit 6fcca991b8
+13
View File
@@ -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