feat(ui): paginated book browser page (#2573)

This commit is contained in:
Alex
2026-09-26 12:55:45 +01:00
committed by GitHub
parent e6fed6e2e7
commit a2f41b29d8
70 changed files with 5139 additions and 236 deletions
@@ -12,6 +12,13 @@ import { MessageService } from '@openng/optimus-ui/api';
import { TranslocoDirective, TranslocoPipe, TranslocoService } from '@jsverse/transloco';
import { AppSettingsService } from '../../../../shared/service/app-settings.service';
export interface BookFileAttacherSourceBook {
id: number;
libraryId: number;
metadata?: {title?: string; authors?: string[]};
primaryFile?: {extension?: string; bookType?: string; fileName?: string};
}
@Component({
selector: 'app-book-file-attacher',
standalone: true,
@@ -29,7 +36,7 @@ import { AppSettingsService } from '../../../../shared/service/app-settings.serv
export class BookFileAttacherComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild('autocompleteWrapper') autocompleteWrapper!: ElementRef;
sourceBooks: Book[] = [];
sourceBooks: readonly BookFileAttacherSourceBook[] = [];
targetBook: Book | null = null;
moveFiles = false;
isAttaching = false;
@@ -128,7 +135,7 @@ export class BookFileAttacherComponent implements OnInit, AfterViewInit, OnDestr
return authors ? `${title} - ${authors}` : title;
}
getSourceFileInfo(book: Book): string {
getSourceFileInfo(book: BookFileAttacherSourceBook): string {
const file = book.primaryFile;
if (!file) return this.t.translate('book.fileAttacher.unknownFile');
const format = file.extension?.toUpperCase() || file.bookType || this.t.translate('book.fileAttacher.unknownFormat');