Add config for customized playlist padding.

This commit is contained in:
PhYrE 2024-04-24 01:42:51 +02:00
parent 5da27d32a1
commit b6c68e2156

View file

@ -36,6 +36,7 @@ PRINT_WARNINGS = 'PRINT_WARNINGS'
RETRY_ATTEMPTS = 'RETRY_ATTEMPTS' RETRY_ATTEMPTS = 'RETRY_ATTEMPTS'
CONFIG_VERSION = 'CONFIG_VERSION' CONFIG_VERSION = 'CONFIG_VERSION'
DOWNLOAD_LYRICS = 'DOWNLOAD_LYRICS' DOWNLOAD_LYRICS = 'DOWNLOAD_LYRICS'
PLAYLIST_NUM_PAD = 'PLAYLIST_NUM_PAD'
CONFIG_VALUES = { CONFIG_VALUES = {
SAVE_CREDENTIALS: { 'default': 'True', 'type': bool, 'arg': '--save-credentials' }, SAVE_CREDENTIALS: { 'default': 'True', 'type': bool, 'arg': '--save-credentials' },
@ -60,6 +61,7 @@ CONFIG_VALUES = {
CHUNK_SIZE: { 'default': '20000', 'type': int, 'arg': '--chunk-size' }, CHUNK_SIZE: { 'default': '20000', 'type': int, 'arg': '--chunk-size' },
DOWNLOAD_REAL_TIME: { 'default': 'False', 'type': bool, 'arg': '--download-real-time' }, DOWNLOAD_REAL_TIME: { 'default': 'False', 'type': bool, 'arg': '--download-real-time' },
LANGUAGE: { 'default': 'en', 'type': str, 'arg': '--language' }, LANGUAGE: { 'default': 'en', 'type': str, 'arg': '--language' },
PLAYLIST_NUM_PAD: { 'default': '2', 'type': int, 'arg': '--playlist-num-pad' },
PRINT_SPLASH: { 'default': 'False', 'type': bool, 'arg': '--print-splash' }, PRINT_SPLASH: { 'default': 'False', 'type': bool, 'arg': '--print-splash' },
PRINT_SKIPS: { 'default': 'True', 'type': bool, 'arg': '--print-skips' }, PRINT_SKIPS: { 'default': 'True', 'type': bool, 'arg': '--print-skips' },
PRINT_DOWNLOAD_PROGRESS: { 'default': 'True', 'type': bool, 'arg': '--print-download-progress' }, PRINT_DOWNLOAD_PROGRESS: { 'default': 'True', 'type': bool, 'arg': '--print-download-progress' },
@ -197,6 +199,10 @@ class Config:
def get_download_lyrics(cls) -> bool: def get_download_lyrics(cls) -> bool:
return cls.get(DOWNLOAD_LYRICS) return cls.get(DOWNLOAD_LYRICS)
@classmethod
def get_playlist_num_pad(cls) -> int:
return cls.get(PLAYLIST_NUM_PAD)
@classmethod @classmethod
def get_bulk_wait_time(cls) -> int: def get_bulk_wait_time(cls) -> int:
return cls.get(BULK_WAIT_TIME) return cls.get(BULK_WAIT_TIME)