set the correct file name when triggering a download (#1513)

This commit is contained in:
Ionuț Staicu
2025-11-20 21:11:45 -07:00
committed by GitHub
parent 278b11e9e1
commit 014874cd11
4 changed files with 21 additions and 20 deletions
@@ -462,7 +462,7 @@
label="Download"
icon="pi pi-download"
[model]="downloadItems"
(onClick)="download(book!.id)"
(onClick)="download(book)"
severity="success"
outlined/>
}
@@ -472,7 +472,7 @@
icon="pi pi-download"
severity="success"
outlined
(onClick)="download(book!.id)">
(onClick)="download(book)">
</p-button>
}
}
@@ -157,7 +157,7 @@ export class MetadataViewerComponent implements OnInit, OnChanges {
items.push({
label: `${format.fileName} (${this.getFileSizeInMB(format)})`,
icon: this.getFileIcon(extension),
command: () => this.downloadAdditionalFile(book.id, format.id)
command: () => this.downloadAdditionalFile(book, format.id)
});
});
}
@@ -175,7 +175,7 @@ export class MetadataViewerComponent implements OnInit, OnChanges {
items.push({
label: `${file.fileName} (${this.getFileSizeInMB(file)})`,
icon: this.getFileIcon(extension),
command: () => this.downloadAdditionalFile(book.id, file.id)
command: () => this.downloadAdditionalFile(book, file.id)
});
});
}
@@ -354,12 +354,12 @@ export class MetadataViewerComponent implements OnInit, OnChanges {
if (bookId) this.bookService.readBook(bookId, reader);
}
download(bookId: number) {
this.bookService.downloadFile(bookId);
download(book: Book) {
this.bookService.downloadFile(book);
}
downloadAdditionalFile(bookId: number, fileId: number) {
this.bookService.downloadAdditionalFile(bookId, fileId);
downloadAdditionalFile(book: Book, fileId: number) {
this.bookService.downloadAdditionalFile(book, fileId);
}
deleteAdditionalFile(bookId: number, fileId: number, fileName: string) {