feat(ui): add file name column to table view and include filename in search (#2712)

This commit is contained in:
ACX
2026-02-12 08:28:57 -07:00
committed by GitHub
parent f8f448a19b
commit 910d26c530
3 changed files with 8 additions and 1 deletions

View File

@@ -63,6 +63,7 @@ export class BookTableComponent implements OnInit, OnDestroy, OnChanges {
{field: 'publishedDate', header: 'Published'},
{field: 'lastReadTime', header: 'Last Read'},
{field: 'addedOn', header: 'Added'},
{field: 'fileName', header: 'File Name'},
{field: 'fileSizeKb', header: 'File Size'},
{field: 'language', header: 'Language'},
{field: 'isbn', header: 'ISBN'},
@@ -284,6 +285,9 @@ export class BookTableComponent implements OnInit, OnDestroy, OnChanges {
case 'addedOn':
return book.addedOn ? this.datePipe.transform(book.addedOn, 'dd-MMM-yyyy') ?? '' : '';
case 'fileName':
return book.primaryFile?.fileName ?? '';
case 'fileSizeKb':
return this.formatFileSize(book.fileSizeKb);

View File

@@ -40,14 +40,16 @@ export class HeaderFilter implements BookFilter {
const categories = book.metadata?.categories || [];
const isbn = book.metadata?.isbn10 || '';
const isbn13 = book.metadata?.isbn13 || '';
const fileName = book.primaryFile?.fileName || '';
const matchesTitle = normalize(title).includes(nTerm);
const matchesSeries = normalize(series).includes(nTerm);
const matchesAuthor = authors.some(author => normalize(author).includes(nTerm));
const matchesCategory = categories.some(category => normalize(category).includes(nTerm));
const matchesIsbn = normalize(isbn).includes(nTerm) || normalize(isbn13).includes(nTerm);
const matchesFileName = normalize(fileName).includes(nTerm);
return matchesTitle || matchesSeries || matchesAuthor || matchesCategory || matchesIsbn;
return matchesTitle || matchesSeries || matchesAuthor || matchesCategory || matchesIsbn || matchesFileName;
}) || null;
return {...bookState, books: filteredBooks};

View File

@@ -24,6 +24,7 @@ export class TableColumnPreferenceService {
{field: 'publishedDate', header: 'Published'},
{field: 'lastReadTime', header: 'Last Read'},
{field: 'addedOn', header: 'Added'},
{field: 'fileName', header: 'File Name'},
{field: 'fileSizeKb', header: 'File Size'},
{field: 'language', header: 'Language'},
{field: 'isbn', header: 'ISBN'},