Restyled by black

This commit is contained in:
Restyled.io 2022-04-03 10:45:50 +00:00 committed by Mungai Geoffrey
parent ec7352ec56
commit 076f42b81f
2 changed files with 4 additions and 8 deletions

View File

@ -59,8 +59,7 @@ def populate():
""" """
start = time.time() start = time.time()
s, files = helpers.run_fast_scandir( s, files = helpers.run_fast_scandir(settings.HOME_DIR, [".flac", ".mp3"], full=True)
settings.HOME_DIR, [".flac", ".mp3"], full=True)
_bar = Bar("Processing files", max=len(files)) _bar = Bar("Processing files", max=len(files))
@ -124,8 +123,7 @@ def populate_images():
_bar = Bar("Processing images", max=len(artists)) _bar = Bar("Processing images", max=len(artists))
for artist in artists: for artist in artists:
file_path = ( file_path = (
helpers.app_dir + "/images/artists/" + helpers.app_dir + "/images/artists/" + artist.replace("/", "::") + ".webp"
artist.replace("/", "::") + ".webp"
) )
if not os.path.exists(file_path): if not os.path.exists(file_path):
@ -367,8 +365,7 @@ def get_album_bio(title: str, albumartist: str):
return None return None
try: try:
bio = data["album"]["wiki"]["summary"].split( bio = data["album"]["wiki"]["summary"].split('<a href="https://www.last.fm/')[0]
'<a href="https://www.last.fm/')[0]
except KeyError: except KeyError:
bio = None bio = None

View File

@ -45,8 +45,7 @@ def get_album_image(album: list) -> str:
""" """
for track in album: for track in album:
img_p = (track["album"] + track["albumartist"] + img_p = (track["album"] + track["albumartist"] + ".webp").replace("/", "::")
".webp").replace("/", "::")
img = functions.extract_thumb(track["filepath"], webp_path=img_p) img = functions.extract_thumb(track["filepath"], webp_path=img_p)
if img is not None: if img is not None: