Skip to content

Commit

Permalink
Remove download delay from already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
justin025 committed Oct 24, 2024
1 parent ee02b05 commit 3f50615
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/onthespot/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def run(self):
self.tr("Downloaded"),
self.tr("Already Exists")
):
time.sleep(0.2)
time.sleep(1)
continue
except (RuntimeError, OSError):
# Item likely cleared from download queue.
Expand Down Expand Up @@ -85,7 +85,7 @@ def run(self):
if item['gui']['status_label'].text() == self.tr("Downloading"):
self.progress.emit(item, self.tr("Already Exists"), 100) # Emit progress
logger.info(f"File already exists, Skipping download for track by id '{item_id}'")
time.sleep(0.2)
time.sleep(1)
continue
except FileNotFoundError:
logger.info(f"File does not already exist.")
Expand Down Expand Up @@ -208,4 +208,4 @@ def run(self):
logger.error(f"Unknown Exception: {str(e)}")
continue
else:
time.sleep(0.2)
time.sleep(1)
8 changes: 4 additions & 4 deletions src/onthespot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ def format_track_path(item_metadata, item_service, item_type, is_playlist_item,
name = item_metadata.get('title', '')
album = item_metadata.get('album_name', '')

if is_playlist_item and config.get("use_playlist_path"):
path = config.get("playlist_path_formatter")
elif item_type == 'track':
path = config.get("playlist_path_formatter")
if item_type == 'track':
path = config.get("track_path_formatter")
elif item_type == 'episode':
path = config.get("podcast_path_formatter")
elif is_playlist_item and config.get("use_playlist_path"):
path = config.get("playlist_path_formatter")

item_path = path.format(
artist=sanitize_data(item_metadata.get('artists', '')),
Expand Down

0 comments on commit 3f50615

Please sign in to comment.