@@ -6,6 +6,7 @@ export class BookSorter {
|
||||
sortOptions: SortOption[] = [
|
||||
{ label: 'Title', field: 'title', direction: SortDirection.ASCENDING },
|
||||
{ label: 'Title + Series', field: 'titleSeries', direction: SortDirection.ASCENDING },
|
||||
{ label: 'File Name', field: 'fileName', direction: SortDirection.ASCENDING },
|
||||
{ label: 'Author', field: 'author', direction: SortDirection.ASCENDING },
|
||||
{ label: 'Last Read', field: 'lastReadTime', direction: SortDirection.ASCENDING },
|
||||
{ label: 'Added On', field: 'addedOn', direction: SortDirection.ASCENDING },
|
||||
|
||||
@@ -38,7 +38,8 @@ export class SortService {
|
||||
.every((key) => book.metadata?.[key] === true),
|
||||
lastReadTime: (book) => book.lastReadTime ? new Date(book.lastReadTime).getTime() : null,
|
||||
addedOn: (book) => book.addedOn ? new Date(book.addedOn).getTime() : null,
|
||||
fileSizeKb: (book) => book.fileSizeKb || null
|
||||
fileSizeKb: (book) => book.fileSizeKb || null,
|
||||
fileName:(book) => book.fileName,
|
||||
};
|
||||
|
||||
applySort(books: Book[], selectedSort: SortOption | null): Book[] {
|
||||
|
||||
Reference in New Issue
Block a user