mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user