From e0241a966205a040df1f4f3ec182be4518ac823e Mon Sep 17 00:00:00 2001 From: Michael Kuperfish Steinberg <36902556+Michael-K-Stein@users.noreply.github.com> Date: Sat, 21 Jan 2023 12:00:40 +0200 Subject: [PATCH] Remove unused settings --- spotify_mass_download.py | 8 ++++---- templates/index.html | 2 -- webgui.py | 4 +--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/spotify_mass_download.py b/spotify_mass_download.py index 52e8107..37b6d32 100644 --- a/spotify_mass_download.py +++ b/spotify_mass_download.py @@ -50,7 +50,7 @@ class Console: console = Console() -def download_track_list(download_dir: str, track_list: Generator[SpotifyTrack, None, None], recursive_artist: bool=False, recursive_album: bool=False, recursive: bool=False, recursive_limit=1024): +def download_track_list(download_dir: str, track_list: Generator[SpotifyTrack, None, None], recursive_artist: bool=False, recursive_album: bool=False, recursive: bool=False): global g_downloaded_songs, g_downloaded_artist_covers my_thread_id = str(get_ident()).zfill(6) artist_images_download_dir = f'{download_dir}/{settings.ARTIST_IMAGES_SUB_DIR}' @@ -117,7 +117,7 @@ def save_globals_save_file(): sleep(settings.DOWNLOADS_FILE_SAVE_INTERVAL) -def full_download(download_dir: str, identifier: str, recursive_artist: bool=False, recursive_album: bool=False, recursive: bool=False, recursive_limit:int=1024, thread_count:int=5): +def full_download(download_dir: str, identifier: str, recursive_artist: bool=False, recursive_album: bool=False, recursive: bool=False): global g_downloaded_songs, g_downloaded_artist_covers, g_keep_saving try: artist_images_download_dir = f'{download_dir}/{settings.ARTIST_IMAGES_SUB_DIR}' @@ -127,8 +127,8 @@ def full_download(download_dir: str, identifier: str, recursive_artist: bool=Fal g_keep_saving += 1 client.refresh_tokens() - console.log(f'Recieved scrape command on identifier: {identifier}, {recursive=}, {recursive_artist=}, {recursive_album=}, {recursive_limit=}, {thread_count=}') - download_track_list(download_dir=download_dir, track_list=scraper.scrape_tracks(identifier, console=console), recursive=recursive, recursive_album=recursive_album, recursive_artist=recursive_artist, recursive_limit=recursive_limit) + console.log(f'Recieved scrape command on identifier: {identifier}, {recursive=}, {recursive_artist=}, {recursive_album=}') + download_track_list(download_dir=download_dir, track_list=scraper.scrape_tracks(identifier, console=console), recursive=recursive, recursive_album=recursive_album, recursive_artist=recursive_artist) console.log(f'Comletely done scraping identifier: {identifier}!') diff --git a/templates/index.html b/templates/index.html index bed0de3..3e048af 100644 --- a/templates/index.html +++ b/templates/index.html @@ -50,8 +50,6 @@
-
-
diff --git a/webgui.py b/webgui.py index d0409e5..b676634 100644 --- a/webgui.py +++ b/webgui.py @@ -19,12 +19,10 @@ def actions_download(): recursive = request.form.get('recursive') or False recursive_artist = request.form.get('recursive-artist') or False recursive_album = request.form.get('recursive-album') or False - recursive_limit = min(int(request.form.get('recursive-limit')) or 1024, settings.FULL_DOWNLOAD_RECURISVE_LIMIT) - thread_count = min(int(request.form.get('thread-count')) or 5, settings.FULL_DOWNLOAD_THREAD_LIMIT) recursive = True if recursive == 'on' else False recursive_album = True if recursive_album == 'on' else False recursive_artist = True if recursive_artist == 'on' else False - full_download(settings.DEFAULT_DOWNLOAD_DIRECTORY, spotify_url, recursive=recursive, recursive_artist=recursive_artist, recursive_album=recursive_album, recursive_limit=recursive_limit, thread_count=thread_count) + full_download(settings.DEFAULT_DOWNLOAD_DIRECTORY, spotify_url, recursive=recursive, recursive_artist=recursive_artist, recursive_album=recursive_album) return 'success' except Exception as ex: return str(ex)