fix duplicate artist and album color entry in db

+ Remove folder store
+ Reduce fuzzy search score cutoff from 90% to 75%
+ use inheritance to init Artist class
+ misc
This commit is contained in:
geoffrey45
2023-03-26 18:01:26 +03:00
parent 357afeb700
commit 5487dad27b
18 changed files with 102 additions and 333 deletions
+6 -2
View File
@@ -1,7 +1,8 @@
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
from io import BytesIO
from PIL import Image
from PIL import Image, UnidentifiedImageError
import requests
import urllib
@@ -55,7 +56,10 @@ class DownloadImage:
"""
Downloads the image from the url.
"""
return Image.open(BytesIO(requests.get(url, timeout=10).content))
try:
return Image.open(BytesIO(requests.get(url, timeout=10).content))
except UnidentifiedImageError:
return None
@staticmethod
def save_img(img: Image.Image, sm_path: Path, lg_path: Path):