mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-24 03:57:14 -04:00
Fix set_playlist_to_album, hardcode max_workers to 15
This commit is contained in:
parent
6f321e5b32
commit
ccd87321b6
2 changed files with 7 additions and 4 deletions
|
@ -753,8 +753,8 @@ class Tracklist(list):
|
||||||
|
|
||||||
if kwargs.get("concurrent_downloads", True):
|
if kwargs.get("concurrent_downloads", True):
|
||||||
# Tidal errors out with unlimited concurrency
|
# Tidal errors out with unlimited concurrency
|
||||||
max_workers = 15 if self.client.source == "tidal" else None
|
# max_workers = 15 if self.client.source == "tidal" else 90
|
||||||
with concurrent.futures.ThreadPoolExecutor(max_workers) as executor:
|
with concurrent.futures.ThreadPoolExecutor(15) as executor:
|
||||||
futures = [executor.submit(target, item, **kwargs) for item in self]
|
futures = [executor.submit(target, item, **kwargs) for item in self]
|
||||||
try:
|
try:
|
||||||
concurrent.futures.wait(futures)
|
concurrent.futures.wait(futures)
|
||||||
|
|
|
@ -282,7 +282,10 @@ class MusicDL(list):
|
||||||
try:
|
try:
|
||||||
track = next(self.search(lastfm_source, query, media_type="track"))
|
track = next(self.search(lastfm_source, query, media_type="track"))
|
||||||
if self.config.session["metadata"]["set_playlist_to_album"]:
|
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)
|
playlist.append(track)
|
||||||
except NoResultsFound:
|
except NoResultsFound:
|
||||||
tracks_not_found += 1
|
tracks_not_found += 1
|
||||||
|
@ -302,7 +305,7 @@ class MusicDL(list):
|
||||||
]
|
]
|
||||||
# only for the progress bar
|
# only for the progress bar
|
||||||
for f in tqdm(
|
for f in tqdm(
|
||||||
concurrent.futures.as_completed(futures), total=len(futures)
|
concurrent.futures.as_completed(futures), total=len(futures), desc='Searching'
|
||||||
):
|
):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue