Prepare V0.2
This commit is contained in:
@@ -325,36 +325,31 @@ class Config:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_output(cls, mode: str) -> str:
|
def get_output(cls, mode: str) -> str:
|
||||||
|
# Custom output overrides all defaults
|
||||||
v = cls.get(OUTPUT)
|
v = cls.get(OUTPUT)
|
||||||
if v:
|
if v:
|
||||||
return v
|
return v
|
||||||
|
|
||||||
|
# Select base template by mode
|
||||||
if mode == 'playlist':
|
if mode == 'playlist':
|
||||||
if cls.get_split_album_discs():
|
v = OUTPUT_DEFAULT_PLAYLIST
|
||||||
split = PurePath(OUTPUT_DEFAULT_PLAYLIST).parent
|
elif mode == 'extplaylist':
|
||||||
return PurePath(split).joinpath('Disc {disc_number}').joinpath(split)
|
v = OUTPUT_DEFAULT_PLAYLIST_EXT
|
||||||
return OUTPUT_DEFAULT_PLAYLIST
|
elif mode == 'liked':
|
||||||
if mode == 'extplaylist':
|
v = OUTPUT_DEFAULT_LIKED_SONGS
|
||||||
if cls.get_split_album_discs():
|
elif mode == 'single':
|
||||||
split = PurePath(OUTPUT_DEFAULT_PLAYLIST_EXT).parent
|
v = OUTPUT_DEFAULT_SINGLE
|
||||||
return PurePath(split).joinpath('Disc {disc_number}').joinpath(split)
|
elif mode == 'album':
|
||||||
return OUTPUT_DEFAULT_PLAYLIST_EXT
|
v = OUTPUT_DEFAULT_ALBUM
|
||||||
if mode == 'liked':
|
else:
|
||||||
if cls.get_split_album_discs():
|
|
||||||
split = PurePath(OUTPUT_DEFAULT_LIKED_SONGS).parent
|
|
||||||
return PurePath(split).joinpath('Disc {disc_number}').joinpath(split)
|
|
||||||
return OUTPUT_DEFAULT_LIKED_SONGS
|
|
||||||
if mode == 'single':
|
|
||||||
if cls.get_split_album_discs():
|
|
||||||
split = PurePath(OUTPUT_DEFAULT_SINGLE).parent
|
|
||||||
return PurePath(split).joinpath('Disc {disc_number}').joinpath(split)
|
|
||||||
return OUTPUT_DEFAULT_SINGLE
|
|
||||||
if mode == 'album':
|
|
||||||
if cls.get_split_album_discs():
|
|
||||||
split = PurePath(OUTPUT_DEFAULT_ALBUM).parent
|
|
||||||
return PurePath(split).joinpath('Disc {disc_number}').joinpath(split)
|
|
||||||
return OUTPUT_DEFAULT_ALBUM
|
|
||||||
raise ValueError()
|
raise ValueError()
|
||||||
|
|
||||||
|
if cls.get_split_album_discs() and mode == 'album':
|
||||||
|
base = PurePath(v)
|
||||||
|
return str(base.parent / 'Disc {disc_number}' / base.name)
|
||||||
|
|
||||||
|
return v
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_retry_attempts(cls) -> int:
|
def get_retry_attempts(cls) -> int:
|
||||||
return cls.get(RETRY_ATTEMPTS)
|
return cls.get(RETRY_ATTEMPTS)
|
||||||
|
|||||||
Reference in New Issue
Block a user