improved artist bulk downloading
This commit is contained in:
@@ -51,7 +51,7 @@ def handle_artist_download():
|
||||
json.dumps({
|
||||
"status": "complete",
|
||||
"task_ids": task_ids,
|
||||
"message": f"Artist download completed – {len(task_ids)} album tasks have been queued."
|
||||
"message": f"Artist discography queued – {len(task_ids)} album tasks have been queued."
|
||||
}),
|
||||
status=202,
|
||||
mimetype='application/json'
|
||||
|
||||
@@ -108,6 +108,22 @@ def get_prg_file(task_id):
|
||||
elif track_info:
|
||||
response["progress_message"] = f"Downloading: {track_info}"
|
||||
|
||||
# For real-time status messages
|
||||
elif status_type == "real_time":
|
||||
# Add real-time specific fields
|
||||
response["current_song"] = last_status.get("song", "")
|
||||
response["percent"] = last_status.get("percent", 0)
|
||||
response["percentage"] = last_status.get("percentage", 0)
|
||||
response["time_elapsed"] = last_status.get("time_elapsed", 0)
|
||||
|
||||
# Format a nice progress message for display
|
||||
song = last_status.get("song", "")
|
||||
percent = last_status.get("percent", 0)
|
||||
if song:
|
||||
response["progress_message"] = f"Downloading {song} ({percent}%)"
|
||||
else:
|
||||
response["progress_message"] = f"Downloading ({percent}%)"
|
||||
|
||||
# For initializing status
|
||||
elif status_type == "initializing":
|
||||
album = last_status.get("album", "")
|
||||
|
||||
@@ -1029,6 +1029,11 @@ def download_playlist(self, **task_data):
|
||||
custom_track_format = task_data.get("custom_track_format", config_params.get("customTrackFormat", "%tracknum%. %music%"))
|
||||
pad_tracks = task_data.get("pad_tracks", config_params.get("tracknum_padding", True))
|
||||
|
||||
# Get retry parameters
|
||||
initial_retry_delay = task_data.get("initial_retry_delay", config_params.get("retryDelaySeconds", 5))
|
||||
retry_delay_increase = task_data.get("retry_delay_increase", config_params.get("retry_delay_increase", 5))
|
||||
max_retries = task_data.get("max_retries", config_params.get("maxRetries", 3))
|
||||
|
||||
# Execute the download
|
||||
download_playlist_func(
|
||||
service=service,
|
||||
|
||||
@@ -19,7 +19,8 @@ def download_playlist(
|
||||
initial_retry_delay=5,
|
||||
retry_delay_increase=5,
|
||||
max_retries=3,
|
||||
progress_callback=None
|
||||
progress_callback=None,
|
||||
spotify_quality=None
|
||||
):
|
||||
try:
|
||||
# DEBUG: Print parameters
|
||||
@@ -96,7 +97,7 @@ def download_playlist(
|
||||
initial_retry_delay=initial_retry_delay,
|
||||
retry_delay_increase=retry_delay_increase,
|
||||
max_retries=max_retries,
|
||||
spotify_quality=fall_quality
|
||||
spotify_quality=spotify_quality or fall_quality
|
||||
)
|
||||
print(f"DEBUG: Playlist download completed successfully using Deezer credentials")
|
||||
except Exception as e:
|
||||
@@ -126,7 +127,7 @@ def download_playlist(
|
||||
spo.download_playlist(
|
||||
link_playlist=url,
|
||||
output_dir="./downloads",
|
||||
quality_download=fall_quality,
|
||||
quality_download=spotify_quality or fall_quality,
|
||||
recursive_quality=True,
|
||||
recursive_download=False,
|
||||
not_interface=False,
|
||||
@@ -167,7 +168,7 @@ def download_playlist(
|
||||
spo.download_playlist(
|
||||
link_playlist=url,
|
||||
output_dir="./downloads",
|
||||
quality_download=quality,
|
||||
quality_download=spotify_quality or quality,
|
||||
recursive_quality=True,
|
||||
recursive_download=False,
|
||||
not_interface=False,
|
||||
|
||||
Reference in New Issue
Block a user