mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-06-06 03:05:35 +00:00
add print on taglib.py, line 60
This commit is contained in:
parent
92841a8f76
commit
574ccf9fea
@ -8,8 +8,7 @@ from requests import ReadTimeout
|
||||
|
||||
from app import settings
|
||||
from app.db.sqlite.favorite import SQLiteFavoriteMethods as favdb
|
||||
from app.db.sqlite.lastfm.similar_artists import \
|
||||
SQLiteLastFMSimilarArtists as lastfmdb
|
||||
from app.db.sqlite.lastfm.similar_artists import SQLiteLastFMSimilarArtists as lastfmdb
|
||||
from app.db.sqlite.settings import SettingsSQLMethods as sdb
|
||||
from app.db.sqlite.tracks import SQLiteTrackMethods
|
||||
from app.lib.albumslib import validate_albums
|
||||
@ -264,16 +263,18 @@ class ProcessTrackThumbnails:
|
||||
# process the rest
|
||||
key_album_map = ((instance_key, album) for album in albums)
|
||||
|
||||
with ThreadPoolExecutor(max_workers=CPU_COUNT) as executor:
|
||||
results = list(
|
||||
tqdm(
|
||||
executor.map(get_image, key_album_map),
|
||||
total=len(albums),
|
||||
desc="Extracting track images",
|
||||
)
|
||||
)
|
||||
# with ThreadPoolExecutor(max_workers=CPU_COUNT) as executor:
|
||||
# results = list(
|
||||
# tqdm(
|
||||
# executor.map(get_image, key_album_map),
|
||||
# total=len(albums),
|
||||
# desc="Extracting track images",
|
||||
# )
|
||||
# )
|
||||
|
||||
list(results)
|
||||
# list(results)
|
||||
for album in key_album_map:
|
||||
get_image(album)
|
||||
|
||||
|
||||
def save_similar_artists(_map: tuple[str, Artist]):
|
||||
|
@ -56,6 +56,7 @@ def extract_thumb(filepath: str, webp_path: str, overwrite=False) -> bool:
|
||||
album_art = parse_album_art(filepath)
|
||||
|
||||
if album_art is not None:
|
||||
print("Reading image: " + filepath)
|
||||
try:
|
||||
img = Image.open(BytesIO(album_art))
|
||||
except (UnidentifiedImageError, OSError):
|
||||
|
Loading…
x
Reference in New Issue
Block a user