mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
calculate playlist duration
- use python's `sum()` method to add durations instead of for loop
This commit is contained in:
committed by
Mungai Geoffrey
parent
5bc0eaf8e6
commit
b318c0d324
@@ -85,19 +85,6 @@ class ValidateAlbumThumbs:
|
||||
self.find_lost_thumbnails()
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
def use_defaults() -> str:
|
||||
"""
|
||||
Returns a path to a random image in the defaults directory.
|
||||
|
||||
Reference in New Issue
Block a user