diff options
Diffstat (limited to 'zspotify-paths.patch')
-rw-r--r-- | zspotify-paths.patch | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/zspotify-paths.patch b/zspotify-paths.patch index 6888bb1f5534..c23786565622 100644 --- a/zspotify-paths.patch +++ b/zspotify-paths.patch @@ -20,25 +20,16 @@ SKIP_EXISTING_FILES: { 'default': 'True', 'type': bool, 'arg': '--skip-existing-files' }, SKIP_PREVIOUSLY_DOWNLOADED: { 'default': 'False', 'type': bool, 'arg': '--skip-previously-downloaded' }, RETRY_ATTEMPTS: { 'default': '5', 'type': int, 'arg': '--retry-attemps' }, -@@ -43,14 +43,14 @@ CONFIG_VALUES = { - FORCE_PREMIUM: { 'default': 'False', 'type': bool, 'arg': '--force-premium' }, - ANTI_BAN_WAIT_TIME: { 'default': '1', 'type': int, 'arg': '--anti-ban-wait-time' }, - OVERRIDE_AUTO_WAIT: { 'default': 'False', 'type': bool, 'arg': '--override-auto-wait' }, -- CHUNK_SIZE: { 'default': '50000', 'type': int, 'arg': '--chunk-size' }, -+ CHUNK_SIZE: { 'default': 50000, 'type': int, 'arg': '--chunk-size' }, - SPLIT_ALBUM_DISCS: { 'default': 'False', 'type': bool, 'arg': '--split-album-discs' }, - DOWNLOAD_REAL_TIME: { 'default': 'False', 'type': bool, 'arg': '--download-real-time' }, +@@ -49,7 +49,7 @@ CONFIG_VALUES = { LANGUAGE: { 'default': 'en', 'type': str, 'arg': '--language' }, BITRATE: { 'default': '', 'type': str, 'arg': '--bitrate' }, SONG_ARCHIVE: { 'default': '.song_archive', 'type': str, 'arg': '--song-archive' }, - CREDENTIALS_LOCATION: { 'default': 'credentials.json', 'type': str, 'arg': '--credentials-location' }, -- OUTPUT: { 'default': '', 'type': str, 'arg': '--output' }, + CREDENTIALS_LOCATION: { 'default': '~/.local/share/zspotify/credentials.json', 'type': str, 'arg': '--credentials-location' }, -+ OUTPUT: { 'default': '{artist} - {song_name}.ogg','type': str, 'arg': '--output' }, + OUTPUT: { 'default': '', 'type': str, 'arg': '--output' }, PRINT_SPLASH: { 'default': 'False', 'type': bool, 'arg': '--print-splash' }, PRINT_SKIPS: { 'default': 'True', 'type': bool, 'arg': '--print-skips' }, - PRINT_DOWNLOAD_PROGRESS: { 'default': 'True', 'type': bool, 'arg': '--print-download-progress' }, -@@ -82,11 +82,12 @@ class Config: +@@ -82,21 +82,21 @@ class Config: if args.config_location: config_fp = args.config_location @@ -51,8 +42,25 @@ + os.makedirs(os.path.dirname(true_config_file_path), exist_ok=True) with open(true_config_file_path, 'w', encoding='utf-8') as config_file: json.dump(cls.get_default_json(), config_file, indent=4) - cls.Values = cls.get_default_json() -@@ -142,11 +143,11 @@ class Config: +- cls.Values = cls.get_default_json() +- else: +- with open(true_config_file_path, encoding='utf-8') as config_file: +- jsonvalues = json.load(config_file) +- cls.Values = {} +- for key in CONFIG_VALUES: +- if key in jsonvalues: +- cls.Values[key] = cls.parse_arg_value(key, jsonvalues[key]) ++ ++ with open(true_config_file_path, encoding='utf-8') as config_file: ++ jsonvalues = json.load(config_file) ++ cls.Values = {} ++ for key in CONFIG_VALUES: ++ if key in jsonvalues: ++ cls.Values[key] = cls.parse_arg_value(key, jsonvalues[key]) + + # Add default values for missing keys + +@@ -142,11 +142,11 @@ class Config: @classmethod def get_root_path(cls) -> str: @@ -66,7 +74,7 @@ @classmethod def get_skip_existing_files(cls) -> bool: -@@ -194,17 +195,17 @@ class Config: +@@ -194,17 +194,17 @@ class Config: @classmethod def get_song_archive(cls) -> str: |