Book additional files support UI (2/3) (#870)
* feat(api/model): add new entity BookAdditionalFileEntity * feat(api/db): add book additional file repository * feat(api/db): add migration * test(api/db): add book additional file repository test * test(api/db): add book additional file repository tests for hash uniqueness * feat(api/domain): add support to additional file model * feat(api): add additional files controller * refactor(api): move addAdditionalFile to FileUploadService as uploadAdditionalFile method * feat(service): search book by additional file * feat(services): process deleted additional files with ability to promote alternative formats to book instead of deleting them * refactor(util): use common code to resolve patter for entity and domain object * feat(service): move additional files * test(service): test move additional files along with book itself * feat(ui/domain): add alternativeFormats and supplementaryFiles to book model * feat(ui/domain): add download additional file method to book service * refactor(api/domain): extract FileInfo interface with common fields Allow to share the same interface thet is implemented by AdditionFile and Book * feat(ui): show multiple download options * feat(ui/domain): add delete additional file method to book service * feat(ui): add delete additional file ui * feat(ui): add additional-file-uploader.component * feat(ui/domain): add uploadAdditionalFile to the service * feat(ui): add Upload File menu item * feat(ui): show supplementary files in download menu item * feat(ui): show supplementary files in delete file menu item * feat(ui): book card allow to select single file to download or delete
This commit is contained in:
@@ -4,7 +4,27 @@ import {BookReview} from '../../book-review-service';
|
||||
|
||||
export type BookType = "PDF" | "EPUB" | "CBX";
|
||||
|
||||
export interface Book {
|
||||
export enum AdditionalFileType {
|
||||
ALTERNATIVE_FORMAT = 'ALTERNATIVE_FORMAT',
|
||||
SUPPLEMENTARY = 'SUPPLEMENTARY'
|
||||
}
|
||||
|
||||
export interface FileInfo {
|
||||
fileName?: string;
|
||||
filePath?: string;
|
||||
fileSubPath?: string;
|
||||
fileSizeKb?: number;
|
||||
}
|
||||
|
||||
export interface AdditionalFile extends FileInfo {
|
||||
id: number;
|
||||
bookId: number;
|
||||
additionalFileType: AdditionalFileType;
|
||||
description?: string;
|
||||
addedOn?: string;
|
||||
}
|
||||
|
||||
export interface Book extends FileInfo {
|
||||
id: number;
|
||||
bookType: BookType;
|
||||
libraryId: number;
|
||||
@@ -16,15 +36,13 @@ export interface Book {
|
||||
pdfProgress?: PdfProgress;
|
||||
cbxProgress?: CbxProgress;
|
||||
koreaderProgress?: KoReaderProgress;
|
||||
filePath?: string;
|
||||
fileSubPath?: string;
|
||||
fileName?: string;
|
||||
fileSizeKb?: number;
|
||||
seriesCount?: number | null;
|
||||
metadataMatchScore?: number | null;
|
||||
readStatus?: ReadStatus;
|
||||
dateFinished?: string;
|
||||
libraryPath?: { id: number };
|
||||
alternativeFormats?: AdditionalFile[];
|
||||
supplementaryFiles?: AdditionalFile[];
|
||||
}
|
||||
|
||||
export interface EpubProgress {
|
||||
|
||||
Reference in New Issue
Block a user