Prepare V0.2
This commit is contained in:
@@ -285,11 +285,16 @@ def download_track(mode: str, track_id: str, extra_keys=None, disable_progressba
|
|||||||
|
|
||||||
# a song with the same name is installed
|
# a song with the same name is installed
|
||||||
if not check_id and check_name:
|
if not check_id and check_name:
|
||||||
c = len([file for file in Path(filedir).iterdir() if re.search(f'^{filename}_', str(file))]) + 1
|
|
||||||
|
|
||||||
#SpotiClub : Fix phantom files when colliding with existing names (-_.mp3)
|
|
||||||
stem = PurePath(filename).stem
|
stem = PurePath(filename).stem
|
||||||
ext = PurePath(filename).suffix
|
ext = PurePath(filename).suffix
|
||||||
|
base_prefix = str(PurePath(filedir).joinpath(stem))
|
||||||
|
c = len([
|
||||||
|
file
|
||||||
|
for file in Path(filedir).iterdir()
|
||||||
|
if str(file).startswith(base_prefix + "_")
|
||||||
|
]) + 1
|
||||||
|
|
||||||
|
# SpotiClub: Fix phantom files when colliding with existing names (-_.mp3)
|
||||||
filename = PurePath(filedir).joinpath(f'{stem}_{c}{ext}')
|
filename = PurePath(filedir).joinpath(f'{stem}_{c}{ext}')
|
||||||
|
|
||||||
|
|
||||||
@@ -355,6 +360,7 @@ def download_track(mode: str, track_id: str, extra_keys=None, disable_progressba
|
|||||||
global _ogg_delay_applied_once
|
global _ogg_delay_applied_once
|
||||||
if mode in ('album', 'playlist', 'extplaylist'):
|
if mode in ('album', 'playlist', 'extplaylist'):
|
||||||
if _ogg_delay_applied_once:
|
if _ogg_delay_applied_once:
|
||||||
|
# Spammy log
|
||||||
# Printer.print(PrintChannel.PROGRESS_INFO, '\n## OGG File : Waiting 5 seconds before resuming... ##')
|
# Printer.print(PrintChannel.PROGRESS_INFO, '\n## OGG File : Waiting 5 seconds before resuming... ##')
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user