feat: better download output
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
Hazel 2024-05-15 14:10:32 +02:00
parent ea4c73158e
commit 017752c4d0

View File

@ -164,6 +164,7 @@ class Pages:
def download(self, data_object: DataObject, genre: str, **kwargs) -> DownloadResult: def download(self, data_object: DataObject, genre: str, **kwargs) -> DownloadResult:
# fetch the given object # fetch the given object
self.fetch_details(data_object) self.fetch_details(data_object)
output(f"\nDownloading {data_object.option_string}...", color=BColors.BOLD)
# fetching all parent objects (e.g. if you only download a song) # fetching all parent objects (e.g. if you only download a song)
if not kwargs.get("fetched_upwards", False): if not kwargs.get("fetched_upwards", False):
@ -260,14 +261,14 @@ class Pages:
)) ))
for target in song.target_collection: for target in song.target_collection:
if target.exists: if target.exists:
output(f'- {target.file_path} {BColors.OKGREEN.value}[already exists]', color=BColors.GREY) output(f'{target.file_path} {BColors.OKGREEN.value}[already exists]', color=BColors.GREY)
r.found_on_disk += 1 r.found_on_disk += 1
if self.download_options.download_again_if_found: if not self.download_options.download_again_if_found:
target.copy_content(tmp) target.copy_content(tmp)
else: else:
target.create_path() target.create_path()
output(f'- {target.file_path}', color=BColors.GREY) output(f'{target.file_path}', color=BColors.GREY)
# this streams from every available source until something succeeds, setting the skip intervals to the values of the according source # this streams from every available source until something succeeds, setting the skip intervals to the values of the according source
used_source: Optional[Source] = None used_source: Optional[Source] = None