move the populate function to separate file

This commit is contained in:
geoffrey45
2022-05-04 01:36:27 +03:00
parent 1e7af1a800
commit 4c09350b41
6 changed files with 195 additions and 142 deletions
+2 -4
View File
@@ -114,17 +114,15 @@ def get_album_image(album: list) -> str:
Gets the image of an album.
"""
uri = settings.IMG_THUMB_URI
for track in album:
img_p = gen_random_path()
exists = taglib.extract_thumb(track["filepath"], webp_path=img_p)
if exists:
return uri + img_p
return img_p
return uri + use_defaults()
return use_defaults()
def get_album_tracks(album: str, artist: str) -> List: