Restyle Move populate to new file (#48)

This commit is contained in:
restyled-io[bot]
2022-05-04 01:42:26 +03:00
committed by GitHub
parent 4c09350b41
commit 559b36bd7b
7 changed files with 34 additions and 35 deletions
+5 -6
View File
@@ -10,12 +10,11 @@ from app import api
from app import functions
from app import instances
from app import models
from app import settings
from app.lib import taglib
from app.lib import trackslib
from progress.bar import Bar
from app.lib import taglib
from app import settings
def get_all_albums() -> List[models.Album]:
"""
@@ -66,7 +65,8 @@ def find_album(albumtitle: str, artist: str) -> int or None:
iter += 1
mid = (left + right) // 2
if api.ALBUMS[mid].title == albumtitle and api.ALBUMS[mid].artist == artist:
if api.ALBUMS[mid].title == albumtitle and api.ALBUMS[
mid].artist == artist:
return mid
if api.ALBUMS[mid].title < albumtitle:
@@ -155,8 +155,7 @@ def create_album(track) -> models.Album:
album["date"] = album_tracks[0]["date"]
album["artistimage"] = urllib.parse.quote_plus(
album_tracks[0]["albumartist"] + ".webp"
)
album_tracks[0]["albumartist"] + ".webp")
album["image"] = get_album_image(album_tracks)