process albums seperate from tracks

- break populate function into 2
This commit is contained in:
geoffrey45
2022-06-19 14:45:25 +03:00
parent 06ed41d869
commit 3cf44759b5
11 changed files with 100 additions and 220 deletions
+1 -12
View File
@@ -73,17 +73,6 @@ def remove_duplicates(tracklist: List[models.Track]) -> List[models.Track]:
return tracklist
# def save_image(url: str, path: str) -> None:
# """
# Saves an image from an url to a path.
# """
# response = requests.get(url)
# img = Image.open(BytesIO(response.content))
# img.save(path, "JPEG")
def is_valid_file(filename: str) -> bool:
"""
Checks if a file is valid. Returns True if it is, False if it isn't.
@@ -120,7 +109,7 @@ def create_album_hash(title: str, artist: str) -> str:
Creates a simple hash for an album
"""
lower = (title + artist).replace(" ", "").lower()
hash = lower.join([i for i in lower if i not in '/\\:*?"<>|&'])
hash = "".join([i for i in lower if i not in '/\\:*?"<>|&'])
return hash