filename shows correctly in downloading view too

This commit is contained in:
DaKheera47 2025-10-15 12:00:22 +01:00
parent 3d74f9b53b
commit 1e37e63b67
2 changed files with 8 additions and 3 deletions

View file

@ -49,9 +49,11 @@ class DownloadInfo:
self.size = None self.size = None
self.timestamp = time.time_ns() self.timestamp = time.time_ns()
self.error = error self.error = error
self.entry = entry self.entry = entry
self.playlist_item_limit = playlist_item_limit self.playlist_item_limit = playlist_item_limit
if self.custom_name:
self.title = self.custom_name
class Download: class Download:
manager = None manager = None
@ -345,6 +347,7 @@ class DownloadQueue:
log.info(f'Custom name conflict for download {dl.url} at {dldirectory} name "{custom_name}"') log.info(f'Custom name conflict for download {dl.url} at {dldirectory} name "{custom_name}"')
return conflict return conflict
output = f'{custom_name}.%(ext)s' output = f'{custom_name}.%(ext)s'
dl.title = custom_name
else: else:
output = self.config.OUTPUT_TEMPLATE if len(dl.custom_name_prefix) == 0 else f'{dl.custom_name_prefix}.{self.config.OUTPUT_TEMPLATE}' output = self.config.OUTPUT_TEMPLATE if len(dl.custom_name_prefix) == 0 else f'{dl.custom_name_prefix}.{self.config.OUTPUT_TEMPLATE}'
output_chapter = self.config.OUTPUT_TEMPLATE_CHAPTER output_chapter = self.config.OUTPUT_TEMPLATE_CHAPTER
@ -541,6 +544,7 @@ class DownloadQueue:
return {'status': 'error', 'msg': f'rename failed: {exc}'} return {'status': 'error', 'msg': f'rename failed: {exc}'}
info.filename = target_relative info.filename = target_relative
info.title = os.path.splitext(target_basename)[0]
self.done.put(download) self.done.put(download)
asyncio.create_task(self.notifier.renamed(info)) asyncio.create_task(self.notifier.renamed(info))
log.info(f"Rename successful for download {id}: {current_basename} -> {target_basename}") log.info(f"Rename successful for download {id}: {current_basename} -> {target_basename}")

View file

@ -416,6 +416,7 @@ export class AppComponent implements AfterViewInit {
if (status.status === 'ok') { if (status.status === 'ok') {
if (status.filename) { if (status.filename) {
download.filename = status.filename; download.filename = status.filename;
download.title = this.getFilenameStem(status.filename);
} }
this.cancelRename(key); this.cancelRename(key);
} else { } else {