@@ -6,6 +6,7 @@ export class BookSorter {
|
|||||||
sortOptions: SortOption[] = [
|
sortOptions: SortOption[] = [
|
||||||
{ label: 'Title', field: 'title', direction: SortDirection.ASCENDING },
|
{ label: 'Title', field: 'title', direction: SortDirection.ASCENDING },
|
||||||
{ label: 'Title + Series', field: 'titleSeries', 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: 'Author', field: 'author', direction: SortDirection.ASCENDING },
|
||||||
{ label: 'Last Read', field: 'lastReadTime', direction: SortDirection.ASCENDING },
|
{ label: 'Last Read', field: 'lastReadTime', direction: SortDirection.ASCENDING },
|
||||||
{ label: 'Added On', field: 'addedOn', direction: SortDirection.ASCENDING },
|
{ label: 'Added On', field: 'addedOn', direction: SortDirection.ASCENDING },
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ export class SortService {
|
|||||||
.every((key) => book.metadata?.[key] === true),
|
.every((key) => book.metadata?.[key] === true),
|
||||||
lastReadTime: (book) => book.lastReadTime ? new Date(book.lastReadTime).getTime() : null,
|
lastReadTime: (book) => book.lastReadTime ? new Date(book.lastReadTime).getTime() : null,
|
||||||
addedOn: (book) => book.addedOn ? new Date(book.addedOn).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[] {
|
applySort(books: Book[], selectedSort: SortOption | null): Book[] {
|
||||||
|
|||||||
+2
@@ -7,6 +7,7 @@ import {CheckboxModule} from 'primeng/checkbox';
|
|||||||
import {InputTextModule} from 'primeng/inputtext';
|
import {InputTextModule} from 'primeng/inputtext';
|
||||||
import {SelectModule} from 'primeng/select';
|
import {SelectModule} from 'primeng/select';
|
||||||
import {InputNumberModule} from 'primeng/inputnumber';
|
import {InputNumberModule} from 'primeng/inputnumber';
|
||||||
|
import {SortDirection} from "../../../book/model/sort.model";
|
||||||
import {DashboardConfig, ScrollerConfig, ScrollerType} from '../../models/dashboard-config.model';
|
import {DashboardConfig, ScrollerConfig, ScrollerType} from '../../models/dashboard-config.model';
|
||||||
import {DashboardConfigService} from '../../services/dashboard-config.service';
|
import {DashboardConfigService} from '../../services/dashboard-config.service';
|
||||||
import {MagicShelfService} from '../../../magic-shelf/service/magic-shelf.service';
|
import {MagicShelfService} from '../../../magic-shelf/service/magic-shelf.service';
|
||||||
@@ -56,6 +57,7 @@ export class DashboardSettingsComponent implements OnInit {
|
|||||||
sortFieldOptions = [
|
sortFieldOptions = [
|
||||||
{label: 'Title', value: 'title'},
|
{label: 'Title', value: 'title'},
|
||||||
{label: 'Title + Series', value: 'titleSeries'},
|
{label: 'Title + Series', value: 'titleSeries'},
|
||||||
|
{label: 'File Name', field: 'fileName'},
|
||||||
{label: 'Date Added', value: 'addedOn'},
|
{label: 'Date Added', value: 'addedOn'},
|
||||||
{label: 'Author', value: 'author'},
|
{label: 'Author', value: 'author'},
|
||||||
{label: 'Personal Rating', value: 'personalRating'},
|
{label: 'Personal Rating', value: 'personalRating'},
|
||||||
|
|||||||
+1
@@ -29,6 +29,7 @@ export class ViewPreferencesComponent implements OnInit, OnDestroy {
|
|||||||
sortOptions = [
|
sortOptions = [
|
||||||
{label: 'Title', field: 'title'},
|
{label: 'Title', field: 'title'},
|
||||||
{label: 'Title + Series', field: 'titleSeries'},
|
{label: 'Title + Series', field: 'titleSeries'},
|
||||||
|
{label: 'File Name', field: 'fileName'},
|
||||||
{label: 'Author', field: 'author'},
|
{label: 'Author', field: 'author'},
|
||||||
{label: 'Last Read', field: 'lastReadTime'},
|
{label: 'Last Read', field: 'lastReadTime'},
|
||||||
{label: 'Added On', field: 'addedOn'},
|
{label: 'Added On', field: 'addedOn'},
|
||||||
|
|||||||
Reference in New Issue
Block a user