calculate playlist duration

- use python's `sum()` method to add durations instead of for loop
This commit is contained in:
geoffrey45
2022-07-02 13:19:09 +03:00
committed by Mungai Geoffrey
parent 5bc0eaf8e6
commit b318c0d324
7 changed files with 27 additions and 25 deletions
-13
View File
@@ -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.