Fix set_playlist_to_album, hardcode max_workers to 15

This commit is contained in:
nathom 2021-04-19 16:02:42 -07:00
parent 6f321e5b32
commit ccd87321b6
2 changed files with 7 additions and 4 deletions

View file

@ -753,8 +753,8 @@ class Tracklist(list):
if kwargs.get("concurrent_downloads", True):
# Tidal errors out with unlimited concurrency
max_workers = 15 if self.client.source == "tidal" else None
with concurrent.futures.ThreadPoolExecutor(max_workers) as executor:
# max_workers = 15 if self.client.source == "tidal" else 90
with concurrent.futures.ThreadPoolExecutor(15) as executor:
futures = [executor.submit(target, item, **kwargs) for item in self]
try:
concurrent.futures.wait(futures)

View file

@ -282,7 +282,10 @@ class MusicDL(list):
try:
track = next(self.search(lastfm_source, query, media_type="track"))
if self.config.session["metadata"]["set_playlist_to_album"]:
track.version = track.work = None
# so that the playlist name (actually the album) isn't
# amended to include version and work tags from individual tracks
track.meta.version = track.meta.work = None
playlist.append(track)
except NoResultsFound:
tracks_not_found += 1
@ -302,7 +305,7 @@ class MusicDL(list):
]
# only for the progress bar
for f in tqdm(
concurrent.futures.as_completed(futures), total=len(futures)
concurrent.futures.as_completed(futures), total=len(futures), desc='Searching'
):
pass