diff --git a/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.html b/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.html index eabb7d2bb..662bd697b 100644 --- a/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.html +++ b/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.html @@ -116,12 +116,12 @@
- - +
} diff --git a/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.spec.ts b/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.spec.ts index 4c41f9ec7..3a164a373 100644 --- a/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.spec.ts +++ b/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.spec.ts @@ -7,8 +7,8 @@ import {Subject, of, throwError} from 'rxjs'; import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest'; import {BookService} from '../../../book/service/book.service'; -import {BookCardOverlayPreferenceService} from '../../../book/components/book-browser/book-card-overlay-preference.service'; -import {CoverScalePreferenceService} from '../../../book/components/book-browser/cover-scale-preference.service'; +import {BookCardOverlayPreferenceService} from '../../../book/components/legacy-book-card/book-card-overlay-preference.service'; +import {CoverScalePreferenceService} from '../../../../shared/service/cover-scale-preference.service'; import {UserService} from '../../../settings/user-management/user.service'; import type {AuthorDetails} from '../../model/author.model'; import {AuthorService} from '../../service/author.service'; diff --git a/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.ts b/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.ts index a9742bebc..134194da6 100644 --- a/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.ts +++ b/frontend/src/app/features/author-browser/components/author-detail/author-detail.component.ts @@ -11,9 +11,9 @@ import { Tooltip } from '@openng/optimus-ui/tooltip'; import { AuthorService } from '../../service/author.service'; import { AuthorDetails } from '../../model/author.model'; import { BookService } from '../../../book/service/book.service'; -import { BookCardComponent } from '../../../book/components/book-browser/book-card/book-card.component'; -import { CoverScalePreferenceService } from '../../../book/components/book-browser/cover-scale-preference.service'; -import { BookCardOverlayPreferenceService } from '../../../book/components/book-browser/book-card-overlay-preference.service'; +import { LegacyBookCardComponent } from '../../../book/components/legacy-book-card/legacy-book-card.component'; +import { CoverScalePreferenceService } from '../../../../shared/service/cover-scale-preference.service'; +import { BookCardOverlayPreferenceService } from '../../../book/components/legacy-book-card/book-card-overlay-preference.service'; import { UserService } from '../../../settings/user-management/user.service'; import { AuthorMatchComponent } from '../author-match/author-match.component'; import { AuthorEditorComponent } from '../author-editor/author-editor.component'; @@ -37,7 +37,7 @@ import { createVirtualGrid } from '../../../../shared/util/virtual-grid.util'; Tag, TranslocoDirective, Tooltip, - BookCardComponent, + LegacyBookCardComponent, AuthorMatchComponent, AuthorEditorComponent ] diff --git a/frontend/src/app/features/book/browse/book-browse-bulk-bar.component.spec.ts b/frontend/src/app/features/book/browse/book-browse-bulk-bar.component.spec.ts index 3cf338f31..41a217b4b 100644 --- a/frontend/src/app/features/book/browse/book-browse-bulk-bar.component.spec.ts +++ b/frontend/src/app/features/book/browse/book-browse-bulk-bar.component.spec.ts @@ -10,7 +10,7 @@ import {AppSettingsService} from '../../../shared/service/app-settings.service'; import {UserService} from '../../settings/user-management/user.service'; import {type BookSummary} from '../data/book-response.models'; import {ShelfDefinitionQueryService} from '../data/shelf-definition-query.service'; -import {BookDialogHelperService} from '../components/book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from '../service/book-dialog-helper.service'; import {BookBrowseBulkBarComponent} from './book-browse-bulk-bar.component'; function selectionOf(ids: readonly number[]): BrowseSelection { diff --git a/frontend/src/app/features/book/browse/book-browse-bulk-commands.spec.ts b/frontend/src/app/features/book/browse/book-browse-bulk-commands.spec.ts index 924a5a506..03196650f 100644 --- a/frontend/src/app/features/book/browse/book-browse-bulk-commands.spec.ts +++ b/frontend/src/app/features/book/browse/book-browse-bulk-commands.spec.ts @@ -8,7 +8,7 @@ import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest'; import {createQueryClientHarness, flushQueryAsync} from '../../../core/testing/query-testing'; import {getTranslocoModule} from '../../../core/testing/transloco-testing'; import {API_CONFIG} from '../../../core/config/api-config'; -import {BookDialogHelperService} from '../components/book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from '../service/book-dialog-helper.service'; import {type BrowseSelection, type BrowseSelectionState} from '../../../shared/browse/selection'; import {createBookBrowseBulkCommands} from './book-browse-bulk-commands'; diff --git a/frontend/src/app/features/book/browse/book-browse-bulk-commands.ts b/frontend/src/app/features/book/browse/book-browse-bulk-commands.ts index b44a78bc1..1b42bd670 100644 --- a/frontend/src/app/features/book/browse/book-browse-bulk-commands.ts +++ b/frontend/src/app/features/book/browse/book-browse-bulk-commands.ts @@ -16,7 +16,7 @@ import {BookShelfCommandService} from '../data/book-shelf-command.service'; import {type BookSummary, type KnownBookReadStatus} from '../data/book-response.models'; import {MetadataRefreshSubmissionService} from '../../metadata/data/metadata-refresh-submission.service'; import {type BookFileAttacherSourceBook} from '../components/book-file-attacher/book-file-attacher.component'; -import {BookDialogHelperService} from '../components/book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from '../service/book-dialog-helper.service'; import {legacyBookCachePatches, withLegacyBookCache} from '../service/book-command-legacy-adapter'; import {resolveSelectedIds, type BrowseSelection} from '../../../shared/browse/selection'; diff --git a/frontend/src/app/features/book/browse/book-browse-page.component.spec.ts b/frontend/src/app/features/book/browse/book-browse-page.component.spec.ts index f6f0f4fbc..3f7d17f5d 100644 --- a/frontend/src/app/features/book/browse/book-browse-page.component.spec.ts +++ b/frontend/src/app/features/book/browse/book-browse-page.component.spec.ts @@ -25,7 +25,7 @@ import {LibraryService} from '../service/library.service'; import {LibraryShelfMenuService} from '../service/library-shelf-menu.service'; import {MagicShelfService} from '../../magic-shelf/service/magic-shelf.service'; import {ShelfDefinitionQueryService} from '../data/shelf-definition-query.service'; -import {BookDialogHelperService} from '../components/book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from '../service/book-dialog-helper.service'; import {UserService} from '../../settings/user-management/user.service'; import {EmailService} from '../../settings/email-v2/email.service'; import {type BookSortTerm} from '../data/book-query-params'; diff --git a/frontend/src/app/features/book/browse/book-browse-page.component.ts b/frontend/src/app/features/book/browse/book-browse-page.component.ts index 6b04b2177..b6448d837 100644 --- a/frontend/src/app/features/book/browse/book-browse-page.component.ts +++ b/frontend/src/app/features/book/browse/book-browse-page.component.ts @@ -24,7 +24,7 @@ import {LayoutService} from '../../../shared/layout/layout.service'; import {LocalStorageService} from '../../../shared/service/local-storage.service'; import {PageTitleService} from '../../../shared/service/page-title.service'; import {createGridDensity, type GridDensityDirection} from '../../../shared/util/grid-density.util'; -import {CoverScalePreferenceService} from '../components/book-browser/cover-scale-preference.service'; +import {CoverScalePreferenceService} from '../../../shared/service/cover-scale-preference.service'; import {LibraryService} from '../service/library.service'; import {BookNavigationService} from '../service/book-navigation.service'; import {DialogLauncherService} from '../../../shared/services/dialog-launcher.service'; diff --git a/frontend/src/app/features/book/components/book-browser/book-browser-entity.service.spec.ts b/frontend/src/app/features/book/components/book-browser/book-browser-entity.service.spec.ts deleted file mode 100644 index f06c762ba..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-browser-entity.service.spec.ts +++ /dev/null @@ -1,149 +0,0 @@ -import {TestBed} from '@angular/core/testing'; -import {convertToParamMap} from '@angular/router'; -import {beforeEach, describe, expect, it, vi} from 'vitest'; - -import {BookBrowserEntityService} from './book-browser-entity.service'; -import {Book} from '../../model/book.model'; -import {Library} from '../../model/library.model'; -import {Shelf} from '../../model/shelf.model'; -import {EntityType} from './book-browser.component'; -import {LibraryService} from '../../service/library.service'; -import {ShelfService} from '../../service/shelf.service'; -import {MagicShelfService, MagicShelf} from '../../../magic-shelf/service/magic-shelf.service'; -import {BookRuleEvaluatorService} from '../../../magic-shelf/service/book-rule-evaluator.service'; - -function makeBook(id: number, overrides: Partial = {}): Book { - return { - id, - libraryId: 1, - libraryName: 'Library', - metadata: {bookId: id, title: `Book ${id}`}, - ...overrides - }; -} - -describe('BookBrowserEntityService', () => { - let service: BookBrowserEntityService; - let libraryService: {libraries: ReturnType}; - let shelfService: {shelves: ReturnType}; - let magicShelfService: {findShelfById: ReturnType}; - let bookRuleEvaluatorService: {evaluateGroup: ReturnType}; - - const library = { - id: 1, - name: 'Library', - watch: true, - paths: [{path: '/books'}] - } as Library; - const shelf = {id: 2, name: 'Shelf'} as Shelf; - const magicShelf = { - id: 3, - name: 'Magic Shelf', - filterJson: JSON.stringify({group: 'all'}) - } as MagicShelf; - - beforeEach(() => { - libraryService = { - libraries: vi.fn(() => [library]) - }; - shelfService = { - shelves: vi.fn(() => [shelf]) - }; - magicShelfService = { - findShelfById: vi.fn((id: number) => id === 3 ? magicShelf : null) - }; - bookRuleEvaluatorService = { - evaluateGroup: vi.fn((book: Book) => book.id === 2) - }; - - TestBed.configureTestingModule({ - providers: [ - BookBrowserEntityService, - {provide: LibraryService, useValue: libraryService}, - {provide: ShelfService, useValue: shelfService}, - {provide: MagicShelfService, useValue: magicShelfService}, - {provide: BookRuleEvaluatorService, useValue: bookRuleEvaluatorService} - ] - }); - - service = TestBed.inject(BookBrowserEntityService); - }); - - it('resolves entity ids from route params in priority order', () => { - const allParams = convertToParamMap({ - libraryId: '1', - shelfId: '2', - magicShelfId: '3' - }); - const shelfFirstParams = convertToParamMap({ - shelfId: '2', - magicShelfId: '3' - }); - const emptyParams = convertToParamMap({}); - - expect(service.getEntityInfo(allParams)).toEqual({ - entityId: 1, - entityType: EntityType.LIBRARY - }); - expect(service.getEntityInfo(shelfFirstParams)).toEqual({ - entityId: 2, - entityType: EntityType.SHELF - }); - expect(service.getEntityInfo(emptyParams)).toEqual({ - entityId: NaN, - entityType: EntityType.ALL_BOOKS - }); - }); - - it('returns entity records and recognizes library and magic shelf types', () => { - expect(service.getEntity(1, EntityType.LIBRARY)).toBe(library); - expect(service.getEntity(2, EntityType.SHELF)).toBe(shelf); - expect(service.getEntity(3, EntityType.MAGIC_SHELF)).toBe(magicShelf); - expect(service.getEntity(999, EntityType.ALL_BOOKS)).toBeNull(); - - expect(service.isLibrary(library)).toBe(true); - expect(service.isLibrary(shelf as Library | Shelf | MagicShelf)).toBe(false); - expect(service.isMagicShelf(magicShelf)).toBe(true); - expect(service.isMagicShelf(null)).toBe(false); - }); - - it('filters books by entity type and handles magic shelf parsing failures', () => { - const books = [ - makeBook(1, {libraryId: 1, shelves: [{id: 2} as never]}), - makeBook(2, {libraryId: 1, shelves: []}), - makeBook(3, {libraryId: 2, shelves: [{id: 2} as never]}) - ]; - const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => undefined); - - expect(service.getBooksByEntity(books, 1, EntityType.LIBRARY)).toEqual([ - books[0], - books[1] - ]); - expect(service.getBooksByEntity(books, 2, EntityType.SHELF)).toEqual([ - books[0], - books[2] - ]); - expect(service.getBooksByEntity(books, 0, EntityType.UNSHELVED)).toEqual([ - books[1] - ]); - expect(service.getBooksByEntity(books, 0, EntityType.ALL_BOOKS)).toBe(books); - - expect(service.getBooksByEntity(books, 3, EntityType.MAGIC_SHELF)).toEqual([ - books[1] - ]); - expect(bookRuleEvaluatorService.evaluateGroup).toHaveBeenCalledWith( - books[0], - {group: 'all'}, - books - ); - - magicShelfService.findShelfById.mockReturnValueOnce({ - id: 4, - name: 'Broken Magic Shelf', - filterJson: '{broken json' - } as MagicShelf); - - expect(service.getBooksByEntity(books, 4, EntityType.MAGIC_SHELF)).toEqual([]); - expect(warnSpy).toHaveBeenCalledWith('Invalid filterJson for MagicShelf'); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/book-browser-entity.service.ts b/frontend/src/app/features/book/components/book-browser/book-browser-entity.service.ts deleted file mode 100644 index a202c7b61..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-browser-entity.service.ts +++ /dev/null @@ -1,97 +0,0 @@ -import {Injectable, inject} from '@angular/core'; -import {ParamMap} from '@angular/router'; -import {Library} from '../../model/library.model'; -import {Shelf} from '../../model/shelf.model'; -import {Book} from '../../model/book.model'; -import {LibraryService} from '../../service/library.service'; -import {ShelfService} from '../../service/shelf.service'; -import {MagicShelf, MagicShelfService} from '../../../magic-shelf/service/magic-shelf.service'; -import {BookRuleEvaluatorService} from '../../../magic-shelf/service/book-rule-evaluator.service'; -import {GroupRule} from '../../../magic-shelf/component/magic-shelf-component'; -import {EntityType} from './book-browser.component'; - -export interface EntityInfo { - entityId: number; - entityType: EntityType; -} - -@Injectable({providedIn: 'root'}) -export class BookBrowserEntityService { - private libraryService = inject(LibraryService); - private shelfService = inject(ShelfService); - private magicShelfService = inject(MagicShelfService); - private bookRuleEvaluatorService = inject(BookRuleEvaluatorService); - - getEntityInfo(paramMap: ParamMap): EntityInfo { - const libraryId = Number(paramMap.get('libraryId') || NaN); - const shelfId = Number(paramMap.get('shelfId') || NaN); - const magicShelfId = Number(paramMap.get('magicShelfId') || NaN); - - if (!Number.isNaN(libraryId)) { - return {entityId: libraryId, entityType: EntityType.LIBRARY}; - } - - if (!Number.isNaN(shelfId)) { - return {entityId: shelfId, entityType: EntityType.SHELF}; - } - - if (!Number.isNaN(magicShelfId)) { - return {entityId: magicShelfId, entityType: EntityType.MAGIC_SHELF}; - } - - return {entityId: NaN, entityType: EntityType.ALL_BOOKS}; - } - - getEntity(entityId: number, entityType: EntityType): Library | Shelf | MagicShelf | null { - switch (entityType) { - case EntityType.LIBRARY: - return this.libraryService.libraries().find(lib => lib.id === entityId) ?? null; - case EntityType.SHELF: - return this.shelfService.shelves().find(shelf => shelf.id === entityId) ?? null; - case EntityType.MAGIC_SHELF: - return this.magicShelfService.findShelfById(entityId) ?? null; - default: - return null; - } - } - - getBooksByEntity(books: Book[], entityId: number, entityType: EntityType): Book[] { - switch (entityType) { - case EntityType.LIBRARY: - return books.filter(book => book.libraryId === entityId); - case EntityType.SHELF: - return books.filter(book => book.shelves?.some(shelf => shelf.id === entityId) ?? false); - case EntityType.MAGIC_SHELF: { - const magicShelf = this.getEntity(entityId, entityType); - return this.isMagicShelf(magicShelf) ? this.filterByMagicShelf(books, magicShelf) : []; - } - case EntityType.UNSHELVED: - return books.filter(book => !book.shelves || book.shelves.length === 0); - case EntityType.ALL_BOOKS: - default: - return books; - } - } - - isLibrary(entity: Library | Shelf | MagicShelf): entity is Library { - return (entity as Library).paths !== undefined; - } - - isMagicShelf(entity: Library | Shelf | MagicShelf | null): entity is MagicShelf { - return !!entity && 'filterJson' in entity; - } - - private filterByMagicShelf(books: Book[], magicShelf: MagicShelf): Book[] { - if (!magicShelf.filterJson) { - return []; - } - - try { - const groupRule = JSON.parse(magicShelf.filterJson) as GroupRule; - return books.filter(book => this.bookRuleEvaluatorService.evaluateGroup(book, groupRule, books)); - } catch { - console.warn('Invalid filterJson for MagicShelf'); - return []; - } - } -} diff --git a/frontend/src/app/features/book/components/book-browser/book-browser-query-params.service.spec.ts b/frontend/src/app/features/book/components/book-browser/book-browser-query-params.service.spec.ts deleted file mode 100644 index 00e18e826..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-browser-query-params.service.spec.ts +++ /dev/null @@ -1,300 +0,0 @@ -import {TestBed} from '@angular/core/testing'; -import {ActivatedRoute, convertToParamMap, ParamMap, Router} from '@angular/router'; -import {vi, describe, beforeEach, afterEach, expect, it} from 'vitest'; - -import {EntityType} from './book-browser.component'; -import { - BookBrowserQueryParamsService, - QUERY_PARAMS, - VIEW_MODES -} from './book-browser-query-params.service'; -import {SortDirection, SortOption} from '../../model/sort.model'; -import {EntityViewPreferences} from '../../../settings/user-management/user.service'; - -describe('BookBrowserQueryParamsService', () => { - let service: BookBrowserQueryParamsService; - let routerNavigate: ReturnType; - let routeSnapshot: { - queryParams: Record; - queryParamMap: ParamMap; - }; - let activatedRoute: {snapshot: typeof routeSnapshot}; - - const sortOptions: SortOption[] = [ - {label: 'Added On', field: 'addedOn', direction: SortDirection.DESCENDING}, - {label: 'Title', field: 'title', direction: SortDirection.ASCENDING}, - {label: 'Authors', field: 'author', direction: SortDirection.ASCENDING} - ]; - - beforeEach(() => { - routerNavigate = vi.fn(); - routeSnapshot = { - queryParams: {}, - queryParamMap: convertToParamMap({}) - }; - activatedRoute = {snapshot: routeSnapshot}; - - TestBed.configureTestingModule({ - providers: [ - BookBrowserQueryParamsService, - {provide: Router, useValue: {navigate: routerNavigate}}, - {provide: ActivatedRoute, useValue: activatedRoute} - ] - }); - - service = TestBed.inject(BookBrowserQueryParamsService); - }); - - afterEach(() => { - TestBed.resetTestingModule(); - }); - - it('parses explicit query params, filters, and toggle state', () => { - const result = service.parseQueryParams( - convertToParamMap({ - [QUERY_PARAMS.VIEW]: VIEW_MODES.TABLE, - [QUERY_PARAMS.SORT]: 'title:desc,author:asc', - [QUERY_PARAMS.FILTER]: 'tag:fiction|sci%20fi,series:A%3AB', - [QUERY_PARAMS.FMODE]: 'or', - [QUERY_PARAMS.FROM]: 'toggle' - }), - undefined, - undefined, - undefined, - sortOptions, - 'and' - ); - - expect(result).toEqual({ - viewMode: VIEW_MODES.TABLE, - sortOption: {label: 'Title', field: 'title', direction: SortDirection.DESCENDING}, - sortCriteria: [ - {label: 'Title', field: 'title', direction: SortDirection.DESCENDING}, - {label: 'Authors', field: 'author', direction: SortDirection.ASCENDING} - ], - filters: { - tag: ['fiction', 'sci fi'], - series: ['A:B'] - }, - filterMode: 'or', - viewModeFromToggle: true - }); - }); - - it('uses entity overrides, legacy preferences, and default sort fallback', () => { - const userPrefs: EntityViewPreferences = { - global: { - sortKey: 'addedOn', - sortDir: 'ASC', - sortCriteria: [ - {field: 'title', direction: 'DESC'} - ], - view: 'TABLE', - coverSize: 1, - seriesCollapsed: false, - overlayBookType: true - }, - overrides: [ - { - entityType: 'LIBRARY', - entityId: 7, - preferences: { - sortKey: 'authors', - sortDir: 'DESC', - sortCriteria: [ - {field: 'authors', direction: 'DESC'} - ], - view: 'GRID', - coverSize: 1, - seriesCollapsed: false, - overlayBookType: false - } - } - ] - }; - - const overrideResult = service.parseQueryParams( - convertToParamMap({ - [QUERY_PARAMS.FMODE]: 'single' - }), - userPrefs, - EntityType.LIBRARY, - 7, - sortOptions, - 'and' - ); - - expect(overrideResult.viewMode).toBe(VIEW_MODES.GRID); - expect(overrideResult.filterMode).toBe('single'); - expect(overrideResult.sortCriteria).toEqual([ - {label: 'authors', field: 'authors', direction: SortDirection.DESCENDING} - ]); - - const legacyResult = service.parseQueryParams( - convertToParamMap({}), - { - global: { - sortKey: 'title', - sortDir: 'DESC', - view: 'TABLE', - coverSize: 1, - seriesCollapsed: false, - overlayBookType: true - }, - overrides: [] - }, - undefined, - undefined, - sortOptions, - 'and' - ); - - expect(legacyResult.sortOption).toEqual({ - label: 'Title', - field: 'title', - direction: SortDirection.DESCENDING - }); - expect(legacyResult.viewMode).toBe('table'); - - const fallbackResult = service.parseQueryParams( - convertToParamMap({}), - { - global: { - sortKey: 'missing', - sortDir: 'DESC', - view: 'TABLE', - coverSize: 1, - seriesCollapsed: false, - overlayBookType: true - }, - overrides: [] - }, - undefined, - undefined, - sortOptions, - 'and' - ); - - expect(fallbackResult.sortOption).toEqual({ - label: 'Added On', - field: 'addedOn', - direction: SortDirection.DESCENDING - }); - }); - - it('serializes and deserializes sorts and filters while ignoring malformed input', () => { - expect(service.serializeSort([ - {label: 'Title', field: 'title', direction: SortDirection.ASCENDING}, - {label: 'Added On', field: 'addedOn', direction: SortDirection.DESCENDING} - ])).toBe('title:asc,addedOn:desc'); - - expect(service.deserializeSort('title:desc,missing:asc', sortOptions)).toEqual([ - {label: 'Title', field: 'title', direction: SortDirection.DESCENDING} - ]); - - expect(service.serializeFilters({ - tag: ['sci fi', 'new:release'], - series: ['A/B'] - })).toBe('tag:sci%20fi|new%3Arelease,series:A%2FB'); - - expect(service.deserializeFilters('tag:sci%20fi|new%3Arelease,broken,series:A%2FB')).toEqual({ - tag: ['sci fi', 'new:release'], - series: ['A/B'] - }); - }); - - it('updates query params for view mode, sort, filters, and sync changes', () => { - routeSnapshot.queryParams = { - foo: 'bar', - [QUERY_PARAMS.SORT]: 'title:asc', - [QUERY_PARAMS.DIRECTION]: 'desc', - [QUERY_PARAMS.VIEW]: VIEW_MODES.GRID, - [QUERY_PARAMS.FMODE]: 'and', - [QUERY_PARAMS.FILTER]: 'tag:fiction' - }; - routeSnapshot.queryParamMap = convertToParamMap({ - [QUERY_PARAMS.FILTER]: 'tag:fiction' - }); - - service.updateViewMode(VIEW_MODES.TABLE); - expect(routerNavigate).toHaveBeenCalledWith([], expect.objectContaining({ - queryParams: { - [QUERY_PARAMS.VIEW]: VIEW_MODES.TABLE, - [QUERY_PARAMS.FROM]: 'toggle' - }, - queryParamsHandling: 'merge', - replaceUrl: true - })); - - service.updateSort({label: 'Added On', field: 'addedOn', direction: SortDirection.DESCENDING}); - expect(routerNavigate).toHaveBeenCalledWith([], expect.objectContaining({ - queryParams: expect.objectContaining({ - foo: 'bar', - [QUERY_PARAMS.SORT]: 'addedOn:desc', - [QUERY_PARAMS.DIRECTION]: null - }), - replaceUrl: true - })); - - routerNavigate.mockClear(); - routeSnapshot.queryParamMap = convertToParamMap({}); - service.updateFilters(null); - expect(routerNavigate).not.toHaveBeenCalled(); - - routeSnapshot.queryParamMap = convertToParamMap({ - [QUERY_PARAMS.FILTER]: 'tag:fiction' - }); - service.updateFilters({tag: ['fiction', 'sci fi']}); - expect(routerNavigate).toHaveBeenCalledWith([], expect.objectContaining({ - relativeTo: activatedRoute as never, - queryParams: {[QUERY_PARAMS.FILTER]: 'tag:fiction|sci%20fi'}, - queryParamsHandling: 'merge', - replaceUrl: false - })); - - service.updateFilterMode('single', {tag: ['fiction', 'sci fi']}); - expect(routerNavigate).toHaveBeenCalledWith([], expect.objectContaining({ - relativeTo: activatedRoute as never, - queryParams: { - [QUERY_PARAMS.FMODE]: 'single', - [QUERY_PARAMS.FILTER]: null - }, - queryParamsHandling: 'merge', - replaceUrl: false - })); - - service.updateFilterMode('or', {tag: ['fiction']}); - expect(routerNavigate).toHaveBeenCalledWith([], expect.objectContaining({ - relativeTo: activatedRoute as never, - queryParams: { - [QUERY_PARAMS.FMODE]: 'or' - }, - queryParamsHandling: 'merge', - replaceUrl: false - })); - - routerNavigate.mockClear(); - service.syncQueryParams('grid', 'and', {tag: ['fiction']}); - expect(routerNavigate).not.toHaveBeenCalled(); - - service.syncQueryParams('table', 'single', {tag: ['fiction']}); - expect(routerNavigate).toHaveBeenCalledWith([], expect.objectContaining({ - queryParams: { - foo: 'bar', - [QUERY_PARAMS.SORT]: 'title:asc', - [QUERY_PARAMS.DIRECTION]: 'desc', - [QUERY_PARAMS.VIEW]: 'table', - [QUERY_PARAMS.FMODE]: 'single', - [QUERY_PARAMS.FILTER]: 'tag:fiction' - }, - replaceUrl: true - })); - }); - - it('detects when a series filter should force expansion', () => { - expect(service.shouldForceExpandSeries(convertToParamMap({}))).toBe(false); - expect(service.shouldForceExpandSeries(convertToParamMap({ - [QUERY_PARAMS.FILTER]: 'tag:fiction,series:space-opera' - }))).toBe(true); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/book-browser-query-params.service.ts b/frontend/src/app/features/book/components/book-browser/book-browser-query-params.service.ts deleted file mode 100644 index 3009a2f73..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-browser-query-params.service.ts +++ /dev/null @@ -1,306 +0,0 @@ -import {Injectable, inject} from '@angular/core'; -import {ActivatedRoute, ParamMap, Router} from '@angular/router'; -import {SortDirection, SortOption} from '../../model/sort.model'; -import {BookFilterMode, EntityViewPreference, EntityViewPreferences, SortCriterion} from '../../../settings/user-management/user.service'; -import {EntityType} from './book-browser.component'; - -export const QUERY_PARAMS = { - VIEW: 'view', - SORT: 'sort', - DIRECTION: 'direction', - FILTER: 'filter', - FMODE: 'fmode', - SIDEBAR: 'sidebar', - FROM: 'from', -} as const; - -export const VIEW_MODES = { - GRID: 'grid', - TABLE: 'table', -} as const; - -export const SORT_DIRECTION = { - ASCENDING: 'asc', - DESCENDING: 'desc', -} as const; - -export interface BookBrowserQueryState { - viewMode: 'grid' | 'table'; - sortField: string; - sortDirection: SortDirection; - filters: Record; - filterMode: BookFilterMode; -} - -export interface QueryParseResult { - viewMode: string; - sortOption: SortOption; - sortCriteria: SortOption[]; - filters: Record; - filterMode: BookFilterMode; - viewModeFromToggle: boolean; -} - -@Injectable({providedIn: 'root'}) -export class BookBrowserQueryParamsService { - private router = inject(Router); - private activatedRoute = inject(ActivatedRoute); - - parseQueryParams( - queryParamMap: ParamMap, - userPrefs: EntityViewPreferences | undefined, - entityType: EntityType | undefined, - entityId: number | undefined, - sortOptions: SortOption[], - defaultFilterMode: BookFilterMode - ): QueryParseResult { - const viewParam = queryParamMap.get(QUERY_PARAMS.VIEW); - const sortParam = queryParamMap.get(QUERY_PARAMS.SORT); - const directionParam = queryParamMap.get(QUERY_PARAMS.DIRECTION); - const filterParams = queryParamMap.get(QUERY_PARAMS.FILTER); - const filterModeParam = queryParamMap.get(QUERY_PARAMS.FMODE); - const fromParam = queryParamMap.get(QUERY_PARAMS.FROM); - - const filterMode = (filterModeParam || defaultFilterMode) as BookFilterMode; - - // Parse filters - const filters = this.deserializeFilters(filterParams); - - // Determine effective preferences - const globalPrefs = userPrefs?.global; - const currentEntityTypeStr = entityType?.toString().toUpperCase().replaceAll(' ', '_'); - const override = userPrefs?.overrides?.find(o => - o.entityType?.toUpperCase() === currentEntityTypeStr && - o.entityId === entityId - ); - - const effectivePrefs: EntityViewPreference = override?.preferences ?? globalPrefs ?? { - sortKey: 'addedOn', - sortDir: 'ASC', - view: 'GRID', - coverSize: 1.0, - seriesCollapsed: false, - overlayBookType: true - }; - - // Parse sort criteria - supports both legacy and new multi-sort format - let sortCriteria: SortOption[]; - - if (sortParam) { - // Check if it's new multi-sort format (contains colons like "author:asc,title:desc") - if (sortParam.includes(':')) { - sortCriteria = this.deserializeSort(sortParam, sortOptions); - } else { - // Legacy format: separate sort and direction params - const effectiveSortDir = directionParam - ? (directionParam.toLowerCase() === SORT_DIRECTION.DESCENDING ? SortDirection.DESCENDING : SortDirection.ASCENDING) - : SortDirection.ASCENDING; - const matchedSort = sortOptions.find(opt => opt.field === sortParam); - sortCriteria = matchedSort ? [{ - label: matchedSort.label, - field: matchedSort.field, - direction: effectiveSortDir - }] : []; - } - } else { - // Use user preferences - if (effectivePrefs.sortCriteria && effectivePrefs.sortCriteria.length > 0) { - sortCriteria = effectivePrefs.sortCriteria.map((c: SortCriterion) => { - const matchedSort = sortOptions.find(opt => opt.field === c.field); - return { - label: matchedSort?.label ?? c.field, - field: c.field, - direction: c.direction === 'DESC' ? SortDirection.DESCENDING : SortDirection.ASCENDING - }; - }); - } else { - // Fall back to legacy single sort preference - const userSortKey = effectivePrefs.sortKey; - const userSortDir = effectivePrefs.sortDir?.toUpperCase() === 'DESC' - ? SortDirection.DESCENDING - : SortDirection.ASCENDING; - const matchedSort = sortOptions.find(opt => opt.field === userSortKey); - sortCriteria = matchedSort ? [{ - label: matchedSort.label, - field: matchedSort.field, - direction: userSortDir - }] : []; - } - } - - // Ensure we have at least a default sort - if (sortCriteria.length === 0) { - sortCriteria = [{ - label: 'Added On', - field: 'addedOn', - direction: SortDirection.DESCENDING - }]; - } - - // For backward compatibility, expose the first sort as sortOption - const sortOption = sortCriteria[0]; - - // Determine view mode - const viewModeFromToggle = fromParam === 'toggle'; - const viewMode = viewModeFromToggle - ? (viewParam === VIEW_MODES.TABLE || viewParam === VIEW_MODES.GRID - ? viewParam - : VIEW_MODES.GRID) - : (effectivePrefs.view?.toLowerCase() ?? VIEW_MODES.GRID); - - return { - viewMode, - sortOption, - sortCriteria, - filters, - filterMode, - viewModeFromToggle - }; - } - - updateViewMode(mode: 'grid' | 'table'): void { - this.router.navigate([], { - queryParams: { - [QUERY_PARAMS.VIEW]: mode, - [QUERY_PARAMS.FROM]: 'toggle' - }, - queryParamsHandling: 'merge', - replaceUrl: true - }); - } - - updateSort(sortOption: SortOption): void { - this.updateMultiSort([sortOption]); - } - - updateMultiSort(sortCriteria: SortOption[]): void { - const currentParams = this.activatedRoute.snapshot.queryParams; - const newParams = { - ...currentParams, - [QUERY_PARAMS.SORT]: this.serializeSort(sortCriteria), - [QUERY_PARAMS.DIRECTION]: null // Remove legacy direction param - }; - - this.router.navigate([], { - queryParams: newParams, - replaceUrl: true - }); - } - - serializeSort(criteria: SortOption[]): string { - return criteria.map(c => - `${c.field}:${c.direction === SortDirection.ASCENDING ? 'asc' : 'desc'}` - ).join(','); - } - - deserializeSort(sortParam: string, sortOptions: SortOption[]): SortOption[] { - const criteria: SortOption[] = []; - - sortParam.split(',').forEach(part => { - const [field, dir] = part.split(':'); - if (field) { - const matchedSort = sortOptions.find(opt => opt.field === field); - if (matchedSort) { - criteria.push({ - label: matchedSort.label, - field: matchedSort.field, - direction: dir?.toLowerCase() === 'desc' ? SortDirection.DESCENDING : SortDirection.ASCENDING - }); - } - } - }); - - return criteria; - } - - updateFilters(filters: Record | null): void { - const queryParam = filters && Object.keys(filters).length > 0 - ? this.serializeFilters(filters) - : null; - - if (queryParam !== this.activatedRoute.snapshot.queryParamMap.get(QUERY_PARAMS.FILTER)) { - this.router.navigate([], { - relativeTo: this.activatedRoute, - queryParams: {[QUERY_PARAMS.FILTER]: queryParam}, - queryParamsHandling: 'merge', - replaceUrl: false - }); - } - } - - updateFilterMode(mode: BookFilterMode, currentFilters: Record): void { - const params: Record = {[QUERY_PARAMS.FMODE]: mode}; - - // Clear filters if switching from multiple selected to single mode - if (mode === 'single') { - const categories = Object.keys(currentFilters); - if (categories.length > 1 || (categories.length === 1 && currentFilters[categories[0]].length > 1)) { - params[QUERY_PARAMS.FILTER] = null; - } - } - - this.router.navigate([], { - relativeTo: this.activatedRoute, - queryParams: params, - queryParamsHandling: 'merge', - replaceUrl: false - }); - } - - serializeFilters(filters: Record): string { - return Object.entries(filters) - .map(([k, v]) => `${k}:${v.map(val => encodeURIComponent(val)).join('|')}`) - .join(','); - } - - deserializeFilters(filterParam: string | null): Record { - const parsedFilters: Record = {}; - - if (!filterParam) return parsedFilters; - - filterParam.split(',').forEach(pair => { - const [key, ...valueParts] = pair.split(':'); - const value = valueParts.join(':'); - if (key && value) { - parsedFilters[key] = value.split('|').map(v => decodeURIComponent(v.trim())).filter(Boolean); - } - }); - - return parsedFilters; - } - - syncQueryParams( - viewMode: string, - filterMode: BookFilterMode, - filters: Record - ): void { - const queryParams: Record = { - [QUERY_PARAMS.VIEW]: viewMode, - [QUERY_PARAMS.FMODE]: filterMode, - }; - - if (Object.keys(filters).length > 0) { - queryParams[QUERY_PARAMS.FILTER] = this.serializeFilters(filters); - } - - const currentParams = this.activatedRoute.snapshot.queryParams; - const changed = Object.keys(queryParams).some(k => (queryParams[k] ?? undefined) !== (currentParams[k] ?? undefined)); - - if (changed) { - const mergedParams = {...currentParams, ...queryParams}; - this.router.navigate([], { - queryParams: mergedParams, - replaceUrl: true - }); - } - } - - shouldForceExpandSeries(queryParamMap: ParamMap): boolean { - const filterParam = queryParamMap.get(QUERY_PARAMS.FILTER); - return ( - !!filterParam && - typeof filterParam === 'string' && - filterParam.split(',').some(pair => pair.trim().startsWith('series:')) - ); - } -} diff --git a/frontend/src/app/features/book/components/book-browser/book-browser.component.html b/frontend/src/app/features/book/components/book-browser/book-browser.component.html deleted file mode 100644 index f9e1ffec9..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-browser.component.html +++ /dev/null @@ -1,469 +0,0 @@ - -
-
- -
-
- @if (entityType(); as entityType) { -
-

- @if (entityType === EntityType.ALL_BOOKS) { - @if (currentFilterLabel() && rawFilterParamFromUrl()) { - {{ currentFilterLabel() }} - } @else if (isFilterActive() || hasSearchTerm()) { - {{ computedFilterLabel() }} - } @else { - {{ t('labels.allBooks') }} - } - } @else if (entityType === EntityType.UNSHELVED) { - {{ (isFilterActive() || hasSearchTerm()) ? t('labels.unshelvedBooksFiltered') : t('labels.unshelvedBooks') }} - } @else { - {{ entityType }}: {{ entity()?.name }}{{ (isFilterActive() || hasSearchTerm()) ? ' ' + t('labels.filteredSuffix') : '' }} - } -

- @if (!showBooksLoadingPlaceholder() && seriesCollapseFilter.seriesCollapsed() && books(); as books) { -

- {{ t('labels.seriesCollapsedInfo', { count: books.length, itemWord: books.length === 1 ? t('labels.item') : t('labels.items') }) }} -

- } -
- - @if (entityMenuTarget(); as menuTarget) { -
- - @if (entityMenu.available()) { - - } -
- } - } -
-
-
- @if (isFilterActive()) { - - - - - } - - @if (currentViewMode() === 'table') { -
- - - - - -
- -
- -
-
- } - - - - -
- - - - -
-
-
- - - -
-
-
- {{ 'common.cardSize' | transloco }} - -
-
-
- - - -
-
-
-
-
- - - -
- - -
- - - -
- - -
-
-
- -
- - - @if (bookTitle()) { - - } -
- - - - - -
-
- -
-
- @if (booksError()) { -
-

- @switch (entityType()) { - @case (EntityType.LIBRARY) { - {{ t('labels.failedLibrary') }} - } - @case (EntityType.SHELF) { - {{ t('labels.failedShelf') }} - } - @default { - {{ t('labels.failedBooks') }} - } - } -

-
- } @else { - @let visibleBooks = books(); - @if (visibleBooks.length === 0 && !showBooksLoadingPlaceholder()) { -
-

- {{ t('labels.noBooks') }} -

-
- } - @if (currentViewMode() === 'table' && (visibleBooks.length > 0 || showTableLoadingPlaceholder())) { - - } - @if (currentViewMode() === 'grid') { -
-
- @for (virtualItem of virtualGrid.virtualizer.getVirtualItems(); track virtualItem.key) { - @if (visibleBooks[virtualItem.index]; as book) { -
- - -
- } @else { -
- } - } -
-
- } - @if (userService.currentUser(); as currentUser) { - - } - } -
- - @if (showFilter()) { -
-
- } - - -
-
- -
-
diff --git a/frontend/src/app/features/book/components/book-browser/book-browser.component.scss b/frontend/src/app/features/book/components/book-browser/book-browser.component.scss deleted file mode 100644 index 628b2ac0b..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-browser.component.scss +++ /dev/null @@ -1,520 +0,0 @@ -// Layout containers -.book-browser-container { - position: relative; - display: flex; - flex-direction: column; - min-width: 0; - width: 100%; - height: 100%; - min-height: 0; -} - -.book-browser-main { - display: flex; - flex-direction: column; - flex: 1 1 auto; - min-width: 0; - width: 100%; - min-height: 0; -} - -.book-browser-body { - position: relative; - display: flex; - flex: 1 1 auto; - flex-direction: row; - min-width: 0; - min-height: 0; -} - -.book-browser-content { - position: relative; - display: flex; - flex: 1 1 0; - flex-direction: column; - min-width: 0; - min-height: 0; -} - -// Header bar -.book-browser-header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 0.2188rem; - padding: 0.3063rem; - margin-right: 2px; - flex-shrink: 0; - background-color: var(--color-card); - border-bottom: 1px solid var(--p-content-border-color); - - @media (width >= 768px) { - gap: 0.875rem; - padding: 0.4375rem 0.875rem; - } -} - -// Entity info section -.entity-info-wrapper { - display: flex; - align-items: center; - min-width: 0; - flex-shrink: 1; - overflow: hidden; -} - -.entity-info { - display: flex; - flex-direction: column; - gap: 0.1094rem; - min-width: 0; - overflow: hidden; - - @media (width <= 767px) { - gap: 0; - } -} - -.entity-title { - font-size: 1.0938rem; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - margin: 0; - - @media (width <= 767px) { - font-size: var(--app-text-base); - padding-left: 0.2188rem; - } -} - -.series-collapsed-info { - font-size: var(--app-text-sm); - color: var(--color-text-secondary); - margin: 0; - - @media (width <= 767px) { - display: none; - margin: 0; - padding: 0; - height: 0; - } -} - -.entity-menu-wrapper { - margin-left: 0.4375rem; - flex-shrink: 0; -} - -// Toolbar actions -.toolbar-actions { - display: flex; - flex-wrap: nowrap; - align-items: center; - gap: 0.2188rem; - flex-shrink: 0; - - @media (width >= 768px) { - gap: 0.875rem; - } -} - -.toolbar-icons { - display: flex; - flex-wrap: nowrap; - align-items: center; - gap: 0.2188rem; - - @media (width >= 768px) { - gap: 1.3125rem; - } -} - -// Icon with orange color for filter -.filter-clear-icon { - color: orange; -} - -// Popover content containers -.column-popover-content { - width: 200px; -} - -.column-popover-footer { - display: flex; - align-items: center; - gap: 0.4375rem; - padding-top: 0.875rem; - padding-left: 0.2188rem; -} - -.display-settings-popover { - width: 220px; - padding: 0.4375rem; - display: flex; - flex-direction: column; - gap: 0.875rem; - font-size: var(--app-text-sm); -} - -.display-settings-section { - display: flex; - flex-direction: column; - gap: 0.4375rem; -} - -.display-settings-checkbox-row { - display: flex; - align-items: center; - gap: 0.4375rem; -} - -.display-settings-label { - font-weight: 500; -} - -// Sort button wrapper -.sort-button-wrapper { - position: relative; - - .sort-badge { - position: absolute; - top: -6px; - right: -6px; - } -} - -// Sort menu item (kept for backward compat) -.sort-menu-item { - display: flex; - justify-content: space-between; - align-items: center; - padding: 0.4375rem 0.875rem; - cursor: pointer; -} - -// Search section -.mobile-search-wrapper { - position: relative; - - @media (width >= 768px) { - display: none; - } -} - -.desktop-search-wrapper { - display: none; - position: relative; - - @media (width >= 768px) { - display: block; - } -} - -.search-popover-content { - position: relative; - width: 100%; -} - -.search-input-full { - width: 100%; -} - -.search-clear-btn { - position: absolute; - right: 0.4375rem; - top: 50%; - transform: translateY(-50%); -} - -// Footer bar -.book-browser-footer { - position: absolute; - bottom: 0; - left: 10%; - right: 10%; - display: flex; - align-items: center; - overflow: hidden; - padding: 0.875rem 0.4375rem 0.4375rem; - z-index: 1; - border-radius: 10px 10px 0 0; - border: 1px solid rgb(255 255 255 / 50%); - border-width: 1px 1px 0; - background-color: var(--color-card); - transition: transform 0.15s ease-out, opacity 0.15s ease-out; - transform: translateY(0); - opacity: 1; - - &.footer-hidden { - transform: translateY(100%); - opacity: 0; - pointer-events: none; - } - - @media (width <= 768px) { - left: 0; - right: 0; - } -} - -.footer-content { - display: flex; - align-items: center; - min-width: 0; - flex: 1; -} - -.footer-left { - display: flex; - align-items: center; - padding-left: 0.4375rem; - flex-shrink: 0; - width: 120px; - - @media (width <= 768px) { - width: auto; - } -} - -.footer-center { - display: flex; - justify-content: center; - flex: 1; - min-width: 0; - overflow-x: auto; - -webkit-overflow-scrolling: touch; - scrollbar-width: none; - mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 32px), transparent 100%); - padding: 0 16px; - - &::-webkit-scrollbar { - display: none; - } - - @media (width <= 768px) { - justify-content: flex-start; - } -} - -.footer-right { - flex-shrink: 0; - width: 120px; - - @media (width <= 768px) { - display: none; - } -} - -.selected-count-badge { - display: inline-flex; - align-items: center; - padding: 0.4375rem 0.875rem; - font-size: 0.7875rem; - color: var(--color-text); - - i { - font-size: var(--app-text-base); - margin-right: 0.4375rem; - } - - @media (width <= 768px) { - padding: 0.35rem 0.7rem; - font-size: 0.7438rem; - - i { - font-size: 0.7875rem; - } - } -} - -.selected-count { - font-weight: 700; - font-size: var(--app-text-base); - color: var(--color-primary); -} - -.selected-label { - margin-left: 0.2188rem; -} - -.action-buttons-group { - display: flex; - flex-shrink: 0; - gap: 0.4375rem; - - @media (width >= 768px) { - gap: 1.3125rem; - } -} - -.more-actions-wrapper { - display: flex; - justify-content: center; -} - -// Virtual scroller and grid -.virtual-scroller { - width: 100%; - height: 100%; - padding: 0.875rem; - box-sizing: border-box; - overflow-y: auto; -} - -.virtual-loader-cell { - border-radius: 8px; - background: var(--p-content-border-color); - animation: skeleton-pulse 1.5s ease-in-out infinite; - pointer-events: none; - will-change: opacity; -} - -@keyframes skeleton-pulse { - 0%, 100% { opacity: 0.3; } - 50% { opacity: 0.6; } -} - -@media (prefers-reduced-motion: reduce) { - .virtual-loader-cell { - animation: none; - will-change: auto; - } -} - -// No books state -.no-books-container { - padding-top: 2.625rem; - display: flex; - justify-content: center; - align-items: center; -} - -.no-books-text { - font-size: var(--app-text-base); - font-weight: 500; - color: var(--color-text); - background: var(--color-card); - padding: 0.6563rem 0.875rem; - border-radius: 0.4375rem; -} - -// Toolbar actions (icon buttons) -.toolbar-item { - display: inline-flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - border: 1px solid var(--color-border); - width: 2.1875rem; - height: 2.1875rem; - transition: outline-color 0.2s, border-color 0.2s; - border-radius: 6px; - margin: 0; - padding: 0; - outline-color: transparent; - background-color: var(--color-card); - cursor: pointer; - - @media (width <= 767px) { - width: 1.75rem; - height: 1.75rem; - } - - &:hover { - border-color: var(--color-primary); - } - - i, span { - color: var(--color-primary); - font-size: 1.0938rem; - font-weight: 100; - - @media (width <= 767px) { - font-size: var(--app-text-base); - } - } -} - -// Search input styling -.search-icon { - position: absolute; - top: 50%; - left: 10px; - transform: translateY(-50%); - color: var(--color-text-secondary); - font-size: var(--app-text-base); - pointer-events: none; -} - -.search-input { - min-width: 19.25rem; - padding-left: 30px; - height: 2.1875rem; - line-height: 2.1875rem; - font-size: var(--app-text-base); - box-sizing: border-box; - - @media (width <= 767px) { - min-width: 0; - } -} - -// Filter overlay (mobile sidebar) -.mobile-filter-mask { - @media (width <= 991px) { - position: absolute; - top: 0; - left: 0; - z-index: 998; - width: 100%; - height: 100%; - background-color: rgb(0 0 0 / 40%); - } -} - -.filter-overlay-container { - --book-filter-sidebar-width: 225px; - - flex-shrink: 0; - z-index: 50; - - @media (width <= 991px) { - width: var(--book-filter-sidebar-width); - position: absolute; - top: 0; - right: 0; - bottom: 0; - height: 100%; - background-color: var(--color-card); - box-shadow: -2px 0 10px rgb(0 0 0 / 15%); - transform: translateX(100%); - transition: transform 0.3s ease; - z-index: 1001; - - &.active { - transform: translateX(0); - margin-left: 0; - } - } - - @media (width >= 992px) { - position: relative; - overflow: hidden; - flex-shrink: 0; - - &:not(.active) { - width: 0 !important; - opacity: 0; - pointer-events: none; - margin-left: 0; - } - - &.active { - width: var(--book-filter-sidebar-width); - opacity: 1; - pointer-events: auto; - margin-left: 0; - } - } -} diff --git a/frontend/src/app/features/book/components/book-browser/book-browser.component.spec.ts b/frontend/src/app/features/book/components/book-browser/book-browser.component.spec.ts deleted file mode 100644 index 0d3823e4b..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-browser.component.spec.ts +++ /dev/null @@ -1,509 +0,0 @@ -import {signal, WritableSignal} from '@angular/core'; -import {TestBed} from '@angular/core/testing'; -import {ActivatedRoute, convertToParamMap, ParamMap, Router} from '@angular/router'; -import {BehaviorSubject, Subject} from 'rxjs'; -import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest'; -import {ConfirmationService, MessageService} from '@openng/optimus-ui/api'; - -import {PageTitleService} from '../../../../shared/service/page-title.service'; -import {BookService} from '../../service/book.service'; -import {BookMetadataManageService} from '../../service/book-metadata-manage.service'; -import {Book} from '../../model/book.model'; -import {SortDirection, SortOption} from '../../model/sort.model'; -import {UserService} from '../../../settings/user-management/user.service'; -import {SeriesCollapseFilter} from './filters/SeriesCollapseFilter'; -import {CoverScalePreferenceService} from './cover-scale-preference.service'; -import {BookDialogHelperService} from './book-dialog-helper.service'; -import {TableColumnPreferenceService} from './table-column-preference.service'; -import {BookMenuService} from '../../service/book-menu.service'; -import {SidebarFilterTogglePrefService} from './filters/sidebar-filter-toggle-pref.service'; -import {TaskHelperService} from '../../../settings/task-management/task-helper.service'; -import {LoadingService} from '../../../../core/services/loading.service'; -import {LocalStorageService} from '../../../../shared/service/local-storage.service'; -import {BookNavigationService} from '../../service/book-navigation.service'; -import {BookCardOverlayPreferenceService} from './book-card-overlay-preference.service'; -import {BookSelectionService} from './book-selection.service'; -import {BookBrowserQueryParamsService, VIEW_MODES} from './book-browser-query-params.service'; -import {BookBrowserEntityService} from './book-browser-entity.service'; -import {RouteScrollPositionService} from '../../../../shared/service/route-scroll-position.service'; -import {AppSettingsService} from '../../../../shared/service/app-settings.service'; -import {BookBrowserComponent, EntityType} from './book-browser.component'; -import {SortService} from '../../service/sort.service'; -import {TranslocoService} from '@jsverse/transloco'; -import {LayoutService} from '../../../../shared/layout/layout.service'; -import {type VirtualGridMetrics} from '../../../../shared/util/virtual-grid.util'; - -function makeBook(id: number, libraryId: number, title: string, addedOn: string): Book { - return { - id, - libraryId, - metadata: { - bookId: id, - title, - }, - addedOn, - } as Book; -} - -function makeCurrentUser() { - return { - id: 1, - username: 'tester', - name: 'Tester', - email: 'tester@example.com', - locale: 'en', - theme: 'grimmory', - themeAccent: null, - themeSyncEnabled: true, - assignedLibraries: [], - permissions: { - admin: false, - canUpload: false, - canDownload: false, - canEmailBook: false, - canDeleteBook: false, - canEditMetadata: false, - canManageLibrary: false, - canManageMetadataConfig: false, - canSyncKoReader: false, - canSyncKobo: false, - canAccessOpds: false, - canAccessBookdrop: false, - canAccessLibraryStats: false, - canAccessUserStats: false, - canAccessTaskManager: false, - canManageEmailConfig: false, - canManageGlobalPreferences: false, - canManageIcons: false, - canManageFonts: false, - demoUser: false, - canBulkAutoFetchMetadata: false, - canBulkCustomFetchMetadata: false, - canBulkEditMetadata: false, - canBulkRegenerateCover: false, - canMoveOrganizeFiles: false, - canBulkLockUnlockMetadata: false, - }, - userSettings: { - filterMode: 'and', - enableSeriesView: false, - visibleSortFields: ['addedOn', 'title'], - entityViewPreferences: { - global: { - sortKey: 'addedOn', - sortDir: 'DESC', - view: 'GRID', - coverSize: 1, - seriesCollapsed: false, - overlayBookType: true, - }, - overrides: [], - }, - }, - } as const; -} - -interface BookBrowserHarness { - component: BookBrowserComponent; - books: WritableSignal; - booksError: WritableSignal; - isBooksLoading: WritableSignal; - paramMap$: BehaviorSubject; - setHasNextPage: (value: boolean) => void; - setIsFetchingNextPage: (value: boolean) => void; - queryParamsService: { - shouldForceExpandSeries: ReturnType; - updateViewMode: ReturnType; - updateFilters: ReturnType; - updateFilterMode: ReturnType; - updateMultiSort: ReturnType; - parseQueryParams: ReturnType; - syncQueryParams: ReturnType; - }; - routeSnapshot: { - routeConfig: {path: string}; - paramMap: ParamMap; - queryParamMap: ParamMap; - params: Record; - }; -} - -function createHarness(options?: { - books?: Book[]; - totalElements?: number; - booksError?: string | null; - isBooksLoading?: boolean; - translate?: (key: string) => string; -}): BookBrowserHarness { - const books = signal( - options?.books ?? [ - makeBook(2, 1, 'Zulu', '2024-02-01T00:00:00Z'), - makeBook(1, 1, 'Alpha', '2024-01-01T00:00:00Z'), - makeBook(3, 2, 'Bravo', '2024-03-01T00:00:00Z'), - ] - ); - const booksError = signal(options?.booksError ?? null); - const isBooksLoading = signal(options?.isBooksLoading ?? false); - const isFetchingNextPage = signal(false); - const hasNextPage = signal(false); - const currentUser = signal(makeCurrentUser()); - const showFilter = signal(false); - const seriesCollapsed = signal(false); - const routerEvents$ = new Subject(); - const paramMap$ = new BehaviorSubject(convertToParamMap({libraryId: '1'})); - const queryParamMap$ = new BehaviorSubject(convertToParamMap({})); - const url$ = new BehaviorSubject([]); - const defaultSort: SortOption = {field: 'addedOn', direction: SortDirection.DESCENDING, label: 'Added On'}; - const queryParamsService = { - parseQueryParams: vi.fn((_q, _u, _et, _ei, _sortOptions, defaultFilterMode) => ({ - viewMode: VIEW_MODES.GRID, - sortOption: defaultSort, - sortCriteria: [defaultSort], - filters: {}, - filterMode: defaultFilterMode, - viewModeFromToggle: false, - })), - syncQueryParams: vi.fn(), - shouldForceExpandSeries: vi.fn(() => false), - updateViewMode: vi.fn(), - updateFilters: vi.fn(), - updateFilterMode: vi.fn(), - updateMultiSort: vi.fn(), - }; - const routeSnapshot = { - routeConfig: {path: 'library/:libraryId/books'}, - paramMap: paramMap$.value, - queryParamMap: queryParamMap$.value, - params: {libraryId: '1'}, - }; - - TestBed.resetTestingModule(); - TestBed.configureTestingModule({ - providers: [ - SortService, - BookSelectionService, - BookNavigationService, - { - provide: UserService, - useValue: { - currentUser: currentUser.asReadonly(), - getCurrentUser: vi.fn(() => currentUser()), - updateUserSetting: vi.fn(), - }, - }, - { - provide: CoverScalePreferenceService, - useValue: { - scaleFactor: vi.fn(() => 1), - setScale: vi.fn(), - }, - }, - { - provide: TableColumnPreferenceService, - useValue: { - allColumns: [], - visibleColumns: [], - initPreferences: vi.fn(), - saveVisibleColumns: vi.fn(), - }, - }, - { - provide: SidebarFilterTogglePrefService, - useValue: { - showFilter: showFilter.asReadonly(), - toggle: vi.fn(() => showFilter.update(value => !value)), - }, - }, - { - provide: SeriesCollapseFilter, - useValue: { - seriesCollapsed: seriesCollapsed.asReadonly(), - setContext: vi.fn(), - collapseBooks: vi.fn((items: Book[]) => items), - setCollapsed: vi.fn((value: boolean) => seriesCollapsed.set(value)), - }, - }, - { - provide: BookSelectionService, - useValue: { - selectedBooks: signal([]), - selectedCount: signal(0), - deselectAll: vi.fn(), - setCurrentBooks: vi.fn(), - }, - }, - { - provide: BookNavigationService, - useValue: { - setAvailableBookIds: vi.fn(), - }, - }, - { - provide: RouteScrollPositionService, - useValue: { - createKey: vi.fn(() => 'test-key'), - keyFor: vi.fn(() => 'test-key'), - savePosition: vi.fn(), - getPosition: vi.fn(() => 0), - trackRoute: vi.fn(), - }, - }, - {provide: ConfirmationService, useValue: {confirm: vi.fn()}}, - {provide: TaskHelperService, useValue: {}}, - { - provide: BookCardOverlayPreferenceService, - useValue: { - showBookTypePill: vi.fn(() => true), - setShowBookTypePill: vi.fn(), - }, - }, - {provide: AppSettingsService, useValue: {appSettings: vi.fn(() => null)}}, - {provide: LayoutService, useValue: {isDesktop: signal(true), sidebarTransitioning: signal(false)}}, - { - provide: ActivatedRoute, - useValue: { - url: url$.asObservable(), - paramMap: paramMap$.asObservable(), - queryParamMap: queryParamMap$.asObservable(), - snapshot: routeSnapshot, - }, - }, - { - provide: Router, - useValue: { - events: routerEvents$.asObservable(), - navigate: vi.fn(), - }, - }, - {provide: MessageService, useValue: {add: vi.fn()}}, - { - provide: BookService, - useValue: { - books: books.asReadonly(), - isBooksLoading: isBooksLoading.asReadonly(), - booksError: booksError.asReadonly(), - }, - }, - {provide: BookMetadataManageService, useValue: {}}, - {provide: BookDialogHelperService, useValue: {}}, - { - provide: BookMenuService, - useValue: { - getMoreActionsMenu: vi.fn(() => []), - getMetadataMenuItems: vi.fn(() => []), - }, - }, - {provide: PageTitleService, useValue: {setPageTitle: vi.fn()}}, - {provide: LoadingService, useValue: {show: vi.fn(), hide: vi.fn()}}, - {provide: LocalStorageService, useValue: {get: vi.fn(), set: vi.fn()}}, - { - provide: BookBrowserQueryParamsService, - useValue: queryParamsService, - }, - { - provide: BookBrowserEntityService, - useValue: { - getEntityInfo: vi.fn((paramMap: ParamMap) => ({ - entityId: Number(paramMap.get('libraryId')), - entityType: EntityType.LIBRARY, - })), - getEntity: vi.fn((entityId: number) => ({id: entityId, name: `Library ${entityId}`})), - getBooksByEntity: vi.fn((items: Book[], entityId: number) => - items.filter(book => book.libraryId === entityId) - ), - isLibrary: vi.fn(() => true), - isMagicShelf: vi.fn(() => false), - }, - }, - { - provide: TranslocoService, - useValue: { - langChanges$: new Subject().asObservable(), - getActiveLang: vi.fn(() => 'en'), - translate: vi.fn((key: string) => { - if (options?.translate) { - return options.translate(key); - } - - return { - 'book.browser.tooltip.toggleView': 'Toggle between Grid and Table view', - 'book.browser.labels.allBooks': 'All Books', - 'book.browser.labels.unshelvedBooks': 'Unshelved Books', - }[key] ?? key; - }), - }, - }, - ], - }); - - const component = TestBed.runInInjectionContext(() => new BookBrowserComponent()); - - return { - component, - books, - booksError, - isBooksLoading, - paramMap$, - setHasNextPage: value => hasNextPage.set(value), - setIsFetchingNextPage: value => isFetchingNextPage.set(value), - queryParamsService, - routeSnapshot, - }; -} - -describe('BookBrowserComponent', () => { - beforeEach(() => { - vi.useFakeTimers(); - vi.stubGlobal('ResizeObserver', class { - observe = vi.fn(); - unobserve = vi.fn(); - disconnect = vi.fn(); - }); - }); - - afterEach(() => { - vi.unstubAllGlobals(); - vi.runOnlyPendingTimers(); - vi.useRealTimers(); - TestBed.resetTestingModule(); - }); - - it('switches view mode through the display settings control', () => { - const {component, queryParamsService} = createHarness(); - - component.currentViewMode.set(VIEW_MODES.GRID); - - component.onViewModeChange(VIEW_MODES.TABLE); - - expect(component.currentViewMode()).toBe(VIEW_MODES.TABLE); - expect(queryParamsService.updateViewMode).toHaveBeenCalledWith(VIEW_MODES.TABLE); - }); - - it('updates books when sorting changes', () => { - const {component} = createHarness(); - - TestBed.flushEffects(); - vi.runOnlyPendingTimers(); - - expect(component.books().map(book => book.id)).toEqual([2, 1]); - - component.applySortCriteria([ - {label: 'Title', field: 'title', direction: SortDirection.ASCENDING}, - ]); - TestBed.flushEffects(); - vi.runOnlyPendingTimers(); - - expect(component.books().map(book => book.id)).toEqual([1, 2]); - }); - - it('updates books after a context change', () => { - const {component, paramMap$, routeSnapshot} = createHarness(); - - TestBed.flushEffects(); - vi.runOnlyPendingTimers(); - - expect(component.books().map(book => book.id)).toEqual([2, 1]); - - routeSnapshot.paramMap = convertToParamMap({libraryId: '2'}); - routeSnapshot.params = {libraryId: '2'}; - paramMap$.next(routeSnapshot.paramMap); - TestBed.flushEffects(); - vi.runOnlyPendingTimers(); - - expect(component.books().map(book => book.id)).toEqual([3]); - }); - - it('hides loading placeholders when the books query is in an error state', () => { - const {component} = createHarness({ - booksError: 'Failed to load books', - isBooksLoading: true, - }); - - expect(component.showBooksLoadingPlaceholder()).toBe(false); - expect(component.showTableLoadingPlaceholder()).toBe(false); - }); - - it('keeps rendered books visible when loading starts after the first render', () => { - const renderedBooks = Array.from({length: 30}, (_, index) => - makeBook(index + 1, 1, `Book ${index + 1}`, `2024-01-${String(index + 1).padStart(2, '0')}T00:00:00Z`) - ); - const {component, isBooksLoading} = createHarness({books: renderedBooks}); - - TestBed.flushEffects(); - vi.runOnlyPendingTimers(); - - expect(component.books()).toHaveLength(30); - expect(component.virtualRowCount()).toBe(30); - - isBooksLoading.set(true); - - expect(component.showBooksLoadingPlaceholder()).toBe(false); - expect(component.virtualRowCount()).toBe(30); - }); - - it('sizes grid loading placeholders to fill the viewport', () => { - const {component} = createHarness({books: [], isBooksLoading: true}); - const loadingGrid = component as unknown as { - minimumLoadingGridItemCount(metrics: VirtualGridMetrics): number; - }; - - component.currentViewMode.set(VIEW_MODES.GRID); - - expect(loadingGrid.minimumLoadingGridItemCount({ - viewportWidth: 960, - viewportHeight: 900, - columns: 6, - itemHeight: 200, - gap: 20, - })).toBe(36); - }); - - it('calls SeriesCollapseFilter.collapseBooks when computing books', () => { - createHarness(); - const filter = TestBed.inject(SeriesCollapseFilter); - const collapseBooksSpy = vi.spyOn(filter, 'collapseBooks'); - - vi.runOnlyPendingTimers(); - TestBed.flushEffects(); - - expect(collapseBooksSpy).toHaveBeenCalled(); - }); - - it.skip('uses the known total book count while more pages are available', () => { - const {component, setHasNextPage} = createHarness({totalElements: 100}); - - setHasNextPage(true); - - vi.runOnlyPendingTimers(); - TestBed.flushEffects(); - - expect(component.virtualRowCount()).toBe(100); - expect(component.virtualGrid.virtualizer.options().count).toBe(100); - }); - - it.skip('uses one unloaded slot for collapsed series while more pages are available', () => { - const {component, setHasNextPage} = createHarness({totalElements: 100}); - const filter = TestBed.inject(SeriesCollapseFilter); - filter.setCollapsed(true); - setHasNextPage(true); - - vi.runOnlyPendingTimers(); - TestBed.flushEffects(); - - expect(component.virtualRowCount()).toBe(component.books().length + 1); - expect(component.virtualGrid.virtualizer.options().count).toBe(component.books().length + 1); - }); - - it('uses the rendered book count once pagination is exhausted', () => { - const {component} = createHarness(); - const filter = TestBed.inject(SeriesCollapseFilter); - vi.mocked(filter.collapseBooks).mockImplementation((items: Book[]) => items.slice(0, 1)); - - vi.runOnlyPendingTimers(); - TestBed.flushEffects(); - - expect(component.books()).toHaveLength(1); - expect(component.virtualRowCount()).toBe(1); - expect(component.virtualGrid.virtualizer.options().count).toBe(1); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/book-browser.component.ts b/frontend/src/app/features/book/components/book-browser/book-browser.component.ts deleted file mode 100644 index 1d9481841..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-browser.component.ts +++ /dev/null @@ -1,1092 +0,0 @@ -import {AfterViewInit, ChangeDetectionStrategy, Component, DestroyRef, ElementRef, HostListener, computed, effect, inject, signal, untracked, viewChild} from '@angular/core'; -import {takeUntilDestroyed, toObservable, toSignal} from '@angular/core/rxjs-interop'; -import {ActivatedRoute} from '@angular/router'; -import {ConfirmationService, MenuItem, MessageService} from '@openng/optimus-ui/api'; -import {PageTitleService} from '../../../../shared/service/page-title.service'; -import {BookService} from '../../service/book.service'; -import {BookMetadataManageService} from '../../service/book-metadata-manage.service'; -import {debounceTime, distinctUntilChanged, filter, map, skip, take} from 'rxjs/operators'; -import {combineLatest, finalize} from 'rxjs'; -import {DynamicDialogRef} from '@openng/optimus-ui/dynamicdialog'; -import {Library} from '../../model/library.model'; -import {SortDirection, SortOption} from '../../model/sort.model'; -import {Book} from '../../model/book.model'; -import { - LibraryShelfMenuComponent, - type LibraryShelfMenuTarget, -} from '../library-shelf-menu/library-shelf-menu.component'; -import {BookTableComponent} from './book-table/book-table.component'; -import {Button, ButtonDirective} from '@openng/optimus-ui/button'; -import {NgClass} from '@angular/common'; -import {BookCardComponent} from './book-card/book-card.component'; - -import {InputText} from '@openng/optimus-ui/inputtext'; -import {FormsModule} from '@angular/forms'; -import {BookFilterComponent} from './book-filter/book-filter.component'; -import {Tooltip} from '@openng/optimus-ui/tooltip'; -import {BookFilterMode, DEFAULT_VISIBLE_SORT_FIELDS, EntityViewPreferences, SortCriterion, UserService} from '../../../settings/user-management/user.service'; -import {SeriesCollapseFilter} from './filters/SeriesCollapseFilter'; -import {CoverScalePreferenceService} from './cover-scale-preference.service'; -import {BookSorter} from './sorting/BookSorter'; -import {BookDialogHelperService} from './book-dialog-helper.service'; -import {Checkbox} from '@openng/optimus-ui/checkbox'; -import {Popover} from '@openng/optimus-ui/popover'; -import {Divider} from '@openng/optimus-ui/divider'; -import {MultiSelect} from '@openng/optimus-ui/multiselect'; -import {TableColumnPreferenceService} from './table-column-preference.service'; -import {TieredMenu} from '@openng/optimus-ui/tieredmenu'; -import {Badge} from '@openng/optimus-ui/badge'; -import {BookMenuService} from '../../service/book-menu.service'; -import {SidebarFilterTogglePrefService} from './filters/sidebar-filter-toggle-pref.service'; -import {MetadataRefreshType} from '../../../metadata/model/request/metadata-refresh-type.enum'; -import {TaskHelperService} from '../../../settings/task-management/task-helper.service'; -import {FilterLabelHelper} from './filter-label.helper'; -import {LoadingService} from '../../../../core/services/loading.service'; -import {LocalStorageService} from '../../../../shared/service/local-storage.service'; -import {LanguageResolverService} from '../../../../shared/service/language-resolver.service'; -import {BookNavigationService} from '../../service/book-navigation.service'; -import {BookCardOverlayPreferenceService} from './book-card-overlay-preference.service'; -import {BookSelectionService, CheckboxClickEvent} from './book-selection.service'; -import {BookBrowserQueryParamsService, VIEW_MODES} from './book-browser-query-params.service'; -import {BookBrowserEntityService, EntityInfo} from './book-browser-entity.service'; -import {RouteScrollPositionService} from '../../../../shared/service/route-scroll-position.service'; -import {AppSettingsService} from '../../../../shared/service/app-settings.service'; -import {MultiSortPopoverComponent} from './sorting/multi-sort-popover/multi-sort-popover.component'; -import {TranslocoDirective, TranslocoPipe, TranslocoService} from '@jsverse/transloco'; - -import {SortService} from '../../service/sort.service'; -import {createVirtualGrid, type VirtualGridMetrics} from '../../../../shared/util/virtual-grid.util'; -import {GridDensityButtonsComponent, type GridDensityDirection} from '../../../../shared/components/grid-density-buttons/grid-density-buttons.component'; -import {filterBooksBySearchTerm} from './filters/HeaderFilter'; -import {filterBooksByFilters} from './filters/sidebar-filter'; -import {LayoutService} from '../../../../shared/layout/layout.service'; -import {createGridDensity} from '../../../../shared/util/grid-density.util'; -import {DeferredRenderState} from './deferred-render-state'; -import {AppMenuTriggerDirective} from '../../../../shared/ui/menu/app-menu-trigger.directive'; - -export enum EntityType { - LIBRARY = 'Library', - SHELF = 'Shelf', - MAGIC_SHELF = 'Magic Shelf', - ALL_BOOKS = 'All Books', - UNSHELVED = 'Unshelved Books', -} - -const INITIAL_LOADING_ROW_COUNT = 24; -const DEFAULT_MOBILE_GRID_COLUMNS = 3; -const MIN_MOBILE_GRID_COLUMNS = 2; -const MAX_MOBILE_GRID_COLUMNS = 4; -const MOBILE_COLUMNS_STORAGE_KEY = 'mobileColumnsPreference'; - -@Component({ - selector: 'app-book-browser', - standalone: true, - templateUrl: './book-browser.component.html', - styleUrls: ['./book-browser.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, - imports: [ - Button, ButtonDirective, BookCardComponent, InputText, FormsModule, - BookTableComponent, BookFilterComponent, Tooltip, NgClass, Popover, - Checkbox, Divider, MultiSelect, TieredMenu, Badge, MultiSortPopoverComponent, TranslocoDirective, TranslocoPipe, GridDensityButtonsComponent, - LibraryShelfMenuComponent, AppMenuTriggerDirective, - ], - providers: [SeriesCollapseFilter], -}) -export class BookBrowserComponent implements AfterViewInit { - protected userService = inject(UserService); - protected coverScalePreferenceService = inject(CoverScalePreferenceService); - protected columnPreferenceService = inject(TableColumnPreferenceService); - protected sidebarFilterTogglePrefService = inject(SidebarFilterTogglePrefService); - protected seriesCollapseFilter = inject(SeriesCollapseFilter); - protected confirmationService = inject(ConfirmationService); - protected taskHelperService = inject(TaskHelperService); - protected bookCardOverlayPreferenceService = inject(BookCardOverlayPreferenceService); - protected bookSelectionService = inject(BookSelectionService); - protected appSettingsService = inject(AppSettingsService); - - private activatedRoute = inject(ActivatedRoute); - private messageService = inject(MessageService); - private bookService = inject(BookService); - private bookMetadataManageService = inject(BookMetadataManageService); - private dialogHelperService = inject(BookDialogHelperService); - private bookMenuService = inject(BookMenuService); - private pageTitle = inject(PageTitleService); - private loadingService = inject(LoadingService); - private bookNavigationService = inject(BookNavigationService); - private queryParamsService = inject(BookBrowserQueryParamsService); - private entityService = inject(BookBrowserEntityService); - private sortService = inject(SortService); - private localStorageService = inject(LocalStorageService); - private scrollService = inject(RouteScrollPositionService); - private layoutService = inject(LayoutService); - private readonly t = inject(TranslocoService); - private readonly languageResolver = inject(LanguageResolverService); - private readonly destroyRef = inject(DestroyRef); - - constructor() { - this.setupRouteChangeHandlers(); - this.setupQueryParamSubscription(); - this.scrollService.trackRoute({ - scrollElement: this.scrollElement, - route: this.activatedRoute, - destroyRef: this.destroyRef, - keySuffix: 'grid', - dismissOverlaysBeforeSave: true, - }); - this.destroyRef.onDestroy(() => this.bookSelectionService.deselectAll()); - } - - private readonly defaultSortCriteria: SortOption[] = [{ - field: 'addedOn', - direction: SortDirection.DESCENDING, - label: 'Added On' - }]; - private readonly routePath = toSignal( - this.activatedRoute.url.pipe( - map(() => this.activatedRoute.snapshot.routeConfig?.path ?? '') - ), - {initialValue: this.activatedRoute.snapshot.routeConfig?.path ?? ''} - ); - private readonly routeParamMap = toSignal(this.activatedRoute.paramMap, { - initialValue: this.activatedRoute.snapshot.paramMap - }); - private readonly queryParamMap = toSignal(this.activatedRoute.queryParamMap, { - initialValue: this.activatedRoute.snapshot.queryParamMap - }); - private readonly searchTerm = signal(''); - private readonly debouncedSearchTerm = toSignal( - toObservable(this.searchTerm).pipe( - debounceTime(500), - distinctUntilChanged() - ), - {initialValue: this.searchTerm()} - ); - private readonly selectedFilter = signal | null>(null); - private readonly selectedFilterMode = signal('and'); - private readonly sortCriteria = signal(this.defaultSortCriteria); - - readonly screenWidth = signal(typeof window !== 'undefined' ? window.innerWidth : 1024); - readonly currentViewMode = signal(undefined); - readonly bookTitle = signal(''); - readonly visibleColumns = signal<{ field: string; header: string }[]>([]); - readonly visibleSortOptions = signal([]); - readonly currentFilterLabel = signal(null); - readonly rawFilterParamFromUrl = signal(null); - private readonly seriesCollapsed = this.seriesCollapseFilter.seriesCollapsed; - readonly selectedBooks = this.bookSelectionService.selectedBooks; - readonly selectedCount = this.bookSelectionService.selectedCount; - readonly showFilter = this.sidebarFilterTogglePrefService.showFilter; - private readonly currentUser$ = toObservable(this.userService.currentUser).pipe(filter(u => !!u)); - readonly entityInfo = computed(() => { - const routePath = this.routePath(); - if (routePath === 'all-books') { - return {entityId: NaN, entityType: EntityType.ALL_BOOKS}; - } - if (routePath === 'unshelved-books') { - return {entityId: NaN, entityType: EntityType.UNSHELVED}; - } - return this.entityService.getEntityInfo(this.routeParamMap()); - }); - readonly entityType = computed(() => this.entityInfo().entityType); - readonly entity = computed(() => { - const {entityId, entityType} = this.entityInfo(); - return this.entityService.getEntity(entityId, entityType); - }); - readonly entityMenuTarget = computed(() => { - const entity = this.entity(); - if (entity?.id == null) return null; - - if (this.entityService.isLibrary(entity)) { - return {type: 'library', entity: {...entity, id: entity.id}}; - } - if (this.entityService.isMagicShelf(entity)) { - return {type: 'magicShelf', entity: {...entity, id: entity.id}}; - } - return {type: 'shelf', entity: {...entity, id: entity.id}}; - }); - // Deferred pipeline: heavy filter/sort runs in a setTimeout so the page chrome - // and skeletons paint first, then real books replace them on the next task. - private readonly forceExpandSeries = computed(() => - this.queryParamsService.shouldForceExpandSeries(this.queryParamMap()) - ); - private readonly booksContextKey = computed(() => { - const {entityId, entityType} = this.entityInfo(); - return Number.isNaN(entityId) ? entityType : `${entityType}:${entityId}`; - }); - private lastBooksContextKey: string | null = null; - private readonly booksRenderState = new DeferredRenderState(); - readonly books = computed(() => this.booksRenderState.value() ?? []); - readonly hasRenderedBooks = this.booksRenderState.hasValue; - readonly isBooksRefreshing = this.booksRenderState.isRefreshing; - - private readonly computeBooksEffect = effect((onCleanup) => { - const contextKey = this.booksContextKey(); - const allBooks = this.bookService.books(); - const {entityId, entityType} = this.entityInfo(); - const searchTerm = this.debouncedSearchTerm(); - const filters = this.selectedFilter(); - const filterMode = this.selectedFilterMode(); - const collapsedFlag = this.seriesCollapsed(); - const forceExpand = this.forceExpandSeries(); - const sortCriteria = this.sortCriteria(); - - const sameContext = contextKey === this.lastBooksContextKey; - const shouldRefresh = sameContext && untracked(() => this.hasRenderedBooks()); - const requestId = this.booksRenderState.begin(shouldRefresh ? 'refresh' : 'reset'); - this.lastBooksContextKey = contextKey; - - const timeoutId = globalThis.setTimeout(() => { - const entityBooks = this.entityService.getBooksByEntity(allBooks, entityId, entityType); - const searched = filterBooksBySearchTerm(entityBooks, searchTerm); - const filtered = filterBooksByFilters(searched, filters, filterMode); - const collapsed = this.seriesCollapseFilter.collapseBooks(filtered, forceExpand, collapsedFlag); - const sorted = this.sortService.applyMultiSort(collapsed, sortCriteria); - this.booksRenderState.commit(requestId, sorted); - }); - - onCleanup(() => { - globalThis.clearTimeout(timeoutId); - this.booksRenderState.cancel(requestId); - }); - }); - - readonly isBooksLoading = this.bookService.isBooksLoading; - readonly booksError = this.bookService.booksError; - - private readonly GRID_GAP = 21; - private readonly CARD_ASPECT_RATIO = 7 / 5; - private readonly MOBILE_TITLE_BAR_HEIGHT = 32; - private readonly DESKTOP_CARD_BASE_WIDTH = 135; - private readonly DESKTOP_CARD_BASE_HEIGHT = 220; - private readonly DESKTOP_MIN_SCALE = 0.5; - private readonly DESKTOP_MAX_SCALE = 1.5; - private readonly AUDIOBOOK_TITLE_BAR_HEIGHT = 31; - private readonly scrollElement = viewChild>('scrollElement'); - private readonly initialScrollOffset = () => this.scrollService.getPosition(this.scrollService.keyFor(this.activatedRoute, 'grid')) ?? 0; - readonly isMobile = computed(() => !this.layoutService.isDesktop()); - private readonly desktopBaseCardWidth = computed(() => - this.isAudiobookOnlyLibrary() - ? this.DESKTOP_CARD_BASE_WIDTH * 1.1 - : this.DESKTOP_CARD_BASE_WIDTH - ); - private readonly gridDensity = createGridDensity(this.localStorageService, { - useFixedColumns: this.isMobile, - screenWidth: this.screenWidth, - storageKey: MOBILE_COLUMNS_STORAGE_KEY, - defaultColumns: DEFAULT_MOBILE_GRID_COLUMNS, - minColumns: MIN_MOBILE_GRID_COLUMNS, - maxColumns: MAX_MOBILE_GRID_COLUMNS, - scale: this.coverScalePreferenceService.scaleFactor, - minScale: this.DESKTOP_MIN_SCALE, - maxScale: this.DESKTOP_MAX_SCALE, - gap: this.GRID_GAP, - baseWidth: this.desktopBaseCardWidth, - setScale: scale => this.coverScalePreferenceService.setScale(scale), - }); - private readonly minCardWidth = computed(() => - this.isMobile() - ? 1 - : Math.round(this.desktopBaseCardWidth() * this.coverScalePreferenceService.scaleFactor()) - ); - readonly virtualRowCount = computed(() => this.bookCountIncludingUnloadedPages(this.books().length)); - private readonly hasUnloadedBooks = computed(() => this.books().length < this.virtualRowCount()); - readonly loadedBookCount = computed(() => this.books().length); - readonly virtualGrid = createVirtualGrid({ - items: this.books, - scrollElement: this.scrollElement, - minItemWidth: this.minCardWidth, - gap: this.gridDensity.gap, - columns: this.gridDensity.columns, - count: this.virtualRowCount, - minimumCount: metrics => this.minimumLoadingGridItemCount(metrics), - initialOffset: this.initialScrollOffset, - fillItemWidth: true, - estimateItemHeight: itemWidth => this.isMobile() - ? this.mobileCardSizeForWidth(itemWidth).height - : this.cardSizeForWidth(itemWidth).height, - }); - readonly bookQueryToken = computed(() => ({ - entity: this.entityInfo(), - search: this.debouncedSearchTerm(), - filter: this.selectedFilter(), - filterMode: this.selectedFilterMode(), - sort: this.sortCriteria(), - })); - private gridLastLoadRequestLoadedBookCount: number | undefined; - private gridLastSeenQueryToken: unknown; - private readonly gridPaginatorEffect = effect(() => { - if (this.currentViewMode() !== VIEW_MODES.GRID) return; - - const queryToken = this.bookQueryToken(); - if (queryToken !== this.gridLastSeenQueryToken) { - this.gridLastLoadRequestLoadedBookCount = undefined; - this.gridLastSeenQueryToken = queryToken; - } - - const items = this.books(); - const loadedBookCount = this.loadedBookCount(); - const lastVirtualItem = this.virtualGrid.virtualizer.getVirtualItems().at(-1); - if (!lastVirtualItem || items.length === 0) return; - if (lastVirtualItem.index < items.length - 1) return; - if (!this.hasUnloadedBooks()) return; - if (this.gridLastLoadRequestLoadedBookCount === loadedBookCount) { - this.gridLastLoadRequestLoadedBookCount = undefined; - return; - } - - this.gridLastLoadRequestLoadedBookCount = loadedBookCount; - }); - readonly isFetchingNextBooksPage = this.bookService.isBooksLoading; - - parsedFilters: Record = {}; - dynamicDialogRef: DynamicDialogRef | undefined | null; - EntityType = EntityType; - private readonly activeLang = toSignal(this.t.langChanges$, { - initialValue: this.t.getActiveLang() - }); - - readonly computedFilterLabel = computed(() => { - this.activeLang(); - const filters = this.selectedFilter(); - - if (!filters || Object.keys(filters).length === 0) { - return this.t.translate('book.browser.labels.allBooks'); - } - - const filterEntries = Object.entries(filters); - - if (filterEntries.length === 1) { - const [filterType, values] = filterEntries[0]; - const filterName = FilterLabelHelper.getFilterTypeName(filterType); - - if (values.length === 1) { - const displayValue = filterType === 'language' - ? this.languageResolver.displayName(String(values[0])) - : FilterLabelHelper.getFilterDisplayValue(filterType, values[0]); - return `${filterName}: ${displayValue}`; - } - - return `${filterName} (${values.length})`; - } - - const filterSummary = filterEntries - .map(([type, values]) => `${FilterLabelHelper.getFilterTypeName(type)} (${values.length})`) - .join(', '); - - return filterSummary.length > 50 - ? this.t.translate('book.browser.labels.activeFilters', {count: filterEntries.length}) - : filterSummary; - }); - entityViewPreferences: EntityViewPreferences | undefined; - lastAppliedSortCriteria: SortOption[] = []; - - private settingFiltersFromUrl = false; - protected metadataMenuItems: MenuItem[] | undefined; - protected moreActionsMenuItems: MenuItem[] | undefined; - protected readonly onBookCardSelect = (book: Book, selected: boolean): void => { - this.handleBookSelect(book, selected); - }; - - protected bookSorter = new BookSorter( - sortCriteria => this.onMultiSortChange(sortCriteria), - this.t - ); - private readonly syncBrowserStateEffect = effect(() => { - this.activeLang(); - const entityType = this.entityType(); - const entity = this.entity(); - - if (entityType === EntityType.ALL_BOOKS) { - this.pageTitle.setPageTitle(this.t.translate('book.browser.labels.allBooks')); - this.seriesCollapseFilter.setContext(null, null); - return; - } - - if (entityType === EntityType.UNSHELVED) { - this.pageTitle.setPageTitle(this.t.translate('book.browser.labels.unshelvedBooks')); - this.seriesCollapseFilter.setContext(null, null); - return; - } - - if (entity) { - this.pageTitle.setPageTitle(entity.name); - } - - if (!entity) { - this.seriesCollapseFilter.setContext(null, null); - return; - } - - switch (entityType) { - case EntityType.LIBRARY: - this.seriesCollapseFilter.setContext('LIBRARY', entity.id ?? 0); - break; - case EntityType.SHELF: - this.seriesCollapseFilter.setContext('SHELF', entity.id ?? 0); - break; - case EntityType.MAGIC_SHELF: - this.seriesCollapseFilter.setContext('MAGIC_SHELF', entity.id ?? 0); - break; - default: - this.seriesCollapseFilter.setContext(null, null); - } - }); - private readonly syncBooksEffect = effect(() => { - const books = this.books(); - this.bookSelectionService.setCurrentBooks(books); - this.bookNavigationService.setAvailableBookIds(books.map(book => book.id)); - }); - private readonly syncMoreActionsMenuEffect = effect(() => { - this.moreActionsMenuItems = this.bookMenuService.getMoreActionsMenu( - this.selectedBooks(), - this.userService.currentUser() - ); - }); - - private readonly bookTableComponent = viewChild(BookTableComponent); - private readonly bookFilterComponent = viewChild(BookFilterComponent); - - @HostListener('window:resize') - onResize(): void { - this.screenWidth.set(window.innerWidth); - } - - readonly gridDensitySmallerDisabled = this.gridDensity.smallerDisabled; - readonly gridDensityLargerDisabled = this.gridDensity.largerDisabled; - - private cardSizeForWidth(width: number): { width: number; height: number } { - const cardWidth = Math.round(width); - if (this.isAudiobookOnlyLibrary()) { - return {width: cardWidth, height: cardWidth + this.AUDIOBOOK_TITLE_BAR_HEIGHT}; - } - return { - width: cardWidth, - height: Math.round(cardWidth * (this.DESKTOP_CARD_BASE_HEIGHT / this.DESKTOP_CARD_BASE_WIDTH)), - }; - } - - private mobileCardSizeForWidth(width: number): { width: number; height: number } { - const cardWidth = Math.round(width); - const coverHeight = this.isAudiobookOnlyLibrary() - ? cardWidth - : Math.floor(cardWidth * this.CARD_ASPECT_RATIO); - return {width: cardWidth, height: coverHeight + this.MOBILE_TITLE_BAR_HEIGHT}; - } - - readonly showBooksLoadingPlaceholder = computed(() => - !this.booksError() && (!this.hasRenderedBooks() || (this.isBooksLoading() && this.books().length === 0)) - ); - - readonly showTableLoadingPlaceholder = computed(() => - this.showBooksLoadingPlaceholder() && this.currentViewMode() === VIEW_MODES.TABLE - ); - - private bookCountIncludingUnloadedPages(renderedBookCount: number): number { - if (this.showBooksLoadingPlaceholder()) { - return INITIAL_LOADING_ROW_COUNT; - } - return renderedBookCount; - } - - private minimumLoadingGridItemCount({viewportHeight, columns, itemHeight, gap}: VirtualGridMetrics): number { - if (!this.showBooksLoadingPlaceholder() || this.currentViewMode() !== VIEW_MODES.GRID) { - return 0; - } - if (viewportHeight <= 0 || itemHeight <= 0) { - return INITIAL_LOADING_ROW_COUNT; - } - - const visibleRows = Math.ceil((viewportHeight + gap) / (itemHeight + gap)); - return Math.max(INITIAL_LOADING_ROW_COUNT, (visibleRows + 1) * columns); - } - - readonly viewIcon = computed(() => - this.currentViewMode() === VIEW_MODES.TABLE ? 'pi pi-table' : 'pi pi-objects-column' - ); - - readonly isFilterActive = computed(() => { - const selectedFilter = this.selectedFilter(); - return !!selectedFilter && Object.keys(selectedFilter).length > 0; - }); - - readonly isAudiobookOnlyLibrary = computed(() => { - const entity = this.entity(); - if (!entity || this.entityType() !== EntityType.LIBRARY) return false; - const library = entity as Library; - return !!library.allowedFormats && library.allowedFormats.length === 1 && library.allowedFormats[0] === 'AUDIOBOOK'; - }); - - readonly seriesViewEnabled = computed(() => Boolean(this.userService.getCurrentUser()?.userSettings?.enableSeriesView)); - - readonly hasMetadataMenuItems = computed(() => (this.metadataMenuItems?.length ?? 0) > 0); - - readonly hasMoreActionsItems = computed(() => (this.moreActionsMenuItems?.length ?? 0) > 0); - - readonly canSaveSort = computed(() => { - const entityType = this.entityType(); - return entityType === EntityType.LIBRARY || - entityType === EntityType.SHELF || - entityType === EntityType.MAGIC_SHELF || - entityType === EntityType.ALL_BOOKS || - entityType === EntityType.UNSHELVED; - }); - - readonly hasSearchTerm = computed(() => this.searchTerm().trim().length > 0); - - readonly sortCriteriaCount = computed(() => this.bookSorter.selectedSortCriteria.length); - - ngAfterViewInit(): void { - const bookFilterComponent = this.bookFilterComponent(); - if (bookFilterComponent) { - bookFilterComponent.setFilters(this.parsedFilters); - bookFilterComponent.onFilterModeChange(this.selectedFilterMode()); - } - } - - private setupRouteChangeHandlers(): void { - this.activatedRoute.paramMap.pipe( - skip(1), - takeUntilDestroyed(this.destroyRef) - ).subscribe(() => { - this.searchTerm.set(''); - this.bookTitle.set(''); - this.bookSelectionService.deselectAll(); - this.clearFilter(); - this.scrollToTop(); - }); - } - - private scrollToTop(): void { - const scrollElement = this.scrollElement()?.nativeElement; - if (scrollElement) { - scrollElement.scrollTop = 0; - } - this.bookTableComponent()?.scrollToTop(); - this.virtualGrid.virtualizer.scrollToOffset(0); - } - - private readonly syncMetadataMenuEffect = effect(() => { - const user = this.userService.currentUser(); - if (!user) return; - - this.metadataMenuItems = this.bookMenuService.getMetadataMenuItems( - () => this.autoFetchMetadata(), - () => this.fetchMetadata(), - () => this.bulkEditMetadata(), - () => this.multiBookEditMetadata(), - () => this.regenerateCoversForSelected(), - () => this.generateCustomCoversForSelected(), - user - ); - }); - - private setupQueryParamSubscription(): void { - combineLatest([ - this.activatedRoute.paramMap.pipe(map(() => this.entityInfo())), - this.activatedRoute.queryParamMap, - this.currentUser$, - ]).pipe( - takeUntilDestroyed(this.destroyRef) - ).subscribe(([entityInfo, queryParamMap, currentUser]) => { - const parseResult = this.queryParamsService.parseQueryParams( - queryParamMap, - currentUser.userSettings?.entityViewPreferences, - entityInfo.entityType, - entityInfo.entityId, - this.bookSorter.sortOptions, - currentUser.userSettings?.filterMode ?? 'and' - ); - - if (parseResult.filterMode !== this.selectedFilterMode()) { - this.selectedFilterMode.set(parseResult.filterMode); - this.bookFilterComponent()?.onFilterModeChange(parseResult.filterMode); - } - - const filterParams = queryParamMap.get('filter'); - - if (filterParams) { - this.settingFiltersFromUrl = true; - this.selectedFilter.set(parseResult.filters); - - this.bookFilterComponent()?.setFilters?.(parseResult.filters); - - if (Object.keys(parseResult.filters).length > 0) { - this.currentFilterLabel.set(this.computedFilterLabel()); - } - - this.rawFilterParamFromUrl.set(filterParams); - this.settingFiltersFromUrl = false; - } else { - this.clearFilter(); - this.rawFilterParamFromUrl.set(null); - } - - this.parsedFilters = parseResult.filters; - - this.entityViewPreferences = currentUser.userSettings?.entityViewPreferences; - this.columnPreferenceService.initPreferences(currentUser.userSettings?.tableColumnPreference); - this.visibleColumns.set(this.columnPreferenceService.visibleColumns); - - const visibleFields = currentUser.userSettings?.visibleSortFields ?? DEFAULT_VISIBLE_SORT_FIELDS; - const sortOptionsByField = new Map(this.bookSorter.sortOptions.map(o => [o.field, o])); - this.visibleSortOptions.set(visibleFields.map(f => sortOptionsByField.get(f)).filter((o): o is SortOption => !!o)); - - if (!this.areSortCriteriaEqual(this.bookSorter.selectedSortCriteria, parseResult.sortCriteria)) { - this.bookSorter.setSortCriteria(parseResult.sortCriteria); - } - this.currentViewMode.set(parseResult.viewMode); - - this.applySortCriteria(this.bookSorter.selectedSortCriteria); - - this.queryParamsService.syncQueryParams( - this.currentViewMode()!, - this.selectedFilterMode(), - this.parsedFilters - ); - }); - } - - onFilterSelected(filters: Record | null): void { - if (this.settingFiltersFromUrl) return; - - const normalizedFilters = filters - ? Object.fromEntries( - Object.entries(filters).map(([key, value]) => [ - key, - (Array.isArray(value) ? value : [value]).map(filterValue => String(filterValue)) - ]) - ) - : null; - - this.selectedFilter.set(normalizedFilters); - this.rawFilterParamFromUrl.set(null); - - const hasSidebarFilters = !!normalizedFilters && Object.keys(normalizedFilters).length > 0; - this.currentFilterLabel.set(hasSidebarFilters ? this.computedFilterLabel() : this.t.translate('book.browser.labels.allBooks')); - this.queryParamsService.updateFilters(normalizedFilters); - } - - onFilterModeChanged(mode: BookFilterMode): void { - if (this.settingFiltersFromUrl || mode === this.selectedFilterMode()) return; - - this.selectedFilterMode.set(mode); - this.queryParamsService.updateFilterMode(mode, this.parsedFilters); - } - - toggleSidebar(): void { - this.sidebarFilterTogglePrefService.toggle(); - } - - onVisibleColumnsChange(selected: { field: string; header: string }[]): void { - const allFields = this.columnPreferenceService.allColumns.map(column => column.field); - this.visibleColumns.set(selected.sort( - (a, b) => allFields.indexOf(a.field) - allFields.indexOf(b.field) - )); - } - - onCheckboxClicked(event: CheckboxClickEvent): void { - this.bookSelectionService.handleCheckboxClick(event); - } - - handleBookSelect(book: Book, selected: boolean): void { - this.bookSelectionService.handleBookSelection(book, selected); - } - - selectAllBooks(): void { - const {entityId, entityType} = this.entityInfo(); - const entityBooks = this.entityService.getBooksByEntity( - this.bookService.books(), entityId, entityType - ); - const searched = filterBooksBySearchTerm(entityBooks, this.debouncedSearchTerm()); - const filtered = filterBooksByFilters(searched, this.selectedFilter(), this.selectedFilterMode()); - this.bookSelectionService.selectAll(filtered.map(b => b.id)); - } - - loadNextBooksPage(): void { - // This function is temporarily a no-op while a long term plan is being considered. - return; - } - - deselectAllBooks(): void { - this.bookSelectionService.deselectAll(); - } - - confirmDeleteBooks(): void { - const selectedBooks = this.selectedBooks(); - this.confirmationService.confirm({ - message: this.t.translate('book.browser.confirm.deleteMessage', {count: selectedBooks.size}), - header: this.t.translate('book.browser.confirm.deleteHeader'), - icon: 'pi pi-exclamation-triangle', - acceptIcon: 'pi pi-trash', - rejectIcon: 'pi pi-times', - acceptLabel: this.t.translate('common.delete'), - rejectLabel: this.t.translate('common.cancel'), - acceptButtonStyleClass: 'p-button-danger', - rejectButtonStyleClass: 'p-button-outlined', - accept: () => { - const count = selectedBooks.size; - const loader = this.loadingService.show(this.t.translate('book.browser.loading.deleting', {count})); - - this.bookService.deleteBooks(selectedBooks) - .pipe(finalize(() => this.loadingService.hide(loader))) - .subscribe(() => { - this.bookSelectionService.deselectAll(); - }); - } - }); - } - - onSeriesCollapseCheckboxChange(value: boolean): void { - this.seriesCollapseFilter.setCollapsed(value); - } - - onMultiSortChange(sortCriteria: SortOption[]): void { - this.applySortCriteria(sortCriteria); - this.queryParamsService.updateMultiSort(sortCriteria); - } - - // Backward compatibility wrapper - onManualSortChange(sortOption: SortOption): void { - this.onMultiSortChange([sortOption]); - } - - applySortCriteria(sortCriteria: SortOption[]): void { - this.sortCriteria.set(sortCriteria.length > 0 ? sortCriteria : this.defaultSortCriteria); - } - - // Backward compatibility wrapper - applySortOption(sortOption: SortOption): void { - this.applySortCriteria([sortOption]); - } - - private areSortCriteriaEqual(a: SortOption[], b: SortOption[]): boolean { - if (a.length !== b.length) return false; - return a.every((criterion, index) => - criterion.field === b[index].field && criterion.direction === b[index].direction - ); - } - - onSortCriteriaChange(criteria: SortOption[]): void { - this.bookSorter.setSortCriteria(criteria); - this.onMultiSortChange(criteria); - } - - onSaveSortConfig(criteria: SortOption[]): void { - const entityType = this.entityType(); - if (!entityType) return; - - const user = this.userService.getCurrentUser(); - if (!user) return; - const entity = this.entity(); - - const sortCriteria: SortCriterion[] = criteria.map(c => ({ - field: c.field, - direction: c.direction === SortDirection.ASCENDING ? 'ASC' as const : 'DESC' as const - })); - - const prefs: EntityViewPreferences = structuredClone( - user.userSettings.entityViewPreferences ?? {global: {sortKey: 'title', sortDir: 'ASC', view: 'GRID', coverSize: 1.0, seriesCollapsed: false, overlayBookType: true}, overrides: []} - ); - - if (entityType === EntityType.ALL_BOOKS || entityType === EntityType.UNSHELVED) { - prefs.global = { - ...prefs.global, - sortKey: sortCriteria[0]?.field ?? 'title', - sortDir: sortCriteria[0]?.direction ?? 'ASC', - sortCriteria - }; - } else { - if (!entity) return; - if (!prefs.overrides) prefs.overrides = []; - - let overrideEntityType: 'LIBRARY' | 'SHELF' | 'MAGIC_SHELF'; - switch (entityType) { - case EntityType.LIBRARY: overrideEntityType = 'LIBRARY'; break; - case EntityType.SHELF: overrideEntityType = 'SHELF'; break; - case EntityType.MAGIC_SHELF: overrideEntityType = 'MAGIC_SHELF'; break; - default: return; - } - - const existingIndex = prefs.overrides.findIndex( - o => o.entityType === overrideEntityType && o.entityId === entity.id - ); - - if (existingIndex >= 0) { - prefs.overrides[existingIndex].preferences = { - ...prefs.overrides[existingIndex].preferences, - sortKey: sortCriteria[0]?.field ?? 'title', - sortDir: sortCriteria[0]?.direction ?? 'ASC', - sortCriteria - }; - } else { - prefs.overrides.push({ - entityType: overrideEntityType, - entityId: entity.id!, - preferences: { - sortKey: sortCriteria[0]?.field ?? 'title', - sortDir: sortCriteria[0]?.direction ?? 'ASC', - sortCriteria, - view: 'GRID', - coverSize: 1.0, - seriesCollapsed: false, - overlayBookType: true - } - }); - } - } - - this.userService.updateUserSetting(user.id, 'entityViewPreferences', prefs); - this.messageService.add({ - severity: 'success', - summary: this.t.translate('book.browser.toast.sortSavedSummary'), - detail: entityType === EntityType.ALL_BOOKS || entityType === EntityType.UNSHELVED - ? this.t.translate('book.browser.toast.sortSavedGlobalDetail') - : this.t.translate('book.browser.toast.sortSavedEntityDetail', {entityType: entityType.toLowerCase()}) - }); - } - - onSearchTermChange(term: string): void { - this.searchTerm.set(term); - } - - clearSearch(): void { - this.bookTitle.set(''); - this.onSearchTermChange(''); - this.resetFilters(); - } - - resetFilters(): void { - this.bookFilterComponent()?.clearActiveFilter(); - } - - clearFilter(): void { - if (this.selectedFilter() !== null) { - this.selectedFilter.set(null); - } - this.clearSearch(); - } - - toggleTableGrid(): void { - const newMode = this.currentViewMode() === VIEW_MODES.GRID ? VIEW_MODES.TABLE : VIEW_MODES.GRID; - this.currentViewMode.set(newMode); - this.queryParamsService.updateViewMode(newMode as 'grid' | 'table'); - } - - onViewModeChange(mode: string): void { - if (mode && mode !== this.currentViewMode()) { - this.currentViewMode.set(mode); - this.queryParamsService.updateViewMode(mode as 'grid' | 'table'); - } - } - - unshelfBooks(): void { - const entity = this.entity(); - if (!entity) return; - const selectedBooks = this.selectedBooks(); - const count = selectedBooks.size; - const loader = this.loadingService.show(this.t.translate('book.browser.loading.unshelving', {count})); - - this.bookService.updateBookShelves(selectedBooks, new Set(), new Set([entity.id!])) - .pipe(finalize(() => this.loadingService.hide(loader))) - .subscribe({ - next: () => { - this.messageService.add({severity: 'info', summary: this.t.translate('common.success'), detail: this.t.translate('book.browser.toast.unshelveSuccessDetail')}); - this.bookSelectionService.deselectAll(); - }, - error: () => { - this.messageService.add({severity: 'error', summary: this.t.translate('common.error'), detail: this.t.translate('book.browser.toast.unshelveFailedDetail')}); - } - }); - } - - async openShelfAssigner() { - this.dynamicDialogRef = await this.dialogHelperService.openShelfAssignerDialog(null, this.selectedBooks()); - if (this.dynamicDialogRef) { - this.dynamicDialogRef.onClose.pipe(take(1)).subscribe(result => { - if (result?.assigned) { - this.bookSelectionService.deselectAll(); - } - }); - } - } - - async lockUnlockMetadata() { - this.dynamicDialogRef = await this.dialogHelperService.openLockUnlockMetadataDialog(this.selectedBooks()); - if (this.dynamicDialogRef) { - this.dynamicDialogRef.onClose.pipe(take(1)).subscribe(() => { - this.bookSelectionService.deselectAll(); - }); - } - } - - autoFetchMetadata(): void { - const selectedBooks = this.selectedBooks(); - if (selectedBooks.size === 0) return; - this.taskHelperService.refreshMetadataTask({ - refreshType: MetadataRefreshType.BOOKS, - bookIds: Array.from(selectedBooks), - }).subscribe(); - } - - async fetchMetadata() { - await this.dialogHelperService.openMetadataRefreshDialog(this.selectedBooks()); - } - - async bulkEditMetadata() { - this.dynamicDialogRef = await this.dialogHelperService.openBulkMetadataEditDialog(this.selectedBooks()); - if (this.dynamicDialogRef) { - this.dynamicDialogRef.onClose.pipe(take(1)).subscribe(() => { - this.bookSelectionService.deselectAll(); - }); - } - } - - async multiBookEditMetadata() { - this.dynamicDialogRef = await this.dialogHelperService.openMultibookMetadataEditorDialog(this.selectedBooks()); - if (this.dynamicDialogRef) { - this.dynamicDialogRef.onClose.pipe(take(1)).subscribe(() => { - this.bookSelectionService.deselectAll(); - }); - } - } - - regenerateCoversForSelected(): void { - const selectedBooks = this.selectedBooks(); - if (selectedBooks.size === 0) return; - const count = selectedBooks.size; - this.confirmationService.confirm({ - message: this.t.translate('book.browser.confirm.regenCoverMessage', {count}), - header: this.t.translate('book.browser.confirm.regenCoverHeader'), - icon: 'pi pi-image', - acceptLabel: this.t.translate('common.yes'), - rejectLabel: this.t.translate('common.no'), - acceptButtonProps: { - label: this.t.translate('common.yes'), - severity: 'success' - }, - rejectButtonProps: { - label: this.t.translate('common.no'), - severity: 'secondary' - }, - accept: () => { - this.bookMetadataManageService.regenerateCoversForBooks(Array.from(selectedBooks)).subscribe({ - next: () => { - this.messageService.add({ - severity: 'success', - summary: this.t.translate('book.browser.toast.regenCoverStartedSummary'), - detail: this.t.translate('book.browser.toast.regenCoverStartedDetail', {count}), - life: 3000 - }); - }, - error: () => { - this.messageService.add({ - severity: 'error', - summary: this.t.translate('book.browser.toast.failedSummary'), - detail: this.t.translate('book.browser.toast.regenCoverFailedDetail'), - life: 3000 - }); - } - }); - } - }); - } - - generateCustomCoversForSelected(): void { - const selectedBooks = this.selectedBooks(); - if (selectedBooks.size === 0) return; - const count = selectedBooks.size; - this.confirmationService.confirm({ - message: this.t.translate('book.browser.confirm.customCoverMessage', {count}), - header: this.t.translate('book.browser.confirm.customCoverHeader'), - icon: 'pi pi-palette', - acceptLabel: this.t.translate('common.yes'), - rejectLabel: this.t.translate('common.no'), - acceptButtonProps: { - label: this.t.translate('common.yes'), - severity: 'success' - }, - rejectButtonProps: { - label: this.t.translate('common.no'), - severity: 'secondary' - }, - accept: () => { - this.bookMetadataManageService.generateCustomCoversForBooks(Array.from(selectedBooks)).subscribe({ - next: () => { - this.messageService.add({ - severity: 'success', - summary: this.t.translate('book.browser.toast.customCoverStartedSummary'), - detail: this.t.translate('book.browser.toast.customCoverStartedDetail', {count}), - life: 3000 - }); - }, - error: () => { - this.messageService.add({ - severity: 'error', - summary: this.t.translate('book.browser.toast.failedSummary'), - detail: this.t.translate('book.browser.toast.customCoverFailedDetail'), - life: 3000 - }); - } - }); - } - }); - } - - async moveFiles() { - await this.dialogHelperService.openFileMoverDialog(this.selectedBooks()); - } - - async attachFilesToBook() { - const selectedBookIds = Array.from(this.selectedBooks()); - const sourceBooks = this.books().filter(book => - selectedBookIds.includes(book.id) - ); - - if (sourceBooks.length === 0) { - this.messageService.add({ - severity: 'warn', - summary: this.t.translate('book.browser.toast.noEligibleBooksSummary'), - detail: this.t.translate('book.browser.toast.noEligibleBooksDetail') - }); - return; - } - - // Check if all books are from the same library - const libraryIds = new Set(sourceBooks.map(b => b.libraryId)); - if (libraryIds.size > 1) { - this.messageService.add({ - severity: 'warn', - summary: this.t.translate('book.browser.toast.multipleLibrariesSummary'), - detail: this.t.translate('book.browser.toast.multipleLibrariesDetail') - }); - return; - } - - this.dynamicDialogRef = await this.dialogHelperService.openBulkBookFileAttacherDialog(sourceBooks); - if (this.dynamicDialogRef) { - this.dynamicDialogRef.onClose.pipe(take(1)).subscribe(result => { - if (result?.success) { - this.bookSelectionService.deselectAll(); - } - }); - } - } - - canAttachFiles(): boolean { - const selectedBookIds = Array.from(this.selectedBooks()); - if (selectedBookIds.length === 0) return false; - - const selectedBooks = this.books().filter(book => - selectedBookIds.includes(book.id) - ); - - if (selectedBooks.length === 0) return false; - - const libraryIds = new Set(selectedBooks.map(b => b.libraryId)); - return libraryIds.size === 1; - } - - adjustGridDensity(direction: GridDensityDirection): void { - this.gridDensity.adjust(direction, this.virtualGrid); - } -} diff --git a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.html b/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.html deleted file mode 100644 index 423771ad1..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.html +++ /dev/null @@ -1,68 +0,0 @@ - -
- -
- {{ t('title') }} - -
- -
- - @for (filterType of visibleFilterTypes(); track filterType; let i = $index) { - @if (filterSignals[filterType]().length > 0 || activeFilters()[filterType]?.length) { - - - - - {{ getFilterLabel(filterType) }} - - @if (activeFilters()[filterType]?.length; as count) { - - ({{ count }}) - - } - - - - - @if (expandedPanels().includes(i)) { - -
- {{ getFilterValueDisplay(filter) }} - -
-
- } -
-
- } - } -
- - -
-
-
diff --git a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.scss b/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.scss deleted file mode 100755 index 9c3dd9816..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.scss +++ /dev/null @@ -1,138 +0,0 @@ -:host ::ng-deep p-accordion { - --p-accordion-header-padding: 0.525rem 0.875rem; - --p-accordion-header-background: var(--color-card); - --p-accordion-header-active-background: var(--color-card); - --p-accordion-header-hover-background: var(--color-surface-hover); - --p-accordion-header-active-hover-background: var(--color-surface-hover); - --p-accordion-content-background: var(--color-card); -} - -:host ::ng-deep .p-accordionpanel { - background: var(--color-card); -} - -:host ::ng-deep .p-togglebutton { - --p-togglebutton-content-padding: 0.2188rem 0.3063rem; -} - -:host ::ng-deep .cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper { - width: calc(var(--book-filter-sidebar-width, 225px) - 35px) !important; - min-width: unset; -} - -.book-filter-container { - height: 100%; - border-radius: 0; - overflow: hidden; - background: var(--color-card); - display: flex; - flex-direction: column; - border-left: 1px solid var(--p-content-border-color); -} - -.filter-header { - display: inline-flex; - align-items: center; - justify-content: space-between; - padding: 0.875rem; - border-bottom: 1px solid var(--p-content-border-color); -} - -.filter-title { - font-weight: 600; -} - -.filter-mode-select { - font-size: var(--app-text-xs); -} - -:host ::ng-deep .filter-mode-select .p-togglebutton-label { - font-size: var(--app-text-xs); -} - -.filter-content { - flex: 1; - overflow-y: auto; - padding-bottom: 0.875rem; - overscroll-behavior: contain; -} - -.filter-type-label { - display: inline-flex; - align-items: center; - gap: 0.2188rem; - max-width: 100%; - overflow: hidden; - min-width: 0; -} - -.filter-label-text { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - flex-shrink: 1; - max-width: 175px; -} - -.active-filter-count { - font-size: var(--app-text-sm); - color: var(--color-primary); - flex-shrink: 0; - white-space: nowrap; - min-width: 0; -} - -.filter-list { - padding-right: 0.2188rem; -} - -.filter-row { - cursor: pointer; - height: 26px; - display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; - gap: 0.4375rem; - max-width: 97%; - transition: color var(--transition-base); - - &.active { - color: var(--color-primary); - } - - &.active-not { - color: var(--p-red-400); - text-decoration: line-through; - } -} - -.filter-value-text { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - flex: 1; - min-width: 0; -} - -.filter-value-badge { - flex-shrink: 0; -} - -.truncation-notice { - font-size: var(--app-text-xs); - color: var(--color-text-secondary); - text-align: center; - padding-top: 0.4375rem; - border-top: 1px solid var(--color-border); -} - -.footer-notice { - font-size: var(--app-text-xs); - color: var(--color-text-secondary); - text-align: center; - padding-top: 0.875rem; - padding-left: 0.875rem; - padding-right: 0.875rem; - margin-top: 0.4375rem; -} diff --git a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.spec.ts b/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.spec.ts deleted file mode 100644 index 38fa53cef..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {describe, it} from 'vitest'; - -// NOTE(frontend-seam): Real coverage here needs seams around reset streams, user-setting effects, -// and virtual-scroll accordion rendering so filter-mode changes and panel expansion can be -// asserted without the full book-browser sidebar runtime. -describe.skip('BookFilterComponent', () => { - it('needs signal seams to verify visible filter hydration, mode changes, and emitted active-filter payloads', () => { - // TODO(seam): Cover selectedFilterMode, setFilters, and emitFilters after the user-settings signal and filter service signals are isolated behind deterministic doubles. - }); - - it('needs UI-shell seams to verify reset handling, panel expansion, and multi-select filter clicks', () => { - // TODO(seam): Cover handleFilterClick, clearActiveFilter, and accordion expansion after the virtual-scroll and select-button runtime is removed from the test surface. - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.ts b/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.ts deleted file mode 100644 index 6d28520b9..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.component.ts +++ /dev/null @@ -1,208 +0,0 @@ -import {ChangeDetectionStrategy, Component, computed, effect, inject, input, output, signal, Signal} from '@angular/core'; -import {Accordion, AccordionContent, AccordionHeader, AccordionPanel} from '@openng/optimus-ui/accordion'; -import {CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport} from '@angular/cdk/scrolling'; -import {NgClass} from '@angular/common'; -import {Badge} from '@openng/optimus-ui/badge'; -import {FormsModule} from '@angular/forms'; -import {SelectButton} from '@openng/optimus-ui/selectbutton'; -import {BookFilterMode, DEFAULT_VISIBLE_FILTERS, UserService, VisibleFilterType} from '../../../../settings/user-management/user.service'; -import {Filter, FILTER_LABEL_KEYS, FilterType} from './book-filter.config'; -import {BookFilterService} from './book-filter.service'; -import {TranslocoDirective, TranslocoService} from '@jsverse/transloco'; -import {Library} from '../../../model/library.model'; -import {Shelf} from '../../../model/shelf.model'; -import {MagicShelf} from '../../../../magic-shelf/service/magic-shelf.service'; -import {EntityType} from '../book-browser.component'; - -interface FilterModeOption { - label: string; - value: BookFilterMode; -} - -@Component({ - selector: 'app-book-filter', - templateUrl: './book-filter.component.html', - styleUrls: ['./book-filter.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, - standalone: true, - imports: [ - Accordion, AccordionPanel, AccordionHeader, AccordionContent, - CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf, - NgClass, Badge, FormsModule, SelectButton, - TranslocoDirective - ] -}) -export class BookFilterComponent { - readonly showFilter = input(false); - - readonly entity = input(null); - readonly entityType = input(EntityType.ALL_BOOKS); - - readonly filterSelected = output | null>(); - readonly filterModeChanged = output(); - - private readonly filterService = inject(BookFilterService); - private readonly userService = inject(UserService); - private readonly t = inject(TranslocoService); - - readonly activeFilters = signal>({}); - readonly expandedPanels = signal([]); - - private readonly visibleFilters = signal([...DEFAULT_VISIBLE_FILTERS]); - - readonly visibleFilterTypes = computed(() => { - const vf = this.visibleFilters(); - return vf.filter(f => this.filterTypes.includes(f as FilterType)) as FilterType[]; - }); - - readonly filterLabelKeys = FILTER_LABEL_KEYS; - - readonly filterModeOptions: FilterModeOption[] = [ - {label: 'AND', value: 'and'}, - {label: 'OR', value: 'or'}, - {label: 'NOT', value: 'not'}, - {label: '1', value: 'single'} - ]; - - private readonly _selectedFilterMode = signal('and'); - readonly selectedFilterMode = this._selectedFilterMode.asReadonly(); - - filterSignals: Record> = this.filterService.createFilterSignals( - this.entity, - this.entityType, - this.activeFilters, - this.selectedFilterMode - ); - get filterTypes(): FilterType[] { - return Object.keys(this.filterSignals) as FilterType[]; - } - - private readonly syncUserSettings = effect(() => { - const user = this.userService.currentUser(); - if (!user) return; - this.visibleFilters.set(user.userSettings.visibleFilters ?? [...DEFAULT_VISIBLE_FILTERS]); - }); - - onFilterModeChange(mode: BookFilterMode): void { - if (mode === this._selectedFilterMode()) return; - this._selectedFilterMode.set(mode); - this.filterModeChanged.emit(mode); - this.emitFilters(); - } - - getFilterLabel(type: FilterType): string { - const key = this.filterLabelKeys[type]; - return key ? this.t.translate(key) : type; - } - - handleFilterClick(filterType: string, value: unknown): void { - if (this._selectedFilterMode() === 'single') { - this.handleSingleMode(filterType, value); - } else { - this.handleMultiMode(filterType, value); - } - this.emitFilters(); - } - - setFilters(filters: Record): void { - const result: Record = {}; - for (const [key, value] of Object.entries(filters)) { - const values = Array.isArray(value) ? value : [value]; - result[key] = values.map(v => this.filterService.processFilterValue(key, v)); - } - this.activeFilters.set(result); - this.emitFilters(); - } - - clearActiveFilter(): void { - this.activeFilters.set({}); - this.expandedPanels.set([]); - this.filterSelected.emit(null); - } - - onExpandedPanelsChange(value: string | number | string[] | number[] | null | undefined): void { - if (Array.isArray(value)) { - const panels = value.map(Number); - if (JSON.stringify(panels) !== JSON.stringify(this.expandedPanels())) { - this.expandedPanels.set(panels); - } - } - } - - getVirtualScrollHeight(itemCount: number): number { - return Math.min(itemCount * 28, 440); - } - - trackByFilter = (_: number, f: Filter): unknown => this.getFilterValueId(f); - - getFilterValueId(f: Filter): unknown { - const value = f.value; - return typeof value === 'object' && value !== null && 'id' in value - ? value.id - : f.value; - } - - getFilterValueDisplay(f: Filter): string { - const value = f.value; - if (typeof value === 'object' && value !== null && 'name' in value) { - return String(value.name ?? ''); - } - return String(value ?? ''); - } - - isActive(filterType: string, filterId: unknown): boolean { - const active = this.activeFilters()[filterType]; - if (!active) return false; - return active.some(v => v === filterId || String(v) === String(filterId)); - } - - private handleSingleMode(filterType: string, value: unknown): void { - const id = this.extractId(value); - const current = this.activeFilters()[filterType]; - const isSame = current?.length === 1 && this.valuesMatch(current[0], id); - this.activeFilters.set(isSame ? {} : {[filterType]: [id]}); - } - - private handleMultiMode(filterType: string, value: unknown): void { - const id = this.extractId(value); - const current = {...this.activeFilters()}; - const arr = [...(current[filterType] ?? [])]; - - const index = arr.findIndex(v => this.valuesMatch(v, id)); - if (index > -1) { - arr.splice(index, 1); - if (arr.length === 0) { - delete current[filterType]; - } else { - current[filterType] = arr; - } - } else { - current[filterType] = [...arr, id]; - } - this.activeFilters.set(current); - } - - private extractId(value: unknown): unknown { - return typeof value === 'object' && value !== null && 'id' in value - ? (value as {id: unknown}).id - : value; - } - - private valuesMatch(a: unknown, b: unknown): boolean { - return a === b || String(a) === String(b); - } - - private emitFilters(): void { - const filters = this.activeFilters(); - const hasFilters = Object.keys(filters).length > 0; - this.filterSelected.emit(hasFilters ? {...filters} : null); - - // Update expanded panels to show panels with active filters - const panels = new Set(); - const types = this.visibleFilterTypes(); - types.forEach((type, i) => { - if (filters[type]?.length) panels.add(i); - }); - this.expandedPanels.set([...panels]); - } -} diff --git a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.config.spec.ts b/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.config.spec.ts deleted file mode 100644 index 028bd7775..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.config.spec.ts +++ /dev/null @@ -1,83 +0,0 @@ -import {describe, expect, it} from 'vitest'; - -import {Book, ReadStatus} from '../../../model/book.model'; -import { - CONTENT_RATING_LABELS, - FILTER_CONFIGS, - FILTER_EXTRACTORS, - FILTER_LABEL_KEYS, - MATCH_SCORE_RANGES, - NUMERIC_ID_FILTER_TYPES, - RATING_OPTIONS_10, - READ_STATUS_LABELS -} from './book-filter.config'; - -const makeBook = (overrides: Partial = {}): Book => ({ - id: 1, - libraryId: 9, - libraryName: 'Main', - ...overrides -}); - -describe('book-filter.config', () => { - it('covers every read status with a label', () => { - expect(READ_STATUS_LABELS[ReadStatus.UNREAD]).toBe('Unread'); - expect(READ_STATUS_LABELS[ReadStatus.UNSET]).toBe('Unset'); - expect(Object.keys(READ_STATUS_LABELS)).toHaveLength(Object.keys(ReadStatus).length); - }); - - it('defines 10 one-step rating buckets', () => { - expect(RATING_OPTIONS_10).toHaveLength(10); - expect(RATING_OPTIONS_10[0]).toMatchObject({id: 1, label: '1', min: 1, max: 2, sortIndex: 0}); - expect(RATING_OPTIONS_10.at(-1)).toMatchObject({id: 10, label: '10', min: 10, max: 11, sortIndex: 9}); - }); - - it('keeps filter labels and configs aligned', () => { - const configKeys = Object.keys(FILTER_CONFIGS).sort(); - const labelKeysWithoutLibrary = Object.keys(FILTER_LABEL_KEYS).filter((key) => key !== 'library').sort(); - - expect(labelKeysWithoutLibrary).toEqual(configKeys); - expect(FILTER_LABEL_KEYS.library).toBe('book.filter.labels.library'); - expect(NUMERIC_ID_FILTER_TYPES.has('pageCount')).toBe(true); - expect(NUMERIC_ID_FILTER_TYPES.has('author')).toBe(false); - }); - - it('normalizes read status, metadata match score, and content ratings', () => { - expect(FILTER_EXTRACTORS.readStatus(makeBook({readStatus: ReadStatus.READING}))).toEqual([ - {id: ReadStatus.READING, name: 'Reading'} - ]); - - expect(FILTER_EXTRACTORS.readStatus(makeBook({readStatus: 'INVALID' as ReadStatus}))).toEqual([ - {id: ReadStatus.UNSET, name: 'Unset'} - ]); - - expect(FILTER_EXTRACTORS.matchScore(makeBook({metadataMatchScore: 92}))).toEqual([ - {id: MATCH_SCORE_RANGES[1].id, name: MATCH_SCORE_RANGES[1].label, sortIndex: MATCH_SCORE_RANGES[1].sortIndex} - ]); - - expect(FILTER_EXTRACTORS.contentRating(makeBook({ - metadata: {bookId: 1, contentRating: 'EVERYONE'} - }))).toEqual([{id: 'EVERYONE', name: CONTENT_RATING_LABELS['EVERYONE']}]); - - expect(FILTER_EXTRACTORS.ageRating(makeBook({ - metadata: {bookId: 1, ageRating: 12} - }))).toEqual([{id: 10, name: '10+', sortIndex: 2}]); - }); - - it('builds comic creator filters with role-aware labels', () => { - const filters = FILTER_EXTRACTORS.comicCreator(makeBook({ - metadata: { - bookId: 1, - comicMetadata: { - pencillers: ['Jane Artist'], - editors: ['Max Editor'] - } - } - })); - - expect(filters).toEqual([ - {id: 'Jane Artist:penciller', name: 'Jane Artist (Penciller)'}, - {id: 'Max Editor:editor', name: 'Max Editor (Editor)'} - ]); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.config.ts b/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.config.ts deleted file mode 100644 index 3f85a4212..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.config.ts +++ /dev/null @@ -1,383 +0,0 @@ -import {Book, ReadStatus} from '../../../model/book.model'; - -// ============================================================================ -// TYPES -// ============================================================================ - -export interface FilterValue { - id?: string | number; - name?: string; - sortIndex?: number; -} - -export interface Filter { - value: T; - bookCount: number; -} - -export type FilterType = - | 'author' | 'category' | 'series' | 'bookType' | 'readStatus' - | 'personalRating' | 'publisher' | 'matchScore' | 'library' | 'shelf' - | 'shelfStatus' | 'tag' | 'publishedDate' | 'fileSize' | 'amazonRating' - | 'goodreadsRating' | 'hardcoverRating' | 'lubimyczytacRating' | 'ranobedbRating' - | 'audibleRating' | 'language' | 'pageCount' | 'mood' - | 'ageRating' | 'contentRating' - | 'narrator' - | 'comicCharacter' | 'comicTeam' | 'comicLocation' | 'comicCreator'; - -export type SortMode = 'count' | 'sortIndex'; - -export interface RangeConfig { - id: number; - label: string; - min: number; - max: number; - sortIndex: number; -} - -export interface FilterConfig { - label: string; - extractor: (book: Book) => FilterValue[]; - sortMode: SortMode; - isNumericId?: boolean; -} - -// ============================================================================ -// CONSTANTS -// ============================================================================ - -export const READ_STATUS_LABELS: Readonly> = { - [ReadStatus.UNREAD]: 'Unread', - [ReadStatus.READING]: 'Reading', - [ReadStatus.RE_READING]: 'Re-reading', - [ReadStatus.PARTIALLY_READ]: 'Partially Read', - [ReadStatus.PAUSED]: 'Paused', - [ReadStatus.READ]: 'Read', - [ReadStatus.WONT_READ]: 'Won\'t Read', - [ReadStatus.ABANDONED]: 'Abandoned', - [ReadStatus.UNSET]: 'Unset' -}; - -export const RATING_RANGES_5: readonly RangeConfig[] = [ - {id: 0, label: '0 to 1', min: 0, max: 1, sortIndex: 0}, - {id: 1, label: '1 to 2', min: 1, max: 2, sortIndex: 1}, - {id: 2, label: '2 to 3', min: 2, max: 3, sortIndex: 2}, - {id: 3, label: '3 to 4', min: 3, max: 4, sortIndex: 3}, - {id: 4, label: '4 to 4.5', min: 4, max: 4.5, sortIndex: 4}, - {id: 5, label: '4.5+', min: 4.5, max: Infinity, sortIndex: 5} -]; - -export const RATING_OPTIONS_10: readonly RangeConfig[] = Array.from({length: 10}, (_, i) => ({ - id: i + 1, - label: `${i + 1}`, - min: i + 1, - max: i + 2, - sortIndex: i -})); - -export const FILE_SIZE_RANGES: readonly RangeConfig[] = [ - {id: 0, label: '< 1 MB', min: 0, max: 1024, sortIndex: 0}, - {id: 1, label: '1–10 MB', min: 1024, max: 10240, sortIndex: 1}, - {id: 2, label: '10–50 MB', min: 10240, max: 51200, sortIndex: 2}, - {id: 3, label: '50–100 MB', min: 51200, max: 102400, sortIndex: 3}, - {id: 4, label: '100–500 MB', min: 102400, max: 512000, sortIndex: 4}, - {id: 5, label: '0.5–1 GB', min: 512000, max: 1048576, sortIndex: 5}, - {id: 6, label: '1–2 GB', min: 1048576, max: 2097152, sortIndex: 6}, - {id: 7, label: '2+ GB', min: 2097152, max: Infinity, sortIndex: 7} -]; - -export const PAGE_COUNT_RANGES: readonly RangeConfig[] = [ - {id: 0, label: '< 50 pages', min: 0, max: 50, sortIndex: 0}, - {id: 1, label: '50–100 pages', min: 50, max: 100, sortIndex: 1}, - {id: 2, label: '100–200 pages', min: 100, max: 200, sortIndex: 2}, - {id: 3, label: '200–400 pages', min: 200, max: 400, sortIndex: 3}, - {id: 4, label: '400–600 pages', min: 400, max: 600, sortIndex: 4}, - {id: 5, label: '600–1000 pages', min: 600, max: 1000, sortIndex: 5}, - {id: 6, label: '1000+ pages', min: 1000, max: Infinity, sortIndex: 6} -]; - -export const MATCH_SCORE_RANGES: readonly RangeConfig[] = [ - {id: 0, min: 0.95, max: 1.01, label: 'Outstanding (95–100%)', sortIndex: 0}, - {id: 1, min: 0.90, max: 0.95, label: 'Excellent (90–94%)', sortIndex: 1}, - {id: 2, min: 0.80, max: 0.90, label: 'Great (80–89%)', sortIndex: 2}, - {id: 3, min: 0.70, max: 0.80, label: 'Good (70–79%)', sortIndex: 3}, - {id: 4, min: 0.50, max: 0.70, label: 'Fair (50–69%)', sortIndex: 4}, - {id: 5, min: 0.30, max: 0.50, label: 'Weak (30–49%)', sortIndex: 5}, - {id: 6, min: 0.00, max: 0.30, label: 'Poor (0–29%)', sortIndex: 6} -]; - -export const AGE_RATING_OPTIONS: readonly RangeConfig[] = [ - {id: 0, min: 0, max: 6, label: 'All Ages', sortIndex: 0}, - {id: 6, min: 6, max: 10, label: '6+', sortIndex: 1}, - {id: 10, min: 10, max: 13, label: '10+', sortIndex: 2}, - {id: 13, min: 13, max: 16, label: '13+', sortIndex: 3}, - {id: 16, min: 16, max: 18, label: '16+', sortIndex: 4}, - {id: 18, min: 18, max: 21, label: '18+', sortIndex: 5}, - {id: 21, min: 21, max: Infinity, label: '21+', sortIndex: 6} -]; - -export const CONTENT_RATING_LABELS: Readonly> = { - 'EVERYONE': 'Everyone', - 'TEEN': 'Teen', - 'MATURE': 'Mature', - 'ADULT': 'Adult', - 'EXPLICIT': 'Explicit' -}; - -export const readStatusLabels = READ_STATUS_LABELS; -export const ratingRanges = RATING_RANGES_5; -export const ratingOptions10 = RATING_OPTIONS_10; -export const fileSizeRanges = FILE_SIZE_RANGES; -export const pageCountRanges = PAGE_COUNT_RANGES; -export const matchScoreRanges = MATCH_SCORE_RANGES; -export const ageRatingRanges = AGE_RATING_OPTIONS; - -export const NUMERIC_ID_FILTER_TYPES = new Set([ - 'personalRating', 'matchScore', 'fileSize', 'amazonRating', - 'goodreadsRating', 'hardcoverRating', 'lubimyczytacRating', 'ranobedbRating', - 'audibleRating', 'pageCount', 'library', 'shelf', - 'ageRating' -]); - -export const FILTER_LABELS: Readonly> = { - author: 'Author', - category: 'Genre', - series: 'Series', - bookType: 'File Format', - readStatus: 'Read Status', - personalRating: 'Personal Rating', - publisher: 'Publisher', - matchScore: 'Metadata Match Score', - library: 'Library', - shelf: 'Shelf', - shelfStatus: 'Shelf Status', - tag: 'Tag', - publishedDate: 'Published Year', - fileSize: 'File Size', - amazonRating: 'Amazon Rating', - goodreadsRating: 'Goodreads Rating', - hardcoverRating: 'Hardcover Rating', - lubimyczytacRating: 'Lubimyczytac Rating', - ranobedbRating: 'RanobeDB Rating', - audibleRating: 'Audible Rating', - language: 'Language', - pageCount: 'Page Count', - mood: 'Mood', - ageRating: 'Age Rating', - contentRating: 'Content Rating', - narrator: 'Narrator', - comicCharacter: 'Comic Character', - comicTeam: 'Comic Team', - comicLocation: 'Comic Location', - comicCreator: 'Comic Creator' -}; - -// ============================================================================ -// FILTER EXTRACTORS -// ============================================================================ - -const findInRange = (value: number | null | undefined, ranges: readonly RangeConfig[]): FilterValue[] => { - if (value == null) return []; - const match = ranges.find(r => value >= r.min && value < r.max); - return match ? [{id: match.id, name: match.label, sortIndex: match.sortIndex}] : []; -}; - -const findExactRating10 = (rating: number | undefined): FilterValue[] => { - if (!rating || rating < 1 || rating > 10) return []; - const match = RATING_OPTIONS_10.find(r => r.id === rating); - return match ? [{id: match.id, name: match.label, sortIndex: match.sortIndex}] : []; -}; - -const normalizeMatchScore = (score: number | null | undefined): number | null => { - if (score == null) return null; - return score > 1 ? score / 100 : score; -}; - -const extractStringsAsFilters = (values: string[] | undefined): FilterValue[] => - values?.map(name => ({id: name, name})) ?? []; - -const extractSingleString = (value: string | undefined | null): FilterValue[] => - value ? [{id: value, name: value}] : []; - -let languageDisplayName: (raw: string) => string = raw => raw; - -export function registerLanguageDisplayName(resolver: (raw: string) => string): void { - languageDisplayName = resolver; -} - -export const FILTER_EXTRACTORS: Readonly, (book: Book) => FilterValue[]>> = { - author: (book) => extractStringsAsFilters(book.metadata?.authors), - category: (book) => extractStringsAsFilters(book.metadata?.categories), - series: (book) => extractSingleString(book.metadata?.seriesName?.trim()), - bookType: (book) => book.isPhysical ? [{id: 'PHYSICAL', name: 'PHYSICAL'}] : extractSingleString(book.primaryFile?.bookType), - readStatus: (book) => { - const status = book.readStatus ?? ReadStatus.UNSET; - const validStatus = status in READ_STATUS_LABELS ? status : ReadStatus.UNSET; - return [{id: validStatus, name: READ_STATUS_LABELS[validStatus]}]; - }, - personalRating: (book) => findExactRating10(book.personalRating ?? undefined), - publisher: (book) => extractSingleString(book.metadata?.publisher), - matchScore: (book) => findInRange(normalizeMatchScore(book.metadataMatchScore), MATCH_SCORE_RANGES), - shelf: (book) => book.shelves?.map(s => ({id: s.id, name: s.name})) ?? [], - shelfStatus: (book) => { - const isShelved = (book.shelves?.length ?? 0) > 0; - return [{id: isShelved ? 'shelved' : 'unshelved', name: isShelved ? 'Shelved' : 'Unshelved'}]; - }, - tag: (book) => extractStringsAsFilters(book.metadata?.tags), - publishedDate: (book) => { - const date = book.metadata?.publishedDate; - if (!date) return []; - const year = new Date(date).getFullYear().toString(); - return [{id: year, name: year}]; - }, - fileSize: (book) => findInRange(book.fileSizeKb, FILE_SIZE_RANGES), - amazonRating: (book) => findInRange(book.metadata?.amazonRating, RATING_RANGES_5), - goodreadsRating: (book) => findInRange(book.metadata?.goodreadsRating, RATING_RANGES_5), - hardcoverRating: (book) => findInRange(book.metadata?.hardcoverRating, RATING_RANGES_5), - lubimyczytacRating: (book) => findInRange(book.metadata?.lubimyczytacRating, RATING_RANGES_5), - ranobedbRating: (book) => findInRange(book.metadata?.ranobedbRating, RATING_RANGES_5), - audibleRating: (book) => findInRange(book.metadata?.audibleRating, RATING_RANGES_5), - language: (book) => { - const language = book.metadata?.language; - return language ? [{id: language, name: languageDisplayName(language)}] : []; - }, - pageCount: (book) => findInRange(book.metadata?.pageCount, PAGE_COUNT_RANGES), - mood: (book) => extractStringsAsFilters(book.metadata?.moods), - ageRating: (book) => findInRange(book.metadata?.ageRating, AGE_RATING_OPTIONS), - contentRating: (book) => { - const rating = book.metadata?.contentRating; - if (!rating) return []; - const label = CONTENT_RATING_LABELS[rating] ?? rating; - return [{id: rating, name: label}]; - }, - narrator: (book) => extractSingleString(book.metadata?.narrator), - comicCharacter: (book) => extractStringsAsFilters(book.metadata?.comicMetadata?.characters), - comicTeam: (book) => extractStringsAsFilters(book.metadata?.comicMetadata?.teams), - comicLocation: (book) => extractStringsAsFilters(book.metadata?.comicMetadata?.locations), - comicCreator: (book) => { - const comic = book.metadata?.comicMetadata; - if (!comic) return []; - const creators: FilterValue[] = []; - const roleLabels: Record = { - penciller: 'Penciller', inker: 'Inker', colorist: 'Colorist', - letterer: 'Letterer', coverArtist: 'Cover Artist', editor: 'Editor' - }; - const roles: [string[] | undefined, string][] = [ - [comic.pencillers, 'penciller'], - [comic.inkers, 'inker'], - [comic.colorists, 'colorist'], - [comic.letterers, 'letterer'], - [comic.coverArtists, 'coverArtist'], - [comic.editors, 'editor'] - ]; - for (const [names, role] of roles) { - if (names) { - for (const name of names) { - creators.push({id: `${name}:${role}`, name: `${name} (${roleLabels[role]})`}); - } - } - } - return creators; - } -}; - -// Translation key for each FilterType — used by UI components to translate filter labels -export const FILTER_LABEL_KEYS: Readonly> = { - author: 'book.filter.labels.author', - category: 'book.filter.labels.category', - series: 'book.filter.labels.series', - bookType: 'book.filter.labels.bookType', - readStatus: 'book.filter.labels.readStatus', - personalRating: 'book.filter.labels.personalRating', - publisher: 'book.filter.labels.publisher', - matchScore: 'book.filter.labels.matchScore', - library: 'book.filter.labels.library', - shelf: 'book.filter.labels.shelf', - shelfStatus: 'book.filter.labels.shelfStatus', - tag: 'book.filter.labels.tag', - publishedDate: 'book.filter.labels.publishedDate', - fileSize: 'book.filter.labels.fileSize', - amazonRating: 'book.filter.labels.amazonRating', - goodreadsRating: 'book.filter.labels.goodreadsRating', - hardcoverRating: 'book.filter.labels.hardcoverRating', - lubimyczytacRating: 'book.filter.labels.lubimyczytacRating', - ranobedbRating: 'book.filter.labels.ranobedbRating', - audibleRating: 'book.filter.labels.audibleRating', - language: 'book.filter.labels.language', - pageCount: 'book.filter.labels.pageCount', - mood: 'book.filter.labels.mood', - ageRating: 'book.filter.labels.ageRating', - contentRating: 'book.filter.labels.contentRating', - narrator: 'book.filter.labels.narrator', - comicCharacter: 'book.filter.labels.comicCharacter', - comicTeam: 'book.filter.labels.comicTeam', - comicLocation: 'book.filter.labels.comicLocation', - comicCreator: 'book.filter.labels.comicCreator' -}; - -export const READ_STATUS_LABEL_KEYS: Readonly> = { - [ReadStatus.UNREAD]: 'book.filter.readStatus.unread', - [ReadStatus.READING]: 'book.filter.readStatus.reading', - [ReadStatus.RE_READING]: 'book.filter.readStatus.reReading', - [ReadStatus.PARTIALLY_READ]: 'book.filter.readStatus.partiallyRead', - [ReadStatus.PAUSED]: 'book.filter.readStatus.paused', - [ReadStatus.READ]: 'book.filter.readStatus.read', - [ReadStatus.WONT_READ]: 'book.filter.readStatus.wontRead', - [ReadStatus.ABANDONED]: 'book.filter.readStatus.abandoned', - [ReadStatus.UNSET]: 'book.filter.readStatus.unset' -}; - -export const CONTENT_RATING_LABEL_KEYS: Readonly> = { - 'EVERYONE': 'book.filter.contentRating.everyone', - 'TEEN': 'book.filter.contentRating.teen', - 'MATURE': 'book.filter.contentRating.mature', - 'ADULT': 'book.filter.contentRating.adult', - 'EXPLICIT': 'book.filter.contentRating.explicit' -}; - -export const SHELF_STATUS_LABEL_KEYS: Readonly> = { - 'shelved': 'book.filter.shelfStatus.shelved', - 'unshelved': 'book.filter.shelfStatus.unshelved' -}; - - -export const COMIC_ROLE_LABEL_KEYS: Readonly> = { - penciller: 'book.filter.comicRoles.penciller', - inker: 'book.filter.comicRoles.inker', - colorist: 'book.filter.comicRoles.colorist', - letterer: 'book.filter.comicRoles.letterer', - coverArtist: 'book.filter.comicRoles.coverArtist', - editor: 'book.filter.comicRoles.editor' -}; - -export const FILTER_CONFIGS: Readonly, Omit>> = { - author: {label: 'Author', sortMode: 'count'}, - category: {label: 'Genre', sortMode: 'count'}, - series: {label: 'Series', sortMode: 'count'}, - bookType: {label: 'Book Type', sortMode: 'count'}, - readStatus: {label: 'Read Status', sortMode: 'count'}, - personalRating: {label: 'Personal Rating', sortMode: 'sortIndex', isNumericId: true}, - publisher: {label: 'Publisher', sortMode: 'count'}, - matchScore: {label: 'Metadata Match Score', sortMode: 'sortIndex', isNumericId: true}, - shelf: {label: 'Shelf', sortMode: 'count', isNumericId: true}, - shelfStatus: {label: 'Shelf Status', sortMode: 'count'}, - tag: {label: 'Tag', sortMode: 'count'}, - publishedDate: {label: 'Published Year', sortMode: 'count'}, - fileSize: {label: 'File Size', sortMode: 'sortIndex', isNumericId: true}, - amazonRating: {label: 'Amazon Rating', sortMode: 'sortIndex', isNumericId: true}, - goodreadsRating: {label: 'Goodreads Rating', sortMode: 'sortIndex', isNumericId: true}, - hardcoverRating: {label: 'Hardcover Rating', sortMode: 'sortIndex', isNumericId: true}, - lubimyczytacRating: {label: 'Lubimyczytac Rating', sortMode: 'sortIndex', isNumericId: true}, - ranobedbRating: {label: 'RanobeDB Rating', sortMode: 'sortIndex', isNumericId: true}, - audibleRating: {label: 'Audible Rating', sortMode: 'sortIndex', isNumericId: true}, - language: {label: 'Language', sortMode: 'count'}, - pageCount: {label: 'Page Count', sortMode: 'sortIndex', isNumericId: true}, - mood: {label: 'Mood', sortMode: 'count'}, - ageRating: {label: 'Age Rating', sortMode: 'sortIndex', isNumericId: true}, - contentRating: {label: 'Content Rating', sortMode: 'count'}, - narrator: {label: 'Narrator', sortMode: 'count'}, - comicCharacter: {label: 'Comic Character', sortMode: 'count'}, - comicTeam: {label: 'Comic Team', sortMode: 'count'}, - comicLocation: {label: 'Comic Location', sortMode: 'count'}, - comicCreator: {label: 'Comic Creator', sortMode: 'count'} -}; diff --git a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.service.spec.ts b/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.service.spec.ts deleted file mode 100644 index a3d39ba76..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.service.spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {describe, it} from 'vitest'; - -// NOTE(frontend-seam): Real coverage here needs seams around the live book, library, and -// magic-shelf signal graph so dynamic filter aggregation can be asserted without recreating the -// full sidebar filter runtime and evaluator dependencies. -describe.skip('BookFilterService', () => { - it('needs signal seams to verify library, shelf, and magic-shelf entity filtering across active sidebar filters', () => { - // TODO(seam): Cover createFilterSignals and filterBooksByEntity once the dependent signals and evaluator service are isolated behind deterministic doubles. - }); - - it('needs aggregation seams to verify filter count sorting, numeric-id coercion, and invalid magic-shelf fallback handling', () => { - // TODO(seam): Cover buildAndSortFilters, processFilterValue, and filterByMagicShelf after extractor inputs and service state are exposed through a stable harness. - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.service.ts b/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.service.ts deleted file mode 100644 index 44b6a2bcc..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-filter/book-filter.service.ts +++ /dev/null @@ -1,177 +0,0 @@ -import {computed, inject, Injectable, Signal} from '@angular/core'; -import {Book} from '../../../model/book.model'; -import {Library} from '../../../model/library.model'; -import {Shelf} from '../../../model/shelf.model'; -import {MagicShelf} from '../../../../magic-shelf/service/magic-shelf.service'; -import {BookService} from '../../../service/book.service'; -import {LibraryService} from '../../../service/library.service'; -import {BookRuleEvaluatorService} from '../../../../magic-shelf/service/book-rule-evaluator.service'; -import {GroupRule} from '../../../../magic-shelf/component/magic-shelf-component'; -import {EntityType} from '../book-browser.component'; -import {Filter, FILTER_CONFIGS, FILTER_EXTRACTORS, FilterType, FilterValue, NUMERIC_ID_FILTER_TYPES, registerLanguageDisplayName, SortMode} from './book-filter.config'; -import {filterBooksByFilters} from '../filters/sidebar-filter'; -import {BookFilterMode} from '../../../../settings/user-management/user.service'; -import {LanguageResolverService} from '../../../../../shared/service/language-resolver.service'; - -const MAX_FILTER_ITEMS = 100; - -@Injectable({providedIn: 'root'}) -export class BookFilterService { - private readonly bookService = inject(BookService); - private readonly libraryService = inject(LibraryService); - private readonly bookRuleEvaluatorService = inject(BookRuleEvaluatorService); - private readonly languageResolver = inject(LanguageResolverService); - - constructor() { - registerLanguageDisplayName(raw => this.languageResolver.displayName(raw) || raw); - } - - createFilterSignals( - entity: Signal, - entityType: Signal, - activeFilters: Signal | null>, - filterMode: Signal - ): Record> { - const filteredBooks = computed(() => - this.filterBooksByEntity(this.bookService.books(), entity(), entityType()) - ); - - const signals = {} as Record>; - - for (const [type, config] of Object.entries(FILTER_CONFIGS)) { - const filterType = type as Exclude; - signals[filterType] = computed(() => { - const books = filterBooksByFilters(filteredBooks(), activeFilters(), filterMode(), filterType); - return this.buildAndSortFilters(books, FILTER_EXTRACTORS[filterType], config.sortMode); - }); - } - - signals.library = computed(() => { - const books = filterBooksByFilters(filteredBooks(), activeFilters(), filterMode(), 'library'); - const libraries = this.libraryService.libraries(); - - const libraryMap = new Map( - libraries - .filter(lib => lib.id !== undefined) - .map(lib => [lib.id!, lib.name]) - ); - - const filterMap = new Map(); - - for (const book of books) { - if (book.libraryId == null) continue; - - if (!filterMap.has(book.libraryId)) { - filterMap.set(book.libraryId, { - value: { - id: book.libraryId, - name: libraryMap.get(book.libraryId) ?? book.libraryName ?? `Library ${book.libraryId}` - }, - bookCount: 0 - }); - } - filterMap.get(book.libraryId)!.bookCount++; - } - - return this.sortFiltersByCount(Array.from(filterMap.values())); - }); - - return signals; - } - - filterBooksByEntity( - books: Book[], - entity: Library | Shelf | MagicShelf | null, - entityType: EntityType - ): Book[] { - if (!entity) return books; - - switch (entityType) { - case EntityType.LIBRARY: - return books.filter(book => book.libraryId === (entity as Library).id); - - case EntityType.SHELF: { - const shelfId = (entity as Shelf).id; - return books.filter(book => book.shelves?.some(s => s.id === shelfId)); - } - - case EntityType.MAGIC_SHELF: - return this.filterByMagicShelf(books, entity as MagicShelf); - - case EntityType.UNSHELVED: - return books.filter(book => !book.shelves || book.shelves.length === 0); - - default: - return books; - } - } - - processFilterValue(key: string, value: unknown): unknown { - if (NUMERIC_ID_FILTER_TYPES.has(key as FilterType) && typeof value === 'string') { - return Number(value); - } - return value; - } - - isNumericFilter(filterType: string): boolean { - return NUMERIC_ID_FILTER_TYPES.has(filterType as FilterType); - } - - private buildAndSortFilters( - books: Book[], - extractor: (book: Book) => FilterValue[], - sortMode: SortMode - ): Filter[] { - const filterMap = new Map(); - - for (const book of books) { - for (const item of extractor(book)) { - const id = item.id; - if (!filterMap.has(id)) { - filterMap.set(id, {value: item, bookCount: 0}); - } - filterMap.get(id)!.bookCount++; - } - } - - const filters = Array.from(filterMap.values()); - const sorted = sortMode === 'sortIndex' - ? this.sortFiltersBySortIndex(filters) - : this.sortFiltersByCount(filters); - - return sorted.slice(0, MAX_FILTER_ITEMS); - } - - private sortFiltersByCount(filters: Filter[]): Filter[] { - return filters.sort((a, b) => { - if (b.bookCount !== a.bookCount) return b.bookCount - a.bookCount; - return this.compareNames(a, b); - }); - } - - private sortFiltersBySortIndex(filters: Filter[]): Filter[] { - return filters.sort((a, b) => { - const aIndex = (a.value as { sortIndex?: number }).sortIndex ?? 999; - const bIndex = (b.value as { sortIndex?: number }).sortIndex ?? 999; - if (aIndex !== bIndex) return aIndex - bIndex; - return this.compareNames(a, b); - }); - } - - private compareNames(a: Filter, b: Filter): number { - const aName = String((a.value as { name?: string }).name ?? ''); - const bName = String((b.value as { name?: string }).name ?? ''); - return aName.localeCompare(bName); - } - - private filterByMagicShelf(books: Book[], magicShelf: MagicShelf): Book[] { - if (!magicShelf.filterJson) return []; - try { - const groupRule = JSON.parse(magicShelf.filterJson) as GroupRule; - return books.filter(book => this.bookRuleEvaluatorService.evaluateGroup(book, groupRule, books)); - } catch { - console.warn('Invalid filterJson for MagicShelf'); - return []; - } - } -} diff --git a/frontend/src/app/features/book/components/book-browser/book-selection.service.spec.ts b/frontend/src/app/features/book/components/book-browser/book-selection.service.spec.ts deleted file mode 100644 index 33a5354bd..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-selection.service.spec.ts +++ /dev/null @@ -1,88 +0,0 @@ -import {TestBed} from '@angular/core/testing'; -import {beforeEach, describe, expect, it} from 'vitest'; - -import {BookSelectionService} from './book-selection.service'; -import {Book} from '../../model/book.model'; - -function makeBook(id: number, overrides: Partial = {}): Book { - return { - id, - libraryId: 1, - libraryName: 'Library', - metadata: {bookId: id, title: `Book ${id}`}, - ...overrides - }; -} - -describe('BookSelectionService', () => { - let service: BookSelectionService; - - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [BookSelectionService] - }); - - service = TestBed.inject(BookSelectionService); - }); - - it('selects and deselects single books and series groups', () => { - const singleBook = makeBook(1); - const seriesBook = makeBook(2, { - seriesBooks: [makeBook(2), makeBook(3)] - }); - - service.selectBook(singleBook); - service.selectBook(seriesBook); - - expect(service.selectedBooks()).toEqual(new Set([1, 2, 3])); - expect(service.selectedCount()).toBe(3); - - service.deselectBook(makeBook(1)); - service.deselectBook(seriesBook); - - expect(service.selectedBooks()).toEqual(new Set()); - expect(service.selectedCount()).toBe(0); - }); - - it('tracks checkbox clicks with and without shift selection', () => { - const books = [makeBook(1), makeBook(2), makeBook(3), makeBook(4)]; - service.setCurrentBooks(books); - - service.handleCheckboxClick({index: 1, book: books[1], selected: true, shiftKey: false}); - expect(service.selectedBooks()).toEqual(new Set([2])); - - service.handleCheckboxClick({index: 3, book: books[3], selected: true, shiftKey: true}); - expect(service.selectedBooks()).toEqual(new Set([2, 3, 4])); - - service.handleCheckboxClick({index: 3, book: books[3], selected: false, shiftKey: true}); - expect(service.selectedBooks()).toEqual(new Set()); - }); - - it('selects all current books, resets selection, and clones selected ids', () => { - expect(() => service.selectAll()).not.toThrow(); - - const books = [makeBook(1), makeBook(2)]; - service.setCurrentBooks(books); - service.selectAll(); - expect(service.selectedBooks()).toEqual(new Set([1, 2])); - - const selectedIds = new Set([4, 5]); - service.setSelectedBooks(selectedIds); - selectedIds.add(6); - - expect(service.selectedBooks()).toEqual(new Set([4, 5])); - - service.deselectAll(); - expect(service.selectedBooks()).toEqual(new Set()); - expect(service.selectedCount()).toBe(0); - }); - - it('selects all from provided book IDs when passed to selectAll', () => { - const books = [makeBook(1), makeBook(2)]; - service.setCurrentBooks(books); - - service.selectAll([10, 20, 30, 40, 50]); - expect(service.selectedBooks()).toEqual(new Set([10, 20, 30, 40, 50])); - expect(service.selectedCount()).toBe(5); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/book-selection.service.ts b/frontend/src/app/features/book/components/book-browser/book-selection.service.ts deleted file mode 100644 index af4ef25cc..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-selection.service.ts +++ /dev/null @@ -1,104 +0,0 @@ -import {computed, Injectable, signal} from '@angular/core'; -import {Book} from '../../model/book.model'; - -export interface CheckboxClickEvent { - index: number; - book: Book; - selected: boolean; - shiftKey: boolean; -} - -@Injectable({providedIn: 'root'}) -export class BookSelectionService { - private readonly _selectedBooks = signal>(new Set()); - readonly selectedBooks = this._selectedBooks.asReadonly(); - readonly selectedCount = computed(() => this._selectedBooks().size); - - private currentBooks: Book[] = []; - private lastSelectedIndex: number | null = null; - - setCurrentBooks(books: Book[]): void { - this.currentBooks = books; - } - - getSelectableBookIds(book: Book): number[] { - return book.seriesBooks?.length - ? book.seriesBooks.map(seriesBook => seriesBook.id) - : [book.id]; - } - - isBookSelected(book: Book): boolean { - const selectedIds = this._selectedBooks(); - const ids = this.getSelectableBookIds(book); - return ids.every(id => selectedIds.has(id)); - } - - selectBook(book: Book): void { - this._selectedBooks.update(current => { - const next = new Set(current); - this.getSelectableBookIds(book).forEach(bookId => next.add(bookId)); - return next; - }); - } - - deselectBook(book: Book): void { - this._selectedBooks.update(current => { - const next = new Set(current); - this.getSelectableBookIds(book).forEach(bookId => next.delete(bookId)); - return next; - }); - } - - handleCheckboxClick(event: CheckboxClickEvent): void { - const {index, book, selected, shiftKey} = event; - - if (!shiftKey || this.lastSelectedIndex === null) { - this.handleBookSelection(book, selected); - this.lastSelectedIndex = index; - } else { - const start = Math.min(this.lastSelectedIndex, index); - const end = Math.max(this.lastSelectedIndex, index); - const isUnselectingRange = !selected; - - for (let i = start; i <= end; i++) { - const rangeBook = this.currentBooks[i]; - if (!rangeBook) continue; - this.handleBookSelection(rangeBook, !isUnselectingRange); - } - } - } - - handleBookSelection(book: Book, selected: boolean): void { - if (selected) { - this.selectBook(book); - } else { - this.deselectBook(book); - } - } - - selectAll(allBookIds?: number[]): void { - if (allBookIds && allBookIds.length > 0) { - this._selectedBooks.set(new Set(allBookIds)); - return; - } - - if (!this.currentBooks || this.currentBooks.length === 0) return; - - this._selectedBooks.update(current => { - const next = new Set(current); - for (const book of this.currentBooks) { - this.getSelectableBookIds(book).forEach(bookId => next.add(bookId)); - } - return next; - }); - } - - deselectAll(): void { - this._selectedBooks.set(new Set()); - this.lastSelectedIndex = null; - } - - setSelectedBooks(bookIds: Set): void { - this._selectedBooks.set(new Set(bookIds)); - } -} diff --git a/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.html b/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.html deleted file mode 100644 index fc1f95975..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.html +++ /dev/null @@ -1,91 +0,0 @@ - - @let currentBook = book(); - @let currentMetadata = metadata(); - @let metadataLocked = isMetadataLocked(); - @let lockPending = isLockPending(); - @let squareCover = useSquareCover(); - @let imageUrl = coverUrl(); - @let coverLabel = currentMetadata.title || currentBook.fileName || t('book.table.bookCoverAlt'); - - @for (cell of cells(); track cell.id; let columnIndex = $index) { -
- @switch (cell.kind) { - @case ('select') { - - } - @case ('lock') { - - } - @case ('cover') { - - - } - @case ('readStatus') { - @if (showReadStatus()) { -
- -
- } - } - @case ('rating') { - - - - } - @case ('clickable') { - @for (item of cell.links; track $index; let isLast = $last) { - {{ item.anchor }}@if (!isLast) {, } - } - } - @case ('text') { - {{ cell.value }} - } - } -
- } -
diff --git a/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.scss b/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.scss deleted file mode 100644 index a9d6fae0a..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.scss +++ /dev/null @@ -1,175 +0,0 @@ -:host { - box-sizing: border-box; - display: grid; - grid-template-columns: var(--book-table-grid-template); - position: absolute; - left: 0; - right: 0; - min-width: 100%; - border-bottom: 1px solid var(--book-table-cell-border-color); - background: var(--book-table-row-background); - color: var(--book-table-row-color); -} - -:host(.book-table-row-striped) { - background: var(--book-table-row-striped-background); -} - -:host(:hover) { - z-index: 3; - background: var(--book-table-row-hover-background); - color: var(--book-table-row-hover-color); -} - -.book-table-cell { - box-sizing: border-box; - display: flex; - align-items: center; - height: inherit; - min-width: 0; - padding: var(--book-table-cell-padding); - border-right: 1px solid var(--book-table-cell-border-color); - overflow: hidden; - color: inherit; - line-height: 1.2; - text-align: start; -} - -.book-table-checkbox { - display: inline-flex; - line-height: 0; - vertical-align: top; -} - -.metadata-lock-button { - display: inline-flex; - align-items: center; - justify-content: center; - width: 1.3125rem; - height: 1.3125rem; - padding: 0; - border: 0; - border-radius: 5px; - color: var(--book-table-lock-unlocked-color); - background: transparent; - cursor: pointer; - - &:hover:not(:disabled) { - background: color-mix(in srgb, var(--book-table-lock-unlocked-color) 16%, transparent); - } - - &:disabled { - cursor: default; - opacity: 0.65; - } - - &.metadata-lock-button-locked { - color: var(--book-table-lock-locked-color); - - &:hover:not(:disabled) { - background: color-mix(in srgb, var(--book-table-lock-locked-color) 16%, transparent); - } - } -} - -.cover-link { - position: relative; - display: inline-flex; - align-items: center; -} - -.cover-thumbnail { - width: calc(1.75rem * 5 / 7); - height: 1.75rem; - aspect-ratio: 5 / 7; - border-radius: 4px; - - &.square-cover { - width: 1.75rem; - aspect-ratio: 1 / 1; - } -} - -.read-status-indicator { - display: flex; - align-items: center; - justify-content: center; - width: 20px; - height: 20px; - margin: 0 auto; - font-size: var(--app-text-sm); - font-weight: 700; -} - -.status-read { - color: var(--book-table-status-read-color); -} - -.status-reading { - color: var(--book-table-status-reading-color); -} - -.status-re-reading { - color: var(--book-table-status-re-reading-color); -} - -.status-partially-read { - color: var(--book-table-status-partially-read-color); -} - -.status-paused { - color: var(--book-table-status-paused-color); -} - -.status-abandoned { - color: var(--book-table-status-abandoned-color); -} - -.status-wont-read { - color: var(--book-table-status-wont-read-color); -} - -.cell-status, -.cell-number { - justify-content: center; - text-align: center; -} - -.cell-rating { - justify-content: flex-start; - text-align: start; -} - -.cell-action, -.cell-cover { - justify-content: center; - padding-inline: 0.4375rem; -} - -.cell-cover { - overflow: visible; -} - -.cell-text { - white-space: nowrap; - text-overflow: ellipsis; -} - -.rating-wrapper { - display: inline-flex; - align-items: center; - justify-content: center; - gap: var(--book-table-rating-gap); - min-width: 6.125rem; -} - -.cell-link { - overflow: hidden; - color: var(--color-primary-text); - text-overflow: ellipsis; - white-space: nowrap; - - &:hover { - text-decoration: underline; - } -} diff --git a/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.spec.ts b/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.spec.ts deleted file mode 100644 index 4e115d44a..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.spec.ts +++ /dev/null @@ -1,129 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {provideRouter} from '@angular/router'; -import {beforeEach, describe, expect, it} from 'vitest'; - -import {getTranslocoModule} from '../../../../../core/testing/transloco-testing'; -import {UrlHelperService} from '../../../../../shared/service/url-helper.service'; -import {Book, ReadStatus} from '../../../model/book.model'; -import {ReadStatusHelper} from '../../../helpers/read-status.helper'; -import {BookTableRowComponent} from './book-table-row.component'; - -function makeBook(id: number, title: string): Book { - return { - id, - libraryId: 1, - libraryName: 'Library', - metadata: { - bookId: id, - title, - authors: ['Test Author'], - categories: ['Fantasy'], - amazonRating: 4.2, - allMetadataLocked: false, - }, - readStatus: ReadStatus.READING, - fileSizeKb: 1536, - primaryFile: { - id: id * 10, - bookId: id, - bookType: 'EPUB', - fileName: `${title}.epub`, - }, - }; -} - -describe('BookTableRowComponent', () => { - let fixture: ComponentFixture; - let component: BookTableRowComponent; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [BookTableRowComponent, getTranslocoModule()], - providers: [ - provideRouter([]), - { - provide: UrlHelperService, - useValue: { - getBookUrl: (book: Book) => `/book/${book.id}`, - filterBooksBy: (filterKey: string, filterValue: string) => `/all-books?filter=${filterKey}:${filterValue}`, - getThumbnailUrl: () => null, - getAudiobookThumbnailUrl: () => null, - }, - }, - { - provide: ReadStatusHelper, - useValue: { - getReadStatusIcon: () => 'pi pi-book', - getReadStatusClass: () => 'status-reading', - getReadStatusTooltip: () => 'Reading', - shouldShowStatusIcon: () => true, - }, - }, - ], - }); - - fixture = TestBed.createComponent(BookTableRowComponent); - component = fixture.componentInstance; - fixture.componentRef.setInput('rowIndex', 0); - fixture.componentRef.setInput('rowHeight', 46); - fixture.componentRef.setInput('rowStart', 0); - fixture.componentRef.setInput('isSelected', false); - fixture.componentRef.setInput('useSquareCovers', false); - }); - - it('renders visible book fields as table cells', () => { - fixture.componentRef.setInput('book', makeBook(1, 'Alpha')); - fixture.componentRef.setInput('cellIds', ['title', 'authors', 'amazonRating', 'fileSizeKb']); - fixture.detectChanges(); - - const host = fixture.nativeElement as HTMLElement; - const cells = host.querySelectorAll('.book-table-cell'); - const links = host.querySelectorAll('.cell-link'); - const rating = host.querySelector('.rating-wrapper'); - - expect(cells).toHaveLength(4); - expect(links[0]?.textContent?.trim()).toBe('Alpha'); - expect(links[0]?.getAttribute('href')).toBe('/book/1'); - expect(links[1]?.textContent?.trim()).toBe('Test Author'); - expect(rating?.querySelector('app-rating')).toBeTruthy(); - expect(rating?.getAttribute('title')).toBe('4.2'); - expect(cells[3]?.textContent?.trim()).toBe('1.5 MB'); - }); - - it('labels icon actions and cover links for assistive tech', () => { - fixture.componentRef.setInput('book', makeBook(1, 'Alpha')); - fixture.componentRef.setInput('cellIds', ['lock', 'cover', 'readStatus']); - fixture.detectChanges(); - - const host = fixture.nativeElement as HTMLElement; - const lockButton = host.querySelector('.metadata-lock-button'); - const coverLink = host.querySelector('.cover-link'); - const cover = host.querySelector('app-cover'); - - expect(lockButton?.getAttribute('aria-label')).toBe('Unlocked'); - expect(lockButton?.getAttribute('aria-pressed')).toBe('false'); - expect(coverLink?.getAttribute('aria-label')).toBe('Alpha'); - expect(cover?.getAttribute('aria-hidden')).toBe('true'); - }); - - it('formats file sizes with the matching unit', () => { - fixture.componentRef.setInput('cellIds', ['fileSizeKb']); - - fixture.componentRef.setInput('book', {...makeBook(1, 'Alpha'), fileSizeKb: 512}); - fixture.detectChanges(); - expect((fixture.nativeElement as HTMLElement).textContent).toContain('512 KB'); - - fixture.componentRef.setInput('book', {...makeBook(1, 'Alpha'), fileSizeKb: 2 * 1024 * 1024}); - fixture.detectChanges(); - expect((fixture.nativeElement as HTMLElement).textContent).toContain('2.0 GB'); - }); - - it('uses empty metadata for books without metadata instead of treating them as loading', () => { - fixture.componentRef.setInput('book', {...makeBook(1, 'Alpha'), metadata: undefined}); - fixture.componentRef.setInput('cellIds', ['title']); - fixture.detectChanges(); - - expect(component.metadata().bookId).toBe(1); - expect(component.cells()[0]).toEqual(expect.objectContaining({id: 'title', kind: 'clickable', title: ''})); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.ts b/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.ts deleted file mode 100644 index 857a58647..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-table/book-table-row.component.ts +++ /dev/null @@ -1,337 +0,0 @@ -import {ChangeDetectionStrategy, Component, computed, inject, input, output} from '@angular/core'; -import {CdkOverlayOrigin} from '@angular/cdk/overlay'; -import {DatePipe, NgClass} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterLink, UrlTree} from '@angular/router'; -import {TranslocoDirective} from '@jsverse/transloco'; -import {Checkbox} from '@openng/optimus-ui/checkbox'; -import {Tooltip} from '@openng/optimus-ui/tooltip'; -import {Book, BookMetadata} from '../../../model/book.model'; -import {ReadStatusHelper} from '../../../helpers/read-status.helper'; -import {UrlHelperService} from '../../../../../shared/service/url-helper.service'; -import {LanguageResolverService} from '../../../../../shared/service/language-resolver.service'; -import {CoverComponent} from '../../../../../shared/components/cover/cover.component'; -import {AppRatingComponent} from '../../../../../shared/ui/rating/app-rating.component'; -import {RATING_FIELDS, isMetadataFullyLocked} from './book-table.helpers'; - -interface BookTableCellLink { - url: string | UrlTree; - anchor?: string | number | null; -} - -interface BookTableBaseCellView { - id: string; - className: string; -} - -interface BookTableActionCellView extends BookTableBaseCellView { - kind: 'select' | 'lock' | 'cover'; -} - -interface BookTableReadStatusCellView extends BookTableBaseCellView { - kind: 'readStatus'; - label: string; -} - -interface BookTableRatingCellView extends BookTableBaseCellView { - kind: 'rating'; - rating: number | null; - display: string; -} - -interface BookTableClickableCellView extends BookTableBaseCellView { - kind: 'clickable'; - links: BookTableCellLink[]; - title: string | number; -} - -interface BookTableTextCellView extends BookTableBaseCellView { - kind: 'text'; - value: string | number; -} - -type BookTableCellView = - | BookTableActionCellView - | BookTableReadStatusCellView - | BookTableRatingCellView - | BookTableClickableCellView - | BookTableTextCellView; -type BookTableCellKind = BookTableCellView['kind']; - -export interface BookTableRowCoverPreview { - book: Book; - metadata: BookMetadata; - origin: CdkOverlayOrigin; - coverUrl: string | null; - useSquareCover: boolean; -} - -export interface BookTableSelectionChange { - book: Book; - checked: boolean; -} - -const CLICKABLE_FIELDS = new Set(['title', 'authors', 'publisher', 'seriesName', 'categories', 'language']); -const CLICKABLE_FILTER_KEYS: Record = { - authors: 'author', - publisher: 'publisher', - categories: 'category', - language: 'language', -}; - -@Component({ - selector: 'app-book-table-row', - standalone: true, - templateUrl: './book-table-row.component.html', - styleUrls: ['./book-table-row.component.scss'], - imports: [ - CdkOverlayOrigin, - Checkbox, - CoverComponent, - FormsModule, - NgClass, - AppRatingComponent, - RouterLink, - Tooltip, - TranslocoDirective, - ], - providers: [DatePipe], - host: { - role: 'row', - '[attr.aria-rowindex]': 'rowIndex() + 2', - '[attr.aria-selected]': 'isSelected()', - '[class.book-table-row-striped]': 'rowIndex() % 2 === 0', - '[style.height.px]': 'rowHeight()', - '[style.transform]': '"translateY(" + rowStart() + "px)"', - }, - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class BookTableRowComponent { - readonly book = input.required(); - readonly cellIds = input.required(); - readonly rowIndex = input.required(); - readonly rowHeight = input.required(); - readonly rowStart = input.required(); - readonly isSelected = input(false); - readonly isLockPending = input(false); - readonly useSquareCovers = input(false); - - readonly selectionChange = output(); - readonly metadataLockToggleRequested = output(); - readonly coverPreviewShow = output(); - readonly coverPreviewHide = output(); - - private readonly datePipe = inject(DatePipe); - private readonly readStatusHelper = inject(ReadStatusHelper); - private readonly languageResolver = inject(LanguageResolverService); - protected readonly urlHelper = inject(UrlHelperService); - - readonly metadata = computed(() => { - const book = this.book(); - return book.metadata ?? {bookId: book.id}; - }); - readonly useSquareCover = computed(() => this.isAudiobook() || this.useSquareCovers()); - readonly coverUrl = computed(() => { - const book = this.book(); - const metadata = this.metadata(); - return this.useSquareCover() - ? this.urlHelper.getAudiobookThumbnailUrl(book.id, metadata.audiobookCoverUpdatedOn) - : this.urlHelper.getThumbnailUrl(book.id, metadata.coverUpdatedOn); - }); - readonly readStatusClass = computed(() => this.readStatusHelper.getReadStatusClass(this.book().readStatus)); - readonly readStatusIcon = computed(() => this.readStatusHelper.getReadStatusIcon(this.book().readStatus)); - readonly readStatusTooltip = computed(() => this.readStatusHelper.getReadStatusTooltip(this.book().readStatus)); - readonly showReadStatus = computed(() => this.readStatusHelper.shouldShowStatusIcon(this.book().readStatus)); - readonly isMetadataLocked = computed(() => isMetadataFullyLocked(this.metadata())); - readonly cells = computed(() => this.cellIds().map(field => this.createCellView(field))); - - onSelectionChange(checked: boolean): void { - this.selectionChange.emit({book: this.book(), checked}); - } - - showCoverPreview(origin: CdkOverlayOrigin): void { - this.coverPreviewShow.emit({ - book: this.book(), - metadata: this.metadata(), - origin, - coverUrl: this.coverUrl(), - useSquareCover: this.useSquareCover(), - }); - } - - private createCellView(field: string): BookTableCellView { - const metadata = this.metadata(); - const book = this.book(); - const kind = this.getCellKind(field); - const cell = { - id: field, - className: this.getCellClass(field), - }; - - switch (kind) { - case 'select': - case 'lock': - case 'cover': - return {...cell, kind}; - case 'readStatus': - return {...cell, kind, label: this.readStatusHelper.getReadStatusTooltip(book.readStatus)}; - case 'rating': { - const rating = this.getRatingValue(metadata, field); - return {...cell, kind, rating, display: rating === null ? '' : rating.toFixed(1)}; - } - case 'clickable': - return {...cell, kind, links: this.getCellClickableValue(metadata, book, field), title: this.getCellValue(metadata, book, field)}; - case 'text': - return {...cell, kind, value: this.getCellValue(metadata, book, field)}; - } - } - - getCellTitle(cell: BookTableCellView): string | number | null { - switch (cell.kind) { - case 'readStatus': - return cell.label; - case 'clickable': - return cell.title; - case 'text': - return cell.value; - default: - return null; - } - } - - private getCellKind(field: string): BookTableCellKind { - if (field === 'select') return 'select'; - if (field === 'lock') return 'lock'; - if (field === 'cover') return 'cover'; - if (field === 'readStatus') return 'readStatus'; - if (RATING_FIELDS.has(field)) return 'rating'; - if (CLICKABLE_FIELDS.has(field)) return 'clickable'; - return 'text'; - } - - private getCellClass(field: string): string { - if (field === 'select' || field === 'lock') return 'cell-action'; - if (field === 'cover') return 'cell-cover'; - if (field === 'readStatus') return 'cell-status'; - if (RATING_FIELDS.has(field)) return 'cell-rating'; - if (field.endsWith('ReviewCount') || field === 'pageCount' || field === 'seriesNumber') return 'cell-number'; - return 'cell-text'; - } - - private getCellClickableValue(metadata: BookMetadata, book: Book, field: string): BookTableCellLink[] { - let values: string[]; - switch (field) { - case 'title': - return [{ - url: this.urlHelper.getBookUrl(book), - anchor: metadata.title ?? book.fileName - }]; - case 'categories': - values = metadata.categories ?? []; - break; - case 'authors': - values = metadata.authors ?? []; - break; - case 'seriesName': { - const seriesName = metadata.seriesName; - if (!seriesName) return []; - return [{ - url: this.urlHelper.filterBooksBy('series', seriesName), - anchor: seriesName - }]; - } - case 'language': { - const language = metadata.language; - if (!language) return []; - return [{ - url: this.urlHelper.filterBooksBy('language', language), - anchor: this.languageResolver.displayName(language) - }]; - } - default: { - const value = this.getMetadataValue(metadata, field); - values = typeof value === 'string' && value ? [value] : []; - } - } - - return values.map(item => ({ - url: this.urlHelper.filterBooksBy(CLICKABLE_FILTER_KEYS[field] ?? field, item), - anchor: item - })); - } - - private getCellValue(metadata: BookMetadata, book: Book, field: string): string | number { - switch (field) { - case 'title': - return metadata.title ?? ''; - case 'authors': - return this.getAuthorNames(metadata.authors); - case 'publisher': - return metadata.publisher ?? ''; - case 'seriesName': - return metadata.seriesName ?? ''; - case 'seriesNumber': - return metadata.seriesNumber ?? ''; - case 'categories': - return this.getGenres(metadata.categories); - case 'publishedDate': - return metadata.publishedDate ? this.datePipe.transform(metadata.publishedDate, 'dd-MMM-yyyy') ?? '' : ''; - case 'lastReadTime': - return book.lastReadTime ? this.datePipe.transform(book.lastReadTime, 'dd-MMM-yyyy') ?? '' : ''; - 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); - case 'language': - return this.languageResolver.displayName(metadata.language); - case 'pageCount': - return metadata.pageCount ?? ''; - case 'amazonReviewCount': - case 'goodreadsReviewCount': - case 'hardcoverReviewCount': - return metadata[field] ?? ''; - case 'isbn': - return metadata.isbn13 ?? metadata.isbn10 ?? ''; - default: - return ''; - } - } - - private getAuthorNames(authors?: string[] | null): string { - return authors?.join(', ') || ''; - } - - private getGenres(genres?: string[] | null): string { - return genres?.join(', ') || ''; - } - - private formatFileSize(kb?: number): string { - if (kb == null || Number.isNaN(kb)) return '-'; - if (kb < 1024) { - return `${Number.isInteger(kb) ? kb.toFixed(0) : kb.toFixed(1)} KB`; - } - if (kb < 1024 * 1024) { - return `${(kb / 1024).toFixed(1)} MB`; - } - return `${(kb / (1024 * 1024)).toFixed(1)} GB`; - } - - private getRatingValue(metadata: BookMetadata, field: string): number | null { - const rating = this.getMetadataValue(metadata, field); - return typeof rating === 'number' ? rating : null; - } - - private getMetadataValue(metadata: BookMetadata, field: string): unknown { - return this.isKeyOf(metadata, field) ? metadata[field] : undefined; - } - - private isKeyOf(value: T, field: PropertyKey): field is keyof T { - return Object.prototype.hasOwnProperty.call(value, field); - } - - private isAudiobook(): boolean { - return this.book().primaryFile?.bookType === 'AUDIOBOOK'; - } -} diff --git a/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.html b/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.html deleted file mode 100644 index c566b381e..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.html +++ /dev/null @@ -1,107 +0,0 @@ - -
-
- @for (headerGroup of table.getHeaderGroups(); track headerGroup.id) { -
- @for (header of headerGroup.headers; track header.id; let columnIndex = $index) { -
- @if (header.column.id === 'select') { - - } @else { - {{ header.column.columnDef.header }} - } - - @if (header.column.getCanResize()) { - - } -
- } -
- } - -
- @for (virtualRow of rowVirtualizer.getVirtualItems(); track virtualRow.key) { - @if (books()[virtualRow.index]; as book) { - - } @else { -
- @for (columnId of visibleCellIds(); track columnId; let columnIndex = $index) { -
- -
- } -
- } - } -
-
-
- - @if (coverPreview(); as preview) { - -
- -
-
- } -
diff --git a/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.scss b/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.scss deleted file mode 100644 index a68294e15..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.scss +++ /dev/null @@ -1,190 +0,0 @@ -:host { - display: flex; - flex-direction: column; - flex: 1 1 auto; - width: 100%; - min-height: 0; - - --book-table-border-color: var(--p-datatable-border-color, color-mix(in srgb, var(--p-content-border-color) 82%, black)); - --book-table-header-background: var(--p-datatable-header-cell-background, var(--p-content-background)); - --book-table-header-color: var(--p-datatable-header-cell-color, var(--p-text-color)); - --book-table-header-padding: var(--p-datatable-header-cell-padding, 0.6563rem 0.875rem); - --book-table-header-weight: var(--p-datatable-column-title-font-weight, 600); - --book-table-row-background: var(--p-datatable-row-background, var(--p-content-background)); - --book-table-row-color: var(--p-datatable-row-color, var(--p-text-color)); - --book-table-row-hover-background: var(--p-datatable-row-hover-background, var(--p-content-hover-background)); - --book-table-row-hover-color: var(--p-datatable-row-hover-color, var(--p-text-color)); - --book-table-row-striped-background: var(--p-datatable-row-striped-background, var(--color-app)); - --book-table-cell-border-color: var(--p-datatable-body-cell-border-color, var(--book-table-border-color)); - --book-table-cell-padding: var(--p-datatable-body-cell-padding, 0.6563rem 0.875rem); - --book-table-rating-gap: var(--p-rating-gap, 0.2188rem); - --book-table-lock-unlocked-color: var(--color-lock-unlocked, var(--color-green-600)); - --book-table-lock-locked-color: var(--color-lock-locked, var(--color-red-600)); - --book-table-status-read-color: var(--color-green-500); - --book-table-status-reading-color: var(--color-blue-500); - --book-table-status-re-reading-color: var(--color-cyan-500); - --book-table-status-partially-read-color: var(--color-amber-500); - --book-table-status-paused-color: var(--color-yellow-500); - --book-table-status-abandoned-color: var(--color-red-500); - --book-table-status-wont-read-color: var(--color-pink-500); -} - -.book-table-scroll { - box-sizing: border-box; - flex: 1 1 auto; - min-height: 0; - overflow: auto; - background: var(--book-table-row-background); -} - -.book-table { - min-width: 100%; - position: relative; -} - -.book-table-header-row, -.book-table-row { - box-sizing: border-box; - display: grid; - grid-template-columns: var(--book-table-grid-template); - min-width: 100%; -} - -.book-table-header-row { - position: sticky; - top: 0; - z-index: 20; - min-height: 46px; - background: var(--book-table-header-background); - border-bottom: 1px solid var(--book-table-border-color); -} - -.book-table-header-cell, -.book-table-cell { - box-sizing: border-box; - height: inherit; - min-width: 0; - border-right: 1px solid var(--book-table-cell-border-color); -} - -.book-table-header-cell { - position: relative; - display: flex; - align-items: center; - padding: var(--book-table-header-padding); - color: var(--book-table-header-color); - font-weight: normal; - text-align: start; - white-space: nowrap; - - .p-datatable-column-title { - overflow: hidden; - font-weight: var(--book-table-header-weight); - text-overflow: ellipsis; - } -} - -.column-resizer { - position: absolute; - top: 0; - right: -3px; - width: 6px; - height: 100%; - padding: 0; - border: 0; - background: transparent; - cursor: col-resize; - touch-action: none; -} - -.book-table-body { - position: relative; -} - -.book-table-row { - position: absolute; - left: 0; - right: 0; - border-bottom: 1px solid var(--book-table-cell-border-color); - background: var(--book-table-row-background); - color: var(--book-table-row-color); -} - -.book-table-row-striped { - background: var(--book-table-row-striped-background); -} - -.book-table-cell { - display: flex; - align-items: center; - padding: var(--book-table-cell-padding); - overflow: hidden; - color: inherit; - line-height: 1.2; - text-align: start; -} - -.book-table-checkbox { - display: inline-flex; - line-height: 0; - vertical-align: top; -} - -.cover-preview { - width: 12.25rem; - max-height: calc(100dvh - 1.75rem); - border-radius: 6px; - box-shadow: - 0 18px 48px rgb(0 0 0 / 42%), - 0 4px 14px rgb(0 0 0 / 32%); - overflow: hidden; -} - -.cover-preview-image { - width: 100%; - max-height: calc(100dvh - 5.25rem); - aspect-ratio: 5 / 7; - border-radius: inherit; - - &.square-cover { - aspect-ratio: 1 / 1; - } -} - -.cell-action, -.cell-cover { - justify-content: center; - padding-inline: 0.4375rem; -} - -.cell-cover { - overflow: visible; -} - -.book-table-row-loading { - pointer-events: none; -} - -.loading-line { - display: block; - width: 85%; - height: 0.6563rem; - border-radius: 999px; - background: color-mix(in srgb, var(--p-text-color) 14%, transparent); - animation: loading-line-pulse 1.5s ease-in-out infinite; -} - -.loading-line-short { - width: 48%; -} - -@keyframes loading-line-pulse { - 0%, 100% { opacity: 0.3; } - 50% { opacity: 0.6; } -} - -@media (prefers-reduced-motion: reduce) { - .loading-line { - animation: none; - } -} diff --git a/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.spec.ts b/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.spec.ts deleted file mode 100644 index 4f0bc36b7..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.spec.ts +++ /dev/null @@ -1,292 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {By} from '@angular/platform-browser'; -import {provideRouter} from '@angular/router'; -import {of, Subject} from 'rxjs'; -import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest'; -import {MessageService} from '@openng/optimus-ui/api'; - -import {getTranslocoModule} from '../../../../../core/testing/transloco-testing'; -import {UrlHelperService} from '../../../../../shared/service/url-helper.service'; -import {Book, BookMetadata, ReadStatus} from '../../../model/book.model'; -import {BookMetadataManageService} from '../../../service/book-metadata-manage.service'; -import {ReadStatusHelper} from '../../../helpers/read-status.helper'; -import {BookSelectionService} from '../book-selection.service'; -import {BookTableComponent} from './book-table.component'; -import {BookTableRowComponent} from './book-table-row.component'; - -function makeBook(id: number, title: string): Book & {metadata: BookMetadata} { - return { - id, - libraryId: 1, - libraryName: 'Library', - metadata: { - bookId: id, - title, - authors: ['Test Author'], - categories: ['Fantasy'], - amazonRating: 4.2, - allMetadataLocked: false, - }, - readStatus: ReadStatus.READING, - primaryFile: { - id: id * 10, - bookId: id, - bookType: 'EPUB', - fileName: `${title}.epub`, - }, - }; -} - -describe('BookTableComponent', () => { - let fixture: ComponentFixture; - let component: BookTableComponent; - let bookSelectionService: BookSelectionService; - let bookMetadataManageService: { toggleAllLock: ReturnType }; - - beforeEach(() => { - bookMetadataManageService = { - toggleAllLock: vi.fn(() => of(null)), - }; - - TestBed.configureTestingModule({ - imports: [BookTableComponent, getTranslocoModule()], - providers: [ - provideRouter([]), - {provide: MessageService, useValue: {add: vi.fn()}}, - { - provide: UrlHelperService, - useValue: { - getBookUrl: (book: Book) => `/book/${book.id}`, - filterBooksBy: (filterKey: string, filterValue: string) => `/all-books?filter=${filterKey}:${filterValue}`, - getThumbnailUrl: () => null, - getAudiobookThumbnailUrl: () => null, - }, - }, - { - provide: BookMetadataManageService, - useValue: bookMetadataManageService, - }, - { - provide: ReadStatusHelper, - useValue: { - getReadStatusIcon: () => 'pi pi-book', - getReadStatusClass: () => 'status-reading', - getReadStatusTooltip: () => 'Reading', - shouldShowStatusIcon: () => true, - }, - }, - ], - }); - - fixture = TestBed.createComponent(BookTableComponent); - component = fixture.componentInstance; - bookSelectionService = TestBed.inject(BookSelectionService); - }); - - afterEach(() => { - TestBed.resetTestingModule(); - }); - - it('renders grid semantics and keeps resize handles out of the tab order', () => { - fixture = TestBed.createComponent(BookTableComponent); - fixture.componentRef.setInput('books', [makeBook(1, 'Alpha')]); - fixture.componentRef.setInput('visibleColumns', [ - {field: 'title', header: 'Title'}, - {field: 'amazonRating', header: 'Amazon Rating'}, - ]); - - fixture.detectChanges(); - - const host = fixture.nativeElement as HTMLElement; - const grid = host.querySelector('.book-table-scroll'); - const headerCells = host.querySelectorAll('.book-table-header-cell'); - const resizer = host.querySelector('.column-resizer'); - - expect(grid?.getAttribute('role')).toBe('grid'); - expect(grid?.getAttribute('aria-rowcount')).toBe('2'); - expect(grid?.getAttribute('aria-colcount')).toBe('5'); - expect(headerCells[0]?.getAttribute('role')).toBe('columnheader'); - expect(headerCells[0]?.getAttribute('aria-colindex')).toBe('1'); - expect(resizer?.tagName).toBe('SPAN'); - expect(resizer?.getAttribute('aria-hidden')).toBe('true'); - expect(resizer?.hasAttribute('tabindex')).toBe(false); - }); - - it('does not recreate a rendered row when selection changes', () => { - const book = makeBook(1, 'Alpha'); - vi.spyOn(component.rowVirtualizer, 'getVirtualItems').mockReturnValue([ - {index: 0, key: 1, start: 0, size: 46, end: 46, lane: 0} - ]); - fixture.componentRef.setInput('books', [book]); - fixture.componentRef.setInput('visibleColumns', [ - {field: 'title', header: 'Title'}, - {field: 'amazonRating', header: 'Amazon Rating'}, - ]); - fixture.detectChanges(); - - const initialRowDebugElement = fixture.debugElement.query(By.directive(BookTableRowComponent)); - const initialRowInstance = initialRowDebugElement.componentInstance as BookTableRowComponent; - const selectionSpy = vi.spyOn(bookSelectionService, 'handleBookSelection'); - const initialRowElement = initialRowDebugElement.nativeElement as HTMLElement; - const checkboxInput = initialRowElement.querySelector('input[type="checkbox"]'); - - expect(checkboxInput).toBeTruthy(); - checkboxInput!.click(); - fixture.detectChanges(); - - const updatedRowDebugElement = fixture.debugElement.query(By.directive(BookTableRowComponent)); - const updatedRowInstance = updatedRowDebugElement.componentInstance as BookTableRowComponent; - expect(updatedRowDebugElement.nativeElement).toBe(initialRowDebugElement.nativeElement); - expect(updatedRowInstance).toBe(initialRowInstance); - expect(selectionSpy).toHaveBeenCalledWith(book, true); - expect(updatedRowInstance.isSelected()).toBe(true); - expect(bookSelectionService.isBookSelected(book)).toBe(true); - expect(component.isRowSelected(book)).toBe(true); - }); - - it('does not request the next page again after a same-size book refresh', () => { - const loadNextPageSpy = vi.fn(); - const books = Array.from({length: 50}, (_, index) => makeBook(index + 1, `Book ${index + 1}`)); - vi.spyOn(component.rowVirtualizer, 'getVirtualItems').mockReturnValue([ - {index: 49, key: 50, start: 2254, size: 46, end: 2300, lane: 0} - ]); - component.loadNextPage.subscribe(loadNextPageSpy); - - fixture.componentRef.setInput('books', books); - fixture.componentRef.setInput('virtualRowCount', 100); - fixture.componentRef.setInput('isFetchingNextPage', false); - fixture.detectChanges(); - - expect(loadNextPageSpy).toHaveBeenCalledTimes(1); - - fixture.componentRef.setInput('books', books.map(book => ({ - ...book, - metadata: {...book.metadata}, - }))); - fixture.detectChanges(); - - expect(loadNextPageSpy).toHaveBeenCalledTimes(1); - }); - - it('can request the next page again after the parent signals a query swap', () => { - const loadNextPageSpy = vi.fn(); - const books = Array.from({length: 50}, (_, index) => makeBook(index + 1, `Book ${index + 1}`)); - const nextBooks = Array.from({length: 50}, (_, index) => makeBook(index + 101, `Next Book ${index + 1}`)); - vi.spyOn(component.rowVirtualizer, 'getVirtualItems').mockReturnValue([ - {index: 49, key: 50, start: 2254, size: 46, end: 2300, lane: 0} - ]); - component.loadNextPage.subscribe(loadNextPageSpy); - - const initialQueryToken = {query: 'first'}; - fixture.componentRef.setInput('books', books); - fixture.componentRef.setInput('virtualRowCount', 51); - fixture.componentRef.setInput('isFetchingNextPage', false); - fixture.componentRef.setInput('bookQueryToken', initialQueryToken); - fixture.detectChanges(); - - expect(loadNextPageSpy).toHaveBeenCalledTimes(1); - - fixture.componentRef.setInput('books', nextBooks); - fixture.componentRef.setInput('bookQueryToken', {query: 'second'}); - fixture.detectChanges(); - - expect(loadNextPageSpy).toHaveBeenCalledTimes(2); - }); - - it('re-arms pagination after a next-page request completes without new rows', () => { - const loadNextPageSpy = vi.fn(); - const books = Array.from({length: 50}, (_, index) => makeBook(index + 1, `Book ${index + 1}`)); - vi.spyOn(component.rowVirtualizer, 'getVirtualItems').mockReturnValue([ - {index: 49, key: 50, start: 2254, size: 46, end: 2300, lane: 0} - ]); - component.loadNextPage.subscribe(loadNextPageSpy); - - fixture.componentRef.setInput('books', books); - fixture.componentRef.setInput('virtualRowCount', 51); - fixture.componentRef.setInput('isFetchingNextPage', false); - fixture.detectChanges(); - - expect(loadNextPageSpy).toHaveBeenCalledTimes(1); - - fixture.componentRef.setInput('isFetchingNextPage', true); - fixture.detectChanges(); - fixture.componentRef.setInput('isFetchingNextPage', false); - fixture.detectChanges(); - - expect(loadNextPageSpy).toHaveBeenCalledTimes(1); - - fixture.componentRef.setInput('virtualRowCount', 52); - fixture.detectChanges(); - - expect(loadNextPageSpy).toHaveBeenCalledTimes(2); - }); - - it('can request the next page again when loaded books grow but rendered rows do not', () => { - const loadNextPageSpy = vi.fn(); - const books = Array.from({length: 50}, (_, index) => makeBook(index + 1, `Book ${index + 1}`)); - vi.spyOn(component.rowVirtualizer, 'getVirtualItems').mockReturnValue([ - {index: 49, key: 50, start: 2254, size: 46, end: 2300, lane: 0} - ]); - component.loadNextPage.subscribe(loadNextPageSpy); - - fixture.componentRef.setInput('books', books); - fixture.componentRef.setInput('virtualRowCount', 51); - fixture.componentRef.setInput('loadedBookCount', 50); - fixture.componentRef.setInput('isFetchingNextPage', false); - fixture.detectChanges(); - - expect(loadNextPageSpy).toHaveBeenCalledTimes(1); - - fixture.componentRef.setInput('isFetchingNextPage', true); - fixture.detectChanges(); - fixture.componentRef.setInput('loadedBookCount', 60); - fixture.componentRef.setInput('isFetchingNextPage', false); - fixture.detectChanges(); - - expect(loadNextPageSpy).toHaveBeenCalledTimes(2); - }); - - it('requests metadata lock without mutating the input book', () => { - const book = makeBook(1, 'Alpha'); - vi.spyOn(component.rowVirtualizer, 'getVirtualItems').mockReturnValue([ - {index: 0, key: 1, start: 0, size: 46, end: 46, lane: 0} - ]); - fixture.componentRef.setInput('books', [book]); - fixture.componentRef.setInput('visibleColumns', [{field: 'title', header: 'Title'}]); - fixture.detectChanges(); - - component.toggleMetadataLock(book.metadata); - fixture.detectChanges(); - - expect(book.metadata?.allMetadataLocked).toBe(false); - expect(bookMetadataManageService.toggleAllLock).toHaveBeenCalledWith(new Set([1]), 'LOCK'); - }); - - it('disables a row lock button while that book lock request is in flight', () => { - const lockRequest = new Subject(); - bookMetadataManageService.toggleAllLock.mockReturnValue(lockRequest.asObservable()); - const book = makeBook(1, 'Alpha'); - vi.spyOn(component.rowVirtualizer, 'getVirtualItems').mockReturnValue([ - {index: 0, key: 1, start: 0, size: 46, end: 46, lane: 0} - ]); - fixture.componentRef.setInput('books', [book]); - fixture.componentRef.setInput('visibleColumns', [{field: 'title', header: 'Title'}]); - fixture.detectChanges(); - - component.toggleMetadataLock(book.metadata); - fixture.detectChanges(); - - const host = fixture.nativeElement as HTMLElement; - const button = host.querySelector('.metadata-lock-button'); - expect(button?.disabled).toBe(true); - - component.toggleMetadataLock(book.metadata); - expect(bookMetadataManageService.toggleAllLock).toHaveBeenCalledTimes(1); - - lockRequest.next(); - lockRequest.complete(); - fixture.detectChanges(); - - expect(button?.disabled).toBe(false); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.ts b/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.ts deleted file mode 100644 index d6c5991b8..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-table/book-table.component.ts +++ /dev/null @@ -1,325 +0,0 @@ -import {ChangeDetectionStrategy, Component, DestroyRef, ElementRef, computed, effect, inject, input, output, signal, viewChild} from '@angular/core'; -import {takeUntilDestroyed} from '@angular/core/rxjs-interop'; -import {CdkConnectedOverlay, ConnectedPosition} from '@angular/cdk/overlay'; -import {FormsModule} from '@angular/forms'; -import {ActivatedRoute} from '@angular/router'; -import {TranslocoDirective, TranslocoService} from '@jsverse/transloco'; -import {finalize} from 'rxjs'; -import {ColumnDef, ColumnSizingState, Header, columnResizingFeature, columnSizingFeature, functionalUpdate, injectTable, tableFeatures} from '@tanstack/angular-table'; -import {injectVirtualizer} from '@tanstack/angular-virtual'; -import {Checkbox} from '@openng/optimus-ui/checkbox'; -import {Book, BookMetadata} from '../../../model/book.model'; -import {RouteScrollPositionService} from '../../../../../shared/service/route-scroll-position.service'; -import {CoverComponent} from '../../../../../shared/components/cover/cover.component'; -import {BookMetadataManageService} from '../../../service/book-metadata-manage.service'; -import {MessageService} from '@openng/optimus-ui/api'; -import {BookSelectionService} from '../book-selection.service'; -import {BookTableRowComponent, type BookTableRowCoverPreview, type BookTableSelectionChange} from './book-table-row.component'; -import {RATING_FIELDS, isMetadataFullyLocked} from './book-table.helpers'; - -interface BookTableColumn { - field: string; - header: string; -} - -const ROW_HEIGHT = 46; -const RENDER_OVERSCAN_ROWS = 16; -const RESIZE_OVERSCAN_ROWS = 2; -const PAGE_LOAD_AHEAD_ROWS = 40; -const DEFAULT_COLUMN_SIZES: Record = { - readStatus: 72, - title: 260, - fileName: 240, - authors: 220, - categories: 220, - pageCount: 120, - seriesNumber: 120, -}; -const DEFAULT_RATING_COLUMN_SIZE = 148; -const DEFAULT_REVIEW_COUNT_COLUMN_SIZE = 120; -const DEFAULT_TEXT_COLUMN_SIZE = 180; -const MIN_COLUMN_SIZES: Record = { - readStatus: 64, - pageCount: 96, - seriesNumber: 96, -}; -const DEFAULT_MIN_COLUMN_SIZE = 120; -const MAX_COLUMN_SIZES: Record = { - title: 420, - fileName: 420, - authors: 360, - categories: 360, -}; -const DEFAULT_MAX_COLUMN_SIZE = 280; -const features = tableFeatures({columnSizingFeature, columnResizingFeature}); -const COVER_OVERLAY_POSITIONS: ConnectedPosition[] = [ - {originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: 8}, - {originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -8}, - {originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: 8}, - {originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom', offsetX: 8}, -]; - -@Component({ - selector: 'app-book-table', - standalone: true, - templateUrl: './book-table.component.html', - imports: [ - CdkConnectedOverlay, - BookTableRowComponent, - Checkbox, - FormsModule, - TranslocoDirective, - CoverComponent - ], - styleUrls: ['./book-table.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, -}) -export class BookTableComponent { - readonly selectAllRequested = output(); - readonly loadNextPage = output(); - - readonly books = input([]); - readonly visibleColumns = input([]); - readonly virtualRowCount = input(0); - readonly loadedBookCount = input(null); - readonly isFetchingNextPage = input(false); - readonly useSquareCovers = input(false); - readonly bookQueryToken = input(undefined); - - private readonly activatedRoute = inject(ActivatedRoute); - private readonly scrollService = inject(RouteScrollPositionService); - protected readonly bookSelectionService = inject(BookSelectionService); - private readonly bookMetadataManageService = inject(BookMetadataManageService); - private readonly messageService = inject(MessageService); - private readonly t = inject(TranslocoService); - private readonly destroyRef = inject(DestroyRef); - private readonly scrollElement = viewChild>('scrollElement'); - private readonly initialScrollOffset = () => this.scrollService.getPosition(this.scrollService.keyFor(this.activatedRoute, 'table')) ?? 0; - - private readonly columnSizing = signal({}); - protected readonly coverPreview = signal(null); - private readonly pendingLockBookIds = signal>(new Set()); - - protected readonly coverOverlayPositions = COVER_OVERLAY_POSITIONS; - - private readonly columnDefs = computed[]>(() => [ - {id: 'select', header: '', size: 42, minSize: 42, maxSize: 42, enableResizing: false}, - {id: 'lock', header: '', size: 42, minSize: 42, maxSize: 42, enableResizing: false}, - {id: 'cover', header: '', size: 56, minSize: 56, maxSize: 56, enableResizing: false}, - ...this.visibleColumns().map(column => ({ - id: column.field, - header: column.header, - size: this.defaultColumnSize(column.field), - minSize: this.minColumnSize(column.field), - maxSize: this.maxColumnSize(column.field), - })), - ]); - - readonly table = injectTable(() => ({ - features, - data: this.books(), - columns: this.columnDefs(), - getRowId: book => String(book.id), - columnResizeMode: 'onChange', - state: { - columnSizing: this.columnSizing(), - }, - onColumnSizingChange: updater => { - this.columnSizing.update(current => functionalUpdate(updater, current)); - }, - })); - - readonly visibleCellIds = computed(() => ['select', 'lock', 'cover', ...this.visibleColumns().map(column => column.field)]); - readonly ariaRowCount = computed(() => this.rowCount() + 1); - readonly ariaColumnCount = computed(() => this.visibleCellIds().length); - readonly isColumnResizing = computed(() => Boolean(this.table.atoms.columnResizing.get().isResizingColumn)); - readonly rowCount = computed(() => Math.max(this.virtualRowCount(), this.books().length)); - readonly columnSizeVars = computed>(() => { - this.columnSizing(); - this.visibleColumns(); - - const headers = this.table.getFlatHeaders(); - const styles = headers.reduce>((columnStyles, header) => { - columnStyles[`--book-table-col-${header.column.id}-size`] = header.column.getSize(); - return columnStyles; - }, {}); - - styles['--book-table-grid-template'] = this.table.getAllFlatColumns() - .map(column => `calc(var(--book-table-col-${column.id}-size) * 1px)`) - .join(' '); - - return styles; - }); - readonly tableWidth = computed(() => { - this.columnSizing(); - this.visibleColumns(); - return this.table.getAllFlatColumns().reduce((width, column) => width + column.getSize(), 0); - }); - readonly allLoadedBooksSelected = computed(() => { - const books = this.books(); - return books.length > 0 && books.every(book => this.bookSelectionService.isBookSelected(book)); - }); - readonly someBooksSelected = computed(() => { - return this.bookSelectionService.selectedCount() > 0 && !this.allLoadedBooksSelected(); - }); - - readonly rowVirtualizer = injectVirtualizer(() => ({ - scrollElement: this.scrollElement(), - count: this.rowCount(), - estimateSize: () => ROW_HEIGHT, - overscan: this.isColumnResizing() ? RESIZE_OVERSCAN_ROWS : RENDER_OVERSCAN_ROWS, - initialOffset: this.initialScrollOffset, - getItemKey: index => this.books()[index]?.id ?? `loading-${index}`, - })); - - constructor() { - this.scrollService.trackRoute({ - scrollElement: this.scrollElement, - route: this.activatedRoute, - destroyRef: this.destroyRef, - keySuffix: 'table', - dismissOverlaysBeforeSave: true, - beforeSave: () => this.clearCoverPreview(), - }); - } - - private readonly measureRowsEffect = effect(() => { - this.rowCount(); - this.visibleColumns(); - queueMicrotask(() => this.rowVirtualizer.measure()); - }); - - private lastLoadRequestLoadedBookCount: number | undefined; - private lastSeenQueryToken: unknown; - private readonly paginatorEffect = effect(() => { - const queryToken = this.bookQueryToken(); - if (queryToken !== this.lastSeenQueryToken) { - this.lastLoadRequestLoadedBookCount = undefined; - this.lastSeenQueryToken = queryToken; - } - - const items = this.books(); - const loadedBookCount = this.loadedBookCount() ?? items.length; - const lastVirtualItem = this.rowVirtualizer.getVirtualItems().at(-1); - if (!lastVirtualItem || items.length === 0) return; - if (lastVirtualItem.index < items.length - PAGE_LOAD_AHEAD_ROWS) return; - if (items.length >= this.virtualRowCount() || this.isFetchingNextPage()) return; - if (this.lastLoadRequestLoadedBookCount === loadedBookCount) { - this.lastLoadRequestLoadedBookCount = undefined; - return; - } - - this.lastLoadRequestLoadedBookCount = loadedBookCount; - this.loadNextPage.emit(); - }); - - private defaultColumnSize(field: string): number { - const defaultSize = DEFAULT_COLUMN_SIZES[field]; - if (defaultSize !== undefined) return defaultSize; - if (RATING_FIELDS.has(field)) return DEFAULT_RATING_COLUMN_SIZE; - if (field.endsWith('ReviewCount')) return DEFAULT_REVIEW_COUNT_COLUMN_SIZE; - return DEFAULT_TEXT_COLUMN_SIZE; - } - - private minColumnSize(field: string): number { - return MIN_COLUMN_SIZES[field] ?? DEFAULT_MIN_COLUMN_SIZE; - } - - private maxColumnSize(field: string): number { - return MAX_COLUMN_SIZES[field] ?? DEFAULT_MAX_COLUMN_SIZE; - } - - isRowSelected(book: Book): boolean { - return this.bookSelectionService.isBookSelected(book); - } - - startColumnResize(header: Header, event: MouseEvent | TouchEvent): void { - event.stopPropagation(); - if (event.cancelable) { - event.preventDefault(); - } - header.getResizeHandler()(event); - } - - scrollToTop(): void { - const scrollElement = this.scrollElement()?.nativeElement; - if (scrollElement) { - scrollElement.scrollTop = 0; - } - this.rowVirtualizer.scrollToOffset(0); - } - - onHeaderCheckboxChange(checked: boolean): void { - if (checked) { - this.selectAllRequested.emit(); - return; - } - - this.bookSelectionService.deselectAll(); - } - - onBookSelectionChange(change: BookTableSelectionChange): void { - this.bookSelectionService.handleBookSelection(change.book, change.checked); - } - - showCoverPreview(preview: BookTableRowCoverPreview): void { - this.coverPreview.set(preview); - } - - clearCoverPreview(): void { - this.coverPreview.set(null); - } - - hideCoverPreview(bookId: number): void { - if (this.coverPreview()?.book.id === bookId) { - this.clearCoverPreview(); - } - } - - isMetadataLockPending(bookId: number): boolean { - return this.pendingLockBookIds().has(bookId); - } - - toggleMetadataLock(metadata: BookMetadata): void { - if (this.isMetadataLockPending(metadata.bookId)) return; - - const lockAction = isMetadataFullyLocked(metadata) ? 'UNLOCK' : 'LOCK'; - this.setMetadataLockPending(metadata.bookId, true); - - this.bookMetadataManageService.toggleAllLock(new Set([metadata.bookId]), lockAction) - .pipe( - finalize(() => this.setMetadataLockPending(metadata.bookId, false)), - takeUntilDestroyed(this.destroyRef) - ) - .subscribe({ - next: () => { - this.messageService.add({ - severity: 'success', - summary: lockAction === 'LOCK' ? this.t.translate('book.table.toast.metadataLockedSummary') : this.t.translate('book.table.toast.metadataUnlockedSummary'), - detail: lockAction === 'LOCK' ? this.t.translate('book.table.toast.metadataLockedDetail') : this.t.translate('book.table.toast.metadataUnlockedDetail'), - }); - }, - error: () => { - this.messageService.add({ - severity: 'error', - summary: lockAction === 'LOCK' ? this.t.translate('book.table.toast.lockFailedSummary') : this.t.translate('book.table.toast.unlockFailedSummary'), - detail: lockAction === 'LOCK' ? this.t.translate('book.table.toast.lockFailedDetail') : this.t.translate('book.table.toast.unlockFailedDetail'), - }); - } - }); - } - - private setMetadataLockPending(bookId: number, pending: boolean): void { - this.pendingLockBookIds.update(current => { - if (current.has(bookId) === pending) return current; - - const next = new Set(current); - if (pending) { - next.add(bookId); - } else { - next.delete(bookId); - } - return next; - }); - } -} diff --git a/frontend/src/app/features/book/components/book-browser/book-table/book-table.helpers.spec.ts b/frontend/src/app/features/book/components/book-browser/book-table/book-table.helpers.spec.ts deleted file mode 100644 index 16b35660d..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-table/book-table.helpers.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {describe, expect, it} from 'vitest'; - -import {BookMetadata} from '../../../model/book.model'; -import {LOCK_FIELDS, isMetadataFullyLocked} from './book-table.helpers'; - -describe('book-table helpers', () => { - it('uses the explicit allMetadataLocked value when present', () => { - expect(isMetadataFullyLocked({bookId: 1, allMetadataLocked: true})).toBe(true); - expect(isMetadataFullyLocked({bookId: 1, allMetadataLocked: false, titleLocked: true})).toBe(false); - }); - - it('does not infer a full lock from partial metadata', () => { - expect(isMetadataFullyLocked({bookId: 1, titleLocked: true, authorsLocked: true})).toBe(false); - }); - - it('requires every metadata lock field to be true when the explicit flag is absent', () => { - const metadata = { - bookId: 1, - ...Object.fromEntries(LOCK_FIELDS.map(field => [field, true])), - } satisfies BookMetadata; - - expect(isMetadataFullyLocked(metadata)).toBe(true); - expect(isMetadataFullyLocked({...metadata, titleLocked: false})).toBe(false); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/book-table/book-table.helpers.ts b/frontend/src/app/features/book/components/book-browser/book-table/book-table.helpers.ts deleted file mode 100644 index b94f5f01a..000000000 --- a/frontend/src/app/features/book/components/book-browser/book-table/book-table.helpers.ts +++ /dev/null @@ -1,69 +0,0 @@ -import {BookMetadata} from '../../../model/book.model'; - -const RATING_FIELD_KEYS = [ - 'rating', - 'amazonRating', - 'goodreadsRating', - 'hardcoverRating', - 'ranobedbRating', - 'lubimyczytacRating', - 'audibleRating', -] satisfies readonly (keyof BookMetadata)[]; - -export const RATING_FIELDS = new Set(RATING_FIELD_KEYS); - -export const LOCK_FIELDS = [ - 'titleLocked', - 'subtitleLocked', - 'publisherLocked', - 'publishedDateLocked', - 'descriptionLocked', - 'seriesNameLocked', - 'seriesNumberLocked', - 'seriesTotalLocked', - 'isbn13Locked', - 'isbn10Locked', - 'openlibraryIdLocked', - 'asinLocked', - 'comicvineIdLocked', - 'goodreadsIdLocked', - 'hardcoverIdLocked', - 'hardcoverBookIdLocked', - 'googleIdLocked', - 'pageCountLocked', - 'languageLocked', - 'amazonRatingLocked', - 'amazonReviewCountLocked', - 'goodreadsRatingLocked', - 'goodreadsReviewCountLocked', - 'hardcoverRatingLocked', - 'hardcoverReviewCountLocked', - 'lubimyczytacIdLocked', - 'lubimyczytacRatingLocked', - 'ranobedbIdLocked', - 'ranobedbRatingLocked', - 'audibleIdLocked', - 'audibleRatingLocked', - 'audibleReviewCountLocked', - 'applebooksIdLocked', - 'applebooksRatingLocked', - 'applebooksReviewCountLocked', - 'authorsLocked', - 'categoriesLocked', - 'moodsLocked', - 'tagsLocked', - 'coverLocked', - 'audiobookCoverLocked', - 'reviewsLocked', - 'narratorLocked', - 'abridgedLocked', - 'ageRatingLocked', - 'contentRatingLocked', -] satisfies readonly (keyof BookMetadata)[]; - -export function isMetadataFullyLocked(metadata: BookMetadata): boolean { - if (typeof metadata.allMetadataLocked === 'boolean') { - return metadata.allMetadataLocked; - } - return LOCK_FIELDS.every(field => metadata[field] === true); -} diff --git a/frontend/src/app/features/book/components/book-browser/deferred-render-state.ts b/frontend/src/app/features/book/components/book-browser/deferred-render-state.ts deleted file mode 100644 index 9a89ccf6f..000000000 --- a/frontend/src/app/features/book/components/book-browser/deferred-render-state.ts +++ /dev/null @@ -1,46 +0,0 @@ -import {computed, signal, untracked} from '@angular/core'; - -export type DeferredRenderMode = 'reset' | 'refresh'; - -export class DeferredRenderState { - private readonly _value = signal(undefined); - readonly value = this._value.asReadonly(); - - private readonly _isRefreshing = signal(false); - readonly isRefreshing = this._isRefreshing.asReadonly(); - - readonly hasValue = computed(() => this._value() !== undefined); - - private activeRequestId = 0; - - begin(mode: DeferredRenderMode): number { - this.activeRequestId += 1; - - if (mode === 'reset') { - this._value.set(undefined); - this._isRefreshing.set(false); - } else { - this._isRefreshing.set(untracked(() => this._value() !== undefined)); - } - - return this.activeRequestId; - } - - commit(requestId: number, value: T): boolean { - if (requestId !== this.activeRequestId) { - return false; - } - - this._value.set(value); - this._isRefreshing.set(false); - return true; - } - - cancel(requestId: number): void { - if (requestId !== this.activeRequestId) { - return; - } - - this._isRefreshing.set(false); - } -} diff --git a/frontend/src/app/features/book/components/book-browser/filter-label.helper.spec.ts b/frontend/src/app/features/book/components/book-browser/filter-label.helper.spec.ts deleted file mode 100644 index ccbf3726b..000000000 --- a/frontend/src/app/features/book/components/book-browser/filter-label.helper.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import {describe, expect, it} from 'vitest'; - -import {FilterLabelHelper} from './filter-label.helper'; - -describe('FilterLabelHelper', () => { - it('returns friendly names for known filter types and capitalizes unknown names', () => { - expect(FilterLabelHelper.getFilterTypeName('personalRating')).toBe('Personal Rating'); - expect(FilterLabelHelper.getFilterTypeName('customFilter')).toBe('CustomFilter'); - }); - - it('maps numeric ids to configured range labels', () => { - expect(FilterLabelHelper.getFilterDisplayValue('fileSize', 1)).toBe('1–10 MB'); - expect(FilterLabelHelper.getFilterDisplayValue('pageCount', 3)).toBe('200–400 pages'); - expect(FilterLabelHelper.getFilterDisplayValue('matchScore', 0)).toBe('Outstanding (95–100%)'); - expect(FilterLabelHelper.getFilterDisplayValue('personalRating', 7)).toBe('7'); - expect(FilterLabelHelper.getFilterDisplayValue('amazonRating', 5)).toBe('4.5+'); - }); - - it('falls back to the raw value when a numeric id is not recognized', () => { - expect(FilterLabelHelper.getFilterDisplayValue('fileSize', 999)).toBe('999'); - expect(FilterLabelHelper.getFilterDisplayValue('tag', 'favorite')).toBe('favorite'); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/filter-label.helper.ts b/frontend/src/app/features/book/components/book-browser/filter-label.helper.ts deleted file mode 100644 index 198e54035..000000000 --- a/frontend/src/app/features/book/components/book-browser/filter-label.helper.ts +++ /dev/null @@ -1,79 +0,0 @@ -import {fileSizeRanges, matchScoreRanges, pageCountRanges, ratingOptions10, ratingRanges} from './book-filter/book-filter.config'; - -export class FilterLabelHelper { - private static readonly FILTER_TYPE_MAP: Record = { - author: 'Author', - category: 'Genre', - series: 'Series', - publisher: 'Publisher', - readStatus: 'Read Status', - personalRating: 'Personal Rating', - publishedDate: 'Year Published', - matchScore: 'Metadata Match Score', - language: 'Language', - bookType: 'Book Type', - shelfStatus: 'Shelf Status', - fileSize: 'File Size', - pageCount: 'Page Count', - amazonRating: 'Amazon Rating', - goodreadsRating: 'Goodreads Rating', - hardcoverRating: 'Hardcover Rating', - lubimyczytacRating: 'Lubimyczytac Rating', - ranobedbRating: 'RanobeDB Rating', - audibleRating: 'Audible Rating', - mood: 'Mood', - tag: 'Tag', - }; - - static getFilterTypeName(filterType: string): string { - return this.FILTER_TYPE_MAP[filterType] || this.capitalize(filterType); - } - - static getFilterDisplayValue(filterType: string, value: string | number): string { - const numericValue = typeof value === 'string' ? Number(value) : value; - - switch (filterType.toLowerCase()) { - case 'filesize': { - const fileSizeRange = fileSizeRanges.find(r => r.id === numericValue); - if (fileSizeRange) return fileSizeRange.label; - return String(value); - } - - case 'pagecount': { - const pageCountRange = pageCountRanges.find(r => r.id === numericValue); - if (pageCountRange) return pageCountRange.label; - return String(value); - } - - case 'matchscore': { - const matchScoreRange = matchScoreRanges.find(r => r.id === numericValue); - if (matchScoreRange) return matchScoreRange.label; - return String(value); - } - - case 'personalrating': { - const personalRating = ratingOptions10.find(r => r.id === numericValue); - if (personalRating) return personalRating.label; - return String(value); - } - - case 'amazonrating': - case 'goodreadsrating': - case 'hardcoverrating': - case 'lubimyczytacrating': - case 'ranobedbrating': - case 'audiblerating': { - const ratingRange = ratingRanges.find(r => r.id === numericValue); - if (ratingRange) return ratingRange.label; - return String(value); - } - - default: - return String(value); - } - } - - private static capitalize(str: string): string { - return str.charAt(0).toUpperCase() + str.slice(1); - } -} diff --git a/frontend/src/app/features/book/components/book-browser/filters/HeaderFilter.spec.ts b/frontend/src/app/features/book/components/book-browser/filters/HeaderFilter.spec.ts deleted file mode 100644 index 0c1a8e3aa..000000000 --- a/frontend/src/app/features/book/components/book-browser/filters/HeaderFilter.spec.ts +++ /dev/null @@ -1,72 +0,0 @@ -import {describe, expect, it} from 'vitest'; - -import {Book} from '../../../model/book.model'; -import {filterBooksBySearchTerm, normalizeSearchTerm} from './HeaderFilter'; - -function makeBook(id: number, overrides: Partial = {}): Book { - return { - id, - libraryId: 1, - libraryName: 'Library', - fileName: `Book ${id}.epub`, - metadata: { - bookId: id, - title: `Title ${id}`, - seriesName: `Series ${id}`, - authors: [`Author ${id}`], - categories: [`Category ${id}`], - isbn10: `ISBN10-${id}`, - isbn13: `ISBN13-${id}` - }, - primaryFile: {id, bookId: id, fileName: `Book ${id}.epub`, bookType: 'EPUB'}, - ...overrides - }; -} - -describe('HeaderFilter', () => { - it('normalizes unicode, punctuation, whitespace, and empty input', () => { - expect(normalizeSearchTerm('')).toBe(''); - expect(normalizeSearchTerm(' Ætna øresund! ')).toBe('aetna oresund'); - expect(normalizeSearchTerm('Łódź / Straße')).toBe('lodz strasse'); - }); - - it('keeps the full book list for short terms and filters by searchable fields', () => { - const books = [ - makeBook(1), - makeBook(2, { - metadata: { - bookId: 2, - title: 'The Other Title', - seriesName: 'Other Series', - authors: ['Different Author'], - categories: ['Biography'], - isbn10: '999', - isbn13: '888' - }, - primaryFile: {id: 2, bookId: 2, fileName: 'Notes.txt', bookType: 'EPUB'} - }), - makeBook(3, { - metadata: { - bookId: 3, - title: 'Completely Different', - seriesName: 'Third Series', - authors: ['Series Match'], - categories: ['History'], - isbn10: '111', - isbn13: '222' - }, - primaryFile: {id: 3, bookId: 3, fileName: 'Search Target.epub', bookType: 'EPUB'} - }) - ]; - - expect(filterBooksBySearchTerm(books, '')).toBe(books); - expect(filterBooksBySearchTerm(books, 'a')).toBe(books); - - expect(filterBooksBySearchTerm(books, 'other title').map(book => book.id)).toEqual([2]); - expect(filterBooksBySearchTerm(books, 'other series').map(book => book.id)).toEqual([2]); - expect(filterBooksBySearchTerm(books, 'series match').map(book => book.id)).toEqual([3]); - expect(filterBooksBySearchTerm(books, 'biography').map(book => book.id)).toEqual([2]); - expect(filterBooksBySearchTerm(books, '222').map(book => book.id)).toEqual([3]); - expect(filterBooksBySearchTerm(books, 'search target').map(book => book.id)).toEqual([3]); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/filters/HeaderFilter.ts b/frontend/src/app/features/book/components/book-browser/filters/HeaderFilter.ts deleted file mode 100644 index 95e282221..000000000 --- a/frontend/src/app/features/book/components/book-browser/filters/HeaderFilter.ts +++ /dev/null @@ -1,42 +0,0 @@ -import {Book} from '../../../model/book.model'; - -export function normalizeSearchTerm(str: string): string { - if (!str) return ''; - // Normalize Unicode combining characters (e.g., é -> e) - let s = str.normalize('NFD').replace(/[\u0300-\u036f]/g, ''); - s = s.replace(/ø/gi, 'o') - .replace(/ł/gi, 'l') - .replace(/æ/gi, 'ae') - .replace(/œ/gi, 'oe') - .replace(/ß/g, 'ss'); - s = s.replace(/[!@$%^&*_=|~`<>?/";']/g, ''); - s = s.replace(/\s+/g, ' ').trim(); - return s.toLowerCase(); -} - -export function filterBooksBySearchTerm(books: Book[], term: string): Book[] { - const normalizedTerm = normalizeSearchTerm(term || '').trim(); - if (normalizedTerm.length < 2) { - return books; - } - - return books.filter(book => { - const title = book.metadata?.title || ''; - const series = book.metadata?.seriesName || ''; - const authors = book.metadata?.authors || []; - const categories = book.metadata?.categories || []; - const isbn = book.metadata?.isbn10 || ''; - const isbn13 = book.metadata?.isbn13 || ''; - const fileName = book.primaryFile?.fileName || ''; - - const matchesTitle = normalizeSearchTerm(title).includes(normalizedTerm); - const matchesSeries = normalizeSearchTerm(series).includes(normalizedTerm); - const matchesAuthor = authors.some(author => normalizeSearchTerm(author).includes(normalizedTerm)); - const matchesCategory = categories.some(category => normalizeSearchTerm(category).includes(normalizedTerm)); - const matchesIsbn = normalizeSearchTerm(isbn).includes(normalizedTerm) || normalizeSearchTerm(isbn13).includes(normalizedTerm); - const matchesFileName = normalizeSearchTerm(fileName).includes(normalizedTerm); - - return matchesTitle || matchesSeries || matchesAuthor || matchesCategory || matchesIsbn || matchesFileName; - }); -} - diff --git a/frontend/src/app/features/book/components/book-browser/filters/SeriesCollapseFilter.spec.ts b/frontend/src/app/features/book/components/book-browser/filters/SeriesCollapseFilter.spec.ts deleted file mode 100644 index ba7ce70ad..000000000 --- a/frontend/src/app/features/book/components/book-browser/filters/SeriesCollapseFilter.spec.ts +++ /dev/null @@ -1,148 +0,0 @@ -import {TestBed} from '@angular/core/testing'; -import {beforeEach, describe, expect, it, vi} from 'vitest'; -import {MessageService} from '@openng/optimus-ui/api'; - -import {SeriesCollapseFilter} from './SeriesCollapseFilter'; -import {UserService} from '../../../../settings/user-management/user.service'; -import {Book} from '../../../model/book.model'; - -function makeBook(id: number, seriesName?: string, seriesNumber?: number): Book { - return { - id, - libraryId: 1, - libraryName: 'Library', - metadata: { - bookId: id, - title: `Book ${id}`, - seriesName, - seriesNumber - } - }; -} - -describe('SeriesCollapseFilter', () => { - let userService: {currentUser: ReturnType; getCurrentUser: ReturnType; updateUserSetting: ReturnType}; - let messageService: {add: ReturnType}; - let service: SeriesCollapseFilter; - - beforeEach(() => { - vi.useFakeTimers(); - userService = { - currentUser: vi.fn(() => ({id: 1})), - getCurrentUser: vi.fn(() => null), - updateUserSetting: vi.fn() - }; - messageService = {add: vi.fn()}; - - TestBed.configureTestingModule({ - providers: [ - SeriesCollapseFilter, - {provide: UserService, useValue: userService}, - {provide: MessageService, useValue: messageService} - ] - }); - - service = TestBed.inject(SeriesCollapseFilter); - }); - - it('returns books unchanged when collapse is disabled or series expansion is forced', () => { - const books = [makeBook(1), makeBook(2, 'Series', 2)]; - - expect(service.collapseBooks(books, false, false)).toBe(books); - expect(service.collapseBooks([], false, true)).toEqual([]); - expect(service.collapseBooks(books, true, true)).toBe(books); - }); - - it('collapses series into grouped books with the lowest numbered entry first', () => { - const books = [ - makeBook(1, 'Series', 2), - makeBook(2, 'Series', 1), - makeBook(3), - makeBook(4, 'Other Series', 5) - ]; - - const collapsed = service.collapseBooks(books, false, true); - - expect(collapsed).toEqual([ - makeBook(3), - { - ...makeBook(2, 'Series', 1), - seriesBooks: [books[0], books[1]], - seriesCount: 2 - }, - { - ...makeBook(4, 'Other Series', 5), - seriesBooks: [books[3]], - seriesCount: 1 - } - ]); - }); - - it('persists context-aware and global preferences with legacy fallbacks', () => { - const user = { - id: 1, - userSettings: { - entityViewPreferences: { - global: { - sortKey: 'addedOn', - sortDir: 'DESC', - view: 'GRID', - coverSize: 1, - seriesCollapse: true - }, - overrides: [ - { - entityType: 'LIBRARY', - entityId: 99, - preferences: { - sortKey: 'title', - sortDir: 'ASC', - view: 'TABLE', - coverSize: 1, - seriesCollapsed: false, - overlayBookType: true - } - } - ] - } - } - }; - - userService.getCurrentUser.mockReturnValue(user); - - service.setContext('LIBRARY', 99); - expect(service.seriesCollapsed()).toBe(false); - - service.setCollapsed(true); - vi.advanceTimersByTime(500); - - expect(userService.updateUserSetting).toHaveBeenCalledWith(1, 'entityViewPreferences', expect.objectContaining({ - overrides: expect.arrayContaining([ - expect.objectContaining({ - entityType: 'LIBRARY', - entityId: 99, - preferences: expect.objectContaining({ - seriesCollapsed: true - }) - }) - ]) - })); - expect(messageService.add).toHaveBeenCalledWith(expect.objectContaining({ - severity: 'success', - summary: 'Preference Saved' - })); - - userService.updateUserSetting.mockClear(); - messageService.add.mockClear(); - - service.setContext(null, null); - service.setCollapsed(false); - vi.advanceTimersByTime(500); - - expect(userService.updateUserSetting).toHaveBeenCalledWith(1, 'entityViewPreferences', expect.objectContaining({ - global: expect.objectContaining({ - seriesCollapsed: false - }) - })); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/filters/SeriesCollapseFilter.ts b/frontend/src/app/features/book/components/book-browser/filters/SeriesCollapseFilter.ts deleted file mode 100644 index ea772ef4b..000000000 --- a/frontend/src/app/features/book/components/book-browser/filters/SeriesCollapseFilter.ts +++ /dev/null @@ -1,169 +0,0 @@ -import {effect, inject, Injectable, signal} from '@angular/core'; -import {Book} from '../../../model/book.model'; -import {MessageService} from '@openng/optimus-ui/api'; -import {UserService} from '../../../../settings/user-management/user.service'; - -@Injectable({providedIn: 'root'}) -export class SeriesCollapseFilter { - private static readonly PERSIST_DELAY_MS = 500; - - private readonly userService = inject(UserService); - private readonly messageService = inject(MessageService); - - private readonly _seriesCollapsed = signal(false); - readonly seriesCollapsed = this._seriesCollapsed.asReadonly(); - private currentContext: { type: 'LIBRARY' | 'SHELF' | 'MAGIC_SHELF', id: number } | null = null; - private persistTimeout: ReturnType | null = null; - - constructor() { - effect(() => { - const user = this.userService.currentUser(); - if (user) { - this.applyPreference(); - } - }); - } - - setContext(type: 'LIBRARY' | 'SHELF' | 'MAGIC_SHELF' | null, id: number | null): void { - if (type && id) { - this.currentContext = {type, id}; - } else { - this.currentContext = null; - } - this.applyPreference(); - } - - setCollapsed(value: boolean): void { - this._seriesCollapsed.set(value); - this.schedulePersist(value); - } - - private applyPreference(): void { - const user = this.userService.getCurrentUser(); - const prefs = user?.userSettings?.entityViewPreferences; - - let collapsed = false; - - if (prefs) { - // Backward compatibility: check for old 'seriesCollapse' field - const legacyGlobalSeriesCollapse = (prefs.global as { seriesCollapse?: boolean }).seriesCollapse; - collapsed = prefs.global?.seriesCollapsed ?? legacyGlobalSeriesCollapse ?? false; - - if (this.currentContext) { - const override = prefs.overrides?.find(o => - o.entityType === this.currentContext?.type && o.entityId === this.currentContext?.id - ); - if (override) { - const legacyOverrideSeriesCollapse = (override.preferences as { seriesCollapse?: boolean }).seriesCollapse; - if (override.preferences.seriesCollapsed !== undefined) { - collapsed = override.preferences.seriesCollapsed; - } else if (legacyOverrideSeriesCollapse !== undefined) { - collapsed = legacyOverrideSeriesCollapse; - } - } - } - } - - if (this._seriesCollapsed() !== collapsed) { - this._seriesCollapsed.set(collapsed); - } - } - - collapseBooks(books: Book[], forceExpandSeries?: boolean, isSeriesCollapsed: boolean = this.seriesCollapsed()): Book[] { - const shouldCollapse = forceExpandSeries ? false : isSeriesCollapsed; - if (!shouldCollapse || books.length === 0) return books; - - const sourceBooks = [...books]; - const seriesMap = new Map(); - const collapsedBooks: Book[] = []; - - for (const book of sourceBooks) { - const seriesName = book.metadata?.seriesName?.trim(); - if (seriesName) { - if (!seriesMap.has(seriesName)) { - seriesMap.set(seriesName, []); - } - seriesMap.get(seriesName)!.push(book); - } else { - collapsedBooks.push(book); - } - } - - for (const group of seriesMap.values()) { - const sortedGroup = group.slice().sort((a, b) => { - const aNum = a.metadata?.seriesNumber ?? Number.MAX_VALUE; - const bNum = b.metadata?.seriesNumber ?? Number.MAX_VALUE; - return aNum - bNum; - }); - const firstBook = sortedGroup[0]; - collapsedBooks.push({ - ...firstBook, - seriesBooks: group, - seriesCount: group.length - }); - } - - return collapsedBooks; - } - - private schedulePersist(isCollapsed: boolean): void { - if (this.persistTimeout) { - clearTimeout(this.persistTimeout); - } - - this.persistTimeout = setTimeout(() => { - this.persistCollapsePreference(isCollapsed); - }, SeriesCollapseFilter.PERSIST_DELAY_MS); - } - - private persistCollapsePreference(isCollapsed: boolean): void { - const user = this.userService.getCurrentUser(); - if (!user) return; - - const prefs = structuredClone(user.userSettings.entityViewPreferences ?? { - global: { - sortKey: 'addedOn', - sortDir: 'DESC', - view: 'GRID', - coverSize: 1.0, - seriesCollapsed: false - }, - overrides: [] - }); - - if (!prefs.overrides) { - prefs.overrides = []; - } - - if (this.currentContext) { - let override = prefs.overrides.find(o => - o.entityType === this.currentContext?.type && o.entityId === this.currentContext?.id - ); - - if (!override) { - override = { - entityType: this.currentContext.type, - entityId: this.currentContext.id, - preferences: { - ...prefs.global, - seriesCollapsed: isCollapsed - } - }; - prefs.overrides.push(override); - } else { - override.preferences.seriesCollapsed = isCollapsed; - } - } else { - prefs.global.seriesCollapsed = isCollapsed; - } - - this.userService.updateUserSetting(user.id, 'entityViewPreferences', prefs); - - this.messageService.add({ - severity: 'success', - summary: 'Preference Saved', - detail: `Series collapse set to ${isCollapsed ? 'enabled' : 'disabled'}${this.currentContext ? ' for this view' : ' globally'}.`, - life: 1500 - }); - } -} diff --git a/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter-toggle-pref.service.spec.ts b/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter-toggle-pref.service.spec.ts deleted file mode 100644 index 3e7223dba..000000000 --- a/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter-toggle-pref.service.spec.ts +++ /dev/null @@ -1,98 +0,0 @@ -import {TestBed} from '@angular/core/testing'; -import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest'; - -import {TranslocoService} from '@jsverse/transloco'; -import {MessageService} from '@openng/optimus-ui/api'; - -import {LocalStorageService} from '../../../../../shared/service/local-storage.service'; -import {SidebarFilterTogglePrefService} from './sidebar-filter-toggle-pref.service'; - -describe('SidebarFilterTogglePrefService', () => { - let originalInnerWidth: number; - let messageService: {add: ReturnType}; - let localStorageService: { - get: ReturnType; - set: ReturnType; - }; - - const setViewport = (width: number) => { - Object.defineProperty(window, 'innerWidth', { - configurable: true, - value: width, - }); - }; - - beforeEach(() => { - originalInnerWidth = window.innerWidth; - messageService = {add: vi.fn()}; - localStorageService = { - get: vi.fn(() => null), - set: vi.fn(), - }; - }); - - afterEach(() => { - setViewport(originalInnerWidth); - TestBed.resetTestingModule(); - }); - - const createService = () => { - TestBed.configureTestingModule({ - providers: [ - SidebarFilterTogglePrefService, - {provide: MessageService, useValue: messageService}, - {provide: LocalStorageService, useValue: localStorageService}, - {provide: TranslocoService, useValue: {translate: (key: string) => key}}, - ], - }); - - return TestBed.inject(SidebarFilterTogglePrefService); - }; - - it('loads the stored preference on wide screens', () => { - setViewport(1280); - localStorageService.get.mockReturnValue(false); - - const service = createService(); - - expect(service.showFilter()).toBe(false); - expect(localStorageService.get).toHaveBeenCalledWith('showSidebarFilter'); - }); - - it('forces the filter closed on narrow screens', () => { - setViewport(640); - - const service = createService(); - - expect(service.showFilter()).toBe(false); - expect(localStorageService.get).not.toHaveBeenCalled(); - }); - - it('toggles the visibility and persists the updated value', () => { - setViewport(1280); - const service = createService(); - - service.toggle(); - - expect(service.showFilter()).toBe(false); - expect(localStorageService.set).toHaveBeenCalledWith('showSidebarFilter', false); - }); - - it('shows an error toast when persistence fails', () => { - setViewport(1280); - localStorageService.set.mockImplementation(() => { - throw new Error('storage failed'); - }); - const service = createService(); - - service.setShowFilter(false); - - expect(messageService.add).toHaveBeenCalledWith( - expect.objectContaining({ - severity: 'error', - summary: 'book.filterPref.toast.saveFailedSummary', - detail: 'book.filterPref.toast.saveFailedDetail', - }) - ); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter-toggle-pref.service.ts b/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter-toggle-pref.service.ts deleted file mode 100644 index 285a28cf9..000000000 --- a/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter-toggle-pref.service.ts +++ /dev/null @@ -1,58 +0,0 @@ -import {inject, Injectable, signal} from '@angular/core'; -import {MessageService} from '@openng/optimus-ui/api'; -import {TranslocoService} from '@jsverse/transloco'; -import {LocalStorageService} from '../../../../../shared/service/local-storage.service'; - -@Injectable({ - providedIn: 'root' -}) -export class SidebarFilterTogglePrefService { - - private readonly STORAGE_KEY = 'showSidebarFilter'; - private readonly messageService = inject(MessageService); - private readonly t = inject(TranslocoService); - private readonly localStorageService = inject(LocalStorageService); - - private readonly _showFilter = signal(true); - readonly showFilter = this._showFilter.asReadonly(); - - constructor() { - const isNarrow = window.innerWidth <= 768; - this._showFilter.set(!isNarrow); - this.loadFromStorage(); - } - - toggle(): void { - this.setShowFilter(!this.showFilter()); - } - - setShowFilter(value: boolean): void { - if (this._showFilter() !== value) { - this._showFilter.set(value); - this.savePreference(value); - } - } - - private savePreference(value: boolean): void { - try { - this.localStorageService.set(this.STORAGE_KEY, value); - } catch { - this.messageService.add({ - severity: 'error', - summary: this.t.translate('book.filterPref.toast.saveFailedSummary'), - detail: this.t.translate('book.filterPref.toast.saveFailedDetail'), - life: 3000 - }); - } - } - - private loadFromStorage(): void { - const isNarrow = window.innerWidth <= 768; - if (isNarrow) { - this._showFilter.set(false); - } else { - const saved = this.localStorageService.get(this.STORAGE_KEY); - this._showFilter.set(saved !== null ? saved : true); - } - } -} diff --git a/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter.spec.ts b/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter.spec.ts deleted file mode 100644 index 9b9f69e20..000000000 --- a/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter.spec.ts +++ /dev/null @@ -1,151 +0,0 @@ -import {describe, expect, it} from 'vitest'; - -import {Book, ReadStatus} from '../../../model/book.model'; -import { - doesBookMatchFilter, - doesBookMatchReadStatus, - filterBooksByFilters, - isAgeRatingInRange, - isFileSizeInRange, - isMatchScoreInRange, - isPageCountInRange, - isRatingInRange, - isRatingInRange10 -} from './sidebar-filter'; - -function makeBook(id: number, overrides: Partial = {}): Book { - return { - id, - libraryId: 1, - libraryName: 'Library', - readStatus: ReadStatus.UNREAD, - fileSizeKb: 1500, - metadataMatchScore: 87, - metadata: { - bookId: id, - title: `Title ${id}`, - authors: [`Author ${id}`], - categories: [`Category ${id}`], - seriesName: `Series ${id}`, - publisher: 'Publisher', - publishedDate: '2024-02-01', - pageCount: 230, - language: 'en', - tags: ['tag-a'], - moods: ['mood-a'], - amazonRating: 4.3, - goodreadsRating: 4.1, - hardcoverRating: 4.2, - narrator: 'Narrator', - ageRating: 16, - contentRating: 'PG-13', - comicMetadata: { - characters: ['hero'], - teams: ['team-a'], - locations: ['earth'], - pencillers: ['Penciller'], - inkers: ['Inker'], - colorists: ['Colorist'], - letterers: ['Letterer'], - coverArtists: ['Cover'], - editors: ['Editor'] - } - }, - shelves: [{id: 7, name: 'Favorites'}], - ...overrides - }; -} - -describe('sidebar-filter', () => { - it('covers the numeric helper ranges and read status matching', () => { - expect(isRatingInRange(null, 1)).toBe(false); - expect(isRatingInRange(4.3, '4')).toBe(true); - expect(isRatingInRange10(4.4, 4)).toBe(true); - expect(isFileSizeInRange(undefined, 1)).toBe(false); - expect(isFileSizeInRange(1500, 1)).toBe(true); - expect(isPageCountInRange(230, '3')).toBe(true); - expect(isAgeRatingInRange(16, 16)).toBe(true); - expect(isAgeRatingInRange(12, 10)).toBe(true); - expect(isMatchScoreInRange(87, 2)).toBe(true); - expect(isMatchScoreInRange(87, 9)).toBe(false); - expect(doesBookMatchReadStatus(makeBook(1), [ReadStatus.UNREAD])).toBe(true); - expect(doesBookMatchReadStatus(makeBook(1, {readStatus: undefined}), [ReadStatus.UNSET])).toBe(true); - }); - - it('matches all filter branches across or, and, and not modes', () => { - const book = makeBook(1); - const books = [book, makeBook(2, { - readStatus: ReadStatus.READING, - metadata: { - bookId: 2, - title: 'Other', - authors: ['Other Author'], - categories: ['Other Category'], - seriesName: 'Other Series', - publisher: 'Other Publisher', - publishedDate: '2021-01-01', - pageCount: 50, - language: 'fr', - tags: ['other-tag'], - moods: ['other-mood'], - amazonRating: 3.1, - goodreadsRating: 3.2, - hardcoverRating: 3.3, - narrator: 'Someone Else', - ageRating: 12, - contentRating: 'R', - comicMetadata: { - characters: ['villain'], - teams: ['team-b'], - locations: ['mars'], - pencillers: ['Alt Penciller'], - inkers: ['Alt Inker'], - colorists: ['Alt Colorist'], - letterers: ['Alt Letterer'], - coverArtists: ['Alt Cover'], - editors: ['Alt Editor'] - } - }, - shelves: [] - })]; - - expect(doesBookMatchFilter(book, 'author', ['Author 1'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'category', ['Category 1'], 'and')).toBe(true); - expect(doesBookMatchFilter(book, 'series', ['Series 1'], 'not')).toBe(true); - expect(doesBookMatchFilter(book, 'bookType', ['PHYSICAL'], 'or')).toBe(false); - expect(doesBookMatchFilter(book, 'readStatus', [ReadStatus.UNREAD], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'publisher', ['Publisher'], 'and')).toBe(true); - expect(doesBookMatchFilter(book, 'matchScore', [2], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'library', [1], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'shelf', [7], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'shelfStatus', ['shelved'], 'or')).toBe(true); - expect(doesBookMatchFilter(makeBook(3, {shelves: []}), 'shelfStatus', ['unshelved'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'tag', ['tag-a'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'publishedDate', ['2024'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'fileSize', [1], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'amazonRating', [4], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'goodreadsRating', [4], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'hardcoverRating', [4], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'language', ['en'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'pageCount', [3], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'mood', ['mood-a'], 'and')).toBe(true); - expect(doesBookMatchFilter(book, 'ageRating', ['16'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'contentRating', ['PG-13'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'narrator', ['Narrator'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'comicCharacter', ['hero'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'comicTeam', ['team-a'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'comicLocation', ['earth'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'comicCreator', ['Penciller:penciller'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'unknown', ['x'], 'or')).toBe(false); - - expect(doesBookMatchFilter(makeBook(4, {isPhysical: true}), 'bookType', ['PHYSICAL'], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'author', [], 'or')).toBe(true); - expect(doesBookMatchFilter(book, 'author', [], 'and')).toBe(false); - - expect(filterBooksByFilters(books, null, 'or')).toBe(books); - expect(filterBooksByFilters(books, {author: ['Author 1']}, 'or')).toEqual([book]); - expect(filterBooksByFilters(books, {author: ['Other Author']}, 'not')).toEqual([book]); - expect(filterBooksByFilters(books, {author: ['Author 1'], category: ['Category 1']}, 'and')).toEqual([book]); - expect(filterBooksByFilters(books, {author: ['Other Author'], category: ['Category 1']}, 'or', 'author')).toEqual([book]); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter.ts b/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter.ts deleted file mode 100644 index c29faf7e7..000000000 --- a/frontend/src/app/features/book/components/book-browser/filters/sidebar-filter.ts +++ /dev/null @@ -1,232 +0,0 @@ -import {ageRatingRanges, fileSizeRanges, matchScoreRanges, pageCountRanges, ratingRanges} from '../book-filter/book-filter.config'; -import {Book, ReadStatus} from '../../../model/book.model'; -import {BookFilterMode} from '../../../../settings/user-management/user.service'; - -export function isRatingInRange(rating: number | undefined | null, rangeId: string | number): boolean { - if (rating == null) return false; - const numericId = typeof rangeId === 'string' ? Number(rangeId) : rangeId; - const range = ratingRanges.find(r => r.id === numericId); - if (!range) return false; - return rating >= range.min && rating < range.max; -} - -export function isRatingInRange10(rating: number | undefined | null, rangeId: string | number): boolean { - if (rating == null) return false; - const numericId = typeof rangeId === 'string' ? Number(rangeId) : rangeId; - return Math.round(rating) === numericId; -} - -export function isFileSizeInRange(fileSizeKb: number | undefined, rangeId: string | number): boolean { - if (fileSizeKb == null) return false; - const numericId = typeof rangeId === 'string' ? Number(rangeId) : rangeId; - const range = fileSizeRanges.find(r => r.id === numericId); - if (!range) return false; - return fileSizeKb >= range.min && fileSizeKb < range.max; -} - -export function isPageCountInRange(pageCount: number | undefined, rangeId: string | number): boolean { - if (pageCount == null) return false; - const numericId = typeof rangeId === 'string' ? Number(rangeId) : rangeId; - const range = pageCountRanges.find(r => r.id === numericId); - if (!range) return false; - return pageCount >= range.min && pageCount < range.max; -} - -export function isMatchScoreInRange(score: number | undefined | null, rangeId: string | number): boolean { - if (score == null) return false; - const normalizedScore = score > 1 ? score / 100 : score; - const numericId = typeof rangeId === 'string' ? Number(rangeId) : rangeId; - const range = matchScoreRanges.find(r => r.id === numericId); - if (!range) return false; - return normalizedScore >= range.min && normalizedScore < range.max; -} - -export function isAgeRatingInRange(ageRating: number | undefined | null, rangeId: string | number): boolean { - if (ageRating == null) return false; - const numericId = typeof rangeId === 'string' ? Number(rangeId) : rangeId; - const range = ageRatingRanges.find(r => r.id === numericId); - if (!range) return false; - return ageRating >= range.min && ageRating < range.max; -} - -export function doesBookMatchReadStatus(book: Book, selected: unknown[]): boolean { - const status = book.readStatus ?? ReadStatus.UNSET; - return selected.includes(status); -} - -export function doesBookMatchFilter( - book: Book, - filterType: string, - filterValues: unknown[], - mode: BookFilterMode -): boolean { - if (!Array.isArray(filterValues) || filterValues.length === 0) { - return mode === 'or'; - } - - const effectiveMode = mode === 'not' ? 'or' : mode; - - switch (filterType) { - case 'author': - return effectiveMode === 'or' - ? filterValues.some(val => book.metadata?.authors?.includes(val as string)) - : filterValues.every(val => book.metadata?.authors?.includes(val as string)); - case 'category': - return effectiveMode === 'or' - ? filterValues.some(val => book.metadata?.categories?.includes(val as string)) - : filterValues.every(val => book.metadata?.categories?.includes(val as string)); - case 'series': - return effectiveMode === 'or' - ? filterValues.some(val => book.metadata?.seriesName?.trim() === val) - : filterValues.every(val => book.metadata?.seriesName?.trim() === val); - case 'bookType': - return book.isPhysical ? filterValues.includes('PHYSICAL') : filterValues.includes(book.primaryFile?.bookType); - case 'readStatus': - return doesBookMatchReadStatus(book, filterValues); - case 'personalRating': - return filterValues.some(range => isRatingInRange10(book.personalRating, range as string | number)); - case 'publisher': - return effectiveMode === 'or' - ? filterValues.some(val => book.metadata?.publisher === val) - : filterValues.every(val => book.metadata?.publisher === val); - case 'matchScore': - return filterValues.some(range => isMatchScoreInRange(book.metadataMatchScore, range as string | number)); - case 'library': - return effectiveMode === 'or' - ? filterValues.some(val => val == book.libraryId) - : filterValues.every(val => val == book.libraryId); - case 'shelf': - return effectiveMode === 'or' - ? filterValues.some(val => book.shelves?.some(s => s.id == val)) - : filterValues.every(val => book.shelves?.some(s => s.id == val)); - case 'shelfStatus': { - const shelved = book.shelves && book.shelves.length > 0 ? 'shelved' : 'unshelved'; - return filterValues.includes(shelved); - } - case 'tag': - return effectiveMode === 'or' - ? filterValues.some(val => book.metadata?.tags?.includes(val as string)) - : filterValues.every(val => book.metadata?.tags?.includes(val as string)); - case 'publishedDate': { - const bookYear = book.metadata?.publishedDate - ? new Date(book.metadata.publishedDate).getFullYear() - : null; - return bookYear ? filterValues.some(val => val == bookYear || val == bookYear.toString()) : false; - } - case 'fileSize': - return filterValues.some(range => isFileSizeInRange(book.fileSizeKb, range as string | number)); - case 'amazonRating': - return filterValues.some(range => isRatingInRange(book.metadata?.amazonRating, range as string | number)); - case 'goodreadsRating': - return filterValues.some(range => isRatingInRange(book.metadata?.goodreadsRating, range as string | number)); - case 'hardcoverRating': - return filterValues.some(range => isRatingInRange(book.metadata?.hardcoverRating, range as string | number)); - case 'lubimyczytacRating': - return filterValues.some(range => isRatingInRange(book.metadata?.lubimyczytacRating, range as string | number)); - case 'ranobedbRating': - return filterValues.some(range => isRatingInRange(book.metadata?.ranobedbRating, range as string | number)); - case 'audibleRating': - return filterValues.some(range => isRatingInRange(book.metadata?.audibleRating, range as string | number)); - case 'language': - return filterValues.includes(book.metadata?.language); - case 'pageCount': - return filterValues.some(range => isPageCountInRange(book.metadata?.pageCount ?? undefined, range as string | number)); - case 'mood': - return effectiveMode === 'or' - ? filterValues.some(val => book.metadata?.moods?.includes(val as string)) - : filterValues.every(val => book.metadata?.moods?.includes(val as string)); - case 'ageRating': - return filterValues.some(range => isAgeRatingInRange(book.metadata?.ageRating, range as string | number)); - case 'contentRating': - return filterValues.includes(book.metadata?.contentRating); - case 'narrator': - return filterValues.includes(book.metadata?.narrator); - case 'comicCharacter': - return effectiveMode === 'or' - ? filterValues.some(val => book.metadata?.comicMetadata?.characters?.includes(val as string)) - : filterValues.every(val => book.metadata?.comicMetadata?.characters?.includes(val as string)); - case 'comicTeam': - return effectiveMode === 'or' - ? filterValues.some(val => book.metadata?.comicMetadata?.teams?.includes(val as string)) - : filterValues.every(val => book.metadata?.comicMetadata?.teams?.includes(val as string)); - case 'comicLocation': - return effectiveMode === 'or' - ? filterValues.some(val => book.metadata?.comicMetadata?.locations?.includes(val as string)) - : filterValues.every(val => book.metadata?.comicMetadata?.locations?.includes(val as string)); - case 'comicCreator': { - const comic = book.metadata?.comicMetadata; - if (!comic) return false; - const allCreators: string[] = []; - const roles: [string[] | undefined, string][] = [ - [comic.pencillers, 'penciller'], - [comic.inkers, 'inker'], - [comic.colorists, 'colorist'], - [comic.letterers, 'letterer'], - [comic.coverArtists, 'coverArtist'], - [comic.editors, 'editor'] - ]; - for (const [names, role] of roles) { - if (names) { - for (const name of names) { - allCreators.push(`${name}:${role}`); - } - } - } - return effectiveMode === 'or' - ? filterValues.some(val => allCreators.includes(val as string)) - : filterValues.every(val => allCreators.includes(val as string)); - } - default: - return false; - } -} - -export function filterBooksByFilters( - books: Book[], - activeFilters: Record | null, - mode: BookFilterMode, - excludeFilterType?: string -): Book[] { - if (!activeFilters) return books; - - const filterEntries = Object.entries(activeFilters) - .filter(([type]) => type !== excludeFilterType); - - if (filterEntries.length === 0) return books; - - return books.filter(book => matchesAllFilters(book, filterEntries, mode)); -} - -function matchesAllFilters( - book: Book, - filterEntries: [string, unknown[]][], - mode: BookFilterMode -): boolean { - if (mode === 'or') { - for (const [filterType, filterValues] of filterEntries) { - if (doesBookMatchFilter(book, filterType, filterValues, mode)) { - return true; - } - } - - return false; - } - - if (mode === 'not') { - for (const [filterType, filterValues] of filterEntries) { - if (doesBookMatchFilter(book, filterType, filterValues, mode)) { - return false; - } - } - - return true; - } - - for (const [filterType, filterValues] of filterEntries) { - if (!doesBookMatchFilter(book, filterType, filterValues, mode)) { - return false; - } - } - - return true; -} diff --git a/frontend/src/app/features/book/components/book-browser/sorting/BookSorter.spec.ts b/frontend/src/app/features/book/components/book-browser/sorting/BookSorter.spec.ts deleted file mode 100644 index e4b3d3015..000000000 --- a/frontend/src/app/features/book/components/book-browser/sorting/BookSorter.spec.ts +++ /dev/null @@ -1,89 +0,0 @@ -import {describe, expect, it, vi} from 'vitest'; - -import {TranslocoService} from '@jsverse/transloco'; -import {CdkDragDrop} from '@angular/cdk/drag-drop'; - -import {SortDirection, SortOption} from '../../../model/sort.model'; -import {BookSorter} from './BookSorter'; - -describe('BookSorter', () => { - it('uses default labels when no transloco service is provided', () => { - const sorter = new BookSorter(() => undefined); - - expect(sorter.sortOptions[0]).toMatchObject({ - field: 'title', - label: 'Title', - direction: SortDirection.ASCENDING - }); - }); - - it('uses translated labels when transloco is available', () => { - const transloco = { - translate: vi.fn((key: string) => `translated:${key}`) - } as unknown as TranslocoService; - - const sorter = new BookSorter(() => undefined, transloco); - - expect(sorter.sortOptions[0].label).toBe('translated:book.sorting.options.title'); - }); - - it('supports legacy selectedSort getter and setter', () => { - const sorter = new BookSorter(() => undefined); - const sort: SortOption = {label: 'Title', field: 'title', direction: SortDirection.ASCENDING}; - - sorter.selectedSort = sort; - expect(sorter.selectedSort).toEqual(sort); - - sorter.selectedSort = undefined; - expect(sorter.selectedSortCriteria).toEqual([]); - }); - - it('sorts by a field and toggles the primary direction on repeat', () => { - const onSortChange = vi.fn(); - const sorter = new BookSorter(onSortChange); - - sorter.sortBooks('title'); - expect(sorter.selectedSortCriteria).toEqual([ - {label: 'Title', field: 'title', direction: SortDirection.ASCENDING} - ]); - - sorter.sortBooks('title'); - expect(sorter.selectedSortCriteria[0].direction).toBe(SortDirection.DESCENDING); - expect(onSortChange).toHaveBeenCalledTimes(2); - }); - - it('adds, removes, toggles, and reorders criteria', () => { - const onSortChange = vi.fn(); - const sorter = new BookSorter(onSortChange); - - sorter.addSortCriterion('title'); - sorter.addSortCriterion('author'); - sorter.addSortCriterion('title'); - expect(sorter.selectedSortCriteria.map((criterion) => criterion.field)).toEqual(['title', 'author']); - - sorter.toggleCriterionDirection(1); - expect(sorter.selectedSortCriteria[1].direction).toBe(SortDirection.DESCENDING); - - sorter.reorderCriteria({ - previousIndex: 1, - currentIndex: 0 - } as unknown as CdkDragDrop); - expect(sorter.selectedSortCriteria.map((criterion) => criterion.field)).toEqual(['author', 'title']); - - sorter.removeSortCriterion(0); - expect(sorter.selectedSortCriteria.map((criterion) => criterion.field)).toEqual(['title']); - }); - - it('omits already-used fields from available options and marks the primary icon', () => { - const sorter = new BookSorter(() => undefined); - - sorter.setSortCriteria([ - {label: 'Title', field: 'title', direction: SortDirection.ASCENDING} - ]); - - const titleOption = sorter.sortOptions.find((option) => option.field === 'title') as SortOption & {icon?: string}; - - expect(sorter.getAvailableSortOptions().some((option) => option.field === 'title')).toBe(false); - expect(titleOption.icon).toBe('pi pi-arrow-up'); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/sorting/BookSorter.ts b/frontend/src/app/features/book/components/book-browser/sorting/BookSorter.ts deleted file mode 100644 index 9ead1937a..000000000 --- a/frontend/src/app/features/book/components/book-browser/sorting/BookSorter.ts +++ /dev/null @@ -1,187 +0,0 @@ -import {SortDirection, SortOption} from '../../../model/sort.model'; -import {CdkDragDrop, moveItemInArray} from '@angular/cdk/drag-drop'; -import {TranslocoService} from '@jsverse/transloco'; - -export const SORT_OPTION_LABEL_KEYS: Readonly> = { - title: 'book.sorting.options.title', - fileName: 'book.sorting.options.fileName', - filePath: 'book.sorting.options.filePath', - author: 'book.sorting.options.author', - authorSurnameVorname: 'book.sorting.options.authorSurnameVorname', - seriesName: 'book.sorting.options.seriesName', - seriesNumber: 'book.sorting.options.seriesNumber', - lastReadTime: 'book.sorting.options.lastReadTime', - personalRating: 'book.sorting.options.personalRating', - addedOn: 'book.sorting.options.addedOn', - fileSizeKb: 'book.sorting.options.fileSizeKb', - locked: 'book.sorting.options.locked', - publisher: 'book.sorting.options.publisher', - publishedDate: 'book.sorting.options.publishedDate', - readStatus: 'book.sorting.options.readStatus', - dateFinished: 'book.sorting.options.dateFinished', - readingProgress: 'book.sorting.options.readingProgress', - bookType: 'book.sorting.options.bookType', - amazonRating: 'book.sorting.options.amazonRating', - amazonReviewCount: 'book.sorting.options.amazonReviewCount', - goodreadsRating: 'book.sorting.options.goodreadsRating', - goodreadsReviewCount: 'book.sorting.options.goodreadsReviewCount', - hardcoverRating: 'book.sorting.options.hardcoverRating', - hardcoverReviewCount: 'book.sorting.options.hardcoverReviewCount', - ranobedbRating: 'book.sorting.options.ranobedbRating', - narrator: 'book.sorting.options.narrator', - pageCount: 'book.sorting.options.pageCount', - random: 'book.sorting.options.random' -}; - -const SORT_FIELDS: { field: string; defaultLabel: string }[] = [ - {field: 'title', defaultLabel: 'Title'}, - {field: 'fileName', defaultLabel: 'File Name'}, - {field: 'filePath', defaultLabel: 'File Path'}, - {field: 'author', defaultLabel: 'Author'}, - {field: 'authorSurnameVorname', defaultLabel: 'Author (Surname)'}, - {field: 'seriesName', defaultLabel: 'Series Name'}, - {field: 'seriesNumber', defaultLabel: 'Series Number'}, - {field: 'lastReadTime', defaultLabel: 'Last Read'}, - {field: 'personalRating', defaultLabel: 'Personal Rating'}, - {field: 'addedOn', defaultLabel: 'Added On'}, - {field: 'fileSizeKb', defaultLabel: 'File Size'}, - {field: 'locked', defaultLabel: 'Locked'}, - {field: 'publisher', defaultLabel: 'Publisher'}, - {field: 'publishedDate', defaultLabel: 'Published Date'}, - {field: 'readStatus', defaultLabel: 'Read Status'}, - {field: 'dateFinished', defaultLabel: 'Date Finished'}, - {field: 'readingProgress', defaultLabel: 'Reading Progress'}, - {field: 'bookType', defaultLabel: 'Book Type'}, - {field: 'amazonRating', defaultLabel: 'Amazon Rating'}, - {field: 'amazonReviewCount', defaultLabel: 'Amazon #'}, - {field: 'goodreadsRating', defaultLabel: 'Goodreads Rating'}, - {field: 'goodreadsReviewCount', defaultLabel: 'Goodreads #'}, - {field: 'hardcoverRating', defaultLabel: 'Hardcover Rating'}, - {field: 'hardcoverReviewCount', defaultLabel: 'Hardcover #'}, - {field: 'ranobedbRating', defaultLabel: 'Ranobedb Rating'}, - {field: 'narrator', defaultLabel: 'Narrator'}, - {field: 'pageCount', defaultLabel: 'Pages'}, - {field: 'random', defaultLabel: 'Random'}, -]; - -export class BookSorter { - selectedSortCriteria: SortOption[] = []; - - sortOptions: SortOption[]; - - constructor(private onSortChange: (criteria: SortOption[]) => void, translocoService?: TranslocoService) { - this.sortOptions = SORT_FIELDS.map(({field, defaultLabel}) => { - const key = SORT_OPTION_LABEL_KEYS[field]; - const label = key && translocoService ? translocoService.translate(key) : defaultLabel; - return {label, field, direction: SortDirection.ASCENDING}; - }); - } - - // For backward compatibility - get first sort option - get selectedSort(): SortOption | undefined { - return this.selectedSortCriteria[0]; - } - - // For backward compatibility - set from single sort option - set selectedSort(sort: SortOption | undefined) { - if (sort) { - this.selectedSortCriteria = [sort]; - } else { - this.selectedSortCriteria = []; - } - } - - setSortCriteria(criteria: SortOption[]): void { - this.selectedSortCriteria = [...criteria]; - this.updateSortOptions(); - } - - // Quick sort by field - toggles direction if already selected as primary sort - sortBooks(field: string): void { - const existingSort = this.sortOptions.find(opt => opt.field === field); - if (!existingSort) return; - - // If this field is the first (primary) sort, toggle its direction - if (this.selectedSortCriteria.length > 0 && this.selectedSortCriteria[0].field === field) { - this.selectedSortCriteria[0] = { - ...this.selectedSortCriteria[0], - direction: this.selectedSortCriteria[0].direction === SortDirection.ASCENDING - ? SortDirection.DESCENDING - : SortDirection.ASCENDING - }; - } else { - // Set as the only sort criterion (single click behavior) - this.selectedSortCriteria = [{ - label: existingSort.label, - field: existingSort.field, - direction: SortDirection.ASCENDING - }]; - } - - this.updateSortOptions(); - this.onSortChange(this.selectedSortCriteria); - } - - addSortCriterion(field: string): void { - // Don't add if already exists - if (this.selectedSortCriteria.some(c => c.field === field)) return; - - const option = this.sortOptions.find(opt => opt.field === field); - if (!option) return; - - this.selectedSortCriteria.push({ - label: option.label, - field: option.field, - direction: SortDirection.ASCENDING - }); - - this.updateSortOptions(); - this.onSortChange(this.selectedSortCriteria); - } - - removeSortCriterion(index: number): void { - if (index < 0 || index >= this.selectedSortCriteria.length) return; - - this.selectedSortCriteria.splice(index, 1); - this.updateSortOptions(); - this.onSortChange(this.selectedSortCriteria); - } - - toggleCriterionDirection(index: number): void { - if (index < 0 || index >= this.selectedSortCriteria.length) return; - - const criterion = this.selectedSortCriteria[index]; - this.selectedSortCriteria[index] = { - ...criterion, - direction: criterion.direction === SortDirection.ASCENDING - ? SortDirection.DESCENDING - : SortDirection.ASCENDING - }; - - this.updateSortOptions(); - this.onSortChange(this.selectedSortCriteria); - } - - reorderCriteria(event: CdkDragDrop): void { - moveItemInArray(this.selectedSortCriteria, event.previousIndex, event.currentIndex); - this.updateSortOptions(); - this.onSortChange(this.selectedSortCriteria); - } - - getAvailableSortOptions(): SortOption[] { - const usedFields = new Set(this.selectedSortCriteria.map(c => c.field)); - return this.sortOptions.filter(opt => !usedFields.has(opt.field)); - } - - updateSortOptions(): void { - const primaryField = this.selectedSortCriteria[0]?.field; - const primaryDirection = this.selectedSortCriteria[0]?.direction; - - const directionIcon = primaryDirection === SortDirection.ASCENDING ? 'pi pi-arrow-up' : 'pi pi-arrow-down'; - - this.sortOptions = this.sortOptions.map((option) => ({ - ...option, - icon: option.field === primaryField ? directionIcon : '', - })); - } -} diff --git a/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.html b/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.html deleted file mode 100644 index 41155055e..000000000 --- a/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.html +++ /dev/null @@ -1,71 +0,0 @@ - -
-
- {{ t('sortOrder') }} -
- -
- @for (criterion of sortCriteria; track criterion.field; let i = $index) { -
-
- -
- {{ i + 1 }}. - {{ criterion.label }} -
- - -
-
- } -
- - @if (unusedOptions.length > 0) { -
- - -
- } - - @if (showSaveButton) { -
- - -
- } -
-
diff --git a/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.scss b/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.scss deleted file mode 100644 index 4e924295e..000000000 --- a/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.scss +++ /dev/null @@ -1,150 +0,0 @@ -.multi-sort-container { - width: 280px; - padding: 0.4375rem; -} - -.multi-sort-header { - display: flex; - justify-content: space-between; - align-items: center; - padding-bottom: 0.6563rem; - border-bottom: 1px solid var(--border-color); - margin-bottom: 0.6563rem; -} - -.header-title { - font-weight: 600; - font-size: 0.7875rem; - color: var(--text-color); -} - -.sort-criteria-list { - display: flex; - flex-direction: column; - gap: 0.4375rem; - min-height: 40px; -} - -.sort-criterion { - display: flex; - align-items: center; - gap: 0.4375rem; - padding: 0.4375rem; - background-color: var(--overlay-background); - border: 1px solid var(--border-color); - border-radius: 6px; - cursor: move; - transition: background-color 0.15s ease, box-shadow 0.15s ease; - - &:hover { - background-color: var(--ground-background); - } -} - -.cdk-drag-preview { - display: flex; - align-items: center; - gap: 0.4375rem; - padding: 0.4375rem; - background-color: var(--card-background); - border: 1px solid var(--primary-color); - border-radius: 6px; - box-shadow: 0 5px 15px rgb(0 0 0 / 25%); -} - -.cdk-drag-placeholder { - opacity: 0.3; -} - -.cdk-drag-animating { - transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); -} - -.sort-criteria-list.cdk-drop-list-dragging .sort-criterion:not(.cdk-drag-placeholder) { - transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); -} - -.criterion-drag-handle { - display: flex; - align-items: center; - justify-content: center; - color: var(--text-secondary-color); - cursor: grab; - - &:active { - cursor: grabbing; - } - - i { - font-size: 0.7438rem; - } -} - -.criterion-rank { - font-weight: 600; - color: var(--primary-color); - min-width: 1.0938rem; -} - -.criterion-label { - flex: 1; - font-size: var(--app-text-sm); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - color: var(--text-color); -} - -.criterion-actions { - display: flex; - align-items: center; - gap: 0.2188rem; -} - -.direction-btn, -.remove-btn { - display: flex; - align-items: center; - justify-content: center; - width: 1.5313rem; - height: 1.5313rem; - padding: 0; - border: none; - border-radius: 4px; - background-color: transparent; - cursor: pointer; - transition: background-color 0.15s ease; - - i { - font-size: 0.7438rem; - } - - &:hover:not(:disabled) { - background-color: var(--ground-background); - } - - &:disabled { - opacity: 0.4; - cursor: not-allowed; - } -} - -.direction-btn { - color: var(--primary-color); -} - -.remove-btn { - color: var(--p-red-500); -} - -.add-sort-section { - margin-top: 0.6563rem; - padding-top: 0.6563rem; - border-top: 1px solid var(--border-color); -} - -.save-sort-section { - margin-top: 0.6563rem; - padding-top: 0.6563rem; - border-top: 1px solid var(--border-color); -} diff --git a/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.spec.ts b/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.spec.ts deleted file mode 100644 index 8df1028d5..000000000 --- a/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.spec.ts +++ /dev/null @@ -1,9 +0,0 @@ -import {describe, expect, it} from 'vitest'; - -// TODO(seam): This popover needs an Optimus UI overlay and drag-drop harness so the -// multi-sort reorder and apply flows can be tested against real emitted events. -describe.skip('MultiSortPopoverComponent', () => { - it('needs an overlay harness for drag-drop reorder and sort application flows', () => { - expect.hasAssertions(); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.ts b/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.ts deleted file mode 100644 index e9712b678..000000000 --- a/frontend/src/app/features/book/components/book-browser/sorting/multi-sort-popover/multi-sort-popover.component.ts +++ /dev/null @@ -1,92 +0,0 @@ -import {ChangeDetectionStrategy, Component, EventEmitter, inject, Input, Output} from '@angular/core'; -import {SortDirection, SortOption} from '../../../../model/sort.model'; -import {CdkDrag, CdkDragDrop, CdkDragHandle, CdkDropList, moveItemInArray} from '@angular/cdk/drag-drop'; -import {Select} from '@openng/optimus-ui/select'; -import {FormsModule} from '@angular/forms'; -import {Tooltip} from '@openng/optimus-ui/tooltip'; -import {Button} from '@openng/optimus-ui/button'; -import {TranslocoDirective, TranslocoService} from '@jsverse/transloco'; - -@Component({ - selector: 'app-multi-sort-popover', - standalone: true, - changeDetection: ChangeDetectionStrategy.OnPush, - imports: [ - CdkDropList, - CdkDrag, - CdkDragHandle, - Select, - FormsModule, - Tooltip, - Button, - TranslocoDirective - ], - templateUrl: './multi-sort-popover.component.html', - styleUrl: './multi-sort-popover.component.scss' -}) -export class MultiSortPopoverComponent { - private readonly t = inject(TranslocoService); - @Input() sortCriteria: SortOption[] = []; - @Input() availableSortOptions: SortOption[] = []; - @Input() showSaveButton = false; - - @Output() criteriaChange = new EventEmitter(); - @Output() saveSortConfig = new EventEmitter(); - - selectedField: string | null = null; - - get unusedOptions(): SortOption[] { - const usedFields = new Set(this.sortCriteria.map(c => c.field)); - return this.availableSortOptions.filter(opt => !usedFields.has(opt.field)); - } - - onDrop(event: CdkDragDrop): void { - const criteria = [...this.sortCriteria]; - moveItemInArray(criteria, event.previousIndex, event.currentIndex); - this.sortCriteria = criteria; - this.criteriaChange.emit(this.sortCriteria); - } - - onToggleDirection(index: number): void { - this.sortCriteria = this.sortCriteria.map((c, i) => - i === index - ? {...c, direction: c.direction === SortDirection.ASCENDING ? SortDirection.DESCENDING : SortDirection.ASCENDING} - : c - ); - this.criteriaChange.emit(this.sortCriteria); - } - - onRemove(index: number): void { - this.sortCriteria = this.sortCriteria.filter((_, i) => i !== index); - this.criteriaChange.emit(this.sortCriteria); - } - - onAddField(): void { - if (!this.selectedField) return; - const option = this.availableSortOptions.find(o => o.field === this.selectedField); - if (!option) return; - this.sortCriteria = [...this.sortCriteria, { - label: option.label, - field: option.field, - direction: SortDirection.ASCENDING - }]; - this.selectedField = null; - this.criteriaChange.emit(this.sortCriteria); - } - - onSave(): void { - this.saveSortConfig.emit(this.sortCriteria); - } - - getDirectionIcon(direction: SortDirection): string { - return direction === SortDirection.ASCENDING ? 'pi pi-arrow-up' : 'pi pi-arrow-down'; - } - - getDirectionTooltip(direction: SortDirection): string { - return direction === SortDirection.ASCENDING - ? this.t.translate('book.sorting.ascendingTooltip') - : this.t.translate('book.sorting.descendingTooltip'); - } - - protected readonly SortDirection = SortDirection; -} diff --git a/frontend/src/app/features/book/components/book-browser/table-column-preference.service.spec.ts b/frontend/src/app/features/book/components/book-browser/table-column-preference.service.spec.ts deleted file mode 100644 index d44a13a0f..000000000 --- a/frontend/src/app/features/book/components/book-browser/table-column-preference.service.spec.ts +++ /dev/null @@ -1,117 +0,0 @@ -import {TestBed} from '@angular/core/testing'; -import {MessageService} from '@openng/optimus-ui/api'; -import {TranslocoService} from '@jsverse/transloco'; -import {vi, describe, beforeEach, afterEach, expect, it} from 'vitest'; - -import {TableColumnPreferenceService} from './table-column-preference.service'; -import {TableColumnPreference, UserService} from '../../../settings/user-management/user.service'; - -describe('TableColumnPreferenceService', () => { - let service: TableColumnPreferenceService; - let userService: { getCurrentUser: ReturnType; updateUserSetting: ReturnType }; - let messageService: { add: ReturnType }; - let translocoService: { translate: ReturnType }; - - beforeEach(() => { - userService = { - getCurrentUser: vi.fn(), - updateUserSetting: vi.fn() - }; - messageService = { - add: vi.fn() - }; - translocoService = { - translate: vi.fn((key: string) => `t:${key}`) - }; - - TestBed.configureTestingModule({ - providers: [ - TableColumnPreferenceService, - {provide: UserService, useValue: userService}, - {provide: MessageService, useValue: messageService}, - {provide: TranslocoService, useValue: translocoService} - ] - }); - - service = TestBed.inject(TableColumnPreferenceService); - }); - - afterEach(() => { - TestBed.resetTestingModule(); - }); - - it('merges saved preferences with all available columns', () => { - const savedPrefs: TableColumnPreference[] = [ - {field: 'title', visible: false, order: 4}, - {field: 'authors', visible: true, order: 1}, - {field: 'fileName', visible: true, order: 0} - ]; - - service.initPreferences(savedPrefs); - - expect(service.preferences().find(pref => pref.field === 'title')).toEqual({ - field: 'title', - visible: false, - order: 4 - }); - expect(service.preferences().find(pref => pref.field === 'authors')).toEqual({ - field: 'authors', - visible: true, - order: 1 - }); - expect(service.allColumns[0]).toEqual({ - field: 'readStatus', - header: 't:book.columnPref.columns.readStatus' - }); - expect(service.visibleColumns.map(column => column.field).slice(0, 2)).toEqual(['readStatus', 'fileName']); - }); - - it('falls back to defaults when no saved preferences exist', () => { - service.initPreferences(undefined); - - expect(service.preferences().length).toBe(service.allColumns.length); - expect(service.visibleColumns[0]).toEqual({ - field: 'readStatus', - header: 't:book.columnPref.columns.readStatus' - }); - }); - - it('skips persistence when there is no current user', () => { - userService.getCurrentUser.mockReturnValue(null); - - service.saveVisibleColumns([{field: 'title'}]); - - expect(userService.updateUserSetting).not.toHaveBeenCalled(); - expect(messageService.add).not.toHaveBeenCalled(); - expect(service.preferences().find(pref => pref.field === 'title')).toEqual({ - field: 'title', - visible: true, - order: 0 - }); - }); - - it('saves preferences and shows a success toast for the current user', () => { - userService.getCurrentUser.mockReturnValue({id: 42}); - - service.saveVisibleColumns([{field: 'title'}, {field: 'authors'}]); - - expect(userService.updateUserSetting).toHaveBeenCalledWith(42, 'tableColumnPreference', expect.any(Array)); - const savedPrefs = userService.updateUserSetting.mock.calls[0][2] as TableColumnPreference[]; - expect(savedPrefs.find(pref => pref.field === 'title')).toEqual({ - field: 'title', - visible: true, - order: 0 - }); - expect(savedPrefs.find(pref => pref.field === 'authors')).toEqual({ - field: 'authors', - visible: true, - order: 1 - }); - expect(messageService.add).toHaveBeenCalledWith(expect.objectContaining({ - severity: 'success', - summary: 't:book.columnPref.toast.savedSummary', - detail: 't:book.columnPref.toast.savedDetail', - life: 1500 - })); - }); -}); diff --git a/frontend/src/app/features/book/components/book-browser/table-column-preference.service.ts b/frontend/src/app/features/book/components/book-browser/table-column-preference.service.ts deleted file mode 100644 index 1a88d8faf..000000000 --- a/frontend/src/app/features/book/components/book-browser/table-column-preference.service.ts +++ /dev/null @@ -1,92 +0,0 @@ -import {inject, Injectable, signal} from '@angular/core'; -import {MessageService} from '@openng/optimus-ui/api'; -import {TranslocoService} from '@jsverse/transloco'; -import {TableColumnPreference, UserService} from '../../../settings/user-management/user.service'; - -@Injectable({ - providedIn: 'root' -}) -export class TableColumnPreferenceService { - private readonly userService = inject(UserService); - private readonly messageService = inject(MessageService); - private readonly t = inject(TranslocoService); - - private readonly _preferences = signal([]); - readonly preferences = this._preferences.asReadonly(); - - private readonly allAvailableFields = [ - 'readStatus', 'title', 'authors', 'publisher', 'seriesName', 'seriesNumber', - 'categories', 'publishedDate', 'lastReadTime', 'addedOn', 'fileName', 'fileSizeKb', - 'language', 'isbn', 'pageCount', 'amazonRating', 'amazonReviewCount', - 'goodreadsRating', 'goodreadsReviewCount', 'hardcoverRating', 'hardcoverReviewCount', - 'ranobedbRating', - ]; - - private readonly fallbackPreferences: TableColumnPreference[] = this.allAvailableFields.map((field, index) => ({ - field, - visible: true, - order: index - })); - - initPreferences(savedPrefs: TableColumnPreference[] | undefined): void { - const effectivePrefs = savedPrefs?.length ? savedPrefs : this.fallbackPreferences; - this._preferences.set(this.mergeWithAllColumns(effectivePrefs)); - } - - get allColumns(): { field: string; header: string }[] { - return this.allAvailableFields.map(field => ({ - field, - header: this.t.translate(`book.columnPref.columns.${field}`) - })); - } - - get visibleColumns(): { field: string; header: string }[] { - return this.preferences() - .filter(pref => pref.visible) - .sort((a, b) => a.order - b.order) - .map(pref => ({ - field: pref.field, - header: this.t.translate(`book.columnPref.columns.${pref.field}`) - })); - } - - saveVisibleColumns(selectedColumns: { field: string }[]): void { - const selectedFieldSet = new Set(selectedColumns.map(c => c.field)); - - const updatedPreferences: TableColumnPreference[] = this.allAvailableFields.map((field, index) => { - const selectionIndex = selectedColumns.findIndex(c => c.field === field); - return { - field, - visible: selectedFieldSet.has(field), - order: selectionIndex >= 0 ? selectionIndex : index - }; - }); - - this._preferences.set(updatedPreferences); - - const currentUser = this.userService.getCurrentUser(); - if (!currentUser) return; - - this.userService.updateUserSetting(currentUser.id, 'tableColumnPreference', updatedPreferences); - - this.messageService.add({ - severity: 'success', - summary: this.t.translate('book.columnPref.toast.savedSummary'), - detail: this.t.translate('book.columnPref.toast.savedDetail'), - life: 1500 - }); - } - - private mergeWithAllColumns(savedPrefs: TableColumnPreference[]): TableColumnPreference[] { - const savedPrefMap = new Map(savedPrefs.map(p => [p.field, p])); - - return this.allAvailableFields.map((field, index) => { - const saved = savedPrefMap.get(field); - return { - field, - visible: saved?.visible ?? true, - order: saved?.order ?? index - }; - }); - } -} diff --git a/frontend/src/app/features/book/components/book-menu/book-menu.component.spec.ts b/frontend/src/app/features/book/components/book-menu/book-menu.component.spec.ts index 2bb4e4fc9..36b01dc32 100644 --- a/frontend/src/app/features/book/components/book-menu/book-menu.component.spec.ts +++ b/frontend/src/app/features/book/components/book-menu/book-menu.component.spec.ts @@ -13,7 +13,7 @@ import {BookCommandService} from '../../data/book-command.service'; import {BookShelfCommandService} from '../../data/book-shelf-command.service'; import {ShelfDefinitionQueryService} from '../../data/shelf-definition-query.service'; import {BookSummary} from '../../data/book-response.models'; -import {BookDialogHelperService} from '../book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from '../../service/book-dialog-helper.service'; import {AppSettingsService} from '../../../../shared/service/app-settings.service'; import {FileDownloadService} from '../../../../shared/service/file-download.service'; import {BookNavigationService} from '../../service/book-navigation.service'; diff --git a/frontend/src/app/features/book/components/book-menu/book-menu.component.ts b/frontend/src/app/features/book/components/book-menu/book-menu.component.ts index e40381976..1030ec6f6 100644 --- a/frontend/src/app/features/book/components/book-menu/book-menu.component.ts +++ b/frontend/src/app/features/book/components/book-menu/book-menu.component.ts @@ -65,7 +65,7 @@ import { import {ShelfDefinitionQueryService} from '../../data/shelf-definition-query.service'; import {AppSettingsService} from '../../../../shared/service/app-settings.service'; import {legacyBookCachePatches, withLegacyBookCache} from '../../service/book-command-legacy-adapter'; -import {BookDialogHelperService} from '../book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from '../../service/book-dialog-helper.service'; import {FileDownloadService} from '../../../../shared/service/file-download.service'; import {BookNavigationService} from '../../service/book-navigation.service'; import { diff --git a/frontend/src/app/features/book/components/book-browser/book-card-overlay-preference.service.spec.ts b/frontend/src/app/features/book/components/legacy-book-card/book-card-overlay-preference.service.spec.ts similarity index 100% rename from frontend/src/app/features/book/components/book-browser/book-card-overlay-preference.service.spec.ts rename to frontend/src/app/features/book/components/legacy-book-card/book-card-overlay-preference.service.spec.ts diff --git a/frontend/src/app/features/book/components/book-browser/book-card-overlay-preference.service.ts b/frontend/src/app/features/book/components/legacy-book-card/book-card-overlay-preference.service.ts similarity index 100% rename from frontend/src/app/features/book/components/book-browser/book-card-overlay-preference.service.ts rename to frontend/src/app/features/book/components/legacy-book-card/book-card-overlay-preference.service.ts diff --git a/frontend/src/app/features/book/components/book-browser/book-card/book-card.component.html b/frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.html similarity index 100% rename from frontend/src/app/features/book/components/book-browser/book-card/book-card.component.html rename to frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.html diff --git a/frontend/src/app/features/book/components/book-browser/book-card/book-card.component.scss b/frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.scss similarity index 97% rename from frontend/src/app/features/book/components/book-browser/book-card/book-card.component.scss rename to frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.scss index 3c8c996bd..5bf2ab06b 100644 --- a/frontend/src/app/features/book/components/book-browser/book-card/book-card.component.scss +++ b/frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.scss @@ -132,11 +132,21 @@ } .cover-container:hover .info-btn, -.cover-container:hover .read-btn { +.cover-container:hover .read-btn, +.book-card:focus-within .info-btn, +.book-card:focus-within .read-btn { opacity: 1; visibility: visible; } +@media (hover: none) { + .info-btn, + .read-btn { + opacity: 1; + visibility: visible; + } +} + .cover-container.center-info-btn .info-btn { top: 50%; transform: translate(-50%, -50%); diff --git a/frontend/src/app/features/book/components/book-browser/book-card/book-card.component.spec.ts b/frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.spec.ts similarity index 91% rename from frontend/src/app/features/book/components/book-browser/book-card/book-card.component.spec.ts rename to frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.spec.ts index 0114ca4f7..3932bee11 100644 --- a/frontend/src/app/features/book/components/book-browser/book-card/book-card.component.spec.ts +++ b/frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.spec.ts @@ -5,19 +5,19 @@ import {QueryClient} from '@tanstack/angular-query-experimental'; import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest'; import {ConfirmationService, MessageService} from '@openng/optimus-ui/api'; -import {TaskHelperService} from '../../../../settings/task-management/task-helper.service'; -import {EmailService} from '../../../../settings/email-v2/email.service'; -import {User, UserService} from '../../../../settings/user-management/user.service'; -import {AppSettingsService} from '../../../../../shared/service/app-settings.service'; -import {UrlHelperService} from '../../../../../shared/service/url-helper.service'; -import {AdditionalFile, Book, ReadStatus} from '../../../model/book.model'; -import {BookDialogHelperService} from '../book-dialog-helper.service'; -import {BookCardComponent} from './book-card.component'; -import {BookFileService} from '../../../service/book-file.service'; -import {BookMetadataManageService} from '../../../service/book-metadata-manage.service'; -import {BookNavigationService} from '../../../service/book-navigation.service'; -import {BookService} from '../../../service/book.service'; -import {getTranslocoModule} from '../../../../../core/testing/transloco-testing'; +import {TaskHelperService} from '../../../settings/task-management/task-helper.service'; +import {EmailService} from '../../../settings/email-v2/email.service'; +import {User, UserService} from '../../../settings/user-management/user.service'; +import {AppSettingsService} from '../../../../shared/service/app-settings.service'; +import {UrlHelperService} from '../../../../shared/service/url-helper.service'; +import {AdditionalFile, Book, ReadStatus} from '../../model/book.model'; +import {BookDialogHelperService} from '../../service/book-dialog-helper.service'; +import {LegacyBookCardComponent} from './legacy-book-card.component'; +import {BookFileService} from '../../service/book-file.service'; +import {BookMetadataManageService} from '../../service/book-metadata-manage.service'; +import {BookNavigationService} from '../../service/book-navigation.service'; +import {BookService} from '../../service/book.service'; +import {getTranslocoModule} from '../../../../core/testing/transloco-testing'; function makeBook(overrides: Partial = {}): Book { return { @@ -85,7 +85,6 @@ function makeUser(metadataCenterViewMode: 'route' | 'dialog'): User { sidebarLibrarySorting: {} as never, sidebarShelfSorting: {} as never, sidebarMagicShelfSorting: {} as never, - filterMode: 'and', enableSeriesView: false, entityViewPreferences: {global: {} as never, overrides: []}, koReaderEnabled: false, @@ -94,10 +93,10 @@ function makeUser(metadataCenterViewMode: 'route' | 'dialog'): User { }; } -describe('BookCardComponent', () => { - let component: BookCardComponent; - let fixture: ComponentFixture; - let ref: ComponentRef; +describe('LegacyBookCardComponent', () => { + let component: LegacyBookCardComponent; + let fixture: ComponentFixture; + let ref: ComponentRef; let bookService: { readBook: ReturnType; }; @@ -209,7 +208,7 @@ describe('BookCardComponent', () => { }; TestBed.configureTestingModule({ - imports: [BookCardComponent, getTranslocoModule()], + imports: [LegacyBookCardComponent, getTranslocoModule()], schemas: [NO_ERRORS_SCHEMA], providers: [ {provide: ActivatedRoute, useValue: {}}, @@ -246,7 +245,7 @@ describe('BookCardComponent', () => { })), }); - fixture = TestBed.createComponent(BookCardComponent); + fixture = TestBed.createComponent(LegacyBookCardComponent); ref = fixture.componentRef; component = fixture.componentInstance; diff --git a/frontend/src/app/features/book/components/book-browser/book-card/book-card.component.ts b/frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.ts similarity index 94% rename from frontend/src/app/features/book/components/book-browser/book-card/book-card.component.ts rename to frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.ts index 3d534354d..3ca14b9e5 100644 --- a/frontend/src/app/features/book/components/book-browser/book-card/book-card.component.ts +++ b/frontend/src/app/features/book/components/legacy-book-card/legacy-book-card.component.ts @@ -1,41 +1,41 @@ import {ChangeDetectionStrategy, Component, computed, inject, input, output, signal} from '@angular/core'; import {Tooltip} from '@openng/optimus-ui/tooltip'; -import {AdditionalFile, Book, BookType, ReadStatus} from '../../../model/book.model'; +import {AdditionalFile, Book, BookType, ReadStatus} from '../../model/book.model'; import {ConfirmationService, MenuItem, MessageService} from '@openng/optimus-ui/api'; -import {BookService} from '../../../service/book.service'; -import {BookFileService} from '../../../service/book-file.service'; -import {BookMetadataManageService} from '../../../service/book-metadata-manage.service'; +import {BookService} from '../../service/book.service'; +import {BookFileService} from '../../service/book-file.service'; +import {BookMetadataManageService} from '../../service/book-metadata-manage.service'; import {CheckboxChangeEvent, Checkbox} from '@openng/optimus-ui/checkbox'; import {FormsModule} from '@angular/forms'; -import {MetadataRefreshType} from '../../../../metadata/model/request/metadata-refresh-type.enum'; -import {UrlHelperService} from '../../../../../shared/service/url-helper.service'; -import {CoverComponent} from '../../../../../shared/components/cover/cover.component'; +import {MetadataRefreshType} from '../../../metadata/model/request/metadata-refresh-type.enum'; +import {UrlHelperService} from '../../../../shared/service/url-helper.service'; +import {CoverComponent} from '../../../../shared/components/cover/cover.component'; import {NgClass} from '@angular/common'; -import {UserService} from '../../../../settings/user-management/user.service'; -import {EmailService} from '../../../../settings/email-v2/email.service'; +import {UserService} from '../../../settings/user-management/user.service'; +import {EmailService} from '../../../settings/email-v2/email.service'; import {TieredMenu} from '@openng/optimus-ui/tieredmenu'; import {Router, RouterLink} from '@angular/router'; -import {readStatusLabels} from '../book-filter/book-filter.config'; -import {ResetProgressTypes} from '../../../../../shared/constants/reset-progress-type'; -import {ReadStatusHelper} from '../../../helpers/read-status.helper'; -import {BookDialogHelperService} from '../book-dialog-helper.service'; -import {TaskHelperService} from '../../../../settings/task-management/task-helper.service'; -import {BookNavigationService} from '../../../service/book-navigation.service'; -import {BookCardOverlayPreferenceService} from '../book-card-overlay-preference.service'; -import {AppSettingsService} from '../../../../../shared/service/app-settings.service'; +import {READ_STATUS_LABELS} from '../../model/book-value-labels'; +import {ResetProgressTypes} from '../../../../shared/constants/reset-progress-type'; +import {ReadStatusHelper} from '../../helpers/read-status.helper'; +import {BookDialogHelperService} from '../../service/book-dialog-helper.service'; +import {TaskHelperService} from '../../../settings/task-management/task-helper.service'; +import {BookNavigationService} from '../../service/book-navigation.service'; +import {BookCardOverlayPreferenceService} from './book-card-overlay-preference.service'; +import {AppSettingsService} from '../../../../shared/service/app-settings.service'; import {TranslocoPipe, TranslocoService} from '@jsverse/transloco'; import {QueryClient} from '@tanstack/angular-query-experimental'; import {ButtonDirective} from '@openng/optimus-ui/button'; @Component({ - selector: 'app-book-card', - templateUrl: './book-card.component.html', - styleUrls: ['./book-card.component.scss'], + selector: 'app-legacy-book-card', + templateUrl: './legacy-book-card.component.html', + styleUrls: ['./legacy-book-card.component.scss'], imports: [ButtonDirective, Checkbox, FormsModule, NgClass, TieredMenu, Tooltip, RouterLink, TranslocoPipe, CoverComponent], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush }) -export class BookCardComponent { +export class LegacyBookCardComponent { // --- Inputs --- readonly book = input.required(); @@ -180,7 +180,7 @@ export class BookCardComponent { readonly readingUrl = computed(() => this.urlHelper.getBookPrimaryReadingUrl(this.book())); private buildReadStatusMenuItems(): void { - this.readStatusMenuItems.set(Object.entries(readStatusLabels).map(([status, label]) => ({ + this.readStatusMenuItems.set(Object.entries(READ_STATUS_LABELS).map(([status, label]) => ({ label, command: () => { this.bookService.updateBookReadStatus(this.book().id, status as ReadStatus).subscribe({ @@ -513,7 +513,7 @@ export class BookCardComponent { { label: this.t.translate('book.card.menu.readStatus'), icon: 'pi pi-book', - items: Object.entries(readStatusLabels).map(([status, label]) => ({ + items: Object.entries(READ_STATUS_LABELS).map(([status, label]) => ({ label, command: () => { this.bookService.updateBookReadStatus(this.book().id, status as ReadStatus).subscribe({ diff --git a/frontend/src/app/features/book/components/library-shelf-menu/library-shelf-menu.component.ts b/frontend/src/app/features/book/components/library-shelf-menu/library-shelf-menu.component.ts index 5585f29d1..f8d50937f 100644 --- a/frontend/src/app/features/book/components/library-shelf-menu/library-shelf-menu.component.ts +++ b/frontend/src/app/features/book/components/library-shelf-menu/library-shelf-menu.component.ts @@ -6,8 +6,6 @@ import {UserService} from '../../../settings/user-management/user.service'; import {type LibraryShelfMenuTarget} from '../../../../shared/layout/navigation/library-shelf-menu-target.model'; import {libraryShelfMenuAvailable, LibraryShelfMenuItemsComponent} from './library-shelf-menu-items.component'; -export type {LibraryShelfMenuTarget} from '../../../../shared/layout/navigation/library-shelf-menu-target.model'; - @Component({ selector: 'app-library-shelf-menu', standalone: true, diff --git a/frontend/src/app/features/book/components/book-browser/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.html b/frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.html similarity index 100% rename from frontend/src/app/features/book/components/book-browser/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.html rename to frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.html diff --git a/frontend/src/app/features/book/components/book-browser/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.scss b/frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.scss similarity index 93% rename from frontend/src/app/features/book/components/book-browser/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.scss rename to frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.scss index 1e05d53ce..8f63bb0da 100644 --- a/frontend/src/app/features/book/components/book-browser/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.scss +++ b/frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.scss @@ -1,4 +1,4 @@ -@use '../../../../../shared/styles/panel-shared' as panel; +@use '../../../../shared/styles/panel-shared' as panel; .lock-unlock-container { display: flex; diff --git a/frontend/src/app/features/book/components/book-browser/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.spec.ts b/frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.spec.ts similarity index 96% rename from frontend/src/app/features/book/components/book-browser/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.spec.ts rename to frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.spec.ts index aabaaa51f..de68b8521 100644 --- a/frontend/src/app/features/book/components/book-browser/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.spec.ts +++ b/frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.spec.ts @@ -3,13 +3,13 @@ import {of, throwError} from 'rxjs'; import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest'; import {TranslocoService} from '@jsverse/transloco'; -import {LoadingService} from '../../../../../core/services/loading.service'; +import {LoadingService} from '../../../../core/services/loading.service'; import { createDynamicDialogHarness, createMessageServiceProvider, createMessageServiceSpy, -} from '../../../../../core/testing/dialog-testing'; -import {BookMetadataManageService} from '../../../service/book-metadata-manage.service'; +} from '../../../../core/testing/dialog-testing'; +import {BookMetadataManageService} from '../../service/book-metadata-manage.service'; import {LockUnlockMetadataDialogComponent} from './lock-unlock-metadata-dialog.component'; describe('LockUnlockMetadataDialogComponent', () => { diff --git a/frontend/src/app/features/book/components/book-browser/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts b/frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts similarity index 95% rename from frontend/src/app/features/book/components/book-browser/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts rename to frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts index 74f939501..63bbb771c 100644 --- a/frontend/src/app/features/book/components/book-browser/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts +++ b/frontend/src/app/features/book/components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component.ts @@ -4,12 +4,12 @@ import {FormsModule} from '@angular/forms'; import {DynamicDialogConfig, DynamicDialogRef} from '@openng/optimus-ui/dynamicdialog'; import {MessageService} from '@openng/optimus-ui/api'; -import {BookMetadataManageService} from '../../../service/book-metadata-manage.service'; +import {BookMetadataManageService} from '../../service/book-metadata-manage.service'; import {Divider} from '@openng/optimus-ui/divider'; -import {LoadingService} from '../../../../../core/services/loading.service'; +import {LoadingService} from '../../../../core/services/loading.service'; import {finalize} from 'rxjs'; import {TranslocoDirective, TranslocoService} from '@jsverse/transloco'; -import {MetadataProviderFieldsService} from '../../../../../shared/metadata'; +import {MetadataProviderFieldsService} from '../../../../shared/metadata'; @Component({ selector: 'app-lock-unlock-metadata-dialog', diff --git a/frontend/src/app/features/book/components/series-page/series-page.component.html b/frontend/src/app/features/book/components/series-page/series-page.component.html index 9afee9185..974f5f13a 100644 --- a/frontend/src/app/features/book/components/series-page/series-page.component.html +++ b/frontend/src/app/features/book/components/series-page/series-page.component.html @@ -285,7 +285,7 @@ [style.--series-grid-card-height.px]="seriesGridCardHeight()" [style.--series-grid-gap.px]="seriesGridGap()"> @for (book of books; track book.id; let index = $index) { - - + } diff --git a/frontend/src/app/features/book/components/series-page/series-page.component.scss b/frontend/src/app/features/book/components/series-page/series-page.component.scss index a7f5cfd08..91ac0ced4 100644 --- a/frontend/src/app/features/book/components/series-page/series-page.component.scss +++ b/frontend/src/app/features/book/components/series-page/series-page.component.scss @@ -557,7 +557,7 @@ $meta-card-colors: ( } } -.series-items-grid > app-book-card { +.series-items-grid > app-legacy-book-card { display: block; width: 100%; height: var(--series-grid-card-height); diff --git a/frontend/src/app/features/book/components/series-page/series-page.component.ts b/frontend/src/app/features/book/components/series-page/series-page.component.ts index 9da4232d8..15e825d45 100644 --- a/frontend/src/app/features/book/components/series-page/series-page.component.ts +++ b/frontend/src/app/features/book/components/series-page/series-page.component.ts @@ -7,7 +7,7 @@ import {finalize, map, take} from "rxjs/operators"; import {Book, BookType, computeSeriesReadStatus, ReadStatus} from "../../model/book.model"; import {BookService} from "../../service/book.service"; import {BookMetadataManageService} from "../../service/book-metadata-manage.service"; -import {BookCardComponent} from "../book-browser/book-card/book-card.component"; +import {LegacyBookCardComponent} from "../legacy-book-card/legacy-book-card.component"; import {Tab, TabList, TabPanel, TabPanels, Tabs} from "@openng/optimus-ui/tabs"; import {ProgressSpinner} from "@openng/optimus-ui/progressspinner"; import {ProgressBar} from "@openng/optimus-ui/progressbar"; @@ -16,7 +16,7 @@ import {ConfirmationService, MenuItem, MessageService} from "@openng/optimus-ui/ import {UserService} from "../../../settings/user-management/user.service"; import {BookMenuService} from "../../service/book-menu.service"; import {LoadingService} from "../../../../core/services/loading.service"; -import {BookDialogHelperService} from "../book-browser/book-dialog-helper.service"; +import {BookDialogHelperService} from "../../service/book-dialog-helper.service"; import {TaskHelperService} from "../../../settings/task-management/task-helper.service"; import {MetadataRefreshType} from "../../../metadata/model/request/metadata-refresh-type.enum"; import {TieredMenu} from "@openng/optimus-ui/tieredmenu"; @@ -26,7 +26,7 @@ import {Tooltip} from "@openng/optimus-ui/tooltip"; import {Divider} from "@openng/optimus-ui/divider"; import {TagComponent} from "../../../../shared/components/tag/tag.component"; import {AfterViewChecked, ChangeDetectionStrategy, Component, computed, effect, ElementRef, inject, signal, viewChild} from '@angular/core'; -import {BookCardOverlayPreferenceService} from '../book-browser/book-card-overlay-preference.service'; +import {BookCardOverlayPreferenceService} from '../legacy-book-card/book-card-overlay-preference.service'; import {UrlHelperService} from '../../../../shared/service/url-helper.service'; import {LanguageResolverService} from '../../../../shared/service/language-resolver.service'; import {CoverComponent} from '../../../../shared/components/cover/cover.component'; @@ -77,7 +77,7 @@ interface SeriesStats { FormsModule, NgStyle, NgClass, - BookCardComponent, + LegacyBookCardComponent, ProgressSpinner, ProgressBar, Tabs, diff --git a/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.spec.ts b/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.spec.ts index 60917a765..a138f4f6a 100644 --- a/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.spec.ts +++ b/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.spec.ts @@ -12,7 +12,7 @@ import {Book} from '../../model/book.model'; import {Shelf} from '../../model/shelf.model'; import {BookService} from '../../service/book.service'; import {ShelfService} from '../../service/shelf.service'; -import {BookDialogHelperService} from '../book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from '../../service/book-dialog-helper.service'; import {ShelfAssignerComponent} from './shelf-assigner.component'; interface CurrentUserLike { diff --git a/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.ts b/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.ts index 062fb1908..5c0a2b1ce 100644 --- a/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.ts +++ b/frontend/src/app/features/book/components/shelf-assigner/shelf-assigner.component.ts @@ -9,7 +9,7 @@ import {Shelf} from '../../model/shelf.model'; import {Button} from '@openng/optimus-ui/button'; import {Checkbox} from '@openng/optimus-ui/checkbox'; import {FormsModule} from '@angular/forms'; -import {BookDialogHelperService} from '../book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from '../../service/book-dialog-helper.service'; import {LoadingService} from '../../../../core/services/loading.service'; import {UserService} from '../../../settings/user-management/user.service'; import {IconDisplayComponent} from '../../../../shared/components/icon-display/icon-display.component'; diff --git a/frontend/src/app/features/book/components/book-browser/book-dialog-helper.service.spec.ts b/frontend/src/app/features/book/service/book-dialog-helper.service.spec.ts similarity index 95% rename from frontend/src/app/features/book/components/book-browser/book-dialog-helper.service.spec.ts rename to frontend/src/app/features/book/service/book-dialog-helper.service.spec.ts index c984d1f61..2e6798532 100644 --- a/frontend/src/app/features/book/components/book-browser/book-dialog-helper.service.spec.ts +++ b/frontend/src/app/features/book/service/book-dialog-helper.service.spec.ts @@ -1,7 +1,7 @@ import {TestBed} from '@angular/core/testing'; import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest'; -import {DialogLauncherService} from '../../../../shared/services/dialog-launcher.service'; +import {DialogLauncherService} from '../../../shared/services/dialog-launcher.service'; import {BookDialogHelperService} from './book-dialog-helper.service'; describe('BookDialogHelperService', () => { diff --git a/frontend/src/app/features/book/components/book-browser/book-dialog-helper.service.ts b/frontend/src/app/features/book/service/book-dialog-helper.service.ts similarity index 80% rename from frontend/src/app/features/book/components/book-browser/book-dialog-helper.service.ts rename to frontend/src/app/features/book/service/book-dialog-helper.service.ts index 92ef67cd7..2125aef56 100644 --- a/frontend/src/app/features/book/components/book-browser/book-dialog-helper.service.ts +++ b/frontend/src/app/features/book/service/book-dialog-helper.service.ts @@ -1,10 +1,10 @@ import {inject, Injectable} from '@angular/core'; import {DynamicDialogRef} from '@openng/optimus-ui/dynamicdialog'; -import {DialogLauncherService, DialogSize, DialogStyle} from '../../../../shared/services/dialog-launcher.service'; -import {MetadataRefreshType} from '../../../metadata/model/request/metadata-refresh-type.enum'; -import {Book} from '../../model/book.model'; -import {type BookSenderSource} from '../book-sender/book-sender.component'; -import {type BookFileAttacherSourceBook} from '../book-file-attacher/book-file-attacher.component'; +import {DialogLauncherService, DialogSize, DialogStyle} from '../../../shared/services/dialog-launcher.service'; +import {MetadataRefreshType} from '../../metadata/model/request/metadata-refresh-type.enum'; +import {Book} from '../model/book.model'; +import {type BookSenderSource} from '../components/book-sender/book-sender.component'; +import {type BookFileAttacherSourceBook} from '../components/book-file-attacher/book-file-attacher.component'; interface MetadataRefreshDialogContext { metadataRefreshType: MetadataRefreshType; @@ -23,7 +23,7 @@ export class BookDialogHelperService { async openBookDetailsDialog(bookId: number): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {BookMetadataCenterComponent} = await import('../../../metadata/component/book-metadata-center/book-metadata-center.component'); + const {BookMetadataCenterComponent} = await import('../../metadata/component/book-metadata-center/book-metadata-center.component'); return this.openDialog(BookMetadataCenterComponent, { showHeader: false, styleClass: `book-details-dialog ${DialogSize.FULL} ${DialogStyle.MINIMAL}`, @@ -47,7 +47,7 @@ export class BookDialogHelperService { } else { return null; } - const {ShelfAssignerComponent} = await import('../shelf-assigner/shelf-assigner.component'); + const {ShelfAssignerComponent} = await import('../components/shelf-assigner/shelf-assigner.component'); return this.openDialog(ShelfAssignerComponent, { showHeader: false, data: data, @@ -58,7 +58,7 @@ export class BookDialogHelperService { async openShelfCreatorDialog(): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {ShelfCreatorComponent} = await import('../shelf-creator/shelf-creator.component'); + const {ShelfCreatorComponent} = await import('../components/shelf-creator/shelf-creator.component'); return this.openDialog(ShelfCreatorComponent, { showHeader: false, styleClass: `${DialogSize.MD} ${DialogStyle.MINIMAL}`, @@ -68,7 +68,7 @@ export class BookDialogHelperService { async openLockUnlockMetadataDialog(bookIds: Set): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {LockUnlockMetadataDialogComponent} = await import('./lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component'); + const {LockUnlockMetadataDialogComponent} = await import('../components/lock-unlock-metadata-dialog/lock-unlock-metadata-dialog.component'); return this.openDialog(LockUnlockMetadataDialogComponent, { showHeader: false, styleClass: `${DialogSize.LG} ${DialogStyle.MINIMAL}`, @@ -88,7 +88,7 @@ export class BookDialogHelperService { async openMetadataRefreshDialogWithContext(context: MetadataRefreshDialogContext): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {MultiBookMetadataFetchComponent} = await import('../../../metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component'); + const {MultiBookMetadataFetchComponent} = await import('../../metadata/component/multi-book-metadata-fetch/multi-book-metadata-fetch-component'); return this.openDialog(MultiBookMetadataFetchComponent, { showHeader: false, styleClass: `${DialogSize.FULL} ${DialogStyle.MINIMAL}`, @@ -103,7 +103,7 @@ export class BookDialogHelperService { async openBulkMetadataEditDialog(bookIds: Set): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {BulkMetadataUpdateComponent} = await import('../../../metadata/component/bulk-metadata-update/bulk-metadata-update-component'); + const {BulkMetadataUpdateComponent} = await import('../../metadata/component/bulk-metadata-update/bulk-metadata-update-component'); return this.openDialog(BulkMetadataUpdateComponent, { showHeader: false, styleClass: `${DialogSize.XL} ${DialogStyle.MINIMAL}`, @@ -116,7 +116,7 @@ export class BookDialogHelperService { async openMultibookMetadataEditorDialog(bookIds: Set): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {MultiBookMetadataEditorComponent} = await import('../../../metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component'); + const {MultiBookMetadataEditorComponent} = await import('../../metadata/component/multi-book-metadata-editor/multi-book-metadata-editor-component'); return this.openDialog(MultiBookMetadataEditorComponent, { showHeader: false, styleClass: `${DialogSize.FULL} ${DialogStyle.MINIMAL}`, @@ -129,7 +129,7 @@ export class BookDialogHelperService { async openFileMoverDialog(bookIds: Set): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {FileMoverComponent} = await import('../../../../shared/components/file-mover/file-mover-component'); + const {FileMoverComponent} = await import('../../../shared/components/file-mover/file-mover-component'); return this.openDialog(FileMoverComponent, { showHeader: false, styleClass: `${DialogSize.FULL} ${DialogStyle.MINIMAL}`, @@ -143,7 +143,7 @@ export class BookDialogHelperService { async openCustomSendDialog(book: BookSenderSource): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {BookSenderComponent} = await import('../book-sender/book-sender.component'); + const {BookSenderComponent} = await import('../components/book-sender/book-sender.component'); return this.openDialog(BookSenderComponent, { showHeader: false, styleClass: `${DialogSize.SM} ${DialogStyle.MINIMAL}`, @@ -156,7 +156,7 @@ export class BookDialogHelperService { async openCoverSearchDialog(bookId: number, coverType?: 'ebook' | 'audiobook'): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {CoverSearchComponent} = await import('../../../metadata/component/cover-search/cover-search.component'); + const {CoverSearchComponent} = await import('../../metadata/component/cover-search/cover-search.component'); return this.openDialog(CoverSearchComponent, { showHeader: false, styleClass: `${DialogSize.FULL} ${DialogStyle.MINIMAL}`, @@ -170,7 +170,7 @@ export class BookDialogHelperService { async openAdditionalFileUploaderDialog(book: Book): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {AdditionalFileUploaderComponent} = await import('../additional-file-uploader/additional-file-uploader.component'); + const {AdditionalFileUploaderComponent} = await import('../components/additional-file-uploader/additional-file-uploader.component'); return this.openDialog(AdditionalFileUploaderComponent, { showHeader: false, styleClass: `${DialogSize.MD} ${DialogStyle.MINIMAL}`, @@ -183,7 +183,7 @@ export class BookDialogHelperService { async openBookFileAttacherDialog(sourceBook: Book): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {BookFileAttacherComponent} = await import('../book-file-attacher/book-file-attacher.component'); + const {BookFileAttacherComponent} = await import('../components/book-file-attacher/book-file-attacher.component'); return this.openDialog(BookFileAttacherComponent, { showHeader: false, styleClass: `${DialogSize.MD} ${DialogStyle.MINIMAL}`, @@ -198,7 +198,7 @@ export class BookDialogHelperService { sourceBooks: readonly BookFileAttacherSourceBook[], ): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {BookFileAttacherComponent} = await import('../book-file-attacher/book-file-attacher.component'); + const {BookFileAttacherComponent} = await import('../components/book-file-attacher/book-file-attacher.component'); return this.openDialog(BookFileAttacherComponent, { showHeader: false, styleClass: `${DialogSize.MD} ${DialogStyle.MINIMAL}`, @@ -211,7 +211,7 @@ export class BookDialogHelperService { async openDuplicateMergerDialog(libraryId: number): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {DuplicateMergerComponent} = await import('../duplicate-merger/duplicate-merger.component'); + const {DuplicateMergerComponent} = await import('../components/duplicate-merger/duplicate-merger.component'); return this.openDialog(DuplicateMergerComponent, { showHeader: false, styleClass: `${DialogSize.XL} ${DialogStyle.MINIMAL}`, @@ -224,7 +224,7 @@ export class BookDialogHelperService { async openAddPhysicalBookDialog(libraryId?: number): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {AddPhysicalBookDialogComponent} = await import('../add-physical-book-dialog/add-physical-book-dialog.component'); + const {AddPhysicalBookDialogComponent} = await import('../components/add-physical-book-dialog/add-physical-book-dialog.component'); return this.openDialog(AddPhysicalBookDialogComponent, { showHeader: false, styleClass: `${DialogSize.LG} ${DialogStyle.MINIMAL}`, @@ -237,7 +237,7 @@ export class BookDialogHelperService { async openBulkIsbnImportDialog(libraryId?: number): Promise { return this.dialogLauncherService.launchLazyDialog(async () => { - const {BulkIsbnImportDialogComponent} = await import('../bulk-isbn-import-dialog/bulk-isbn-import-dialog.component'); + const {BulkIsbnImportDialogComponent} = await import('../components/bulk-isbn-import-dialog/bulk-isbn-import-dialog.component'); return this.openDialog(BulkIsbnImportDialogComponent, { showHeader: false, styleClass: `${DialogSize.LG} ${DialogStyle.MINIMAL}`, diff --git a/frontend/src/app/features/book/service/book-navigation.service.spec.ts b/frontend/src/app/features/book/service/book-navigation.service.spec.ts index fba4638b6..a2f223f0d 100644 --- a/frontend/src/app/features/book/service/book-navigation.service.spec.ts +++ b/frontend/src/app/features/book/service/book-navigation.service.spec.ts @@ -3,7 +3,7 @@ import {Router} from '@angular/router'; import {beforeEach, describe, expect, it, vi} from 'vitest'; import {UserService} from '../../settings/user-management/user.service'; -import {BookDialogHelperService} from '../components/book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from './book-dialog-helper.service'; import {BookNavigationService} from './book-navigation.service'; const navigate = vi.fn(() => Promise.resolve(true)); diff --git a/frontend/src/app/features/book/service/book-navigation.service.ts b/frontend/src/app/features/book/service/book-navigation.service.ts index f1b957691..37e69c99b 100644 --- a/frontend/src/app/features/book/service/book-navigation.service.ts +++ b/frontend/src/app/features/book/service/book-navigation.service.ts @@ -3,7 +3,7 @@ import {Router} from '@angular/router'; import {UserService} from '../../settings/user-management/user.service'; import {type BookFileResponse, type BookFileType, type BookSummary} from '../data/book-response.models'; -import {BookDialogHelperService} from '../components/book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from './book-dialog-helper.service'; export interface BookNavigationState { bookIds: number[]; diff --git a/frontend/src/app/features/book/service/library-shelf-menu.service.spec.ts b/frontend/src/app/features/book/service/library-shelf-menu.service.spec.ts index 860b6808a..0372d9c67 100644 --- a/frontend/src/app/features/book/service/library-shelf-menu.service.spec.ts +++ b/frontend/src/app/features/book/service/library-shelf-menu.service.spec.ts @@ -9,7 +9,7 @@ import {LoadingService} from '../../../core/services/loading.service'; import {DialogLauncherService} from '../../../shared/services/dialog-launcher.service'; import {MagicShelfService} from '../../magic-shelf/service/magic-shelf.service'; import {TaskHelperService} from '../../settings/task-management/task-helper.service'; -import {BookDialogHelperService} from '../components/book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from './book-dialog-helper.service'; import {LibraryService} from './library.service'; import {LibraryShelfMenuService} from './library-shelf-menu.service'; import {ShelfService} from './shelf.service'; diff --git a/frontend/src/app/features/book/service/library-shelf-menu.service.ts b/frontend/src/app/features/book/service/library-shelf-menu.service.ts index 73dc9fa6a..bafba2aa6 100644 --- a/frontend/src/app/features/book/service/library-shelf-menu.service.ts +++ b/frontend/src/app/features/book/service/library-shelf-menu.service.ts @@ -9,7 +9,7 @@ import {DialogLauncherService} from '../../../shared/services/dialog-launcher.se import {MagicShelfService} from '../../magic-shelf/service/magic-shelf.service'; import {MetadataRefreshType} from '../../metadata/model/request/metadata-refresh-type.enum'; import {TaskHelperService} from '../../settings/task-management/task-helper.service'; -import {BookDialogHelperService} from '../components/book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from './book-dialog-helper.service'; import {LibraryService} from './library.service'; import {ShelfService} from './shelf.service'; diff --git a/frontend/src/app/features/command-palette/command-palette.service.spec.ts b/frontend/src/app/features/command-palette/command-palette.service.spec.ts index 9cc4540c4..aeb4bb5fc 100644 --- a/frontend/src/app/features/command-palette/command-palette.service.spec.ts +++ b/frontend/src/app/features/command-palette/command-palette.service.spec.ts @@ -8,7 +8,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { MessageService } from '@openng/optimus-ui/api'; import { createQueryClientHarness } from '../../core/testing/query-testing'; import { getTranslocoModule } from '../../core/testing/transloco-testing'; -import { BookDialogHelperService } from '../book/components/book-browser/book-dialog-helper.service'; +import { BookDialogHelperService } from '../book/service/book-dialog-helper.service'; import { BookPage } from '../book/data/book-query.models'; import { BookQueryService } from '../book/data/book-query.service'; import { BookSummary } from '../book/data/book-response.models'; diff --git a/frontend/src/app/features/command-palette/command-palette.service.ts b/frontend/src/app/features/command-palette/command-palette.service.ts index 020225561..91657e825 100644 --- a/frontend/src/app/features/command-palette/command-palette.service.ts +++ b/frontend/src/app/features/command-palette/command-palette.service.ts @@ -5,7 +5,7 @@ import { Router } from '@angular/router'; import { TranslocoService } from '@jsverse/transloco'; import { injectQuery, QueryClient } from '@tanstack/angular-query-experimental'; -import { BookDialogHelperService } from '../book/components/book-browser/book-dialog-helper.service'; +import { BookDialogHelperService } from '../book/service/book-dialog-helper.service'; import { BookPageParams, EMPTY_FACET_SELECTION } from '../book/data/book-query-params'; import { BookSummary } from '../book/data/book-response.models'; import { BookQueryService } from '../book/data/book-query.service'; diff --git a/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.html b/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.html index c56784b78..b45c029f5 100644 --- a/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.html +++ b/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.html @@ -20,13 +20,13 @@
@for (book of books(); track book.id; let i = $index) {
- - +
}
diff --git a/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.ts b/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.ts index 64ec683b2..3b5524236 100644 --- a/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.ts +++ b/frontend/src/app/features/dashboard/components/dashboard-scroller/dashboard-scroller.component.ts @@ -2,8 +2,8 @@ import {ChangeDetectionStrategy, Component, computed, input} from '@angular/core import {NgClass} from '@angular/common'; import {Book} from '../../../book/model/book.model'; import {ScrollerType} from '../../models/dashboard-config.model'; -import {BookCardComponent} from '../../../book/components/book-browser/book-card/book-card.component'; -import {BookCardOverlayPreferenceService} from '../../../book/components/book-browser/book-card-overlay-preference.service'; +import {LegacyBookCardComponent} from '../../../book/components/legacy-book-card/legacy-book-card.component'; +import {BookCardOverlayPreferenceService} from '../../../book/components/legacy-book-card/book-card-overlay-preference.service'; import {TranslocoDirective, TranslocoPipe} from '@jsverse/transloco'; @Component({ @@ -12,7 +12,7 @@ import {TranslocoDirective, TranslocoPipe} from '@jsverse/transloco'; templateUrl: './dashboard-scroller.component.html', styleUrls: ['./dashboard-scroller.component.scss'], imports: [ - BookCardComponent, + LegacyBookCardComponent, NgClass, TranslocoDirective, TranslocoPipe diff --git a/frontend/src/app/features/dashboard/components/main-dashboard/main-dashboard.component.ts b/frontend/src/app/features/dashboard/components/main-dashboard/main-dashboard.component.ts index 8e9cecdcb..e96c322be 100644 --- a/frontend/src/app/features/dashboard/components/main-dashboard/main-dashboard.component.ts +++ b/frontend/src/app/features/dashboard/components/main-dashboard/main-dashboard.component.ts @@ -10,7 +10,7 @@ import {ScrollerConfig, ScrollerType} from '../../models/dashboard-config.model' import {DialogLauncherService} from '../../../../shared/services/dialog-launcher.service'; import {PageTitleService} from '../../../../shared/service/page-title.service'; import {LibraryService} from '../../../book/service/library.service'; -import {BookCardOverlayPreferenceService} from '../../../book/components/book-browser/book-card-overlay-preference.service'; +import {BookCardOverlayPreferenceService} from '../../../book/components/legacy-book-card/book-card-overlay-preference.service'; import {DashboardBookService} from '../../services/dashboard-book.service'; import {Book} from '../../../book/model/book.model'; diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.ts b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.ts index 09c7e3603..662f7a9b6 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-editor/metadata-editor.component.ts @@ -24,7 +24,7 @@ import {DatePicker} from "@openng/optimus-ui/datepicker"; import {Textarea} from "@openng/optimus-ui/textarea"; import {Select} from "@openng/optimus-ui/select"; import {TaskHelperService} from '../../../../settings/task-management/task-helper.service'; -import {BookDialogHelperService} from "../../../../book/components/book-browser/book-dialog-helper.service"; +import {BookDialogHelperService} from "../../../../book/service/book-dialog-helper.service"; import {BookNavigationService} from '../../../../book/service/book-navigation.service'; import {BookMetadataHostService} from '../../../../../shared/service/book-metadata-host.service'; import {Router} from '@angular/router'; diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.spec.ts b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.spec.ts index 4ccbc5608..6786ddd7b 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.spec.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.spec.ts @@ -15,7 +15,7 @@ import {AppSettingsService} from '../../../../../shared/service/app-settings.ser import {UrlHelperService} from '../../../../../shared/service/url-helper.service'; import {UserService} from '../../../../settings/user-management/user.service'; import {EmailService} from '../../../../settings/email-v2/email.service'; -import {BookDialogHelperService} from '../../../../book/components/book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from '../../../../book/service/book-dialog-helper.service'; import {LibraryService} from '../../../../book/service/library.service'; import {TaskHelperService} from '../../../../settings/task-management/task-helper.service'; import {AuthorService} from '../../../../author-browser/service/author.service'; diff --git a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts index 077eff92b..e3af10bf9 100644 --- a/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts +++ b/frontend/src/app/features/metadata/component/book-metadata-center/metadata-viewer/metadata-viewer.component.ts @@ -25,7 +25,7 @@ import {ResetProgressType, ResetProgressTypes} from '../../../../../shared/const import {DatePicker} from '@openng/optimus-ui/datepicker'; import {ProgressSpinner} from '@openng/optimus-ui/progressspinner'; import {TieredMenu} from '@openng/optimus-ui/tieredmenu'; -import {BookDialogHelperService} from '../../../../book/components/book-browser/book-dialog-helper.service'; +import {BookDialogHelperService} from '../../../../book/service/book-dialog-helper.service'; import {LibraryService} from '../../../../book/service/library.service'; import {TagColor, TagComponent} from '../../../../../shared/components/tag/tag.component'; import {TaskHelperService} from '../../../../settings/task-management/task-helper.service'; diff --git a/frontend/src/app/features/settings/reader-preferences/cbx-reader-preferences/cbx-reader-preferences-component.spec.ts b/frontend/src/app/features/settings/reader-preferences/cbx-reader-preferences/cbx-reader-preferences-component.spec.ts index 389dd7dbc..d88712330 100644 --- a/frontend/src/app/features/settings/reader-preferences/cbx-reader-preferences/cbx-reader-preferences-component.spec.ts +++ b/frontend/src/app/features/settings/reader-preferences/cbx-reader-preferences/cbx-reader-preferences-component.spec.ts @@ -17,7 +17,6 @@ function createUserSettings(): UserSettings { sidebarLibrarySorting: {field: 'name', order: 'ASC'}, sidebarShelfSorting: {field: 'name', order: 'ASC'}, sidebarMagicShelfSorting: {field: 'name', order: 'ASC'}, - filterMode: 'and', metadataCenterViewMode: 'route', enableSeriesView: true, entityViewPreferences: {global: {sortKey: 'title', sortDir: 'ASC', view: 'GRID', coverSize: 100, seriesCollapsed: false, overlayBookType: false}, overrides: []}, diff --git a/frontend/src/app/features/settings/reader-preferences/pdf-reader-preferences/pdf-reader-preferences-component.spec.ts b/frontend/src/app/features/settings/reader-preferences/pdf-reader-preferences/pdf-reader-preferences-component.spec.ts index dceff9864..c8994b75d 100644 --- a/frontend/src/app/features/settings/reader-preferences/pdf-reader-preferences/pdf-reader-preferences-component.spec.ts +++ b/frontend/src/app/features/settings/reader-preferences/pdf-reader-preferences/pdf-reader-preferences-component.spec.ts @@ -17,7 +17,6 @@ function createUserSettings(): UserSettings { sidebarLibrarySorting: {field: 'name', order: 'ASC'}, sidebarShelfSorting: {field: 'name', order: 'ASC'}, sidebarMagicShelfSorting: {field: 'name', order: 'ASC'}, - filterMode: 'and', metadataCenterViewMode: 'route', enableSeriesView: true, entityViewPreferences: {global: {sortKey: 'title', sortDir: 'ASC', view: 'GRID', coverSize: 100, seriesCollapsed: false, overlayBookType: false}, overrides: []}, diff --git a/frontend/src/app/features/settings/reader-preferences/reader-preferences.service.spec.ts b/frontend/src/app/features/settings/reader-preferences/reader-preferences.service.spec.ts index ecbb9ff50..0f2867df6 100644 --- a/frontend/src/app/features/settings/reader-preferences/reader-preferences.service.spec.ts +++ b/frontend/src/app/features/settings/reader-preferences/reader-preferences.service.spec.ts @@ -19,7 +19,6 @@ describe('ReaderPreferencesService', () => { sidebarLibrarySorting: {field: 'name', order: 'ASC'}, sidebarShelfSorting: {field: 'name', order: 'ASC'}, sidebarMagicShelfSorting: {field: 'name', order: 'ASC'}, - filterMode: 'and', metadataCenterViewMode: 'route', enableSeriesView: true, entityViewPreferences: {global: {sortKey: 'title', sortDir: 'ASC', view: 'GRID', coverSize: 100, seriesCollapsed: false, overlayBookType: false}, overrides: []}, diff --git a/frontend/src/app/features/settings/reader-preferences/settings-application-mode/settings-application-mode.component.spec.ts b/frontend/src/app/features/settings/reader-preferences/settings-application-mode/settings-application-mode.component.spec.ts index 4feb4d857..8bd9ebe8b 100644 --- a/frontend/src/app/features/settings/reader-preferences/settings-application-mode/settings-application-mode.component.spec.ts +++ b/frontend/src/app/features/settings/reader-preferences/settings-application-mode/settings-application-mode.component.spec.ts @@ -18,7 +18,6 @@ describe('SettingsApplicationModeComponent', () => { sidebarLibrarySorting: {field: 'name', order: 'ASC'}, sidebarShelfSorting: {field: 'name', order: 'ASC'}, sidebarMagicShelfSorting: {field: 'name', order: 'ASC'}, - filterMode: 'and', metadataCenterViewMode: 'route', enableSeriesView: true, entityViewPreferences: {global: {sortKey: 'title', sortDir: 'ASC', view: 'GRID', coverSize: 100, seriesCollapsed: false, overlayBookType: false}, overrides: []}, diff --git a/frontend/src/app/features/settings/user-management/user.service.spec.ts b/frontend/src/app/features/settings/user-management/user.service.spec.ts index c0a600ccd..0277a7931 100644 --- a/frontend/src/app/features/settings/user-management/user.service.spec.ts +++ b/frontend/src/app/features/settings/user-management/user.service.spec.ts @@ -45,7 +45,6 @@ function buildUserSettings(overrides: Partial = {}): UserSettings sidebarLibrarySorting: {field: 'name', order: 'ASC'}, sidebarShelfSorting: {field: 'name', order: 'ASC'}, sidebarMagicShelfSorting: {field: 'name', order: 'ASC'}, - filterMode: 'and', metadataCenterViewMode: 'route', enableSeriesView: true, entityViewPreferences: { @@ -216,24 +215,24 @@ describe('UserService', () => { await flushCurrentUserQuery(); service.setInitialUser(buildUser({ id: 21, - userSettings: buildUserSettings({filterMode: 'and'}), + userSettings: buildUserSettings({metadataCenterViewMode: 'route'}), })); await flushCurrentUserQuery(); - service.updateUserSetting(21, 'filterMode', 'or'); + service.updateUserSetting(21, 'metadataCenterViewMode', 'dialog'); const request = httpTestingController.expectOne(req => req.url.endsWith('/api/v1/users/21/settings')); expect(request.request.method).toBe('PUT'); - expect(request.request.body).toEqual({key: 'filterMode', value: 'or'}); + expect(request.request.body).toEqual({key: 'metadataCenterViewMode', value: 'dialog'}); expect(request.request.headers.get('Content-Type')).toBe('application/json'); request.flush(''); await flushCurrentUserQuery(); - expect(service.currentUser()?.userSettings.filterMode).toBe('or'); + expect(service.currentUser()?.userSettings.metadataCenterViewMode).toBe('dialog'); expect(queryClientHarness.queryClient.getQueryData(CURRENT_USER_QUERY_KEY)).toEqual( expect.objectContaining({ id: 21, - userSettings: expect.objectContaining({filterMode: 'or'}), + userSettings: expect.objectContaining({metadataCenterViewMode: 'dialog'}), }), ); }); diff --git a/frontend/src/app/features/settings/user-management/user.service.ts b/frontend/src/app/features/settings/user-management/user.service.ts index 7483999d1..644a2ad2a 100644 --- a/frontend/src/app/features/settings/user-management/user.service.ts +++ b/frontend/src/app/features/settings/user-management/user.service.ts @@ -60,7 +60,6 @@ export interface PerBookSetting { } export type PageSpread = 'off' | 'even' | 'odd'; -export type BookFilterMode = 'and' | 'or' | 'single' | 'not'; export enum CbxPageViewMode { @@ -224,77 +223,6 @@ export interface TableColumnPreference { order: number; } -export type VisibleFilterType = - | 'author' | 'category' | 'series' | 'bookType' | 'readStatus' - | 'personalRating' | 'publisher' | 'matchScore' | 'library' | 'shelf' - | 'shelfStatus' | 'tag' | 'publishedDate' | 'fileSize' | 'amazonRating' - | 'goodreadsRating' | 'hardcoverRating' | 'lubimyczytacRating' | 'ranobedbRating' - | 'audibleRating' | 'language' | 'pageCount' | 'mood' - | 'ageRating' | 'contentRating' - | 'narrator' - | 'comicCharacter' | 'comicTeam' | 'comicLocation' | 'comicCreator'; - -export const DEFAULT_VISIBLE_FILTERS: VisibleFilterType[] = [ - 'author', 'category', 'series', 'bookType', 'readStatus', - 'personalRating', 'amazonRating', 'goodreadsRating', 'hardcoverRating', - 'lubimyczytacRating', 'ranobedbRating', 'audibleRating', - 'library', 'shelf', 'tag', 'ageRating', 'contentRating', - 'matchScore', 'publisher', 'publishedDate', 'fileSize', - 'pageCount', 'shelfStatus', 'language', 'mood', 'narrator', - 'comicCharacter', 'comicTeam', 'comicLocation', 'comicCreator' -]; - -// Translation key for each filter option — use book.filter.labels. -export const ALL_FILTER_OPTION_VALUES: VisibleFilterType[] = [ - 'author', 'category', 'series', 'bookType', 'readStatus', - 'personalRating', 'library', 'tag', 'ageRating', 'contentRating', - 'matchScore', 'publisher', 'publishedDate', 'fileSize', 'shelf', - 'shelfStatus', 'language', 'pageCount', 'mood', 'amazonRating', - 'goodreadsRating', 'hardcoverRating', 'lubimyczytacRating', 'ranobedbRating', - 'audibleRating', 'narrator', - 'comicCharacter', 'comicTeam', 'comicLocation', 'comicCreator' -]; - -export const ALL_FILTER_OPTIONS: { label: string; value: VisibleFilterType }[] = [ - { label: 'Author', value: 'author' }, - { label: 'Genre', value: 'category' }, - { label: 'Series', value: 'series' }, - { label: 'Book Type', value: 'bookType' }, - { label: 'Read Status', value: 'readStatus' }, - { label: 'Personal Rating', value: 'personalRating' }, - { label: 'Library', value: 'library' }, - { label: 'Tag', value: 'tag' }, - { label: 'Age Rating', value: 'ageRating' }, - { label: 'Content Rating', value: 'contentRating' }, - { label: 'Metadata Match Score', value: 'matchScore' }, - { label: 'Publisher', value: 'publisher' }, - { label: 'Published Year', value: 'publishedDate' }, - { label: 'File Size', value: 'fileSize' }, - { label: 'Shelf', value: 'shelf' }, - { label: 'Shelf Status', value: 'shelfStatus' }, - { label: 'Language', value: 'language' }, - { label: 'Page Count', value: 'pageCount' }, - { label: 'Mood', value: 'mood' }, - { label: 'Amazon Rating', value: 'amazonRating' }, - { label: 'Goodreads Rating', value: 'goodreadsRating' }, - { label: 'Hardcover Rating', value: 'hardcoverRating' }, - { label: 'Lubimyczytac Rating', value: 'lubimyczytacRating' }, - { label: 'RanobeDB Rating', value: 'ranobedbRating' }, - { label: 'Audible Rating', value: 'audibleRating' }, - { label: 'Narrator', value: 'narrator' }, - { label: 'Comic Character', value: 'comicCharacter' }, - { label: 'Comic Team', value: 'comicTeam' }, - { label: 'Comic Location', value: 'comicLocation' }, - { label: 'Comic Creator', value: 'comicCreator' } -]; - -export const DEFAULT_VISIBLE_SORT_FIELDS: string[] = [ - 'title', 'seriesName', 'fileName', 'filePath', - 'author', 'authorSurnameVorname', 'seriesNumber', - 'lastReadTime', 'personalRating', 'addedOn', - 'fileSizeKb', 'locked', 'publisher', 'publishedDate', 'pageCount', 'random' -]; - export interface UserSettings { perBookSetting: PerBookSetting; pdfReaderSetting: PdfReaderSetting; @@ -305,9 +233,6 @@ export interface UserSettings { sidebarLibrarySorting: SidebarLibrarySorting; sidebarShelfSorting: SidebarShelfSorting; sidebarMagicShelfSorting: SidebarMagicShelfSorting; - filterMode: BookFilterMode; - visibleFilters?: VisibleFilterType[]; - visibleSortFields?: string[]; metadataCenterViewMode: 'route' | 'dialog'; enableSeriesView: boolean; entityViewPreferences: EntityViewPreferences; diff --git a/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.html b/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.html deleted file mode 100644 index 51024ee14..000000000 --- a/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.html +++ /dev/null @@ -1,92 +0,0 @@ - -
-
-

- - {{ t('sectionTitle') }} -

-

- {{ t('sectionDesc') }} -

-
- -
-
-
- {{ t('filterMode') }} -
-

{{ t('filterModeDesc') }}

-
- - -
-
- -
-
- {{ t('visibleFilters') }} -
-

- {{ t('visibleFiltersDesc', {min: minFilters, max: maxFilters}) }} - ({{ selectionCountText }}) -

-
-
- @for (f of selectedVisibleFilters; track f; let i = $index) { -
-
- -
- {{ i + 1 }}. - {{ getFilterLabel(f) }} - -
- } -
-
- @if (availableFilters.length > 0 && selectedVisibleFilters.length < maxFilters) { - - - } - -
-
-
- -
-
-
diff --git a/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.scss b/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.scss deleted file mode 100644 index df4c49623..000000000 --- a/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.scss +++ /dev/null @@ -1,196 +0,0 @@ -@use '../../../../shared/styles/settings-shared' as settings; - -.settings-card { - @include settings.settings-card; -} - -.section-header { - @include settings.settings-section-header; -} - -.section-title { - @include settings.settings-section-title; -} - -.section-description { - @include settings.settings-section-description; -} - -.section-body { - @include settings.settings-section-body; -} - -.setting-item { - @include settings.settings-item; -} - -.setting-header-standalone { - @include settings.settings-item-header-standalone; -} - -.setting-label { - @include settings.settings-label; -} - -.setting-description { - @include settings.settings-item-description; -} - -.setting-options { - @include settings.settings-options; - - p-select { - min-width: 200px; - - @media (width <= 768px) { - min-width: 100%; - width: 100%; - } - } -} - -.filter-count { - font-weight: 500; - color: var(--p-primary-color); -} - -// Filter order editor styles -.filter-order-editor { - margin-top: 0.6563rem; -} - -.filter-order-list { - display: flex; - flex-direction: column; - gap: 0.4375rem; - min-height: 40px; - max-height: 320px; - max-width: 350px; - overflow-y: auto; - margin-bottom: 0.6563rem; -} - -.filter-order-row { - display: flex; - align-items: center; - gap: 0.4375rem; - padding: 0.4375rem 0.6563rem; - background-color: var(--overlay-background); - border: 1px solid var(--border-color); - border-radius: 6px; - cursor: move; - transition: background-color 0.15s ease, box-shadow 0.15s ease; - - &:hover { - background-color: var(--ground-background); - } -} - -.cdk-drag-preview { - display: flex; - align-items: center; - gap: 0.4375rem; - padding: 0.3063rem 0.6563rem; - background-color: var(--card-background); - border: 1px solid var(--primary-color); - border-radius: 6px; - box-shadow: 0 5px 15px rgb(0 0 0 / 25%); -} - -.cdk-drag-placeholder { - opacity: 0.3; -} - -.cdk-drag-animating { - transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); -} - -.filter-order-list.cdk-drop-list-dragging .filter-order-row:not(.cdk-drag-placeholder) { - transition: transform 250ms cubic-bezier(0, 0, 0.2, 1); -} - -.filter-drag-handle { - display: flex; - align-items: center; - justify-content: center; - color: var(--text-secondary-color); - cursor: grab; - - &:active { - cursor: grabbing; - } - - i { - font-size: 0.7438rem; - } -} - -.filter-rank { - font-weight: 600; - color: var(--primary-color); - min-width: 1.5313rem; -} - -.filter-label { - flex: 1; - font-size: var(--app-text-sm); - color: var(--text-color); -} - -.remove-filter-btn { - display: flex; - align-items: center; - justify-content: center; - width: 1.5313rem; - height: 1.5313rem; - padding: 0; - border: none; - border-radius: 4px; - background-color: transparent; - color: var(--p-red-500); - cursor: pointer; - transition: background-color 0.15s ease; - - i { - font-size: 0.7438rem; - } - - &:hover:not(:disabled) { - background-color: var(--ground-background); - } - - &:disabled { - opacity: 0.4; - cursor: not-allowed; - } -} - -.filter-actions-row { - display: flex; - align-items: center; - gap: 0.4375rem; -} - -.reset-btn { - display: flex; - align-items: center; - justify-content: center; - width: 1.5313rem; - height: 1.5313rem; - padding: 0; - border: none; - border-radius: 4px; - background-color: transparent; - color: var(--text-secondary-color); - cursor: pointer; - transition: background-color 0.15s ease, color 0.15s ease; - - i { - font-size: 0.7438rem; - } - - &:hover { - background-color: var(--ground-background); - color: var(--primary-color); - } -} diff --git a/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.spec.ts b/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.spec.ts deleted file mode 100644 index f25631448..000000000 --- a/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {describe, it} from 'vitest'; - -// NOTE(frontend-seam): Real coverage here needs seams around signal-backed user-preference -// hydration, drag/drop reorder behavior, and Optimus UI selection widgets so filter persistence can -// be asserted without the full view-preferences runtime. -describe.skip('FilterPreferencesComponent', () => { - it('needs preference seams to verify bootstrap, reset, and save behavior for filter visibility state', () => { - // TODO(seam): Cover the effect-driven settings sync once user preferences can be injected through deterministic doubles. - }); - - it('needs drag/drop seams to verify ordering and selection changes without CDK/Optimus UI widget runtime coupling', () => { - // TODO(seam): Cover reorder and toggle flows after the drag-drop and pick-list interactions are isolated behind a testable adapter. - }); -}); diff --git a/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.ts b/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.ts deleted file mode 100644 index b9e376c7a..000000000 --- a/frontend/src/app/features/settings/view-preferences-parent/filter-preferences/filter-preferences.component.ts +++ /dev/null @@ -1,146 +0,0 @@ -import {Component, effect, ElementRef, inject, viewChild} from '@angular/core'; -import {Select} from '@openng/optimus-ui/select'; -import {ALL_FILTER_OPTION_VALUES, ALL_FILTER_OPTIONS, BookFilterMode, DEFAULT_VISIBLE_FILTERS, User, UserService, UserSettings, VisibleFilterType} from '../../user-management/user.service'; -import {FILTER_LABEL_KEYS} from '../../../book/components/book-browser/book-filter/book-filter.config'; -import {MessageService} from '@openng/optimus-ui/api'; -import {FormsModule} from '@angular/forms'; -import {CdkDrag, CdkDragDrop, CdkDragHandle, CdkDropList, moveItemInArray} from '@angular/cdk/drag-drop'; -import {Tooltip} from '@openng/optimus-ui/tooltip'; -import {TranslocoDirective, TranslocoPipe, TranslocoService} from '@jsverse/transloco'; - -const MIN_VISIBLE_FILTERS = 5; -const MAX_VISIBLE_FILTERS = 50; -type MutableSettingsBranch = Record; - -@Component({ - selector: 'app-filter-preferences', - imports: [ - Select, - FormsModule, - CdkDropList, - CdkDrag, - CdkDragHandle, - Tooltip, - TranslocoDirective, - TranslocoPipe - ], - templateUrl: './filter-preferences.component.html', - styleUrl: './filter-preferences.component.scss' -}) -export class FilterPreferencesComponent { - - readonly filterModes = [ - {label: 'And', value: 'and'}, - {label: 'Or', value: 'or'}, - {label: 'Single', value: 'single'}, - ]; - - readonly allFilterOptions = ALL_FILTER_OPTIONS; - readonly minFilters = MIN_VISIBLE_FILTERS; - readonly maxFilters = MAX_VISIBLE_FILTERS; - - selectedFilterMode: BookFilterMode = 'and'; - selectedVisibleFilters: VisibleFilterType[] = [...DEFAULT_VISIBLE_FILTERS]; - - private readonly filterList = viewChild>('filterList'); - - private readonly userService = inject(UserService); - private readonly messageService = inject(MessageService); - private readonly t = inject(TranslocoService); - - private currentUser: User | null = null; - private hasInitialized = false; - - constructor() { - effect(() => { - const user = this.userService.currentUser(); - if (!user) return; - - this.currentUser = user; - if (!this.hasInitialized) { - this.hasInitialized = true; - this.loadPreferences(user.userSettings); - } - }); - } - - private loadPreferences(settings: UserSettings): void { - this.selectedFilterMode = settings.filterMode ?? 'and'; - this.selectedVisibleFilters = settings.visibleFilters ?? [...DEFAULT_VISIBLE_FILTERS]; - } - - private updatePreference(path: string[], value: unknown): void { - if (!this.currentUser) return; - - let target = this.currentUser.userSettings as unknown as MutableSettingsBranch; - for (let i = 0; i < path.length - 1; i++) { - const next = target[path[i]]; - if (!next || typeof next !== 'object') { - target[path[i]] = {}; - } - target = target[path[i]] as MutableSettingsBranch; - } - target[path.at(-1)!] = value; - - const [rootKey] = path; - const updatedValue = this.currentUser.userSettings[rootKey as keyof UserSettings]; - this.userService.updateUserSetting(this.currentUser.id, rootKey, updatedValue); - this.messageService.add({ - severity: 'success', - summary: this.t.translate('settingsView.sidebarSort.prefsUpdated'), - detail: this.t.translate('settingsView.sidebarSort.prefsUpdatedDetail'), - life: 1500 - }); - } - - onFilterModeChange(): void { - this.updatePreference(['filterMode'], this.selectedFilterMode); - } - - selectedAddFilter: string | null = null; - - get availableFilters(): {label: string; value: string}[] { - const used = new Set(this.selectedVisibleFilters); - return ALL_FILTER_OPTION_VALUES - .filter(v => !used.has(v)) - .map(v => ({label: this.getFilterLabel(v), value: v})); - } - - getFilterLabel(value: string): string { - const key = FILTER_LABEL_KEYS[value as keyof typeof FILTER_LABEL_KEYS]; - return key ? this.t.translate(key) : value; - } - - onDrop(event: CdkDragDrop): void { - moveItemInArray(this.selectedVisibleFilters, event.previousIndex, event.currentIndex); - this.updatePreference(['visibleFilters'], this.selectedVisibleFilters); - } - - addFilter(): void { - if (this.selectedAddFilter) { - this.selectedVisibleFilters.push(this.selectedAddFilter as VisibleFilterType); - this.selectedAddFilter = null; - this.updatePreference(['visibleFilters'], this.selectedVisibleFilters); - requestAnimationFrame(() => { - const el = this.filterList()?.nativeElement; - if (el) el.scrollTop = el.scrollHeight; - }); - } - } - - removeFilter(index: number): void { - if (this.selectedVisibleFilters.length > MIN_VISIBLE_FILTERS) { - this.selectedVisibleFilters.splice(index, 1); - this.updatePreference(['visibleFilters'], this.selectedVisibleFilters); - } - } - - resetToDefaults(): void { - this.selectedVisibleFilters = [...DEFAULT_VISIBLE_FILTERS]; - this.updatePreference(['visibleFilters'], this.selectedVisibleFilters); - } - - get selectionCountText(): string { - return this.t.translate('settingsView.filter.selectionCount', {count: this.selectedVisibleFilters.length, total: this.allFilterOptions.length}); - } -} diff --git a/frontend/src/app/features/settings/view-preferences-parent/view-preferences-parent.component.html b/frontend/src/app/features/settings/view-preferences-parent/view-preferences-parent.component.html index 605a3c4be..89caeb331 100644 --- a/frontend/src/app/features/settings/view-preferences-parent/view-preferences-parent.component.html +++ b/frontend/src/app/features/settings/view-preferences-parent/view-preferences-parent.component.html @@ -16,8 +16,6 @@


- -


diff --git a/frontend/src/app/features/settings/view-preferences-parent/view-preferences-parent.component.ts b/frontend/src/app/features/settings/view-preferences-parent/view-preferences-parent.component.ts index e71384920..b2a570d43 100644 --- a/frontend/src/app/features/settings/view-preferences-parent/view-preferences-parent.component.ts +++ b/frontend/src/app/features/settings/view-preferences-parent/view-preferences-parent.component.ts @@ -5,7 +5,6 @@ import {TableModule} from '@openng/optimus-ui/table'; import {ViewPreferencesComponent} from './view-preferences/view-preferences.component'; import {SidebarSortingPreferencesComponent} from './sidebar-sorting-preferences/sidebar-sorting-preferences.component'; import {MetaCenterViewModeComponent} from './meta-center-view-mode/meta-center-view-mode-component'; -import {FilterPreferencesComponent} from './filter-preferences/filter-preferences.component'; import {DisplayPreferencesComponent} from './display-preferences/display-preferences.component'; import {DashboardPreferencesComponent} from './dashboard-preferences/dashboard-preferences.component'; import {TranslocoDirective, TranslocoService} from '@jsverse/transloco'; @@ -22,7 +21,6 @@ import {LayoutService, SIDEBAR_MAX_WIDTH, SIDEBAR_MIN_WIDTH} from '../../../shar ViewPreferencesComponent, SidebarSortingPreferencesComponent, MetaCenterViewModeComponent, - FilterPreferencesComponent, DisplayPreferencesComponent, DashboardPreferencesComponent, TranslocoDirective, diff --git a/frontend/src/app/shared/layout/layout-sidebar/app.sidebar.component.spec.ts b/frontend/src/app/shared/layout/layout-sidebar/app.sidebar.component.spec.ts index ad917429a..72c0c729b 100644 --- a/frontend/src/app/shared/layout/layout-sidebar/app.sidebar.component.spec.ts +++ b/frontend/src/app/shared/layout/layout-sidebar/app.sidebar.component.spec.ts @@ -6,7 +6,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { MessageService } from '@openng/optimus-ui/api'; import { getTranslocoModule } from '../../../core/testing/transloco-testing'; -import { BookDialogHelperService } from '../../../features/book/components/book-browser/book-dialog-helper.service'; +import { BookDialogHelperService } from '../../../features/book/service/book-dialog-helper.service'; import { BookService } from '../../../features/book/service/book.service'; import { LibraryHealthService } from '../../../features/book/service/library-health.service'; import { LibraryService } from '../../../features/book/service/library.service'; diff --git a/frontend/src/app/shared/layout/layout-sidebar/app.sidebar.component.ts b/frontend/src/app/shared/layout/layout-sidebar/app.sidebar.component.ts index d33777c1b..5713f2b77 100644 --- a/frontend/src/app/shared/layout/layout-sidebar/app.sidebar.component.ts +++ b/frontend/src/app/shared/layout/layout-sidebar/app.sidebar.component.ts @@ -3,7 +3,7 @@ import { Router, RouterLink } from '@angular/router'; import { AppSidebarSectionComponent } from './app.sidebar-section.component'; import { CdkTrapFocus } from '@angular/cdk/a11y'; import { CdkConnectedOverlay, CdkOverlayOrigin, ConnectedPosition } from '@angular/cdk/overlay'; -import { BookDialogHelperService } from '../../../features/book/components/book-browser/book-dialog-helper.service'; +import { BookDialogHelperService } from '../../../features/book/service/book-dialog-helper.service'; import { UnifiedNotificationBoxComponent } from '../../components/unified-notification-popover/unified-notification-popover-component'; import { AppButtonDirective } from '../../components/button/app-button.directive'; import { diff --git a/frontend/src/app/features/book/components/book-browser/cover-scale-preference.service.spec.ts b/frontend/src/app/shared/service/cover-scale-preference.service.spec.ts similarity index 96% rename from frontend/src/app/features/book/components/book-browser/cover-scale-preference.service.spec.ts rename to frontend/src/app/shared/service/cover-scale-preference.service.spec.ts index 1e485cfe5..8655138cd 100644 --- a/frontend/src/app/features/book/components/book-browser/cover-scale-preference.service.spec.ts +++ b/frontend/src/app/shared/service/cover-scale-preference.service.spec.ts @@ -2,7 +2,7 @@ import {TestBed} from '@angular/core/testing'; import {vi, describe, beforeEach, afterEach, expect, it} from 'vitest'; import {CoverScalePreferenceService} from './cover-scale-preference.service'; -import {LocalStorageService} from '../../../../shared/service/local-storage.service'; +import {LocalStorageService} from './local-storage.service'; describe('CoverScalePreferenceService', () => { let service: CoverScalePreferenceService; diff --git a/frontend/src/app/features/book/components/book-browser/cover-scale-preference.service.ts b/frontend/src/app/shared/service/cover-scale-preference.service.ts similarity index 84% rename from frontend/src/app/features/book/components/book-browser/cover-scale-preference.service.ts rename to frontend/src/app/shared/service/cover-scale-preference.service.ts index 0c0248931..43eb47cab 100644 --- a/frontend/src/app/features/book/components/book-browser/cover-scale-preference.service.ts +++ b/frontend/src/app/shared/service/cover-scale-preference.service.ts @@ -1,6 +1,6 @@ import {computed, inject, Injectable} from '@angular/core'; -import {LocalStorageService} from '../../../../shared/service/local-storage.service'; -import {ScalePreference} from '../../../../shared/util/scale-preference.util'; +import {LocalStorageService} from './local-storage.service'; +import {ScalePreference} from '../util/scale-preference.util'; @Injectable({ providedIn: 'root' diff --git a/frontend/src/app/shared/service/url-helper.service.spec.ts b/frontend/src/app/shared/service/url-helper.service.spec.ts index ad97d7b0a..fdb4d3aec 100644 --- a/frontend/src/app/shared/service/url-helper.service.spec.ts +++ b/frontend/src/app/shared/service/url-helper.service.spec.ts @@ -105,24 +105,4 @@ describe('UrlHelperService', () => { }); expect(consoleErrorSpy).toHaveBeenCalledWith('Unsupported book type:', undefined); }); - - it('builds series and generic book filters with the expected router shape', () => { - expect(service.filterBooksBy('series', 'The Wheel of Time')).toEqual({ - commands: ['/series', 'The Wheel of Time'], - extras: undefined, - }); - - expect(service.filterBooksBy('author', 'Ursula K. Le Guin')).toEqual({ - commands: ['/all-books'], - extras: { - queryParams: { - view: 'grid', - sort: 'title', - direction: 'asc', - sidebar: true, - filter: 'author:Ursula%20K.%20Le%20Guin', - }, - }, - }); - }); }); diff --git a/frontend/src/app/shared/service/url-helper.service.ts b/frontend/src/app/shared/service/url-helper.service.ts index ddfaa9033..42db1e18a 100644 --- a/frontend/src/app/shared/service/url-helper.service.ts +++ b/frontend/src/app/shared/service/url-helper.service.ts @@ -108,20 +108,4 @@ export class UrlHelperService { return this.router.createUrlTree([`/${baseUrl}/book/${book.id}`], undefined); } - - filterBooksBy(filterKey: string, filterValue: string) { - if (filterKey === 'series') { - return this.router.createUrlTree(['/series', filterValue]) - } - - return this.router.createUrlTree(['/all-books'], { - queryParams: { - view: 'grid', - sort: 'title', - direction: 'asc', - sidebar: true, - filter: `${filterKey}:${encodeURIComponent(filterValue)}` - } - }); - } } diff --git a/frontend/src/app/shared/util/virtual-grid.util.ts b/frontend/src/app/shared/util/virtual-grid.util.ts index d1a5bd539..ae055519d 100644 --- a/frontend/src/app/shared/util/virtual-grid.util.ts +++ b/frontend/src/app/shared/util/virtual-grid.util.ts @@ -21,8 +21,6 @@ export interface VirtualGridOptions { estimateItemHeight: (itemWidth: number) => number; gap: number | Signal; rowGap?: Signal; - overscan?: number; - count?: Signal; trailingRows?: Signal; minimumCount?: (metrics: VirtualGridMetrics) => number; columns?: Signal; @@ -173,7 +171,7 @@ export function createVirtualGrid(options: VirtualGridOptions) { const sharedVirtualizerOptions = () => ({ count: Math.max( - options.count?.() ?? (options.items().length + (gridColumns() * (options.trailingRows?.() ?? 0))), + options.items().length + (gridColumns() * (options.trailingRows?.() ?? 0)), minimumCount(), ), getItemKey: (index: number): VirtualItem['key'] => { @@ -183,7 +181,7 @@ export function createVirtualGrid(options: VirtualGridOptions) { : (options.itemKey?.(item, index) ?? index); }, estimateSize: () => toSafeSize(itemHeight(), DEFAULT_ITEM_SIZE), - overscan: toSafeInteger(options.overscan ?? gridColumns() * overscanRows(), DEFAULT_OVERSCAN_ROWS), + overscan: toSafeInteger(gridColumns() * overscanRows(), DEFAULT_OVERSCAN_ROWS), gap: toSafeSize(rowGap(), DEFAULT_ITEM_SIZE), lanes: toSafeInteger(gridColumns(), 1), initialOffset: () => options.initialOffset?.() ?? 0, diff --git a/frontend/src/i18n/cs.json b/frontend/src/i18n/cs.json index a6c383759..bad5b20cb 100644 --- a/frontend/src/i18n/cs.json +++ b/frontend/src/i18n/cs.json @@ -555,20 +555,6 @@ "editSort": "", "tableSortConfig": "" }, - "filter": { - "sectionTitle": "", - "sectionDesc": "", - "filterMode": "", - "filterModeDesc": "", - "visibleFilters": "", - "visibleFiltersDesc": "", - "selectionCount": "", - "addFilter": "", - "resetToDefaults": "", - "modeAnd": "", - "modeOr": "", - "modeSingle": "" - }, "sidebarSort": { "sectionTitle": "", "sectionDesc": "", @@ -2732,68 +2718,20 @@ "customCoverHeader": "" }, "toast": { - "sortSavedSummary": "", - "sortSavedGlobalDetail": "", - "sortSavedEntityDetail": "", "regenCoverStartedSummary": "", "regenCoverStartedDetail": "", "customCoverStartedSummary": "", "customCoverStartedDetail": "", "failedSummary": "", "regenCoverFailedDetail": "", - "customCoverFailedDetail": "", - "unshelveSuccessDetail": "", - "unshelveFailedDetail": "", - "noEligibleBooksSummary": "", - "noEligibleBooksDetail": "", - "multipleLibrariesSummary": "", - "multipleLibrariesDetail": "" + "customCoverFailedDetail": "" }, "loading": { - "deleting": "", - "unshelving": "" + "deleting": "" }, "labels": { "allBooks": "", - "unshelvedBooks": "", - "unshelvedBooksFiltered": "", - "filteredSuffix": "", - "seriesCollapsedInfo": "", - "item": "", - "items": "", - "selected": "", - "setAsDefault": "", - "save": "", - "collapseSeries": "", - "gridColumns": "", - "bookTypeOverlay": "", - "noBooks": "", - "failedLibrary": "", - "failedShelf": "", - "failedBooks": "", - "activeFilters": "" - }, - "tooltip": { - "clearFilters": "", - "visibleColumns": "", - "selectSorting": "", - "toggleView": "", - "search": "", - "toggleSidebar": "", - "metadataActions": "", - "assignToShelf": "", - "removeFromShelf": "", - "lockUnlockMetadata": "", - "organizeFiles": "", - "attachToBook": "", - "moreActions": "", - "selectAll": "", - "deselectAll": "", - "deleteSelected": "" - }, - "placeholder": { - "selectColumns": "", - "search": "" + "unshelvedBooks": "" } }, "card": { @@ -3031,36 +2969,6 @@ "deletingLibrary": "" } }, - "columnPref": { - "columns": { - "readStatus": "", - "title": "", - "authors": "", - "publisher": "", - "seriesName": "", - "seriesNumber": "", - "categories": "", - "publishedDate": "", - "lastReadTime": "", - "addedOn": "", - "fileName": "", - "fileSizeKb": "", - "language": "", - "isbn": "", - "pageCount": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "", - "savedDetail": "" - } - }, "coverPref": { "toast": { "savedSummary": "", @@ -3069,12 +2977,6 @@ "saveFailedDetail": "" } }, - "filterPref": { - "toast": { - "saveFailedSummary": "", - "saveFailedDetail": "" - } - }, "reviews": { "confirm": { "deleteAllMessage": "", @@ -3232,41 +3134,7 @@ } }, "filter": { - "title": "", "showingFirst100": "", - "footerNote": "", - "labels": { - "author": "", - "category": "", - "series": "", - "bookType": "", - "readStatus": "", - "personalRating": "", - "publisher": "", - "matchScore": "", - "library": "", - "shelf": "", - "shelfStatus": "", - "tag": "", - "publishedDate": "", - "fileSize": "", - "amazonRating": "", - "goodreadsRating": "", - "hardcoverRating": "", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "", - "pageCount": "", - "mood": "", - "ageRating": "", - "contentRating": "", - "narrator": "", - "comicCharacter": "", - "comicTeam": "", - "comicLocation": "", - "comicCreator": "" - }, "readStatus": { "unread": "", "reading": "", @@ -3319,14 +3187,6 @@ "shelfStatus": { "shelved": "", "unshelved": "" - }, - "comicRoles": { - "penciller": "", - "inker": "", - "colorist": "", - "letterer": "", - "coverArtist": "", - "editor": "" } }, "shelfAssigner": { @@ -3389,27 +3249,6 @@ "updateFailedDetail": "" } }, - "table": { - "label": "", - "bookCoverAlt": "", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "", - "locked": "", - "unlocked": "", - "toast": { - "metadataLockedSummary": "", - "metadataLockedDetail": "", - "metadataUnlockedSummary": "", - "metadataUnlockedDetail": "", - "lockFailedSummary": "", - "lockFailedDetail": "", - "unlockFailedSummary": "", - "unlockFailedDetail": "" - } - }, "lockUnlockDialog": { "title": "", "selectedCount": "", @@ -3430,42 +3269,7 @@ } }, "sorting": { - "sortOrder": "", - "removeTooltip": "", - "addSortFieldPlaceholder": "", - "saveAsDefault": "", - "ascendingTooltip": "", - "descendingTooltip": "", - "options": { - "title": "", - "fileName": "", - "filePath": "", - "author": "", - "authorSurnameVorname": "", - "seriesName": "", - "seriesNumber": "", - "lastReadTime": "", - "personalRating": "", - "addedOn": "", - "fileSizeKb": "", - "locked": "", - "publisher": "", - "publishedDate": "", - "readStatus": "", - "dateFinished": "", - "readingProgress": "", - "bookType": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "", - "narrator": "", - "pageCount": "", - "random": "" - } + "saveAsDefault": "" }, "fileAttacher": { "title": "", diff --git a/frontend/src/i18n/da.json b/frontend/src/i18n/da.json index 8983d9c23..b35e7fbab 100644 --- a/frontend/src/i18n/da.json +++ b/frontend/src/i18n/da.json @@ -555,20 +555,6 @@ "editSort": "", "tableSortConfig": "" }, - "filter": { - "sectionTitle": "", - "sectionDesc": "", - "filterMode": "", - "filterModeDesc": "", - "visibleFilters": "", - "visibleFiltersDesc": "", - "selectionCount": "", - "addFilter": "", - "resetToDefaults": "", - "modeAnd": "", - "modeOr": "", - "modeSingle": "" - }, "sidebarSort": { "sectionTitle": "", "sectionDesc": "", @@ -2732,68 +2718,20 @@ "customCoverHeader": "" }, "toast": { - "sortSavedSummary": "", - "sortSavedGlobalDetail": "", - "sortSavedEntityDetail": "", "regenCoverStartedSummary": "", "regenCoverStartedDetail": "", "customCoverStartedSummary": "", "customCoverStartedDetail": "", "failedSummary": "", "regenCoverFailedDetail": "", - "customCoverFailedDetail": "", - "unshelveSuccessDetail": "", - "unshelveFailedDetail": "", - "noEligibleBooksSummary": "", - "noEligibleBooksDetail": "", - "multipleLibrariesSummary": "", - "multipleLibrariesDetail": "" + "customCoverFailedDetail": "" }, "loading": { - "deleting": "", - "unshelving": "" + "deleting": "" }, "labels": { "allBooks": "", - "unshelvedBooks": "", - "unshelvedBooksFiltered": "", - "filteredSuffix": "", - "seriesCollapsedInfo": "", - "item": "", - "items": "", - "selected": "", - "setAsDefault": "", - "save": "", - "collapseSeries": "", - "gridColumns": "", - "bookTypeOverlay": "", - "noBooks": "", - "failedLibrary": "", - "failedShelf": "", - "failedBooks": "", - "activeFilters": "" - }, - "tooltip": { - "clearFilters": "", - "visibleColumns": "", - "selectSorting": "", - "toggleView": "", - "search": "", - "toggleSidebar": "", - "metadataActions": "", - "assignToShelf": "", - "removeFromShelf": "", - "lockUnlockMetadata": "", - "organizeFiles": "", - "attachToBook": "", - "moreActions": "", - "selectAll": "", - "deselectAll": "", - "deleteSelected": "" - }, - "placeholder": { - "selectColumns": "", - "search": "" + "unshelvedBooks": "" } }, "card": { @@ -3031,36 +2969,6 @@ "deletingLibrary": "" } }, - "columnPref": { - "columns": { - "readStatus": "", - "title": "", - "authors": "", - "publisher": "", - "seriesName": "", - "seriesNumber": "", - "categories": "", - "publishedDate": "", - "lastReadTime": "", - "addedOn": "", - "fileName": "", - "fileSizeKb": "", - "language": "", - "isbn": "", - "pageCount": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "", - "savedDetail": "" - } - }, "coverPref": { "toast": { "savedSummary": "", @@ -3069,12 +2977,6 @@ "saveFailedDetail": "" } }, - "filterPref": { - "toast": { - "saveFailedSummary": "", - "saveFailedDetail": "" - } - }, "reviews": { "confirm": { "deleteAllMessage": "", @@ -3232,41 +3134,7 @@ } }, "filter": { - "title": "", "showingFirst100": "", - "footerNote": "", - "labels": { - "author": "", - "category": "", - "series": "", - "bookType": "", - "readStatus": "", - "personalRating": "", - "publisher": "", - "matchScore": "", - "library": "", - "shelf": "", - "shelfStatus": "", - "tag": "", - "publishedDate": "", - "fileSize": "", - "amazonRating": "", - "goodreadsRating": "", - "hardcoverRating": "", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "", - "pageCount": "", - "mood": "", - "ageRating": "", - "contentRating": "", - "narrator": "", - "comicCharacter": "", - "comicTeam": "", - "comicLocation": "", - "comicCreator": "" - }, "readStatus": { "unread": "", "reading": "", @@ -3319,14 +3187,6 @@ "shelfStatus": { "shelved": "", "unshelved": "" - }, - "comicRoles": { - "penciller": "", - "inker": "", - "colorist": "", - "letterer": "", - "coverArtist": "", - "editor": "" } }, "shelfAssigner": { @@ -3389,27 +3249,6 @@ "updateFailedDetail": "" } }, - "table": { - "label": "", - "bookCoverAlt": "", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "{{ status }}", - "locked": "", - "unlocked": "", - "toast": { - "metadataLockedSummary": "", - "metadataLockedDetail": "", - "metadataUnlockedSummary": "", - "metadataUnlockedDetail": "", - "lockFailedSummary": "", - "lockFailedDetail": "", - "unlockFailedSummary": "", - "unlockFailedDetail": "" - } - }, "lockUnlockDialog": { "title": "", "selectedCount": "", @@ -3430,42 +3269,7 @@ } }, "sorting": { - "sortOrder": "", - "removeTooltip": "", - "addSortFieldPlaceholder": "", - "saveAsDefault": "", - "ascendingTooltip": "", - "descendingTooltip": "", - "options": { - "title": "", - "fileName": "", - "filePath": "", - "author": "", - "authorSurnameVorname": "", - "seriesName": "", - "seriesNumber": "", - "lastReadTime": "", - "personalRating": "", - "addedOn": "", - "fileSizeKb": "", - "locked": "", - "publisher": "", - "publishedDate": "", - "readStatus": "", - "dateFinished": "", - "readingProgress": "", - "bookType": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "", - "narrator": "", - "pageCount": "", - "random": "" - } + "saveAsDefault": "" }, "fileAttacher": { "title": "", diff --git a/frontend/src/i18n/de.json b/frontend/src/i18n/de.json index 4f4780eda..69205326b 100644 --- a/frontend/src/i18n/de.json +++ b/frontend/src/i18n/de.json @@ -556,20 +556,6 @@ "tableSortConfig": "Sortierkonfiguration", "formatOverlay": "Dateiformat-Overlay" }, - "filter": { - "sectionTitle": "Filtereinstellungen", - "sectionDesc": "Konfigurieren Sie Standardoptionen für die Filtersteuerungen in der Seitenleiste.", - "filterMode": "Filtermodus", - "filterModeDesc": "Wählen Sie den Standardmodus für die Kombination von Filtern aus der rechten Filter-Seitenleiste.", - "visibleFilters": "Sichtbare Filter", - "visibleFiltersDesc": "Wählen Sie, welche Filter in der Seitenleiste angezeigt werden, und ziehen Sie zum Neuordnen. Zwischen {{min}} und {{max}} Filter.", - "selectionCount": "{{count}} von {{total}} ausgewählt", - "addFilter": "Filter hinzufügen...", - "resetToDefaults": "Auf Standard zurücksetzen", - "modeAnd": "Und", - "modeOr": "Oder", - "modeSingle": "Einzeln" - }, "sidebarSort": { "sectionTitle": "Seitenleisten-Sortierung für Bibliotheken und Regale", "sectionDesc": "Konfigurieren Sie Sortieroptionen für Ihre Bibliotheks- und Regalnamen im linken Menü der Seitenleiste.", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Benutzerdefinierte Cover-Generierung bestätigen" }, "toast": { - "sortSavedSummary": "Sortierung gespeichert", - "sortSavedGlobalDetail": "Standard-Sortierung wurde gespeichert.", - "sortSavedEntityDetail": "Sortierung für dieses {{ entityType }} wurde gespeichert.", "regenCoverStartedSummary": "Cover-Neugenerierung gestartet", "regenCoverStartedDetail": "Cover für {{ count }} Buch/Bücher werden neu generiert. Aktualisieren Sie die Seite nach Abschluss.", "customCoverStartedSummary": "Benutzerdefinierte Cover-Generierung gestartet", "customCoverStartedDetail": "Benutzerdefinierte Cover für {{ count }} Buch/Bücher werden generiert.", "failedSummary": "Fehlgeschlagen", "regenCoverFailedDetail": "Cover-Neugenerierung konnte nicht gestartet werden.", - "customCoverFailedDetail": "Benutzerdefinierte Cover-Generierung konnte nicht gestartet werden.", - "unshelveSuccessDetail": "Bücherregale aktualisiert", - "unshelveFailedDetail": "Aktualisierung der Bücherregale fehlgeschlagen", - "noEligibleBooksSummary": "Keine geeigneten Bücher", - "noEligibleBooksDetail": "Ausgewählte Bücher müssen Einzeldatei-Bücher sein (keine alternativen Formate).", - "multipleLibrariesSummary": "Mehrere Bibliotheken", - "multipleLibrariesDetail": "Alle ausgewählten Bücher müssen aus derselben Bibliothek stammen." + "customCoverFailedDetail": "Benutzerdefinierte Cover-Generierung konnte nicht gestartet werden." }, "loading": { - "deleting": "{{ count }} Buch/Bücher werden gelöscht...", - "unshelving": "{{ count }} Buch/Bücher werden aus Regalen entfernt..." + "deleting": "{{ count }} Buch/Bücher werden gelöscht..." }, "labels": { "allBooks": "Alle Bücher", - "unshelvedBooks": "Nicht eingeordnete Bücher", - "unshelvedBooksFiltered": "Nicht eingeordnete Bücher (Gefiltert)", - "filteredSuffix": "(Gefiltert)", - "seriesCollapsedInfo": "{{ count }} {{ itemWord }} angezeigt (Serien zusammengeklappt)", - "item": "Element", - "items": "Elemente", - "selected": "ausgewählt", - "setAsDefault": "Als Standard setzen?", - "save": "Speichern", - "collapseSeries": "Serien zusammenklappen", - "gridColumns": "Rasterspalten", - "bookTypeOverlay": "Dateiformat-Overlay", - "noBooks": "Diese Sammlung enthält keine Bücher!", - "failedLibrary": "Bücher der Bibliothek konnten nicht geladen werden!", - "failedShelf": "Bücher des Regals konnten nicht geladen werden!", - "failedBooks": "", - "activeFilters": "{{ count }} aktive Filter" - }, - "tooltip": { - "clearFilters": "Angewendete Filter löschen", - "visibleColumns": "Sichtbare Spalten", - "selectSorting": "Sortierung auswählen", - "toggleView": "Zwischen Raster- und Tabellenansicht wechseln", - "search": "Suchen", - "toggleSidebar": "Seitenleistenfilter umschalten", - "metadataActions": "Metadaten-Aktionen", - "assignToShelf": "Regal zuweisen", - "removeFromShelf": "Aus diesem Regal entfernen", - "lockUnlockMetadata": "Metadaten sperren/entsperren", - "organizeFiles": "Dateien organisieren", - "attachToBook": "An ein anderes Buch anhängen", - "moreActions": "Weitere Aktionen", - "selectAll": "Alle Bücher auswählen", - "deselectAll": "Alle Bücher abwählen", - "deleteSelected": "Ausgewählte Bücher löschen" - }, - "placeholder": { - "selectColumns": "Spalten auswählen", - "search": "Titel, Autor, Serie, Genre oder ISBN..." + "unshelvedBooks": "Nicht eingeordnete Bücher" } }, "card": { @@ -3079,36 +3017,6 @@ "deletingLibrary": "Bibliothek '{{ name }}' wird gelöscht..." } }, - "columnPref": { - "columns": { - "readStatus": "Gelesen", - "title": "Titel", - "authors": "Autoren", - "publisher": "Verlag", - "seriesName": "Serie", - "seriesNumber": "Serie Nr.", - "categories": "", - "publishedDate": "Veröffentlicht", - "lastReadTime": "Zuletzt gelesen", - "addedOn": "Hinzugefügt", - "fileName": "Dateiname", - "fileSizeKb": "Dateigröße", - "language": "Sprache", - "isbn": "", - "pageCount": "Seiten", - "amazonRating": "", - "amazonReviewCount": "AZ Nr.", - "goodreadsRating": "", - "goodreadsReviewCount": "GR Nr.", - "hardcoverRating": "", - "hardcoverReviewCount": "HC Nr.", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "Einstellungen gespeichert", - "savedDetail": "Ihr Spaltenlayout wurde gespeichert." - } - }, "coverPref": { "toast": { "savedSummary": "Covergröße gespeichert", @@ -3117,12 +3025,6 @@ "saveFailedDetail": "Covergröße konnte lokal nicht gespeichert werden." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Speichern fehlgeschlagen", - "saveFailedDetail": "Seitenleistenfilter-Einstellung konnte lokal nicht gespeichert werden." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Sind Sie sicher, dass Sie alle {{ count }} Rezensionen für dieses Buch löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden.", @@ -3280,41 +3182,7 @@ } }, "filter": { - "title": "Filter", "showingFirst100": "Die ersten 100 Einträge werden angezeigt", - "footerNote": "Hinweis: Pro Filterkategorie werden die ersten 100 Einträge angezeigt", - "labels": { - "author": "Autor", - "category": "", - "series": "Serie", - "bookType": "Buchtyp", - "readStatus": "Lesestatus", - "personalRating": "Persönliche Bewertung", - "publisher": "Verlag", - "matchScore": "Metadaten-Übereinstimmung", - "library": "Bibliothek", - "shelf": "Regal", - "shelfStatus": "Regalstatus", - "tag": "Schlagwort", - "publishedDate": "Erscheinungsjahr", - "fileSize": "Dateigröße", - "amazonRating": "Amazon-Bewertung", - "goodreadsRating": "Goodreads-Bewertung", - "hardcoverRating": "Hardcover-Bewertung", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "Sprache", - "pageCount": "Seitenzahl", - "mood": "Stimmung", - "ageRating": "Altersfreigabe", - "contentRating": "Inhaltsbewertung", - "narrator": "Sprecher", - "comicCharacter": "Comic-Charakter", - "comicTeam": "Comic-Team", - "comicLocation": "Comic-Ort", - "comicCreator": "Comic-Zeichner" - }, "readStatus": { "unread": "Ungelesen", "reading": "Wird gelesen", @@ -3367,14 +3235,6 @@ "shelfStatus": { "shelved": "Eingeordnet", "unshelved": "Nicht eingeordnet" - }, - "comicRoles": { - "penciller": "Zeichner", - "inker": "Tuscher", - "colorist": "Kolorist", - "letterer": "", - "coverArtist": "Cover-Künstler", - "editor": "Redakteur" } }, "shelfAssigner": { @@ -3437,27 +3297,6 @@ "updateFailedDetail": "Beim Aktualisieren des Regals ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut." } }, - "table": { - "label": "", - "bookCoverAlt": "Buchcover", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "", - "locked": "Gesperrt", - "unlocked": "Entsperrt", - "toast": { - "metadataLockedSummary": "Metadaten gesperrt", - "metadataLockedDetail": "Buchmetadaten wurden erfolgreich gesperrt.", - "metadataUnlockedSummary": "Metadaten entsperrt", - "metadataUnlockedDetail": "Buchmetadaten wurden erfolgreich entsperrt.", - "lockFailedSummary": "Sperren fehlgeschlagen", - "lockFailedDetail": "Beim Sperren der Metadaten ist ein Fehler aufgetreten.", - "unlockFailedSummary": "Entsperren fehlgeschlagen", - "unlockFailedDetail": "Beim Entsperren der Metadaten ist ein Fehler aufgetreten." - } - }, "lockUnlockDialog": { "title": "Metadaten sperren oder entsperren", "selectedCount": "{{ count }} Buch/Bücher ausgewählt", @@ -3478,42 +3317,7 @@ } }, "sorting": { - "sortOrder": "Sortierreihenfolge", - "removeTooltip": "Entfernen", - "addSortFieldPlaceholder": "Sortierfeld hinzufügen...", - "saveAsDefault": "Als Standard speichern", - "ascendingTooltip": "Aufsteigend - klicken zum Ändern", - "descendingTooltip": "Absteigend - klicken zum Ändern", - "options": { - "title": "Titel", - "fileName": "Dateiname", - "filePath": "Dateipfad", - "author": "Autor", - "authorSurnameVorname": "Autor (Nachname)", - "seriesName": "Serienname", - "seriesNumber": "Seriennummer", - "lastReadTime": "Zuletzt gelesen", - "personalRating": "Persönliche Bewertung", - "addedOn": "Hinzugefügt am", - "fileSizeKb": "Dateigröße", - "locked": "Gesperrt", - "publisher": "Verlag", - "publishedDate": "Veröffentlichungsdatum", - "readStatus": "Lesestatus", - "dateFinished": "Beendet am", - "readingProgress": "Lesefortschritt", - "bookType": "Buchtyp", - "amazonRating": "Amazon-Bewertung", - "amazonReviewCount": "Amazon Nr.", - "goodreadsRating": "Goodreads-Bewertung", - "goodreadsReviewCount": "Goodreads Nr.", - "hardcoverRating": "Hardcover-Bewertung", - "hardcoverReviewCount": "Hardcover Nr.", - "ranobedbRating": "Ranobedb-Bewertung", - "narrator": "Sprecher", - "pageCount": "Seiten", - "random": "Zufällig" - } + "saveAsDefault": "Als Standard speichern" }, "fileAttacher": { "title": "Datei an ein anderes Buch anhängen", diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 869f11220..3bdbaffb7 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -557,20 +557,6 @@ "editSort": "Edit Sort", "tableSortConfig": "Sort Config" }, - "filter": { - "sectionTitle": "Filter Preferences", - "sectionDesc": "Configure default options for filter controls shown in the sidebar.", - "filterMode": "Filter Mode", - "filterModeDesc": "Choose the default mode for combining filters selected from the right filter sidebar.", - "visibleFilters": "Visible Filters", - "visibleFiltersDesc": "Choose which filters appear in the sidebar and drag to reorder. Between {{min}} and {{max}} filters.", - "selectionCount": "{{count}} of {{total}} selected", - "addFilter": "Add filter...", - "resetToDefaults": "Reset to defaults", - "modeAnd": "And", - "modeOr": "Or", - "modeSingle": "Single" - }, "sidebarSort": { "sectionTitle": "Sidebar Library and Shelf Sorting Preference", "sectionDesc": "Configure sorting options for your library and shelves names shown in the left menu sidebar.", @@ -2766,68 +2752,20 @@ "customCoverHeader": "Confirm Custom Cover Generation" }, "toast": { - "sortSavedSummary": "Sort Saved", - "sortSavedGlobalDetail": "Default sort configuration saved.", - "sortSavedEntityDetail": "Sort configuration saved for this {{ entityType }}.", "regenCoverStartedSummary": "Cover Regeneration Started", "regenCoverStartedDetail": "Regenerating covers for {{ count }} book(s). Refresh the page when complete.", "customCoverStartedSummary": "Custom Cover Generation Started", "customCoverStartedDetail": "Generating custom covers for {{ count }} book(s).", "failedSummary": "Failed", "regenCoverFailedDetail": "Could not start cover regeneration.", - "customCoverFailedDetail": "Could not start custom cover generation.", - "unshelveSuccessDetail": "Books shelves updated", - "unshelveFailedDetail": "Failed to update books shelves", - "noEligibleBooksSummary": "No Eligible Books", - "noEligibleBooksDetail": "Selected books must be single-file books (no alternative formats).", - "multipleLibrariesSummary": "Multiple Libraries", - "multipleLibrariesDetail": "All selected books must be from the same library." + "customCoverFailedDetail": "Could not start custom cover generation." }, "loading": { - "deleting": "Deleting {{ count }} book(s)...", - "unshelving": "Unshelving {{ count }} book(s)..." + "deleting": "Deleting {{ count }} book(s)..." }, "labels": { "allBooks": "All Books", - "unshelvedBooks": "Unshelved Books", - "unshelvedBooksFiltered": "Unshelved Books (Filtered)", - "filteredSuffix": "(Filtered)", - "seriesCollapsedInfo": "Showing {{ count }} {{ itemWord }} (series collapsed)", - "item": "item", - "items": "items", - "selected": "selected", - "setAsDefault": "Set as default?", - "save": "Save", - "collapseSeries": "Collapse series", - "gridColumns": "Grid columns", - "bookTypeOverlay": "File format overlay", - "noBooks": "This collection has no books!", - "failedLibrary": "Failed to load library's books!", - "failedShelf": "Failed to load shelf's books!", - "failedBooks": "Failed to load books!", - "activeFilters": "{{ count }} Active Filters" - }, - "tooltip": { - "clearFilters": "Clear applied filters", - "visibleColumns": "Visible columns", - "selectSorting": "Select sorting", - "toggleView": "Toggle between Grid and Table view", - "search": "Search", - "toggleSidebar": "Toggle sidebar filters", - "metadataActions": "Metadata actions", - "assignToShelf": "Assign to shelf", - "removeFromShelf": "Remove from this shelf", - "lockUnlockMetadata": "Lock/Unlock metadata", - "organizeFiles": "Organize Files", - "attachToBook": "Attach to Another Book", - "moreActions": "More actions", - "selectAll": "Select all books", - "deselectAll": "Deselect all books", - "deleteSelected": "Delete selected books" - }, - "placeholder": { - "selectColumns": "Select Columns", - "search": "Title, Author, Series, Genre, or ISBN..." + "unshelvedBooks": "Unshelved Books" } }, "card": { @@ -3129,36 +3067,6 @@ "deletingLibrary": "Deleting library '{{ name }}'..." } }, - "columnPref": { - "columns": { - "readStatus": "Read", - "title": "Title", - "authors": "Authors", - "publisher": "Publisher", - "seriesName": "Series", - "seriesNumber": "Series #", - "categories": "Genres", - "publishedDate": "Published", - "lastReadTime": "Last Read", - "addedOn": "Added", - "fileName": "File Name", - "fileSizeKb": "File Size", - "language": "Language", - "isbn": "ISBN", - "pageCount": "Pages", - "amazonRating": "Amazon", - "amazonReviewCount": "AZ #", - "goodreadsRating": "Goodreads", - "goodreadsReviewCount": "GR #", - "hardcoverRating": "Hardcover", - "hardcoverReviewCount": "HC #", - "ranobedbRating": "Ranobedb" - }, - "toast": { - "savedSummary": "Preferences Saved", - "savedDetail": "Your column layout has been saved." - } - }, "coverPref": { "toast": { "savedSummary": "Cover Size Saved", @@ -3167,12 +3075,6 @@ "saveFailedDetail": "Could not save cover size preference locally." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Save Failed", - "saveFailedDetail": "Could not save sidebar filter preference locally." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Are you sure you want to delete all {{ count }} reviews for this book? This action cannot be undone.", @@ -3332,41 +3234,7 @@ } }, "filter": { - "title": "Filters", "showingFirst100": "Showing first 100 items", - "footerNote": "Note: Top 100 items are displayed per filter category", - "labels": { - "author": "Author", - "category": "Genre", - "series": "Series", - "bookType": "File Format", - "readStatus": "Read Status", - "personalRating": "Personal Rating", - "publisher": "Publisher", - "matchScore": "Metadata Match Score", - "library": "Library", - "shelf": "Shelf", - "shelfStatus": "Shelf Status", - "tag": "Tag", - "publishedDate": "Published Year", - "fileSize": "File Size", - "amazonRating": "Amazon Rating", - "goodreadsRating": "Goodreads Rating", - "hardcoverRating": "Hardcover Rating", - "lubimyczytacRating": "Lubimyczytac Rating", - "ranobedbRating": "RanobeDB Rating", - "audibleRating": "Audible Rating", - "language": "Language", - "pageCount": "Page Count", - "mood": "Mood", - "ageRating": "Age Rating", - "contentRating": "Content Rating", - "narrator": "Narrator", - "comicCharacter": "Comic Character", - "comicTeam": "Comic Team", - "comicLocation": "Comic Location", - "comicCreator": "Comic Creator" - }, "readStatus": { "unread": "Unread", "reading": "Reading", @@ -3419,14 +3287,6 @@ "shelfStatus": { "shelved": "Shelved", "unshelved": "Unshelved" - }, - "comicRoles": { - "penciller": "Penciller", - "inker": "Inker", - "colorist": "Colorist", - "letterer": "Letterer", - "coverArtist": "Cover Artist", - "editor": "Editor" } }, "shelfAssigner": { @@ -3489,27 +3349,6 @@ "updateFailedDetail": "An error occurred while updating the shelf. Please try again." } }, - "table": { - "label": "Books table", - "bookCoverAlt": "Book Cover", - "selectBook": "Select {{ title }}", - "selectBookFallback": "Select book", - "noRating": "No rating", - "ratingOutOf": "{{ rating }} out of {{ max }}", - "statusWithPrefix": "Status: {{ status }}", - "locked": "Locked", - "unlocked": "Unlocked", - "toast": { - "metadataLockedSummary": "Metadata Locked", - "metadataLockedDetail": "Book metadata has been locked successfully.", - "metadataUnlockedSummary": "Metadata Unlocked", - "metadataUnlockedDetail": "Book metadata has been unlocked successfully.", - "lockFailedSummary": "Failed to Lock", - "lockFailedDetail": "An error occurred while locking the metadata.", - "unlockFailedSummary": "Failed to Unlock", - "unlockFailedDetail": "An error occurred while unlocking the metadata." - } - }, "lockUnlockDialog": { "title": "Lock or Unlock Metadata", "selectedCount": "{{ count }} book(s) selected", @@ -3530,42 +3369,7 @@ } }, "sorting": { - "sortOrder": "Sort Order", - "removeTooltip": "Remove", - "addSortFieldPlaceholder": "Add sort field...", - "saveAsDefault": "Save as Default for {{scope}}", - "ascendingTooltip": "Ascending - click to change", - "descendingTooltip": "Descending - click to change", - "options": { - "title": "Title", - "fileName": "File Name", - "filePath": "File Path", - "author": "Author", - "authorSurnameVorname": "Author (Surname)", - "seriesName": "Series Name", - "seriesNumber": "Series Number", - "lastReadTime": "Last Read", - "personalRating": "Personal Rating", - "addedOn": "Added On", - "fileSizeKb": "File Size", - "locked": "Locked", - "publisher": "Publisher", - "publishedDate": "Published Date", - "readStatus": "Read Status", - "dateFinished": "Date Finished", - "readingProgress": "Reading Progress", - "bookType": "File Format", - "amazonRating": "Amazon Rating", - "amazonReviewCount": "Amazon #", - "goodreadsRating": "Goodreads Rating", - "goodreadsReviewCount": "Goodreads #", - "hardcoverRating": "Hardcover Rating", - "hardcoverReviewCount": "Hardcover #", - "ranobedbRating": "Ranobedb Rating", - "narrator": "Narrator", - "pageCount": "Pages", - "random": "Random" - } + "saveAsDefault": "Save as Default for {{scope}}" }, "fileAttacher": { "title": "Attach File to Another Book", diff --git a/frontend/src/i18n/es.json b/frontend/src/i18n/es.json index cdce7246b..06c26184d 100644 --- a/frontend/src/i18n/es.json +++ b/frontend/src/i18n/es.json @@ -556,20 +556,6 @@ "tableSortConfig": "Configuración de orden", "formatOverlay": "Indicador de formato de archivo" }, - "filter": { - "sectionTitle": "Preferencias de filtros", - "sectionDesc": "Configura las opciones predeterminadas para los controles de filtro mostrados en la barra lateral.", - "filterMode": "Modo de filtro", - "filterModeDesc": "Elige el modo predeterminado para combinar los filtros seleccionados en la barra lateral derecha.", - "visibleFilters": "Filtros visibles", - "visibleFiltersDesc": "Elige qué filtros aparecen en la barra lateral y arrastra para reordenar. Entre {{min}} y {{max}} filtros.", - "selectionCount": "{{count}} de {{total}} seleccionados", - "addFilter": "Añadir filtro...", - "resetToDefaults": "Restablecer valores predeterminados", - "modeAnd": "Y", - "modeOr": "O", - "modeSingle": "Único" - }, "sidebarSort": { "sectionTitle": "Preferencia de ordenación de la barra lateral", "sectionDesc": "Configura las opciones de ordenación para los nombres de bibliotecas y estantes mostrados en el menú lateral izquierdo.", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Confirmar generación de portada personalizada" }, "toast": { - "sortSavedSummary": "Orden guardado", - "sortSavedGlobalDetail": "Configuración de orden predeterminada guardada.", - "sortSavedEntityDetail": "Configuración de orden guardada para este/a {{ entityType }}.", "regenCoverStartedSummary": "Regeneración de portada iniciada", "regenCoverStartedDetail": "Regenerando portadas para {{ count }} libro(s). Actualiza la página cuando termine.", "customCoverStartedSummary": "Generación de portada personalizada iniciada", "customCoverStartedDetail": "Generando portadas personalizadas para {{ count }} libro(s).", "failedSummary": "Error", "regenCoverFailedDetail": "No se pudo iniciar la regeneración de portadas.", - "customCoverFailedDetail": "No se pudo iniciar la generación de portadas personalizadas.", - "unshelveSuccessDetail": "Estantes de libros actualizados", - "unshelveFailedDetail": "Error al actualizar los estantes de libros", - "noEligibleBooksSummary": "Sin libros elegibles", - "noEligibleBooksDetail": "Los libros seleccionados deben ser de un solo archivo (sin formatos alternativos).", - "multipleLibrariesSummary": "Múltiples bibliotecas", - "multipleLibrariesDetail": "Todos los libros seleccionados deben ser de la misma biblioteca." + "customCoverFailedDetail": "No se pudo iniciar la generación de portadas personalizadas." }, "loading": { - "deleting": "Eliminando {{ count }} libro(s)...", - "unshelving": "Quitando {{ count }} libro(s) del estante..." + "deleting": "Eliminando {{ count }} libro(s)..." }, "labels": { "allBooks": "Todos los libros", - "unshelvedBooks": "Libros sin estante", - "unshelvedBooksFiltered": "Libros sin estante (Filtrados)", - "filteredSuffix": "(Filtrados)", - "seriesCollapsedInfo": "Mostrando {{ count }} {{ itemWord }} (series contraídas)", - "item": "elemento", - "items": "elementos", - "selected": "seleccionados", - "setAsDefault": "¿Establecer como predeterminado?", - "save": "Guardar", - "collapseSeries": "Contraer series", - "gridColumns": "Columnas de cuadrícula", - "bookTypeOverlay": "Indicador de formato de archivo", - "noBooks": "¡Esta colección no tiene libros!", - "failedLibrary": "¡Error al cargar los libros de la biblioteca!", - "failedShelf": "¡Error al cargar los libros del estante!", - "failedBooks": "¡Error al cargar los libros!", - "activeFilters": "{{ count }} filtros activos" - }, - "tooltip": { - "clearFilters": "Limpiar filtros aplicados", - "visibleColumns": "Columnas visibles", - "selectSorting": "Seleccionar ordenamiento", - "toggleView": "Alternar entre vista de cuadrícula y tabla", - "search": "Buscar", - "toggleSidebar": "Alternar filtros laterales", - "metadataActions": "Acciones de metadatos", - "assignToShelf": "Asignar a estante", - "removeFromShelf": "Quitar de este estante", - "lockUnlockMetadata": "Bloquear/Desbloquear metadatos", - "organizeFiles": "Organizar archivos", - "attachToBook": "Adjuntar a otro libro", - "moreActions": "Más acciones", - "selectAll": "Seleccionar todos los libros", - "deselectAll": "Deseleccionar todos los libros", - "deleteSelected": "Eliminar libros seleccionados" - }, - "placeholder": { - "selectColumns": "Seleccionar columnas", - "search": "Título, Autor, Serie, Género o ISBN..." + "unshelvedBooks": "Libros sin estante" } }, "card": { @@ -3084,36 +3022,6 @@ "deletingLibrary": "Eliminando biblioteca '{{ name }}'..." } }, - "columnPref": { - "columns": { - "readStatus": "Lectura", - "title": "Título", - "authors": "Autores", - "publisher": "Editorial", - "seriesName": "Serie", - "seriesNumber": "Serie #", - "categories": "Géneros", - "publishedDate": "Publicado", - "lastReadTime": "Última lectura", - "addedOn": "Añadido", - "fileName": "Nombre de archivo", - "fileSizeKb": "Tamaño", - "language": "Idioma", - "isbn": "", - "pageCount": "Páginas", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "Preferencias guardadas", - "savedDetail": "Tu diseño de columnas ha sido guardado." - } - }, "coverPref": { "toast": { "savedSummary": "Tamaño de portada guardado", @@ -3122,12 +3030,6 @@ "saveFailedDetail": "No se pudo guardar la preferencia de tamaño de portada localmente." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Error al guardar", - "saveFailedDetail": "No se pudo guardar la preferencia del filtro lateral localmente." - } - }, "reviews": { "confirm": { "deleteAllMessage": "¿Estás seguro de que deseas eliminar las {{ count }} reseñas de este libro? Esta acción no se puede deshacer.", @@ -3285,41 +3187,7 @@ } }, "filter": { - "title": "Filtros", "showingFirst100": "Mostrando los primeros 100 elementos", - "footerNote": "Nota: Se muestran los 100 primeros elementos por categoría de filtro", - "labels": { - "author": "Autor", - "category": "Género", - "series": "Serie", - "bookType": "Formato de archivo", - "readStatus": "Estado de lectura", - "personalRating": "Calificación personal", - "publisher": "Editorial", - "matchScore": "Puntuación de coincidencia de metadatos", - "library": "Biblioteca", - "shelf": "Estante", - "shelfStatus": "Estado del estante", - "tag": "Etiqueta", - "publishedDate": "Año de publicación", - "fileSize": "Tamaño de archivo", - "amazonRating": "Calificación Amazon", - "goodreadsRating": "Calificación Goodreads", - "hardcoverRating": "Calificación Hardcover", - "lubimyczytacRating": "Calificación Lubimyczytac", - "ranobedbRating": "Calificación RanobeDB", - "audibleRating": "Calificación Audible", - "language": "Idioma", - "pageCount": "Número de páginas", - "mood": "Estado de ánimo", - "ageRating": "Clasificación por edad", - "contentRating": "Clasificación de contenido", - "narrator": "Narrador", - "comicCharacter": "Personaje de cómic", - "comicTeam": "Equipo de cómic", - "comicLocation": "Ubicación de cómic", - "comicCreator": "Creador de cómic" - }, "readStatus": { "unread": "No leído", "reading": "Leyendo", @@ -3372,14 +3240,6 @@ "shelfStatus": { "shelved": "En estante", "unshelved": "Sin estante" - }, - "comicRoles": { - "penciller": "Dibujante", - "inker": "Entintador", - "colorist": "Colorista", - "letterer": "Rotulista", - "coverArtist": "Artista de portada", - "editor": "" } }, "shelfAssigner": { @@ -3442,27 +3302,6 @@ "updateFailedDetail": "Ocurrió un error al actualizar el estante. Por favor, inténtelo de nuevo." } }, - "table": { - "label": "Tabla de Libros", - "bookCoverAlt": "Portada del libro", - "selectBook": "Seleccionar {{ title }}", - "selectBookFallback": "Seleccionar libro", - "noRating": "Sin calificación", - "ratingOutOf": "{{ rating }} de {{ max }}", - "statusWithPrefix": "Estado: {{ status }}", - "locked": "Bloqueado", - "unlocked": "Desbloqueado", - "toast": { - "metadataLockedSummary": "Metadatos bloqueados", - "metadataLockedDetail": "Los metadatos del libro se han bloqueado correctamente.", - "metadataUnlockedSummary": "Metadatos desbloqueados", - "metadataUnlockedDetail": "Los metadatos del libro se han desbloqueado correctamente.", - "lockFailedSummary": "Error al bloquear", - "lockFailedDetail": "Se produjo un error al bloquear los metadatos.", - "unlockFailedSummary": "Error al desbloquear", - "unlockFailedDetail": "Se produjo un error al desbloquear los metadatos." - } - }, "lockUnlockDialog": { "title": "Bloquear o desbloquear metadatos", "selectedCount": "{{ count }} libro(s) seleccionados", @@ -3483,42 +3322,7 @@ } }, "sorting": { - "sortOrder": "Orden de clasificación", - "removeTooltip": "Eliminar", - "addSortFieldPlaceholder": "Agregar campo de orden...", - "saveAsDefault": "Guardar como predeterminado", - "ascendingTooltip": "Ascendente - clic para cambiar", - "descendingTooltip": "Descendente - clic para cambiar", - "options": { - "title": "Título", - "fileName": "Nombre de archivo", - "filePath": "Ruta de archivo", - "author": "Autor", - "authorSurnameVorname": "Autor (Apellido)", - "seriesName": "Nombre de serie", - "seriesNumber": "Número de serie", - "lastReadTime": "Última lectura", - "personalRating": "Calificación personal", - "addedOn": "Fecha de añadido", - "fileSizeKb": "Tamaño de archivo", - "locked": "Bloqueado", - "publisher": "Editorial", - "publishedDate": "Fecha de publicación", - "readStatus": "Estado de lectura", - "dateFinished": "Fecha de finalización", - "readingProgress": "Progreso de lectura", - "bookType": "Formato de archivo", - "amazonRating": "Calificación Amazon", - "amazonReviewCount": "", - "goodreadsRating": "Calificación Goodreads", - "goodreadsReviewCount": "", - "hardcoverRating": "Calificación Hardcover", - "hardcoverReviewCount": "", - "ranobedbRating": "Calificación Ranobedb", - "narrator": "Narrador", - "pageCount": "Páginas", - "random": "Aleatorio" - } + "saveAsDefault": "Guardar como predeterminado" }, "fileAttacher": { "title": "Adjuntar archivo a otro libro", diff --git a/frontend/src/i18n/fr.json b/frontend/src/i18n/fr.json index f9babff57..0c00fc294 100644 --- a/frontend/src/i18n/fr.json +++ b/frontend/src/i18n/fr.json @@ -556,20 +556,6 @@ "tableSortConfig": "Configuration de tri", "formatOverlay": "Superposition du type de livre" }, - "filter": { - "sectionTitle": "Préférences de filtre", - "sectionDesc": "Configurez les options par défaut pour les contrôles de filtre affichés dans la barre latérale.", - "filterMode": "Mode de filtre", - "filterModeDesc": "Choisissez le mode par défaut pour combiner les filtres sélectionnés depuis la barre latérale droite.", - "visibleFilters": "Filtres visibles", - "visibleFiltersDesc": "Choisissez quels filtres apparaissent dans la barre latérale et glissez pour réordonner. Entre {{min}} et {{max}} filtres.", - "selectionCount": "{{count}} sur {{total}} sélectionnés", - "addFilter": "Ajouter un filtre...", - "resetToDefaults": "Réinitialiser par défaut", - "modeAnd": "Et", - "modeOr": "Ou", - "modeSingle": "Simple" - }, "sidebarSort": { "sectionTitle": "Préférence de tri de la barre latérale", "sectionDesc": "Configurez les options de tri pour les noms de vos bibliothèques et étagères affichés dans le menu latéral gauche.", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Confirmer la génération de couvertures personnalisées" }, "toast": { - "sortSavedSummary": "Tri enregistré", - "sortSavedGlobalDetail": "Configuration de tri par défaut enregistrée.", - "sortSavedEntityDetail": "Configuration de tri enregistrée pour ce {{ entityType }}.", "regenCoverStartedSummary": "Régénération des couvertures lancée", "regenCoverStartedDetail": "Régénération des couvertures pour {{ count }} livre(s). Rafraîchissez la page une fois terminé.", "customCoverStartedSummary": "Génération de couvertures personnalisées lancée", "customCoverStartedDetail": "Génération de couvertures personnalisées pour {{ count }} livre(s).", "failedSummary": "Échec", "regenCoverFailedDetail": "Impossible de lancer la régénération des couvertures.", - "customCoverFailedDetail": "Impossible de lancer la génération de couvertures personnalisées.", - "unshelveSuccessDetail": "Étagères des livres mises à jour", - "unshelveFailedDetail": "Échec de la mise à jour des étagères des livres", - "noEligibleBooksSummary": "Aucun livre éligible", - "noEligibleBooksDetail": "Les livres sélectionnés doivent être des livres à fichier unique (pas de formats alternatifs).", - "multipleLibrariesSummary": "Bibliothèques multiples", - "multipleLibrariesDetail": "Tous les livres sélectionnés doivent provenir de la même bibliothèque." + "customCoverFailedDetail": "Impossible de lancer la génération de couvertures personnalisées." }, "loading": { - "deleting": "Suppression de {{ count }} livre(s)...", - "unshelving": "Retrait de {{ count }} livre(s) des étagères..." + "deleting": "Suppression de {{ count }} livre(s)..." }, "labels": { "allBooks": "Tous les livres", - "unshelvedBooks": "Livres sans étagère", - "unshelvedBooksFiltered": "Livres sans étagère (filtrés)", - "filteredSuffix": "(Filtrés)", - "seriesCollapsedInfo": "Affichage de {{ count }} {{ itemWord }} (séries regroupées)", - "item": "élément", - "items": "éléments", - "selected": "sélectionné(s)", - "setAsDefault": "Définir par défaut ?", - "save": "Enregistrer", - "collapseSeries": "Regrouper les séries", - "gridColumns": "Colonnes de la grille", - "bookTypeOverlay": "Superposition du type de livre", - "noBooks": "Cette collection ne contient aucun livre !", - "failedLibrary": "Échec du chargement des livres de la bibliothèque !", - "failedShelf": "Échec du chargement des livres de l'étagère !", - "failedBooks": "", - "activeFilters": "{{ count }} filtres actifs" - }, - "tooltip": { - "clearFilters": "Effacer les filtres appliqués", - "visibleColumns": "Colonnes visibles", - "selectSorting": "Sélectionner le tri", - "toggleView": "Basculer entre vue grille et tableau", - "search": "Rechercher", - "toggleSidebar": "Afficher/masquer les filtres latéraux", - "metadataActions": "Actions sur les métadonnées", - "assignToShelf": "Assigner à une étagère", - "removeFromShelf": "Retirer de cette étagère", - "lockUnlockMetadata": "Verrouiller/Déverrouiller les métadonnées", - "organizeFiles": "Organiser les fichiers", - "attachToBook": "Joindre à un autre livre", - "moreActions": "Plus d'actions", - "selectAll": "Sélectionner tous les livres", - "deselectAll": "Désélectionner tous les livres", - "deleteSelected": "Supprimer les livres sélectionnés" - }, - "placeholder": { - "selectColumns": "Sélectionner les colonnes", - "search": "Titre, auteur, série, genre ou ISBN..." + "unshelvedBooks": "Livres sans étagère" } }, "card": { @@ -3080,36 +3018,6 @@ "deletingLibrary": "Suppression de la bibliothèque '{{ name }}'..." } }, - "columnPref": { - "columns": { - "readStatus": "Lu", - "title": "Titre", - "authors": "Auteurs", - "publisher": "Éditeur", - "seriesName": "Série", - "seriesNumber": "N° de série", - "categories": "", - "publishedDate": "Publié", - "lastReadTime": "Dernière lecture", - "addedOn": "Ajouté", - "fileName": "Nom du fichier", - "fileSizeKb": "Taille du fichier", - "language": "Langue", - "isbn": "", - "pageCount": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "Préférences enregistrées", - "savedDetail": "Votre disposition de colonnes a été enregistrée." - } - }, "coverPref": { "toast": { "savedSummary": "Taille de couverture enregistrée", @@ -3118,12 +3026,6 @@ "saveFailedDetail": "Impossible d'enregistrer la préférence de taille de couverture localement." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Échec de l'enregistrement", - "saveFailedDetail": "Impossible d'enregistrer la préférence de filtre latéral localement." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Êtes-vous sûr de vouloir supprimer les {{ count }} avis de ce livre ? Cette action est irréversible.", @@ -3281,41 +3183,7 @@ } }, "filter": { - "title": "Filtres", "showingFirst100": "Affichage des 100 premiers éléments", - "footerNote": "Note : Les 100 premiers éléments sont affichés par catégorie de filtre", - "labels": { - "author": "Auteur", - "category": "", - "series": "Série", - "bookType": "Type de livre", - "readStatus": "Statut de lecture", - "personalRating": "Note personnelle", - "publisher": "Éditeur", - "matchScore": "Score de correspondance des métadonnées", - "library": "Bibliothèque", - "shelf": "Étagère", - "shelfStatus": "Statut d'étagère", - "tag": "", - "publishedDate": "Année de publication", - "fileSize": "Taille du fichier", - "amazonRating": "Note Amazon", - "goodreadsRating": "Note Goodreads", - "hardcoverRating": "Note Hardcover", - "lubimyczytacRating": "Note Lubimyczytac", - "ranobedbRating": "Note RanobeDB", - "audibleRating": "Note Audible", - "language": "Langue", - "pageCount": "Nombre de pages", - "mood": "Humeur", - "ageRating": "Classification d'âge", - "contentRating": "Classification de contenu", - "narrator": "Narrateur", - "comicCharacter": "Personnage de BD", - "comicTeam": "Équipe de BD", - "comicLocation": "Lieu de BD", - "comicCreator": "Créateur de BD" - }, "readStatus": { "unread": "Non lu", "reading": "En lecture", @@ -3368,14 +3236,6 @@ "shelfStatus": { "shelved": "Sur une étagère", "unshelved": "Sans étagère" - }, - "comicRoles": { - "penciller": "Dessinateur", - "inker": "Encreur", - "colorist": "Coloriste", - "letterer": "Lettreur", - "coverArtist": "Artiste de couverture", - "editor": "Éditeur" } }, "shelfAssigner": { @@ -3438,27 +3298,6 @@ "updateFailedDetail": "Une erreur est survenue lors de la mise à jour de l'étagère. Veuillez réessayer." } }, - "table": { - "label": "", - "bookCoverAlt": "Couverture du livre", - "selectBook": "Sélectionner {{ title }}", - "selectBookFallback": "Sélectionner un livre", - "noRating": "Pas de note", - "ratingOutOf": "", - "statusWithPrefix": "Statut : {{ status }}", - "locked": "Verrouillé", - "unlocked": "Déverrouillé", - "toast": { - "metadataLockedSummary": "Métadonnées verrouillées", - "metadataLockedDetail": "Les métadonnées du livre ont été verrouillées avec succès.", - "metadataUnlockedSummary": "Métadonnées déverrouillées", - "metadataUnlockedDetail": "Les métadonnées du livre ont été déverrouillées avec succès.", - "lockFailedSummary": "Échec du verrouillage", - "lockFailedDetail": "Une erreur est survenue lors du verrouillage des métadonnées.", - "unlockFailedSummary": "Échec du déverrouillage", - "unlockFailedDetail": "Une erreur est survenue lors du déverrouillage des métadonnées." - } - }, "lockUnlockDialog": { "title": "Verrouiller ou déverrouiller les métadonnées", "selectedCount": "{{ count }} livre(s) sélectionné(s)", @@ -3479,42 +3318,7 @@ } }, "sorting": { - "sortOrder": "Ordre de tri", - "removeTooltip": "Retirer", - "addSortFieldPlaceholder": "Ajouter un champ de tri...", - "saveAsDefault": "Enregistrer par défaut", - "ascendingTooltip": "Croissant - cliquez pour changer", - "descendingTooltip": "Décroissant - cliquez pour changer", - "options": { - "title": "Titre", - "fileName": "Nom du fichier", - "filePath": "Chemin du fichier", - "author": "Auteur", - "authorSurnameVorname": "Auteur (nom de famille)", - "seriesName": "Nom de la série", - "seriesNumber": "Numéro de la série", - "lastReadTime": "Dernière lecture", - "personalRating": "Note personnelle", - "addedOn": "Date d'ajout", - "fileSizeKb": "Taille du fichier", - "locked": "Verrouillé", - "publisher": "Éditeur", - "publishedDate": "Date de publication", - "readStatus": "Statut de lecture", - "dateFinished": "Date de fin", - "readingProgress": "Progression de lecture", - "bookType": "Type de livre", - "amazonRating": "Note Amazon", - "amazonReviewCount": "", - "goodreadsRating": "Note Goodreads", - "goodreadsReviewCount": "", - "hardcoverRating": "Note Hardcover", - "hardcoverReviewCount": "", - "ranobedbRating": "Note Ranobedb", - "narrator": "Narrateur", - "pageCount": "", - "random": "Aléatoire" - } + "saveAsDefault": "Enregistrer par défaut" }, "fileAttacher": { "title": "Joindre le fichier à un autre livre", diff --git a/frontend/src/i18n/hr.json b/frontend/src/i18n/hr.json index 9e1d8949d..e85903dee 100644 --- a/frontend/src/i18n/hr.json +++ b/frontend/src/i18n/hr.json @@ -556,20 +556,6 @@ "editSort": "Uredi sortiranje", "tableSortConfig": "Konfiguracija sortiranja" }, - "filter": { - "sectionTitle": "Postavke filtera", - "sectionDesc": "Konfigurirajte zadane opcije za kontrole filtera prikazane u bočnoj traci.", - "filterMode": "Način filtriranja", - "filterModeDesc": "Odaberite zadani način kombiniranja filtera odabranih iz desne bočne trake filtera.", - "visibleFilters": "Vidljivi filteri", - "visibleFiltersDesc": "Odaberite koji se filteri pojavljuju u bočnoj traci i povucite za promjenu redoslijeda. Između {{min}} i {{max}} filtera.", - "selectionCount": "{{count}} od {{total}} odabrano", - "addFilter": "Dodaj filter...", - "resetToDefaults": "Vrati na zadano", - "modeAnd": "I", - "modeOr": "Ili", - "modeSingle": "Pojedinačno" - }, "sidebarSort": { "sectionTitle": "Postavke sortiranja bočne trake zbirki i polica", "sectionDesc": "Konfigurirajte opcije sortiranja za nazive zbirki i polica prikazane u lijevom izborniku bočne trake.", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Potvrdi generiranje prilagođenih naslovnica" }, "toast": { - "sortSavedSummary": "Sortiranje spremljeno", - "sortSavedGlobalDetail": "Zadana konfiguracija sortiranja spremljena.", - "sortSavedEntityDetail": "Konfiguracija sortiranja spremljena za {{ entityType }}.", "regenCoverStartedSummary": "Regeneracija naslovnica pokrenuta", "regenCoverStartedDetail": "Regeneriranje naslovnica za {{ count }} knjigu/e. Osvježite stranicu po završetku.", "customCoverStartedSummary": "Generiranje prilagođenih naslovnica pokrenuto", "customCoverStartedDetail": "Generiranje prilagođenih naslovnica za {{ count }} knjigu/e.", "failedSummary": "Neuspjelo", "regenCoverFailedDetail": "Pokretanje regeneracije naslovnica nije uspjelo.", - "customCoverFailedDetail": "Pokretanje generiranja prilagođenih naslovnica nije uspjelo.", - "unshelveSuccessDetail": "Police knjiga ažurirane", - "unshelveFailedDetail": "Ažuriranje polica knjiga nije uspjelo", - "noEligibleBooksSummary": "Nema prihvatljivih knjiga", - "noEligibleBooksDetail": "Odabrane knjige moraju biti jednodatotečne knjige (bez alternativnih formata).", - "multipleLibrariesSummary": "Više zbirki", - "multipleLibrariesDetail": "Sve odabrane knjige moraju biti iz iste zbirke." + "customCoverFailedDetail": "Pokretanje generiranja prilagođenih naslovnica nije uspjelo." }, "loading": { - "deleting": "Brisanje {{ count }} knjige/a...", - "unshelving": "Uklanjanje {{ count }} knjige/a s polica..." + "deleting": "Brisanje {{ count }} knjige/a..." }, "labels": { "allBooks": "Sve knjige", - "unshelvedBooks": "Knjige bez police", - "unshelvedBooksFiltered": "Knjige bez police (filtrirano)", - "filteredSuffix": "(Filtrirano)", - "seriesCollapsedInfo": "Prikazujem {{ count }} {{ itemWord }} (serijali skupljeni)", - "item": "stavka", - "items": "stavki", - "selected": "odabrano", - "setAsDefault": "Postavi kao zadano?", - "save": "Spremi", - "collapseSeries": "Skupi serijale", - "gridColumns": "Stupci mreže", - "bookTypeOverlay": "Prekrivanje formata datoteke", - "noBooks": "Ova kolekcija nema knjiga!", - "failedLibrary": "Učitavanje knjiga zbirke nije uspjelo!", - "failedShelf": "Učitavanje knjiga police nije uspjelo!", - "failedBooks": "Učitavanje knjiga nije uspjelo!", - "activeFilters": "{{ count }} aktivnih filtera" - }, - "tooltip": { - "clearFilters": "Očisti primijenjene filtere", - "visibleColumns": "Vidljivi stupci", - "selectSorting": "Odaberi sortiranje", - "toggleView": "Prebaci između prikaza mreže i tablice", - "search": "Pretraži", - "toggleSidebar": "Prebaci filtere bočne trake", - "metadataActions": "Radnje s metapodacima", - "assignToShelf": "Dodijeli polici", - "removeFromShelf": "Ukloni s ove police", - "lockUnlockMetadata": "Zaključaj/Otključaj metapodatke", - "organizeFiles": "Organiziraj datoteke", - "attachToBook": "Priloži drugoj knjizi", - "moreActions": "Više radnji", - "selectAll": "Odaberi sve knjige", - "deselectAll": "Poništi odabir svih knjiga", - "deleteSelected": "Obriši odabrane knjige" - }, - "placeholder": { - "selectColumns": "Odaberi stupce", - "search": "Naslov, autor, serijal, žanr ili ISBN..." + "unshelvedBooks": "Knjige bez police" } }, "card": { @@ -3080,36 +3018,6 @@ "deletingLibrary": "Brisanje zbirke '{{ name }}'..." } }, - "columnPref": { - "columns": { - "readStatus": "Čitanje", - "title": "Naslov", - "authors": "Autori", - "publisher": "Izdavač", - "seriesName": "Serijal", - "seriesNumber": "Serijal #", - "categories": "Žanrovi", - "publishedDate": "Objavljeno", - "lastReadTime": "Zadnje čitano", - "addedOn": "Dodano", - "fileName": "Naziv datoteke", - "fileSizeKb": "Veličina datoteke", - "language": "Jezik", - "isbn": "ISBN", - "pageCount": "Stranice", - "amazonRating": "Amazon", - "amazonReviewCount": "AZ #", - "goodreadsRating": "Goodreads", - "goodreadsReviewCount": "GR #", - "hardcoverRating": "Hardcover", - "hardcoverReviewCount": "HC #", - "ranobedbRating": "Ranobedb" - }, - "toast": { - "savedSummary": "Postavke spremljene", - "savedDetail": "Vaš raspored stupaca je spremljen." - } - }, "coverPref": { "toast": { "savedSummary": "Veličina naslovnice spremljena", @@ -3118,12 +3026,6 @@ "saveFailedDetail": "Spremanje postavke veličine naslovnice lokalno nije uspjelo." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Spremanje nije uspjelo", - "saveFailedDetail": "Spremanje postavke filtera bočne trake lokalno nije uspjelo." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Jeste li sigurni da želite obrisati svih {{ count }} recenzija za ovu knjigu? Ova radnja se ne može poništiti.", @@ -3281,41 +3183,7 @@ } }, "filter": { - "title": "Filteri", "showingFirst100": "Prikazujem prvih 100 stavki", - "footerNote": "Napomena: Prikazuje se prvih 100 stavki po kategoriji filtera", - "labels": { - "author": "Autor", - "category": "Žanr", - "series": "Serijal", - "bookType": "Vrsta knjige", - "readStatus": "Status čitanja", - "personalRating": "Osobna ocjena", - "publisher": "Izdavač", - "matchScore": "Rezultat usklađenosti metapodataka", - "library": "Zbirka", - "shelf": "Polica", - "shelfStatus": "Status police", - "tag": "Oznaka", - "publishedDate": "Godina izdavanja", - "fileSize": "Veličina datoteke", - "amazonRating": "Amazon ocjena", - "goodreadsRating": "Goodreads ocjena", - "hardcoverRating": "Hardcover ocjena", - "lubimyczytacRating": "Lubimyczytac ocjena", - "ranobedbRating": "RanobeDB ocjena", - "audibleRating": "Audible ocjena", - "language": "Jezik", - "pageCount": "Broj stranica", - "mood": "Raspoloženje", - "ageRating": "Dobna ocjena", - "contentRating": "Ocjena sadržaja", - "narrator": "Narator", - "comicCharacter": "Lik iz stripa", - "comicTeam": "Tim iz stripa", - "comicLocation": "Lokacija iz stripa", - "comicCreator": "Autor stripa" - }, "readStatus": { "unread": "Nepročitano", "reading": "Čitanje", @@ -3368,14 +3236,6 @@ "shelfStatus": { "shelved": "Na polici", "unshelved": "Bez police" - }, - "comicRoles": { - "penciller": "Crtač", - "inker": "Tušer", - "colorist": "Kolorist", - "letterer": "Letrist", - "coverArtist": "Naslovničar", - "editor": "Urednik" } }, "shelfAssigner": { @@ -3438,27 +3298,6 @@ "updateFailedDetail": "Došlo je do pogreške prilikom ažuriranja police. Pokušajte ponovo." } }, - "table": { - "label": "Stol za knjige", - "bookCoverAlt": "Naslovnica knjige", - "selectBook": "Odaberite {{ title }}", - "selectBookFallback": "Odaberi knjigu", - "noRating": "Nema ratinga", - "ratingOutOf": "{{ rating }} od {{ max }}", - "statusWithPrefix": "Status: {{ status }}", - "locked": "Zaključano", - "unlocked": "Otključano", - "toast": { - "metadataLockedSummary": "Metapodaci zaključani", - "metadataLockedDetail": "Metapodaci knjige su uspješno zaključani.", - "metadataUnlockedSummary": "Metapodaci otključani", - "metadataUnlockedDetail": "Metapodaci knjige su uspješno otključani.", - "lockFailedSummary": "Zaključavanje nije uspjelo", - "lockFailedDetail": "Došlo je do pogreške prilikom zaključavanja metapodataka.", - "unlockFailedSummary": "Otključavanje nije uspjelo", - "unlockFailedDetail": "Došlo je do pogreške prilikom otključavanja metapodataka." - } - }, "lockUnlockDialog": { "title": "Zaključaj ili otključaj metapodatke", "selectedCount": "{{ count }} knjiga odabrano", @@ -3479,42 +3318,7 @@ } }, "sorting": { - "sortOrder": "Redoslijed sortiranja", - "removeTooltip": "Ukloni", - "addSortFieldPlaceholder": "Dodaj polje sortiranja...", - "saveAsDefault": "Spremi kao zadano", - "ascendingTooltip": "Uzlazno - kliknite za promjenu", - "descendingTooltip": "Silazno - kliknite za promjenu", - "options": { - "title": "Naslov", - "fileName": "Naziv datoteke", - "filePath": "Putanja datoteke", - "author": "Autor", - "authorSurnameVorname": "Autor (prezime)", - "seriesName": "Naziv serijala", - "seriesNumber": "Broj u serijalu", - "lastReadTime": "Zadnje čitano", - "personalRating": "Osobna ocjena", - "addedOn": "Dodano", - "fileSizeKb": "Veličina datoteke", - "locked": "Zaključano", - "publisher": "Izdavač", - "publishedDate": "Datum izdavanja", - "readStatus": "Status čitanja", - "dateFinished": "Datum završetka", - "readingProgress": "Napredak čitanja", - "bookType": "Vrsta knjige", - "amazonRating": "Amazon ocjena", - "amazonReviewCount": "Amazon #", - "goodreadsRating": "Goodreads ocjena", - "goodreadsReviewCount": "Goodreads #", - "hardcoverRating": "Hardcover ocjena", - "hardcoverReviewCount": "Hardcover #", - "ranobedbRating": "Ranobedb ocjena", - "narrator": "Narator", - "pageCount": "Stranice", - "random": "Nasumično" - } + "saveAsDefault": "Spremi kao zadano" }, "fileAttacher": { "title": "Priloži datoteku drugoj knjizi", diff --git a/frontend/src/i18n/hu.json b/frontend/src/i18n/hu.json index 637414c12..9d1c018e6 100644 --- a/frontend/src/i18n/hu.json +++ b/frontend/src/i18n/hu.json @@ -556,20 +556,6 @@ "tableSortConfig": "", "formatOverlay": "Fájlformátum overlay" }, - "filter": { - "sectionTitle": "", - "sectionDesc": "", - "filterMode": "", - "filterModeDesc": "", - "visibleFilters": "", - "visibleFiltersDesc": "", - "selectionCount": "", - "addFilter": "", - "resetToDefaults": "", - "modeAnd": "", - "modeOr": "", - "modeSingle": "" - }, "sidebarSort": { "sectionTitle": "", "sectionDesc": "", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Egyedi borító generálás megerősítése" }, "toast": { - "sortSavedSummary": "Rendezés elmentve", - "sortSavedGlobalDetail": "Alapértelmezett rendezési sorrend elmentve.", - "sortSavedEntityDetail": "Rendezési sorrend elmentve a következőhöz: {{ entityType }}", "regenCoverStartedSummary": "Borító újragenerálás elindítva", "regenCoverStartedDetail": "Borítók újragenerálása {{ count }} könyv számára. Frissítsd az oldalt miután végeztünk.", "customCoverStartedSummary": "Egyedi borító generálás elindítva", "customCoverStartedDetail": "Egyedi borító generálása {{ count }} könyv számára.", "failedSummary": "Sikertelen", "regenCoverFailedDetail": "Nem tudtuk elindítani a borítók újragenerálását.", - "customCoverFailedDetail": "Nem tudtuk elindítani az egyedi borító generálást.", - "unshelveSuccessDetail": "Könyvespolcok frissítve", - "unshelveFailedDetail": "Könyvespolcok frissítése sikertelen", - "noEligibleBooksSummary": "Nincsenek alkalmas könyvek", - "noEligibleBooksDetail": "A kiválasztott könyvek egy fájlból kell álljanak (alternatív formátumok nem elérhetőek).", - "multipleLibrariesSummary": "Külöböző könyvtárak", - "multipleLibrariesDetail": "Minden kiválasztott könyvnek azonos könyvtárból kell származnia." + "customCoverFailedDetail": "Nem tudtuk elindítani az egyedi borító generálást." }, "loading": { - "deleting": "{{ count }} könyv törlése...", - "unshelving": "{{ count }} könyv levétele a polcokról..." + "deleting": "{{ count }} könyv törlése..." }, "labels": { "allBooks": "Minden könyv", - "unshelvedBooks": "Polc nélküli könyvek", - "unshelvedBooksFiltered": "Polc nélküli könyvek (szűrt)", - "filteredSuffix": "(Szűrt)", - "seriesCollapsedInfo": "{{ count }} {{ itemWord }} mutatása (sorozatok összevonva)", - "item": "elem", - "items": "elemek", - "selected": "kiválasztott", - "setAsDefault": "Beállítod alapértelmezésként?", - "save": "Mentés", - "collapseSeries": "Sorozatok összevonása", - "gridColumns": "Rácsnézet oszlopai", - "bookTypeOverlay": "Fájlformátum overlay", - "noBooks": "Ebben a gyűjteményben nem találhatóak könyvek!", - "failedLibrary": "Nem sikerült betölteni a könyvtárban lévő könyveket!", - "failedShelf": "Nem sikerült betölteni a polcon lévő könyveket!", - "failedBooks": "", - "activeFilters": "{{ count }} aktív szűrő" - }, - "tooltip": { - "clearFilters": "Szűrők eltávolítása", - "visibleColumns": "Látható oszlopok", - "selectSorting": "Rendezés kiválasztása", - "toggleView": "Válts Rácsos és Táblázatos megjelenítés között", - "search": "Keresés", - "toggleSidebar": "Oldalhasáb megjelenítése / elrejtése", - "metadataActions": "Metaadat tevékenységek", - "assignToShelf": "Polcra tesz", - "removeFromShelf": "Polcról levesz", - "lockUnlockMetadata": "Metaadatok zárolása / feloldása", - "organizeFiles": "Fájlok rendszerezése", - "attachToBook": "Hozzáadás egy másik könyvhöz", - "moreActions": "További lehetőségek", - "selectAll": "Összes könyv kiválasztása", - "deselectAll": "Kiválasztások megszüntetése", - "deleteSelected": "Kiválasztott könyvek törlése" - }, - "placeholder": { - "selectColumns": "Oszlopok kiválasztása", - "search": "Cím, Szerző, Sorozat, Műfaj, vagy ISBN..." + "unshelvedBooks": "Polc nélküli könyvek" } }, "card": { @@ -3035,36 +2973,6 @@ "deletingLibrary": "" } }, - "columnPref": { - "columns": { - "readStatus": "", - "title": "", - "authors": "", - "publisher": "", - "seriesName": "", - "seriesNumber": "", - "categories": "", - "publishedDate": "", - "lastReadTime": "", - "addedOn": "", - "fileName": "", - "fileSizeKb": "", - "language": "", - "isbn": "", - "pageCount": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "", - "savedDetail": "" - } - }, "coverPref": { "toast": { "savedSummary": "", @@ -3073,12 +2981,6 @@ "saveFailedDetail": "" } }, - "filterPref": { - "toast": { - "saveFailedSummary": "", - "saveFailedDetail": "" - } - }, "reviews": { "confirm": { "deleteAllMessage": "", @@ -3236,41 +3138,7 @@ } }, "filter": { - "title": "", "showingFirst100": "", - "footerNote": "", - "labels": { - "author": "", - "category": "", - "series": "", - "bookType": "", - "readStatus": "", - "personalRating": "", - "publisher": "", - "matchScore": "", - "library": "", - "shelf": "", - "shelfStatus": "", - "tag": "", - "publishedDate": "", - "fileSize": "", - "amazonRating": "", - "goodreadsRating": "", - "hardcoverRating": "", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "", - "pageCount": "", - "mood": "", - "ageRating": "", - "contentRating": "", - "narrator": "", - "comicCharacter": "", - "comicTeam": "", - "comicLocation": "", - "comicCreator": "" - }, "readStatus": { "unread": "", "reading": "", @@ -3323,14 +3191,6 @@ "shelfStatus": { "shelved": "", "unshelved": "" - }, - "comicRoles": { - "penciller": "", - "inker": "", - "colorist": "", - "letterer": "", - "coverArtist": "", - "editor": "" } }, "shelfAssigner": { @@ -3393,27 +3253,6 @@ "updateFailedDetail": "" } }, - "table": { - "label": "", - "bookCoverAlt": "", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "{{ status }}", - "locked": "", - "unlocked": "", - "toast": { - "metadataLockedSummary": "", - "metadataLockedDetail": "", - "metadataUnlockedSummary": "", - "metadataUnlockedDetail": "", - "lockFailedSummary": "", - "lockFailedDetail": "", - "unlockFailedSummary": "", - "unlockFailedDetail": "" - } - }, "lockUnlockDialog": { "title": "", "selectedCount": "", @@ -3434,42 +3273,7 @@ } }, "sorting": { - "sortOrder": "", - "removeTooltip": "", - "addSortFieldPlaceholder": "", - "saveAsDefault": "", - "ascendingTooltip": "", - "descendingTooltip": "", - "options": { - "title": "", - "fileName": "", - "filePath": "", - "author": "", - "authorSurnameVorname": "", - "seriesName": "", - "seriesNumber": "", - "lastReadTime": "", - "personalRating": "", - "addedOn": "", - "fileSizeKb": "", - "locked": "", - "publisher": "", - "publishedDate": "", - "readStatus": "", - "dateFinished": "", - "readingProgress": "", - "bookType": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "", - "narrator": "", - "pageCount": "", - "random": "" - } + "saveAsDefault": "" }, "fileAttacher": { "title": "", diff --git a/frontend/src/i18n/id.json b/frontend/src/i18n/id.json index 0337ed33f..75bccf6cf 100644 --- a/frontend/src/i18n/id.json +++ b/frontend/src/i18n/id.json @@ -555,20 +555,6 @@ "editSort": "", "tableSortConfig": "" }, - "filter": { - "sectionTitle": "", - "sectionDesc": "", - "filterMode": "", - "filterModeDesc": "", - "visibleFilters": "", - "visibleFiltersDesc": "", - "selectionCount": "", - "addFilter": "", - "resetToDefaults": "", - "modeAnd": "Dan", - "modeOr": "Atau", - "modeSingle": "" - }, "sidebarSort": { "sectionTitle": "", "sectionDesc": "", @@ -2732,68 +2718,20 @@ "customCoverHeader": "Konfirmasi Pembuatan Sampul Khusus" }, "toast": { - "sortSavedSummary": "Pengurutan Disimpan", - "sortSavedGlobalDetail": "Konfigurasi bawaan pengurutan disimpan.", - "sortSavedEntityDetail": "Konfigurasi pengurutan disimpan untuk {{ entityType }} ini.", "regenCoverStartedSummary": "Pembuatan Ulang Sampul Dimulai", "regenCoverStartedDetail": "Memperbarui sampul untuk {{ count }} buku. Segarkan halaman setelah selesai.", "customCoverStartedSummary": "Pembuatan Sampul Khusus Dimulai", "customCoverStartedDetail": "Membuat sampul khusus untuk {{ count }} buku.", "failedSummary": "Gagal", "regenCoverFailedDetail": "Tidak dapat memulai pembuatan ulang sampul.", - "customCoverFailedDetail": "Tidak dapat memulai pembuatan sampul khusus.", - "unshelveSuccessDetail": "Rak buku diperbarui", - "unshelveFailedDetail": "Gagal memperbarui rak buku", - "noEligibleBooksSummary": "", - "noEligibleBooksDetail": "Buku yang dipilih harus berupa buku satu file (tidak ada format alternatif).", - "multipleLibrariesSummary": "", - "multipleLibrariesDetail": "Semua buku yang dipilih harus berasal dari perpustakaan yang sama." + "customCoverFailedDetail": "Tidak dapat memulai pembuatan sampul khusus." }, "loading": { - "deleting": "Menghapus {{ count }} buku...", - "unshelving": "Mengeluarkan {{ count }} buku dari rak..." + "deleting": "Menghapus {{ count }} buku..." }, "labels": { "allBooks": "Semua Buku", - "unshelvedBooks": "Buku Di Luar Rak", - "unshelvedBooksFiltered": "Buku Di Luar Rak (Disaring)", - "filteredSuffix": "(Disaring)", - "seriesCollapsedInfo": "", - "item": "", - "items": "", - "selected": "dipilih", - "setAsDefault": "Tetapkan sebagai bawaan?", - "save": "Simpan", - "collapseSeries": "", - "gridColumns": "", - "bookTypeOverlay": "", - "noBooks": "Tidak ada buku di koleksi ini!", - "failedLibrary": "Gagal memuat buku perpustakaan!", - "failedShelf": "Gagal memuat rak buku!", - "failedBooks": "", - "activeFilters": "{{ count }} Saringan Aktif" - }, - "tooltip": { - "clearFilters": "Bersikan saringan yang diterapkan", - "visibleColumns": "", - "selectSorting": "Pilih pengurutan", - "toggleView": "", - "search": "Cari", - "toggleSidebar": "", - "metadataActions": "", - "assignToShelf": "Masukkan ke rak", - "removeFromShelf": "Keluarkan dari rak ini", - "lockUnlockMetadata": "Kunci/Buka kunci metadata", - "organizeFiles": "Atur Berkas", - "attachToBook": "Sematkan ke Buku Lainnya", - "moreActions": "Tindakan lain", - "selectAll": "Pilih semua buku", - "deselectAll": "Batalkan memilih semua buku", - "deleteSelected": "Hapus buku terpilih" - }, - "placeholder": { - "selectColumns": "Pilih Kolom", - "search": "Judul, Pengarang, Seri, Genre, atau ISBN..." + "unshelvedBooks": "Buku Di Luar Rak" } }, "card": { @@ -3031,36 +2969,6 @@ "deletingLibrary": "" } }, - "columnPref": { - "columns": { - "readStatus": "", - "title": "", - "authors": "", - "publisher": "", - "seriesName": "", - "seriesNumber": "", - "categories": "", - "publishedDate": "", - "lastReadTime": "", - "addedOn": "", - "fileName": "", - "fileSizeKb": "", - "language": "", - "isbn": "", - "pageCount": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "", - "savedDetail": "" - } - }, "coverPref": { "toast": { "savedSummary": "", @@ -3069,12 +2977,6 @@ "saveFailedDetail": "" } }, - "filterPref": { - "toast": { - "saveFailedSummary": "", - "saveFailedDetail": "" - } - }, "reviews": { "confirm": { "deleteAllMessage": "", @@ -3232,41 +3134,7 @@ } }, "filter": { - "title": "", "showingFirst100": "", - "footerNote": "", - "labels": { - "author": "", - "category": "", - "series": "", - "bookType": "", - "readStatus": "", - "personalRating": "", - "publisher": "", - "matchScore": "", - "library": "", - "shelf": "", - "shelfStatus": "", - "tag": "", - "publishedDate": "", - "fileSize": "", - "amazonRating": "", - "goodreadsRating": "", - "hardcoverRating": "", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "", - "pageCount": "", - "mood": "", - "ageRating": "", - "contentRating": "", - "narrator": "", - "comicCharacter": "", - "comicTeam": "", - "comicLocation": "", - "comicCreator": "" - }, "readStatus": { "unread": "", "reading": "", @@ -3319,14 +3187,6 @@ "shelfStatus": { "shelved": "", "unshelved": "" - }, - "comicRoles": { - "penciller": "", - "inker": "", - "colorist": "", - "letterer": "", - "coverArtist": "", - "editor": "" } }, "shelfAssigner": { @@ -3389,27 +3249,6 @@ "updateFailedDetail": "" } }, - "table": { - "label": "", - "bookCoverAlt": "", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "{{ status }}", - "locked": "", - "unlocked": "", - "toast": { - "metadataLockedSummary": "", - "metadataLockedDetail": "", - "metadataUnlockedSummary": "", - "metadataUnlockedDetail": "", - "lockFailedSummary": "", - "lockFailedDetail": "", - "unlockFailedSummary": "", - "unlockFailedDetail": "" - } - }, "lockUnlockDialog": { "title": "", "selectedCount": "", @@ -3430,42 +3269,7 @@ } }, "sorting": { - "sortOrder": "", - "removeTooltip": "", - "addSortFieldPlaceholder": "", - "saveAsDefault": "", - "ascendingTooltip": "", - "descendingTooltip": "", - "options": { - "title": "", - "fileName": "", - "filePath": "", - "author": "", - "authorSurnameVorname": "", - "seriesName": "", - "seriesNumber": "", - "lastReadTime": "", - "personalRating": "", - "addedOn": "", - "fileSizeKb": "", - "locked": "", - "publisher": "", - "publishedDate": "", - "readStatus": "", - "dateFinished": "", - "readingProgress": "", - "bookType": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "", - "narrator": "", - "pageCount": "", - "random": "" - } + "saveAsDefault": "" }, "fileAttacher": { "title": "", diff --git a/frontend/src/i18n/it.json b/frontend/src/i18n/it.json index a63b10633..89ff2bcf1 100644 --- a/frontend/src/i18n/it.json +++ b/frontend/src/i18n/it.json @@ -556,20 +556,6 @@ "tableSortConfig": "Configurazione ordinamento", "formatOverlay": "Overlay tipo libro" }, - "filter": { - "sectionTitle": "Preferenze filtri", - "sectionDesc": "Configura le opzioni predefinite per i controlli filtro mostrati nella barra laterale.", - "filterMode": "Modalità filtro", - "filterModeDesc": "Scegli la modalità predefinita per combinare i filtri selezionati dalla barra laterale destra dei filtri.", - "visibleFilters": "Filtri visibili", - "visibleFiltersDesc": "Scegli quali filtri appaiono nella barra laterale e trascina per riordinare. Tra {{min}} e {{max}} filtri.", - "selectionCount": "{{count}} di {{total}} selezionati", - "addFilter": "Aggiungi filtro...", - "resetToDefaults": "Ripristina predefiniti", - "modeAnd": "E", - "modeOr": "O", - "modeSingle": "Singolo" - }, "sidebarSort": { "sectionTitle": "Preferenza ordinamento barra laterale librerie e scaffali", "sectionDesc": "Configura le opzioni di ordinamento per i nomi delle librerie e degli scaffali mostrati nel menu della barra laterale sinistra.", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Conferma generazione copertine personalizzate" }, "toast": { - "sortSavedSummary": "Ordinamento salvato", - "sortSavedGlobalDetail": "Configurazione di ordinamento predefinita salvata.", - "sortSavedEntityDetail": "Configurazione di ordinamento salvata per questo {{ entityType }}.", "regenCoverStartedSummary": "Rigenerazione copertine avviata", "regenCoverStartedDetail": "Rigenerazione copertine per {{ count }} libro/i. Aggiorna la pagina al termine.", "customCoverStartedSummary": "Generazione copertine personalizzate avviata", "customCoverStartedDetail": "Generazione copertine personalizzate per {{ count }} libro/i.", "failedSummary": "Fallito", "regenCoverFailedDetail": "Impossibile avviare la rigenerazione delle copertine.", - "customCoverFailedDetail": "Impossibile avviare la generazione delle copertine personalizzate.", - "unshelveSuccessDetail": "Scaffali dei libri aggiornati", - "unshelveFailedDetail": "Aggiornamento scaffali dei libri fallito", - "noEligibleBooksSummary": "Nessun libro idoneo", - "noEligibleBooksDetail": "I libri selezionati devono essere libri con un singolo file (senza formati alternativi).", - "multipleLibrariesSummary": "Librerie multiple", - "multipleLibrariesDetail": "Tutti i libri selezionati devono provenire dalla stessa libreria." + "customCoverFailedDetail": "Impossibile avviare la generazione delle copertine personalizzate." }, "loading": { - "deleting": "Eliminazione di {{ count }} libro/i...", - "unshelving": "Rimozione di {{ count }} libro/i dagli scaffali..." + "deleting": "Eliminazione di {{ count }} libro/i..." }, "labels": { "allBooks": "Tutti i libri", - "unshelvedBooks": "Libri non catalogati", - "unshelvedBooksFiltered": "Libri non catalogati (Filtrati)", - "filteredSuffix": "(Filtrati)", - "seriesCollapsedInfo": "Visualizzazione di {{ count }} {{ itemWord }} (serie compresse)", - "item": "elemento", - "items": "elementi", - "selected": "selezionati", - "setAsDefault": "Impostare come predefinito?", - "save": "Salva", - "collapseSeries": "Comprimi serie", - "gridColumns": "Colonne griglia", - "bookTypeOverlay": "Overlay tipo libro", - "noBooks": "Questa collezione non ha libri!", - "failedLibrary": "Impossibile caricare i libri della libreria!", - "failedShelf": "Impossibile caricare i libri dello scaffale!", - "failedBooks": "", - "activeFilters": "{{ count }} filtri attivi" - }, - "tooltip": { - "clearFilters": "Cancella filtri applicati", - "visibleColumns": "Colonne visibili", - "selectSorting": "Seleziona ordinamento", - "toggleView": "Alterna tra vista a griglia e tabella", - "search": "Cerca", - "toggleSidebar": "Attiva/disattiva filtri barra laterale", - "metadataActions": "Azioni metadati", - "assignToShelf": "Assegna a scaffale", - "removeFromShelf": "Rimuovi da questo scaffale", - "lockUnlockMetadata": "Blocca/Sblocca metadati", - "organizeFiles": "Organizza file", - "attachToBook": "Allega ad un altro libro", - "moreActions": "Altre azioni", - "selectAll": "Seleziona tutti i libri", - "deselectAll": "Deseleziona tutti i libri", - "deleteSelected": "Elimina libri selezionati" - }, - "placeholder": { - "selectColumns": "Seleziona colonne", - "search": "Titolo, Autore, Serie, Genere o ISBN..." + "unshelvedBooks": "Libri non catalogati" } }, "card": { @@ -3076,36 +3014,6 @@ "deletingLibrary": "Eliminazione libreria '{{ name }}'..." } }, - "columnPref": { - "columns": { - "readStatus": "Lettura", - "title": "Titolo", - "authors": "Autori", - "publisher": "Editore", - "seriesName": "Serie", - "seriesNumber": "Serie #", - "categories": "Generi", - "publishedDate": "Pubblicato", - "lastReadTime": "Ultima lettura", - "addedOn": "Aggiunto", - "fileName": "Nome file", - "fileSizeKb": "Dimensione file", - "language": "Lingua", - "isbn": "", - "pageCount": "Pagine", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "Preferenze salvate", - "savedDetail": "Il layout delle colonne è stato salvato." - } - }, "coverPref": { "toast": { "savedSummary": "Dimensione copertina salvata", @@ -3114,12 +3022,6 @@ "saveFailedDetail": "Impossibile salvare la preferenza dimensione copertina localmente." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Salvataggio fallito", - "saveFailedDetail": "Impossibile salvare la preferenza filtro barra laterale localmente." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Sei sicuro di voler eliminare tutte le {{ count }} recensioni per questo libro? Questa azione non può essere annullata.", @@ -3277,41 +3179,7 @@ } }, "filter": { - "title": "Filtri", "showingFirst100": "Visualizzazione primi 100 elementi", - "footerNote": "Nota: I primi 100 elementi vengono visualizzati per categoria di filtro", - "labels": { - "author": "Autore", - "category": "Genere", - "series": "Serie", - "bookType": "Tipo libro", - "readStatus": "Stato lettura", - "personalRating": "Valutazione personale", - "publisher": "Editore", - "matchScore": "Punteggio corrispondenza metadati", - "library": "Libreria", - "shelf": "Scaffale", - "shelfStatus": "Stato scaffale", - "tag": "", - "publishedDate": "Anno pubblicazione", - "fileSize": "Dimensione file", - "amazonRating": "Valutazione Amazon", - "goodreadsRating": "Valutazione Goodreads", - "hardcoverRating": "Valutazione Hardcover", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "Lingua", - "pageCount": "Numero pagine", - "mood": "", - "ageRating": "Classificazione età", - "contentRating": "Classificazione contenuto", - "narrator": "Narratore", - "comicCharacter": "Personaggio fumetto", - "comicTeam": "Squadra fumetto", - "comicLocation": "Luogo fumetto", - "comicCreator": "Creatore fumetto" - }, "readStatus": { "unread": "Non letto", "reading": "In lettura", @@ -3364,14 +3232,6 @@ "shelfStatus": { "shelved": "Catalogato", "unshelved": "Non catalogato" - }, - "comicRoles": { - "penciller": "Matitista", - "inker": "Inchiostratore", - "colorist": "Colorista", - "letterer": "Letterista", - "coverArtist": "Copertinista", - "editor": "Editore" } }, "shelfAssigner": { @@ -3434,27 +3294,6 @@ "updateFailedDetail": "Si è verificato un errore durante l'aggiornamento dello scaffale. Riprova." } }, - "table": { - "label": "", - "bookCoverAlt": "Copertina libro", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "Stato: {{ status }}", - "locked": "Bloccato", - "unlocked": "Sbloccato", - "toast": { - "metadataLockedSummary": "Metadati bloccati", - "metadataLockedDetail": "I metadati del libro sono stati bloccati con successo.", - "metadataUnlockedSummary": "Metadati sbloccati", - "metadataUnlockedDetail": "I metadati del libro sono stati sbloccati con successo.", - "lockFailedSummary": "Blocco fallito", - "lockFailedDetail": "Si è verificato un errore durante il blocco dei metadati.", - "unlockFailedSummary": "Sblocco fallito", - "unlockFailedDetail": "Si è verificato un errore durante lo sblocco dei metadati." - } - }, "lockUnlockDialog": { "title": "Blocca o sblocca metadati", "selectedCount": "{{ count }} libro/i selezionato/i", @@ -3475,42 +3314,7 @@ } }, "sorting": { - "sortOrder": "Ordine", - "removeTooltip": "Rimuovi", - "addSortFieldPlaceholder": "Aggiungi campo di ordinamento...", - "saveAsDefault": "Salva come predefinito", - "ascendingTooltip": "Crescente, clicca per cambiare", - "descendingTooltip": "Decrescente, clicca per cambiare", - "options": { - "title": "Titolo", - "fileName": "Nome file", - "filePath": "Percorso file", - "author": "Autore", - "authorSurnameVorname": "Autore (Cognome)", - "seriesName": "Nome serie", - "seriesNumber": "Numero serie", - "lastReadTime": "Ultima lettura", - "personalRating": "Valutazione personale", - "addedOn": "Data aggiunta", - "fileSizeKb": "Dimensione file", - "locked": "Bloccato", - "publisher": "Editore", - "publishedDate": "Data pubblicazione", - "readStatus": "Stato lettura", - "dateFinished": "Data completamento", - "readingProgress": "Progresso lettura", - "bookType": "Tipo libro", - "amazonRating": "Valutazione Amazon", - "amazonReviewCount": "", - "goodreadsRating": "Valutazione Goodreads", - "goodreadsReviewCount": "", - "hardcoverRating": "Valutazione Hardcover", - "hardcoverReviewCount": "", - "ranobedbRating": "Valutazione Ranobedb", - "narrator": "Narratore", - "pageCount": "Pagine", - "random": "Casuale" - } + "saveAsDefault": "Salva come predefinito" }, "fileAttacher": { "title": "Allega file ad un altro libro", diff --git a/frontend/src/i18n/ja.json b/frontend/src/i18n/ja.json index ba8934256..b68a6ccc4 100644 --- a/frontend/src/i18n/ja.json +++ b/frontend/src/i18n/ja.json @@ -556,20 +556,6 @@ "editSort": "ソートを編集", "tableSortConfig": "ソート設定" }, - "filter": { - "sectionTitle": "フィルター設定", - "sectionDesc": "サイドバーに表示されるフィルターコントロールのデフォルトオプションを設定します。", - "filterMode": "フィルターモード", - "filterModeDesc": "右側のフィルターサイドバーから選択したフィルターを組み合わせるデフォルトモードを選択します。", - "visibleFilters": "表示フィルター", - "visibleFiltersDesc": "サイドバーに表示するフィルターを選択し、ドラッグで並べ替えます。{{min}}~{{max}}個のフィルター。", - "selectionCount": "{{count}} / {{total}} 選択中", - "addFilter": "フィルターを追加...", - "resetToDefaults": "デフォルトに戻す", - "modeAnd": "AND", - "modeOr": "OR", - "modeSingle": "単一" - }, "sidebarSort": { "sectionTitle": "サイドバーのライブラリとシェルフのソート設定", "sectionDesc": "左メニューサイドバーに表示されるライブラリとシェルフ名のソートオプションを設定します。", @@ -2736,68 +2722,20 @@ "customCoverHeader": "カスタムカバー生成の確認" }, "toast": { - "sortSavedSummary": "ソートを保存しました", - "sortSavedGlobalDetail": "デフォルトのソート設定が保存されました。", - "sortSavedEntityDetail": "この{{ entityType }}のソート設定が保存されました。", "regenCoverStartedSummary": "カバー再生成を開始しました", "regenCoverStartedDetail": "{{ count }}冊の本のカバーを再生成中です。完了後にページを更新してください。", "customCoverStartedSummary": "カスタムカバー生成を開始しました", "customCoverStartedDetail": "{{ count }}冊の本のカスタムカバーを生成中です。", "failedSummary": "失敗", "regenCoverFailedDetail": "カバー再生成を開始できませんでした。", - "customCoverFailedDetail": "カスタムカバー生成を開始できませんでした。", - "unshelveSuccessDetail": "本のシェルフが更新されました", - "unshelveFailedDetail": "本のシェルフの更新に失敗しました", - "noEligibleBooksSummary": "対象の本がありません", - "noEligibleBooksDetail": "選択した本は単一ファイルの本(代替フォーマットなし)である必要があります。", - "multipleLibrariesSummary": "複数のライブラリ", - "multipleLibrariesDetail": "選択した本はすべて同じライブラリのものである必要があります。" + "customCoverFailedDetail": "カスタムカバー生成を開始できませんでした。" }, "loading": { - "deleting": "{{ count }}冊の本を削除中...", - "unshelving": "{{ count }}冊の本をシェルフから削除中..." + "deleting": "{{ count }}冊の本を削除中..." }, "labels": { "allBooks": "すべての本", - "unshelvedBooks": "未分類の本", - "unshelvedBooksFiltered": "未分類の本(フィルター適用中)", - "filteredSuffix": "(フィルター適用中)", - "seriesCollapsedInfo": "{{ count }}{{ itemWord }}を表示中(シリーズを折りたたみ)", - "item": "件", - "items": "件", - "selected": "選択中", - "setAsDefault": "デフォルトに設定しますか?", - "save": "保存", - "collapseSeries": "シリーズを折りたたむ", - "gridColumns": "グリッド列数", - "bookTypeOverlay": "本の種類オーバーレイ", - "noBooks": "このコレクションには本がありません!", - "failedLibrary": "ライブラリの本の読み込みに失敗しました!", - "failedShelf": "シェルフの本の読み込みに失敗しました!", - "failedBooks": "", - "activeFilters": "{{ count }}件のアクティブフィルター" - }, - "tooltip": { - "clearFilters": "適用されたフィルターをクリア", - "visibleColumns": "表示列", - "selectSorting": "ソートを選択", - "toggleView": "グリッドとテーブル表示を切替", - "search": "検索", - "toggleSidebar": "サイドバーフィルターの切替", - "metadataActions": "メタデータ操作", - "assignToShelf": "シェルフに割り当て", - "removeFromShelf": "このシェルフから削除", - "lockUnlockMetadata": "メタデータのロック/解除", - "organizeFiles": "ファイルを整理", - "attachToBook": "別の本に添付", - "moreActions": "その他の操作", - "selectAll": "すべての本を選択", - "deselectAll": "すべての本の選択を解除", - "deleteSelected": "選択した本を削除" - }, - "placeholder": { - "selectColumns": "列を選択", - "search": "タイトル、著者、シリーズ、ジャンル、またはISBN..." + "unshelvedBooks": "未分類の本" } }, "card": { @@ -3077,36 +3015,6 @@ "deletingLibrary": "ライブラリ「{{ name }}」を削除中..." } }, - "columnPref": { - "columns": { - "readStatus": "読了", - "title": "タイトル", - "authors": "著者", - "publisher": "出版社", - "seriesName": "シリーズ", - "seriesNumber": "シリーズ #", - "categories": "ジャンル", - "publishedDate": "出版日", - "lastReadTime": "最終閲覧", - "addedOn": "追加日", - "fileName": "ファイル名", - "fileSizeKb": "ファイルサイズ", - "language": "言語", - "isbn": "", - "pageCount": "ページ数", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "設定を保存しました", - "savedDetail": "列レイアウトが保存されました。" - } - }, "coverPref": { "toast": { "savedSummary": "カバーサイズを保存しました", @@ -3115,12 +3023,6 @@ "saveFailedDetail": "カバーサイズの設定をローカルに保存できませんでした。" } }, - "filterPref": { - "toast": { - "saveFailedSummary": "保存に失敗しました", - "saveFailedDetail": "サイドバーフィルターの設定をローカルに保存できませんでした。" - } - }, "reviews": { "confirm": { "deleteAllMessage": "この本の{{ count }}件すべてのレビューを削除してもよろしいですか?この操作は元に戻せません。", @@ -3278,41 +3180,7 @@ } }, "filter": { - "title": "フィルター", "showingFirst100": "最初の100件を表示", - "footerNote": "注意: フィルターカテゴリごとに上位100件が表示されます", - "labels": { - "author": "著者", - "category": "ジャンル", - "series": "シリーズ", - "bookType": "本の種類", - "readStatus": "読書状態", - "personalRating": "個人評価", - "publisher": "出版社", - "matchScore": "メタデータマッチスコア", - "library": "ライブラリ", - "shelf": "シェルフ", - "shelfStatus": "シェルフ状態", - "tag": "タグ", - "publishedDate": "出版年", - "fileSize": "ファイルサイズ", - "amazonRating": "Amazon評価", - "goodreadsRating": "Goodreads評価", - "hardcoverRating": "Hardcover評価", - "lubimyczytacRating": "Lubimyczytac評価", - "ranobedbRating": "Ranobedb評価", - "audibleRating": "Audible評価", - "language": "言語", - "pageCount": "ページ数", - "mood": "ムード", - "ageRating": "年齢制限", - "contentRating": "コンテンツレーティング", - "narrator": "ナレーター", - "comicCharacter": "コミックキャラクター", - "comicTeam": "コミックチーム", - "comicLocation": "コミックロケーション", - "comicCreator": "コミッククリエイター" - }, "readStatus": { "unread": "未読", "reading": "読書中", @@ -3365,14 +3233,6 @@ "shelfStatus": { "shelved": "シェルフに登録済み", "unshelved": "未分類" - }, - "comicRoles": { - "penciller": "ペンシラー", - "inker": "インカー", - "colorist": "カラリスト", - "letterer": "レタラー", - "coverArtist": "カバーアーティスト", - "editor": "エディター" } }, "shelfAssigner": { @@ -3435,27 +3295,6 @@ "updateFailedDetail": "シェルフの更新中にエラーが発生しました。もう一度お試しください。" } }, - "table": { - "label": "", - "bookCoverAlt": "ブックカバー", - "selectBook": "", - "selectBookFallback": "書籍を選択", - "noRating": "評価なし", - "ratingOutOf": "", - "statusWithPrefix": "状態: {{ status }}", - "locked": "ロック済み", - "unlocked": "ロック解除", - "toast": { - "metadataLockedSummary": "メタデータをロックしました", - "metadataLockedDetail": "ブックメタデータが正常にロックされました。", - "metadataUnlockedSummary": "メタデータのロックを解除しました", - "metadataUnlockedDetail": "ブックメタデータのロックが正常に解除されました。", - "lockFailedSummary": "ロックに失敗しました", - "lockFailedDetail": "メタデータのロック中にエラーが発生しました。", - "unlockFailedSummary": "ロック解除に失敗しました", - "unlockFailedDetail": "メタデータのロック解除中にエラーが発生しました。" - } - }, "lockUnlockDialog": { "title": "メタデータのロック/解除", "selectedCount": "{{ count }}冊選択中", @@ -3476,42 +3315,7 @@ } }, "sorting": { - "sortOrder": "ソート順", - "removeTooltip": "削除", - "addSortFieldPlaceholder": "ソートフィールドを追加...", - "saveAsDefault": "デフォルトとして保存", - "ascendingTooltip": "昇順 - クリックで変更", - "descendingTooltip": "降順 - クリックで変更", - "options": { - "title": "タイトル", - "fileName": "ファイル名", - "filePath": "ファイルパス", - "author": "著者", - "authorSurnameVorname": "著者(姓)", - "seriesName": "シリーズ名", - "seriesNumber": "シリーズ番号", - "lastReadTime": "最終閲覧", - "personalRating": "個人評価", - "addedOn": "追加日", - "fileSizeKb": "ファイルサイズ", - "locked": "ロック", - "publisher": "出版社", - "publishedDate": "出版日", - "readStatus": "読書状態", - "dateFinished": "完了日", - "readingProgress": "読書進捗", - "bookType": "本の種類", - "amazonRating": "Amazon評価", - "amazonReviewCount": "", - "goodreadsRating": "Goodreads評価", - "goodreadsReviewCount": "", - "hardcoverRating": "Hardcover評価", - "hardcoverReviewCount": "", - "ranobedbRating": "Ranobedb評価", - "narrator": "ナレーター", - "pageCount": "ページ数", - "random": "ランダム" - } + "saveAsDefault": "デフォルトとして保存" }, "fileAttacher": { "title": "ファイルを別の本に添付", diff --git a/frontend/src/i18n/ko.json b/frontend/src/i18n/ko.json index a6c383759..bad5b20cb 100644 --- a/frontend/src/i18n/ko.json +++ b/frontend/src/i18n/ko.json @@ -555,20 +555,6 @@ "editSort": "", "tableSortConfig": "" }, - "filter": { - "sectionTitle": "", - "sectionDesc": "", - "filterMode": "", - "filterModeDesc": "", - "visibleFilters": "", - "visibleFiltersDesc": "", - "selectionCount": "", - "addFilter": "", - "resetToDefaults": "", - "modeAnd": "", - "modeOr": "", - "modeSingle": "" - }, "sidebarSort": { "sectionTitle": "", "sectionDesc": "", @@ -2732,68 +2718,20 @@ "customCoverHeader": "" }, "toast": { - "sortSavedSummary": "", - "sortSavedGlobalDetail": "", - "sortSavedEntityDetail": "", "regenCoverStartedSummary": "", "regenCoverStartedDetail": "", "customCoverStartedSummary": "", "customCoverStartedDetail": "", "failedSummary": "", "regenCoverFailedDetail": "", - "customCoverFailedDetail": "", - "unshelveSuccessDetail": "", - "unshelveFailedDetail": "", - "noEligibleBooksSummary": "", - "noEligibleBooksDetail": "", - "multipleLibrariesSummary": "", - "multipleLibrariesDetail": "" + "customCoverFailedDetail": "" }, "loading": { - "deleting": "", - "unshelving": "" + "deleting": "" }, "labels": { "allBooks": "", - "unshelvedBooks": "", - "unshelvedBooksFiltered": "", - "filteredSuffix": "", - "seriesCollapsedInfo": "", - "item": "", - "items": "", - "selected": "", - "setAsDefault": "", - "save": "", - "collapseSeries": "", - "gridColumns": "", - "bookTypeOverlay": "", - "noBooks": "", - "failedLibrary": "", - "failedShelf": "", - "failedBooks": "", - "activeFilters": "" - }, - "tooltip": { - "clearFilters": "", - "visibleColumns": "", - "selectSorting": "", - "toggleView": "", - "search": "", - "toggleSidebar": "", - "metadataActions": "", - "assignToShelf": "", - "removeFromShelf": "", - "lockUnlockMetadata": "", - "organizeFiles": "", - "attachToBook": "", - "moreActions": "", - "selectAll": "", - "deselectAll": "", - "deleteSelected": "" - }, - "placeholder": { - "selectColumns": "", - "search": "" + "unshelvedBooks": "" } }, "card": { @@ -3031,36 +2969,6 @@ "deletingLibrary": "" } }, - "columnPref": { - "columns": { - "readStatus": "", - "title": "", - "authors": "", - "publisher": "", - "seriesName": "", - "seriesNumber": "", - "categories": "", - "publishedDate": "", - "lastReadTime": "", - "addedOn": "", - "fileName": "", - "fileSizeKb": "", - "language": "", - "isbn": "", - "pageCount": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "", - "savedDetail": "" - } - }, "coverPref": { "toast": { "savedSummary": "", @@ -3069,12 +2977,6 @@ "saveFailedDetail": "" } }, - "filterPref": { - "toast": { - "saveFailedSummary": "", - "saveFailedDetail": "" - } - }, "reviews": { "confirm": { "deleteAllMessage": "", @@ -3232,41 +3134,7 @@ } }, "filter": { - "title": "", "showingFirst100": "", - "footerNote": "", - "labels": { - "author": "", - "category": "", - "series": "", - "bookType": "", - "readStatus": "", - "personalRating": "", - "publisher": "", - "matchScore": "", - "library": "", - "shelf": "", - "shelfStatus": "", - "tag": "", - "publishedDate": "", - "fileSize": "", - "amazonRating": "", - "goodreadsRating": "", - "hardcoverRating": "", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "", - "pageCount": "", - "mood": "", - "ageRating": "", - "contentRating": "", - "narrator": "", - "comicCharacter": "", - "comicTeam": "", - "comicLocation": "", - "comicCreator": "" - }, "readStatus": { "unread": "", "reading": "", @@ -3319,14 +3187,6 @@ "shelfStatus": { "shelved": "", "unshelved": "" - }, - "comicRoles": { - "penciller": "", - "inker": "", - "colorist": "", - "letterer": "", - "coverArtist": "", - "editor": "" } }, "shelfAssigner": { @@ -3389,27 +3249,6 @@ "updateFailedDetail": "" } }, - "table": { - "label": "", - "bookCoverAlt": "", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "", - "locked": "", - "unlocked": "", - "toast": { - "metadataLockedSummary": "", - "metadataLockedDetail": "", - "metadataUnlockedSummary": "", - "metadataUnlockedDetail": "", - "lockFailedSummary": "", - "lockFailedDetail": "", - "unlockFailedSummary": "", - "unlockFailedDetail": "" - } - }, "lockUnlockDialog": { "title": "", "selectedCount": "", @@ -3430,42 +3269,7 @@ } }, "sorting": { - "sortOrder": "", - "removeTooltip": "", - "addSortFieldPlaceholder": "", - "saveAsDefault": "", - "ascendingTooltip": "", - "descendingTooltip": "", - "options": { - "title": "", - "fileName": "", - "filePath": "", - "author": "", - "authorSurnameVorname": "", - "seriesName": "", - "seriesNumber": "", - "lastReadTime": "", - "personalRating": "", - "addedOn": "", - "fileSizeKb": "", - "locked": "", - "publisher": "", - "publishedDate": "", - "readStatus": "", - "dateFinished": "", - "readingProgress": "", - "bookType": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "", - "narrator": "", - "pageCount": "", - "random": "" - } + "saveAsDefault": "" }, "fileAttacher": { "title": "", diff --git a/frontend/src/i18n/nl.json b/frontend/src/i18n/nl.json index 88032cc4b..4413ac5e8 100644 --- a/frontend/src/i18n/nl.json +++ b/frontend/src/i18n/nl.json @@ -555,20 +555,6 @@ "editSort": "", "tableSortConfig": "" }, - "filter": { - "sectionTitle": "", - "sectionDesc": "", - "filterMode": "", - "filterModeDesc": "", - "visibleFilters": "", - "visibleFiltersDesc": "", - "selectionCount": "", - "addFilter": "", - "resetToDefaults": "", - "modeAnd": "", - "modeOr": "", - "modeSingle": "" - }, "sidebarSort": { "sectionTitle": "", "sectionDesc": "", @@ -2735,68 +2721,20 @@ "customCoverHeader": "Bevestig aangepaste omslag genereren" }, "toast": { - "sortSavedSummary": "Sorteren op opgeslagen", - "sortSavedGlobalDetail": "Standaard sorteerconfiguratie opgeslagen.", - "sortSavedEntityDetail": "Sorteerconfiguratie opgeslagen voor deze {{ entityType }}.", "regenCoverStartedSummary": "Omslag regeneratie gestart", "regenCoverStartedDetail": "Omslagen voor {{ count }} boek(en) opnieuw genereren. Vernieuw de pagina wanneer u klaar bent.", "customCoverStartedSummary": "Aangepaste omslaggeneratie gestart", "customCoverStartedDetail": "Aangepaste omslagen genereren voor {{ count }} boek(en).", "failedSummary": "Mislukt", "regenCoverFailedDetail": "Het opnieuw genereren van de omslag kon niet worden gestart.", - "customCoverFailedDetail": "Het genereren van een aangepaste omslag kon niet worden gestart.", - "unshelveSuccessDetail": "Boekenplanken bijgewerkt", - "unshelveFailedDetail": "Kan boekenplanken niet bijwerken", - "noEligibleBooksSummary": "Geen in aanmerking komende boeken", - "noEligibleBooksDetail": "Geselecteerde boeken moeten boeken in één bestand zijn (geen alternatieve formaten).", - "multipleLibrariesSummary": "Meerdere bibliotheken", - "multipleLibrariesDetail": "Alle geselecteerde boeken moeten uit dezelfde bibliotheek komen." + "customCoverFailedDetail": "Het genereren van een aangepaste omslag kon niet worden gestart." }, "loading": { - "deleting": "{{ count }} boek(en) verwijderen...", - "unshelving": "" + "deleting": "{{ count }} boek(en) verwijderen..." }, "labels": { "allBooks": "", - "unshelvedBooks": "", - "unshelvedBooksFiltered": "", - "filteredSuffix": "", - "seriesCollapsedInfo": "", - "item": "", - "items": "", - "selected": "", - "setAsDefault": "", - "save": "", - "collapseSeries": "", - "gridColumns": "", - "bookTypeOverlay": "", - "noBooks": "", - "failedLibrary": "", - "failedShelf": "", - "failedBooks": "", - "activeFilters": "{{ count }} Actieve filters" - }, - "tooltip": { - "clearFilters": "Toegepaste filters wissen", - "visibleColumns": "Zichtbare kolommen", - "selectSorting": "Selecteer sortering", - "toggleView": "Schakel tussen raster- en tabelweergave", - "search": "Zoeken", - "toggleSidebar": "Filters in zijbalk in-/uitschakelen", - "metadataActions": "Metadata-acties", - "assignToShelf": "Toewijzen aan plank", - "removeFromShelf": "Verwijder van deze plank", - "lockUnlockMetadata": "Metadata vergrendelen/ontgrendelen", - "organizeFiles": "Bestanden ordenen", - "attachToBook": "Toevoegen aan een ander boek", - "moreActions": "Meer acties", - "selectAll": "Selecteer alle boeken", - "deselectAll": "Alle boeken deselecteren", - "deleteSelected": "Geselecteerde boeken verwijderen" - }, - "placeholder": { - "selectColumns": "Kolommen selecteren", - "search": "Titel, Auteur, Serie, Genre of ISBN..." + "unshelvedBooks": "" } }, "card": { @@ -3061,36 +2999,6 @@ "deletingLibrary": "Bibliotheek ‘{{ name }}’ verwijderen..." } }, - "columnPref": { - "columns": { - "readStatus": "Lezen", - "title": "Titel", - "authors": "Auteurs", - "publisher": "Uitgever", - "seriesName": "", - "seriesNumber": "", - "categories": "", - "publishedDate": "Gepubliceerd", - "lastReadTime": "Laatst gelezen", - "addedOn": "Toegevoegd", - "fileName": "Bestandsnaam", - "fileSizeKb": "Bestandsgrootte", - "language": "Taal", - "isbn": "", - "pageCount": "Pagina's", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "Voorkeuren opgeslagen", - "savedDetail": "De indeling van uw kolom is opgeslagen." - } - }, "coverPref": { "toast": { "savedSummary": "Afmetingen omslag opgeslagen", @@ -3099,12 +3007,6 @@ "saveFailedDetail": "De voorkeur voor de omslaggrootte kon niet lokaal worden opgeslagen." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Opslaan mislukt", - "saveFailedDetail": "De voorkeuren voor de zijbalkfilter konden niet lokaal worden opgeslagen." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Weet u zeker dat u alle {{ count }} recensies voor dit boek wilt verwijderen? Deze actie kan niet ongedaan worden gemaakt.", @@ -3262,41 +3164,7 @@ } }, "filter": { - "title": "", "showingFirst100": "", - "footerNote": "", - "labels": { - "author": "", - "category": "", - "series": "", - "bookType": "", - "readStatus": "", - "personalRating": "", - "publisher": "", - "matchScore": "", - "library": "", - "shelf": "", - "shelfStatus": "", - "tag": "", - "publishedDate": "", - "fileSize": "", - "amazonRating": "", - "goodreadsRating": "", - "hardcoverRating": "", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "", - "pageCount": "", - "mood": "", - "ageRating": "", - "contentRating": "", - "narrator": "", - "comicCharacter": "", - "comicTeam": "", - "comicLocation": "", - "comicCreator": "" - }, "readStatus": { "unread": "", "reading": "", @@ -3349,14 +3217,6 @@ "shelfStatus": { "shelved": "", "unshelved": "" - }, - "comicRoles": { - "penciller": "", - "inker": "", - "colorist": "", - "letterer": "", - "coverArtist": "", - "editor": "" } }, "shelfAssigner": { @@ -3419,27 +3279,6 @@ "updateFailedDetail": "" } }, - "table": { - "label": "", - "bookCoverAlt": "", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "{{ status }}", - "locked": "", - "unlocked": "", - "toast": { - "metadataLockedSummary": "", - "metadataLockedDetail": "", - "metadataUnlockedSummary": "", - "metadataUnlockedDetail": "", - "lockFailedSummary": "", - "lockFailedDetail": "", - "unlockFailedSummary": "", - "unlockFailedDetail": "" - } - }, "lockUnlockDialog": { "title": "", "selectedCount": "", @@ -3460,42 +3299,7 @@ } }, "sorting": { - "sortOrder": "", - "removeTooltip": "", - "addSortFieldPlaceholder": "", - "saveAsDefault": "", - "ascendingTooltip": "", - "descendingTooltip": "", - "options": { - "title": "", - "fileName": "", - "filePath": "", - "author": "", - "authorSurnameVorname": "", - "seriesName": "", - "seriesNumber": "", - "lastReadTime": "", - "personalRating": "", - "addedOn": "", - "fileSizeKb": "", - "locked": "", - "publisher": "", - "publishedDate": "", - "readStatus": "", - "dateFinished": "", - "readingProgress": "", - "bookType": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "", - "narrator": "", - "pageCount": "", - "random": "" - } + "saveAsDefault": "" }, "fileAttacher": { "title": "", diff --git a/frontend/src/i18n/pl.json b/frontend/src/i18n/pl.json index 7b421ae1d..695a1fbee 100644 --- a/frontend/src/i18n/pl.json +++ b/frontend/src/i18n/pl.json @@ -556,20 +556,6 @@ "tableSortConfig": "Konfiguracja sortowania", "formatOverlay": "Nakładka typu książki" }, - "filter": { - "sectionTitle": "Preferencje filtrów", - "sectionDesc": "Skonfiguruj domyślne opcje kontroli filtrów wyświetlanych na pasku bocznym.", - "filterMode": "Tryb filtrowania", - "filterModeDesc": "Wybierz domyślny tryb łączenia filtrów wybranych z prawego paska filtrów.", - "visibleFilters": "Widoczne filtry", - "visibleFiltersDesc": "Wybierz, które filtry wyświetlać na pasku bocznym i przeciągnij, aby zmienić kolejność. Między {{min}} a {{max}} filtrów.", - "selectionCount": "{{count}} z {{total}} wybranych", - "addFilter": "Dodaj filtr...", - "resetToDefaults": "Resetuj do domyślnych", - "modeAnd": "I", - "modeOr": "Lub", - "modeSingle": "Pojedynczy" - }, "sidebarSort": { "sectionTitle": "Preferencje sortowania paska bocznego bibliotek i półek", "sectionDesc": "Skonfiguruj opcje sortowania nazw bibliotek i półek wyświetlanych w lewym pasku bocznym.", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Potwierdź generowanie niestandardowych okładek" }, "toast": { - "sortSavedSummary": "Sortowanie zapisane", - "sortSavedGlobalDetail": "Domyślna konfiguracja sortowania została zapisana.", - "sortSavedEntityDetail": "Konfiguracja sortowania została zapisana dla {{ entityType }}.", "regenCoverStartedSummary": "Rozpoczęto ponowne generowanie okładek", "regenCoverStartedDetail": "Ponowne generowanie okładek dla {{ count }} książki/książek. Odśwież stronę po zakończeniu.", "customCoverStartedSummary": "Rozpoczęto generowanie niestandardowych okładek", "customCoverStartedDetail": "Generowanie niestandardowych okładek dla {{ count }} książki/książek.", "failedSummary": "Niepowodzenie", "regenCoverFailedDetail": "Nie udało się rozpocząć ponownego generowania okładek.", - "customCoverFailedDetail": "Nie udało się rozpocząć generowania niestandardowych okładek.", - "unshelveSuccessDetail": "Półki książek zostały zaktualizowane", - "unshelveFailedDetail": "Nie udało się zaktualizować półek książek", - "noEligibleBooksSummary": "Brak kwalifikujących się książek", - "noEligibleBooksDetail": "Wybrane książki muszą być książkami jednoplikowymi (bez alternatywnych formatów).", - "multipleLibrariesSummary": "Wiele bibliotek", - "multipleLibrariesDetail": "Wszystkie wybrane książki muszą pochodzić z tej samej biblioteki." + "customCoverFailedDetail": "Nie udało się rozpocząć generowania niestandardowych okładek." }, "loading": { - "deleting": "Usuwanie {{ count }} książki/książek...", - "unshelving": "Usuwanie z półek {{ count }} książki/książek..." + "deleting": "Usuwanie {{ count }} książki/książek..." }, "labels": { "allBooks": "Wszystkie książki", - "unshelvedBooks": "Książki bez półki", - "unshelvedBooksFiltered": "Książki bez półki (Filtrowane)", - "filteredSuffix": "(Filtrowane)", - "seriesCollapsedInfo": "Wyświetlanie {{ count }} {{ itemWord }} (serie zwinięte)", - "item": "element", - "items": "elementy", - "selected": "zaznaczono", - "setAsDefault": "Ustaw jako domyślne?", - "save": "Zapisz", - "collapseSeries": "Zwiń serie", - "gridColumns": "Kolumny siatki", - "bookTypeOverlay": "Nakładka typu książki", - "noBooks": "Ta kolekcja nie zawiera książek!", - "failedLibrary": "Nie udało się załadować książek biblioteki!", - "failedShelf": "Nie udało się załadować książek półki!", - "failedBooks": "", - "activeFilters": "{{ count }} aktywnych filtrów" - }, - "tooltip": { - "clearFilters": "Wyczyść zastosowane filtry", - "visibleColumns": "Widoczne kolumny", - "selectSorting": "Wybierz sortowanie", - "toggleView": "Przełącz między widokiem siatki i tabeli", - "search": "Szukaj", - "toggleSidebar": "Przełącz filtry boczne", - "metadataActions": "Akcje metadanych", - "assignToShelf": "Przypisz do półki", - "removeFromShelf": "Usuń z tej półki", - "lockUnlockMetadata": "Zablokuj/Odblokuj metadane", - "organizeFiles": "Organizuj pliki", - "attachToBook": "Dołącz do innej książki", - "moreActions": "Więcej akcji", - "selectAll": "Zaznacz wszystkie książki", - "deselectAll": "Odznacz wszystkie książki", - "deleteSelected": "Usuń zaznaczone książki" - }, - "placeholder": { - "selectColumns": "Wybierz kolumny", - "search": "Tytuł, autor, seria, gatunek lub ISBN..." + "unshelvedBooks": "Książki bez półki" } }, "card": { @@ -3076,36 +3014,6 @@ "deletingLibrary": "Usuwanie biblioteki '{{ name }}'..." } }, - "columnPref": { - "columns": { - "readStatus": "Czytanie", - "title": "Tytuł", - "authors": "Autorzy", - "publisher": "Wydawca", - "seriesName": "Seria", - "seriesNumber": "Nr serii", - "categories": "Gatunki", - "publishedDate": "Data wydania", - "lastReadTime": "Ostatnio czytano", - "addedOn": "Dodano", - "fileName": "Nazwa pliku", - "fileSizeKb": "Rozmiar pliku", - "language": "Język", - "isbn": "", - "pageCount": "Strony", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "Preferencje zapisane", - "savedDetail": "Twój układ kolumn został zapisany." - } - }, "coverPref": { "toast": { "savedSummary": "Rozmiar okładki zapisany", @@ -3114,12 +3022,6 @@ "saveFailedDetail": "Nie udało się zapisać preferencji rozmiaru okładki lokalnie." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Zapis nie powiódł się", - "saveFailedDetail": "Nie udało się zapisać preferencji filtra bocznego lokalnie." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Czy na pewno chcesz usunąć wszystkie {{ count }} recenzje dla tej książki? Tej operacji nie można cofnąć.", @@ -3277,41 +3179,7 @@ } }, "filter": { - "title": "Filtry", "showingFirst100": "Wyświetlanie pierwszych 100 elementów", - "footerNote": "Uwaga: wyświetlane jest 100 najlepszych elementów na kategorię filtra", - "labels": { - "author": "Autor", - "category": "Gatunek", - "series": "Seria", - "bookType": "Typ książki", - "readStatus": "Status czytania", - "personalRating": "Ocena osobista", - "publisher": "Wydawca", - "matchScore": "Jakość metadanych", - "library": "Biblioteka", - "shelf": "Półka", - "shelfStatus": "Status półki", - "tag": "", - "publishedDate": "Rok wydania", - "fileSize": "Rozmiar pliku", - "amazonRating": "Ocena Amazon", - "goodreadsRating": "Ocena Goodreads", - "hardcoverRating": "Ocena Hardcover", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "Język", - "pageCount": "Liczba stron", - "mood": "Nastrój", - "ageRating": "Kategoria wiekowa", - "contentRating": "Ocena treści", - "narrator": "", - "comicCharacter": "Postać komiksowa", - "comicTeam": "Drużyna komiksowa", - "comicLocation": "Lokacja komiksowa", - "comicCreator": "Twórca komiksu" - }, "readStatus": { "unread": "Nieprzeczytana", "reading": "Czytam", @@ -3364,14 +3232,6 @@ "shelfStatus": { "shelved": "Na półce", "unshelved": "Bez półki" - }, - "comicRoles": { - "penciller": "Rysownik ołówkiem", - "inker": "Tuszownik", - "colorist": "Kolorysta", - "letterer": "Liternik", - "coverArtist": "Autor okładki", - "editor": "Redaktor" } }, "shelfAssigner": { @@ -3434,27 +3294,6 @@ "updateFailedDetail": "Wystąpił błąd podczas aktualizacji półki. Spróbuj ponownie." } }, - "table": { - "label": "", - "bookCoverAlt": "Okładka książki", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "", - "locked": "Zablokowane", - "unlocked": "Odblokowane", - "toast": { - "metadataLockedSummary": "Metadane zablokowane", - "metadataLockedDetail": "Metadane książki zostały pomyślnie zablokowane.", - "metadataUnlockedSummary": "Metadane odblokowane", - "metadataUnlockedDetail": "Metadane książki zostały pomyślnie odblokowane.", - "lockFailedSummary": "Blokowanie nie powiodło się", - "lockFailedDetail": "Wystąpił błąd podczas blokowania metadanych.", - "unlockFailedSummary": "Odblokowywanie nie powiodło się", - "unlockFailedDetail": "Wystąpił błąd podczas odblokowywania metadanych." - } - }, "lockUnlockDialog": { "title": "Zablokuj lub odblokuj metadane", "selectedCount": "Zaznaczono {{ count }} książkę/książki/książek", @@ -3475,42 +3314,7 @@ } }, "sorting": { - "sortOrder": "Kolejność sortowania", - "removeTooltip": "Usuń", - "addSortFieldPlaceholder": "Dodaj pole sortowania...", - "saveAsDefault": "Zapisz jako domyślne", - "ascendingTooltip": "Rosnąco - kliknij, aby zmienić", - "descendingTooltip": "Malejąco - kliknij, aby zmienić", - "options": { - "title": "Tytuł", - "fileName": "Nazwa pliku", - "filePath": "Ścieżka pliku", - "author": "Autor", - "authorSurnameVorname": "Autor (Nazwisko)", - "seriesName": "Nazwa serii", - "seriesNumber": "Numer serii", - "lastReadTime": "Ostatnio czytano", - "personalRating": "Ocena osobista", - "addedOn": "Data dodania", - "fileSizeKb": "Rozmiar pliku", - "locked": "Zablokowane", - "publisher": "Wydawca", - "publishedDate": "Data wydania", - "readStatus": "Status czytania", - "dateFinished": "Data ukończenia", - "readingProgress": "Postęp czytania", - "bookType": "Typ książki", - "amazonRating": "Ocena Amazon", - "amazonReviewCount": "", - "goodreadsRating": "Ocena Goodreads", - "goodreadsReviewCount": "", - "hardcoverRating": "Ocena Hardcover", - "hardcoverReviewCount": "", - "ranobedbRating": "Ocena Ranobedb", - "narrator": "", - "pageCount": "Strony", - "random": "Losowo" - } + "saveAsDefault": "Zapisz jako domyślne" }, "fileAttacher": { "title": "Dołącz plik do innej książki", diff --git a/frontend/src/i18n/pt.json b/frontend/src/i18n/pt.json index 3a315d5c0..ee480cbb6 100644 --- a/frontend/src/i18n/pt.json +++ b/frontend/src/i18n/pt.json @@ -556,20 +556,6 @@ "tableSortConfig": "Configuração de Ordenação", "formatOverlay": "Sobreposição de tipo de livro" }, - "filter": { - "sectionTitle": "Preferências de Filtro", - "sectionDesc": "Configure opções padrão para controles de filtro exibidos na barra lateral.", - "filterMode": "Modo de Filtro", - "filterModeDesc": "Escolha o modo padrão para combinar filtros selecionados na barra lateral direita de filtros.", - "visibleFilters": "Filtros Visíveis", - "visibleFiltersDesc": "Escolha quais filtros aparecem na barra lateral e arraste para reordenar. Entre {{min}} e {{max}} filtros.", - "selectionCount": "{{count}} de {{total}} selecionados", - "addFilter": "Adicionar filtro...", - "resetToDefaults": "Redefinir para padrão", - "modeAnd": "E", - "modeOr": "Ou", - "modeSingle": "Único" - }, "sidebarSort": { "sectionTitle": "Preferência de Ordenação de Biblioteca e Prateleira na Barra Lateral", "sectionDesc": "Configure opções de ordenação para nomes de bibliotecas e prateleiras exibidos no menu lateral esquerdo.", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Confirmar Geração de Capa Personalizada" }, "toast": { - "sortSavedSummary": "Ordenação Salva", - "sortSavedGlobalDetail": "Configuração de ordenação padrão salva.", - "sortSavedEntityDetail": "Configuração de ordenação salva para este(a) {{ entityType }}.", "regenCoverStartedSummary": "Regeneração de Capa Iniciada", "regenCoverStartedDetail": "Regenerando capas de {{ count }} livro(s). Atualize a página quando concluído.", "customCoverStartedSummary": "Geração de Capa Personalizada Iniciada", "customCoverStartedDetail": "Gerando capas personalizadas para {{ count }} livro(s).", "failedSummary": "Falhou", "regenCoverFailedDetail": "Não foi possível iniciar a regeneração de capa.", - "customCoverFailedDetail": "Não foi possível iniciar a geração de capa personalizada.", - "unshelveSuccessDetail": "Prateleiras dos livros atualizadas", - "unshelveFailedDetail": "Falha ao atualizar prateleiras dos livros", - "noEligibleBooksSummary": "Nenhum Livro Elegível", - "noEligibleBooksDetail": "Os livros selecionados devem ser livros de arquivo único (sem formatos alternativos).", - "multipleLibrariesSummary": "Múltiplas Bibliotecas", - "multipleLibrariesDetail": "Todos os livros selecionados devem ser da mesma biblioteca." + "customCoverFailedDetail": "Não foi possível iniciar a geração de capa personalizada." }, "loading": { - "deleting": "Excluindo {{ count }} livro(s)...", - "unshelving": "Removendo {{ count }} livro(s) das prateleiras..." + "deleting": "Excluindo {{ count }} livro(s)..." }, "labels": { "allBooks": "Todos os Livros", - "unshelvedBooks": "Livros Sem Prateleira", - "unshelvedBooksFiltered": "Livros Sem Prateleira (Filtrado)", - "filteredSuffix": "(Filtrado)", - "seriesCollapsedInfo": "Mostrando {{ count }} {{ itemWord }} (séries recolhidas)", - "item": "", - "items": "itens", - "selected": "selecionado(s)", - "setAsDefault": "Definir como padrão?", - "save": "Salvar", - "collapseSeries": "Recolher séries", - "gridColumns": "Colunas da grade", - "bookTypeOverlay": "Sobreposição de tipo de livro", - "noBooks": "Esta coleção não possui livros!", - "failedLibrary": "Falha ao carregar os livros da biblioteca!", - "failedShelf": "Falha ao carregar os livros da prateleira!", - "failedBooks": "", - "activeFilters": "{{ count }} Filtros Ativos" - }, - "tooltip": { - "clearFilters": "Limpar filtros aplicados", - "visibleColumns": "Colunas visíveis", - "selectSorting": "Selecionar ordenação", - "toggleView": "Alternar entre visualização em Grade e Tabela", - "search": "Pesquisar", - "toggleSidebar": "Alternar filtros da barra lateral", - "metadataActions": "Ações de metadados", - "assignToShelf": "Atribuir à prateleira", - "removeFromShelf": "Remover desta prateleira", - "lockUnlockMetadata": "Bloquear/Desbloquear metadados", - "organizeFiles": "Organizar Arquivos", - "attachToBook": "Anexar a Outro Livro", - "moreActions": "Mais ações", - "selectAll": "Selecionar todos os livros", - "deselectAll": "Desmarcar todos os livros", - "deleteSelected": "Excluir livros selecionados" - }, - "placeholder": { - "selectColumns": "Selecionar Colunas", - "search": "Título, Autor, Série, Gênero ou ISBN..." + "unshelvedBooks": "Livros Sem Prateleira" } }, "card": { @@ -3076,36 +3014,6 @@ "deletingLibrary": "Excluindo biblioteca '{{ name }}'..." } }, - "columnPref": { - "columns": { - "readStatus": "Leitura", - "title": "Título", - "authors": "Autores", - "publisher": "Editora", - "seriesName": "Série", - "seriesNumber": "Série #", - "categories": "Gêneros", - "publishedDate": "Publicado", - "lastReadTime": "Última Leitura", - "addedOn": "Adicionado", - "fileName": "Nome do Arquivo", - "fileSizeKb": "Tamanho do Arquivo", - "language": "Idioma", - "isbn": "", - "pageCount": "Páginas", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "Preferências Salvas", - "savedDetail": "Seu layout de colunas foi salvo." - } - }, "coverPref": { "toast": { "savedSummary": "Tamanho da Capa Salvo", @@ -3114,12 +3022,6 @@ "saveFailedDetail": "Não foi possível salvar a preferência de tamanho da capa localmente." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Falha ao Salvar", - "saveFailedDetail": "Não foi possível salvar a preferência de filtro da barra lateral localmente." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Tem certeza de que deseja excluir todas as {{ count }} avaliações deste livro? Essa ação não pode ser desfeita.", @@ -3277,41 +3179,7 @@ } }, "filter": { - "title": "Filtros", "showingFirst100": "Mostrando os primeiros 100 itens", - "footerNote": "Nota: Os 100 primeiros itens são exibidos por categoria de filtro", - "labels": { - "author": "Autor", - "category": "Gênero", - "series": "Série", - "bookType": "Tipo de Livro", - "readStatus": "Status de Leitura", - "personalRating": "Avaliação Pessoal", - "publisher": "Editora", - "matchScore": "Pontuação de Correspondência de Metadados", - "library": "Biblioteca", - "shelf": "Prateleira", - "shelfStatus": "Status da Prateleira", - "tag": "", - "publishedDate": "Ano de Publicação", - "fileSize": "Tamanho do Arquivo", - "amazonRating": "Avaliação Amazon", - "goodreadsRating": "Avaliação Goodreads", - "hardcoverRating": "Avaliação Hardcover", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "Idioma", - "pageCount": "Número de Páginas", - "mood": "Humor", - "ageRating": "Classificação Etária", - "contentRating": "Classificação de Conteúdo", - "narrator": "Narrador", - "comicCharacter": "Personagem de Quadrinhos", - "comicTeam": "Equipe de Quadrinhos", - "comicLocation": "Local de Quadrinhos", - "comicCreator": "Criador de Quadrinhos" - }, "readStatus": { "unread": "Não Lido", "reading": "Lendo", @@ -3364,14 +3232,6 @@ "shelfStatus": { "shelved": "Na Prateleira", "unshelved": "Sem Prateleira" - }, - "comicRoles": { - "penciller": "Desenhista", - "inker": "Arte-finalista", - "colorist": "Colorista", - "letterer": "Letrista", - "coverArtist": "Artista de Capa", - "editor": "" } }, "shelfAssigner": { @@ -3434,27 +3294,6 @@ "updateFailedDetail": "Ocorreu um erro ao atualizar a prateleira. Tente novamente." } }, - "table": { - "label": "", - "bookCoverAlt": "Capa do Livro", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "", - "locked": "Bloqueado", - "unlocked": "Desbloqueado", - "toast": { - "metadataLockedSummary": "Metadados Bloqueados", - "metadataLockedDetail": "Os metadados do livro foram bloqueados com sucesso.", - "metadataUnlockedSummary": "Metadados Desbloqueados", - "metadataUnlockedDetail": "Os metadados do livro foram desbloqueados com sucesso.", - "lockFailedSummary": "Falha ao Bloquear", - "lockFailedDetail": "Ocorreu um erro ao bloquear os metadados.", - "unlockFailedSummary": "Falha ao Desbloquear", - "unlockFailedDetail": "Ocorreu um erro ao desbloquear os metadados." - } - }, "lockUnlockDialog": { "title": "Bloquear ou Desbloquear Metadados", "selectedCount": "{{ count }} livro(s) selecionado(s)", @@ -3475,42 +3314,7 @@ } }, "sorting": { - "sortOrder": "Ordem de Classificação", - "removeTooltip": "Remover", - "addSortFieldPlaceholder": "Adicionar campo de ordenação...", - "saveAsDefault": "Salvar como Padrão", - "ascendingTooltip": "Ascendente - clique para alterar", - "descendingTooltip": "Descendente - clique para alterar", - "options": { - "title": "Título", - "fileName": "Nome do Arquivo", - "filePath": "Caminho do Arquivo", - "author": "Autor", - "authorSurnameVorname": "Autor (Sobrenome)", - "seriesName": "Nome da Série", - "seriesNumber": "Número da Série", - "lastReadTime": "Última Leitura", - "personalRating": "Avaliação Pessoal", - "addedOn": "Adicionado Em", - "fileSizeKb": "Tamanho do Arquivo", - "locked": "Bloqueado", - "publisher": "Editora", - "publishedDate": "Data de Publicação", - "readStatus": "Status de Leitura", - "dateFinished": "Data de Conclusão", - "readingProgress": "Progresso de Leitura", - "bookType": "Tipo de Livro", - "amazonRating": "Avaliação Amazon", - "amazonReviewCount": "", - "goodreadsRating": "Avaliação Goodreads", - "goodreadsReviewCount": "", - "hardcoverRating": "Avaliação Hardcover", - "hardcoverReviewCount": "", - "ranobedbRating": "Avaliação Ranobedb", - "narrator": "Narrador", - "pageCount": "Páginas", - "random": "Aleatório" - } + "saveAsDefault": "Salvar como Padrão" }, "fileAttacher": { "title": "Anexar Arquivo a Outro Livro", diff --git a/frontend/src/i18n/ru.json b/frontend/src/i18n/ru.json index b0f173ae3..a5fc22c20 100644 --- a/frontend/src/i18n/ru.json +++ b/frontend/src/i18n/ru.json @@ -556,20 +556,6 @@ "tableSortConfig": "Конфигурация сортировки", "formatOverlay": "Наложение типа книги" }, - "filter": { - "sectionTitle": "Настройки фильтров", - "sectionDesc": "Настройте параметры по умолчанию для фильтров, отображаемых в боковой панели.", - "filterMode": "Режим фильтрации", - "filterModeDesc": "Выберите режим по умолчанию для объединения фильтров, выбранных в правой боковой панели фильтров.", - "visibleFilters": "Видимые фильтры", - "visibleFiltersDesc": "Выберите, какие фильтры отображаются в боковой панели, и перетащите для изменения порядка. От {{min}} до {{max}} фильтров.", - "selectionCount": "{{count}} из {{total}} выбрано", - "addFilter": "Добавить фильтр...", - "resetToDefaults": "Сбросить по умолчанию", - "modeAnd": "И", - "modeOr": "Или", - "modeSingle": "Одиночный" - }, "sidebarSort": { "sectionTitle": "Сортировка библиотек и полок в боковой панели", "sectionDesc": "Настройте параметры сортировки названий библиотек и полок, отображаемых в левом меню боковой панели.", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Подтверждение генерации пользовательских обложек" }, "toast": { - "sortSavedSummary": "Сортировка сохранена", - "sortSavedGlobalDetail": "Конфигурация сортировки по умолчанию сохранена.", - "sortSavedEntityDetail": "Конфигурация сортировки сохранена для этого {{ entityType }}.", "regenCoverStartedSummary": "Пересоздание обложек начато", "regenCoverStartedDetail": "Пересоздание обложек для {{ count }} книг(и). Обновите страницу по завершении.", "customCoverStartedSummary": "Генерация пользовательских обложек начата", "customCoverStartedDetail": "Генерация пользовательских обложек для {{ count }} книг(и).", "failedSummary": "Ошибка", "regenCoverFailedDetail": "Не удалось запустить пересоздание обложек.", - "customCoverFailedDetail": "Не удалось запустить генерацию пользовательских обложек.", - "unshelveSuccessDetail": "Полки книг обновлены", - "unshelveFailedDetail": "Не удалось обновить полки книг", - "noEligibleBooksSummary": "Нет подходящих книг", - "noEligibleBooksDetail": "Выбранные книги должны быть однофайловыми (без альтернативных форматов).", - "multipleLibrariesSummary": "Несколько библиотек", - "multipleLibrariesDetail": "Все выбранные книги должны быть из одной библиотеки." + "customCoverFailedDetail": "Не удалось запустить генерацию пользовательских обложек." }, "loading": { - "deleting": "Удаление {{ count }} книг(и)...", - "unshelving": "Снятие с полки {{ count }} книг(и)..." + "deleting": "Удаление {{ count }} книг(и)..." }, "labels": { "allBooks": "Все книги", - "unshelvedBooks": "Книги без полки", - "unshelvedBooksFiltered": "Книги без полки (отфильтровано)", - "filteredSuffix": "(Отфильтровано)", - "seriesCollapsedInfo": "Показано {{ count }} {{ itemWord }} (серии свёрнуты)", - "item": "элемент", - "items": "элементов", - "selected": "выбрано", - "setAsDefault": "Установить по умолчанию?", - "save": "Сохранить", - "collapseSeries": "Свернуть серии", - "gridColumns": "Столбцы сетки", - "bookTypeOverlay": "Наложение типа книги", - "noBooks": "В этой коллекции нет книг!", - "failedLibrary": "Не удалось загрузить книги библиотеки!", - "failedShelf": "Не удалось загрузить книги полки!", - "failedBooks": "", - "activeFilters": "{{ count }} активных фильтров" - }, - "tooltip": { - "clearFilters": "Очистить применённые фильтры", - "visibleColumns": "Видимые столбцы", - "selectSorting": "Выбрать сортировку", - "toggleView": "Переключить между видом сетки и таблицы", - "search": "Поиск", - "toggleSidebar": "Переключить боковые фильтры", - "metadataActions": "Действия с метаданными", - "assignToShelf": "Добавить на полку", - "removeFromShelf": "Убрать с этой полки", - "lockUnlockMetadata": "Заблокировать/Разблокировать метаданные", - "organizeFiles": "Организовать файлы", - "attachToBook": "Прикрепить к другой книге", - "moreActions": "Дополнительные действия", - "selectAll": "Выбрать все книги", - "deselectAll": "Снять выделение со всех книг", - "deleteSelected": "Удалить выбранные книги" - }, - "placeholder": { - "selectColumns": "Выберите столбцы", - "search": "Название, автор, серия, жанр или ISBN..." + "unshelvedBooks": "Книги без полки" } }, "card": { @@ -3076,36 +3014,6 @@ "deletingLibrary": "Удаление библиотеки '{{ name }}'..." } }, - "columnPref": { - "columns": { - "readStatus": "Прочитано", - "title": "Название", - "authors": "Авторы", - "publisher": "Издательство", - "seriesName": "Серия", - "seriesNumber": "Серия №", - "categories": "Жанры", - "publishedDate": "Опубликовано", - "lastReadTime": "Последнее чтение", - "addedOn": "Добавлено", - "fileName": "Имя файла", - "fileSizeKb": "Размер файла", - "language": "Язык", - "isbn": "", - "pageCount": "Страницы", - "amazonRating": "", - "amazonReviewCount": "AZ №", - "goodreadsRating": "", - "goodreadsReviewCount": "GR №", - "hardcoverRating": "", - "hardcoverReviewCount": "HC №", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "Настройки сохранены", - "savedDetail": "Ваш макет столбцов сохранён." - } - }, "coverPref": { "toast": { "savedSummary": "Размер обложки сохранён", @@ -3114,12 +3022,6 @@ "saveFailedDetail": "Не удалось сохранить настройку размера обложки локально." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Ошибка сохранения", - "saveFailedDetail": "Не удалось сохранить настройку бокового фильтра локально." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Вы уверены, что хотите удалить все {{ count }} отзывов для этой книги? Это действие нельзя отменить.", @@ -3277,41 +3179,7 @@ } }, "filter": { - "title": "Фильтры", "showingFirst100": "Показаны первые 100 элементов", - "footerNote": "Примечание: отображаются 100 лучших элементов для каждой категории фильтра", - "labels": { - "author": "Автор", - "category": "Жанр", - "series": "Серия", - "bookType": "Тип книги", - "readStatus": "Статус чтения", - "personalRating": "Личная оценка", - "publisher": "Издательство", - "matchScore": "Оценка соответствия метаданных", - "library": "Библиотека", - "shelf": "Полка", - "shelfStatus": "Статус полки", - "tag": "Тег", - "publishedDate": "Год публикации", - "fileSize": "Размер файла", - "amazonRating": "Рейтинг Amazon", - "goodreadsRating": "Рейтинг Goodreads", - "hardcoverRating": "Рейтинг Hardcover", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "Язык", - "pageCount": "Количество страниц", - "mood": "Настроение", - "ageRating": "Возрастной рейтинг", - "contentRating": "Рейтинг контента", - "narrator": "Чтец", - "comicCharacter": "Персонаж комикса", - "comicTeam": "Команда комикса", - "comicLocation": "Место действия комикса", - "comicCreator": "Создатель комикса" - }, "readStatus": { "unread": "Не прочитано", "reading": "Читаю", @@ -3364,14 +3232,6 @@ "shelfStatus": { "shelved": "На полке", "unshelved": "Без полки" - }, - "comicRoles": { - "penciller": "Карандашист", - "inker": "Контурист", - "colorist": "Колорист", - "letterer": "Леттерер", - "coverArtist": "Художник обложки", - "editor": "Редактор" } }, "shelfAssigner": { @@ -3434,27 +3294,6 @@ "updateFailedDetail": "Произошла ошибка при обновлении полки. Пожалуйста, попробуйте снова." } }, - "table": { - "label": "", - "bookCoverAlt": "Обложка книги", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "Статус: {{ status }}", - "locked": "Заблокировано", - "unlocked": "Разблокировано", - "toast": { - "metadataLockedSummary": "Метаданные заблокированы", - "metadataLockedDetail": "Метаданные книги успешно заблокированы.", - "metadataUnlockedSummary": "Метаданные разблокированы", - "metadataUnlockedDetail": "Метаданные книги успешно разблокированы.", - "lockFailedSummary": "Ошибка блокировки", - "lockFailedDetail": "Произошла ошибка при блокировке метаданных.", - "unlockFailedSummary": "Ошибка разблокировки", - "unlockFailedDetail": "Произошла ошибка при разблокировке метаданных." - } - }, "lockUnlockDialog": { "title": "Заблокировать или разблокировать метаданные", "selectedCount": "{{ count }} книг(а/и) выбрано", @@ -3475,42 +3314,7 @@ } }, "sorting": { - "sortOrder": "Порядок сортировки", - "removeTooltip": "Удалить", - "addSortFieldPlaceholder": "Добавить поле сортировки...", - "saveAsDefault": "Сохранить по умолчанию", - "ascendingTooltip": "По возрастанию, нажмите для изменения", - "descendingTooltip": "По убыванию, нажмите для изменения", - "options": { - "title": "Название", - "fileName": "Имя файла", - "filePath": "Путь к файлу", - "author": "Автор", - "authorSurnameVorname": "Автор (фамилия)", - "seriesName": "Название серии", - "seriesNumber": "Номер в серии", - "lastReadTime": "Последнее чтение", - "personalRating": "Личная оценка", - "addedOn": "Дата добавления", - "fileSizeKb": "Размер файла", - "locked": "Заблокировано", - "publisher": "Издательство", - "publishedDate": "Дата публикации", - "readStatus": "Статус чтения", - "dateFinished": "Дата завершения", - "readingProgress": "Прогресс чтения", - "bookType": "Тип книги", - "amazonRating": "Рейтинг Amazon", - "amazonReviewCount": "Amazon №", - "goodreadsRating": "Рейтинг Goodreads", - "goodreadsReviewCount": "Goodreads №", - "hardcoverRating": "Рейтинг Hardcover", - "hardcoverReviewCount": "Hardcover №", - "ranobedbRating": "Рейтинг Ranobedb", - "narrator": "Чтец", - "pageCount": "Страницы", - "random": "Случайно" - } + "saveAsDefault": "Сохранить по умолчанию" }, "fileAttacher": { "title": "Прикрепить файл к другой книге", diff --git a/frontend/src/i18n/sk.json b/frontend/src/i18n/sk.json index 72c0e0b65..586630807 100644 --- a/frontend/src/i18n/sk.json +++ b/frontend/src/i18n/sk.json @@ -555,20 +555,6 @@ "editSort": "", "tableSortConfig": "" }, - "filter": { - "sectionTitle": "", - "sectionDesc": "", - "filterMode": "", - "filterModeDesc": "", - "visibleFilters": "", - "visibleFiltersDesc": "", - "selectionCount": "", - "addFilter": "", - "resetToDefaults": "", - "modeAnd": "", - "modeOr": "", - "modeSingle": "" - }, "sidebarSort": { "sectionTitle": "", "sectionDesc": "", @@ -2732,68 +2718,20 @@ "customCoverHeader": "" }, "toast": { - "sortSavedSummary": "", - "sortSavedGlobalDetail": "", - "sortSavedEntityDetail": "", "regenCoverStartedSummary": "", "regenCoverStartedDetail": "", "customCoverStartedSummary": "", "customCoverStartedDetail": "", "failedSummary": "", "regenCoverFailedDetail": "", - "customCoverFailedDetail": "", - "unshelveSuccessDetail": "", - "unshelveFailedDetail": "", - "noEligibleBooksSummary": "", - "noEligibleBooksDetail": "", - "multipleLibrariesSummary": "", - "multipleLibrariesDetail": "" + "customCoverFailedDetail": "" }, "loading": { - "deleting": "", - "unshelving": "" + "deleting": "" }, "labels": { "allBooks": "", - "unshelvedBooks": "", - "unshelvedBooksFiltered": "", - "filteredSuffix": "", - "seriesCollapsedInfo": "", - "item": "", - "items": "", - "selected": "", - "setAsDefault": "", - "save": "", - "collapseSeries": "", - "gridColumns": "", - "bookTypeOverlay": "", - "noBooks": "", - "failedLibrary": "", - "failedShelf": "", - "failedBooks": "", - "activeFilters": "" - }, - "tooltip": { - "clearFilters": "", - "visibleColumns": "", - "selectSorting": "", - "toggleView": "", - "search": "", - "toggleSidebar": "", - "metadataActions": "", - "assignToShelf": "", - "removeFromShelf": "", - "lockUnlockMetadata": "", - "organizeFiles": "", - "attachToBook": "", - "moreActions": "", - "selectAll": "", - "deselectAll": "", - "deleteSelected": "" - }, - "placeholder": { - "selectColumns": "", - "search": "" + "unshelvedBooks": "" } }, "card": { @@ -3031,36 +2969,6 @@ "deletingLibrary": "" } }, - "columnPref": { - "columns": { - "readStatus": "", - "title": "", - "authors": "", - "publisher": "", - "seriesName": "", - "seriesNumber": "", - "categories": "", - "publishedDate": "", - "lastReadTime": "", - "addedOn": "", - "fileName": "", - "fileSizeKb": "", - "language": "", - "isbn": "", - "pageCount": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "", - "savedDetail": "" - } - }, "coverPref": { "toast": { "savedSummary": "", @@ -3069,12 +2977,6 @@ "saveFailedDetail": "" } }, - "filterPref": { - "toast": { - "saveFailedSummary": "", - "saveFailedDetail": "" - } - }, "reviews": { "confirm": { "deleteAllMessage": "", @@ -3232,41 +3134,7 @@ } }, "filter": { - "title": "", "showingFirst100": "", - "footerNote": "", - "labels": { - "author": "", - "category": "", - "series": "", - "bookType": "", - "readStatus": "", - "personalRating": "", - "publisher": "", - "matchScore": "", - "library": "", - "shelf": "", - "shelfStatus": "", - "tag": "", - "publishedDate": "", - "fileSize": "", - "amazonRating": "", - "goodreadsRating": "", - "hardcoverRating": "", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "", - "pageCount": "", - "mood": "", - "ageRating": "", - "contentRating": "", - "narrator": "", - "comicCharacter": "", - "comicTeam": "", - "comicLocation": "", - "comicCreator": "" - }, "readStatus": { "unread": "", "reading": "", @@ -3319,14 +3187,6 @@ "shelfStatus": { "shelved": "", "unshelved": "" - }, - "comicRoles": { - "penciller": "", - "inker": "", - "colorist": "", - "letterer": "", - "coverArtist": "", - "editor": "" } }, "shelfAssigner": { @@ -3389,27 +3249,6 @@ "updateFailedDetail": "" } }, - "table": { - "label": "", - "bookCoverAlt": "", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "{{ status }}", - "locked": "", - "unlocked": "", - "toast": { - "metadataLockedSummary": "", - "metadataLockedDetail": "", - "metadataUnlockedSummary": "", - "metadataUnlockedDetail": "", - "lockFailedSummary": "", - "lockFailedDetail": "", - "unlockFailedSummary": "", - "unlockFailedDetail": "" - } - }, "lockUnlockDialog": { "title": "", "selectedCount": "", @@ -3430,42 +3269,7 @@ } }, "sorting": { - "sortOrder": "", - "removeTooltip": "", - "addSortFieldPlaceholder": "", - "saveAsDefault": "", - "ascendingTooltip": "", - "descendingTooltip": "", - "options": { - "title": "", - "fileName": "", - "filePath": "", - "author": "", - "authorSurnameVorname": "", - "seriesName": "", - "seriesNumber": "", - "lastReadTime": "", - "personalRating": "", - "addedOn": "", - "fileSizeKb": "", - "locked": "", - "publisher": "", - "publishedDate": "", - "readStatus": "", - "dateFinished": "", - "readingProgress": "", - "bookType": "", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "", - "narrator": "", - "pageCount": "", - "random": "" - } + "saveAsDefault": "" }, "fileAttacher": { "title": "", diff --git a/frontend/src/i18n/sl.json b/frontend/src/i18n/sl.json index cd0be0703..92b1f7fba 100644 --- a/frontend/src/i18n/sl.json +++ b/frontend/src/i18n/sl.json @@ -556,20 +556,6 @@ "editSort": "Uredi razvrščanje", "tableSortConfig": "Konfig. razvrščanja" }, - "filter": { - "sectionTitle": "Nastavitve filtrov", - "sectionDesc": "Konfiguriraj privzete možnosti za filtre, prikazane v stranski vrstici.", - "filterMode": "Način filtriranja", - "filterModeDesc": "Izberi privzeti način za kombiniranje izbranih filtrov v desni stranski vrstici.", - "visibleFilters": "Vidni filtri", - "visibleFiltersDesc": "Izberi, kateri filtri naj bodo vidni, in jih razvrsti s vlečenjem. Izberi med {{min}} in {{max}} filtri.", - "selectionCount": "Izbrano: {{count}} od {{total}}", - "addFilter": "Dodaj filter...", - "resetToDefaults": "Ponastavi na privzeto", - "modeAnd": "In (vse hkrati)", - "modeOr": "Ali (katerikoli)", - "modeSingle": "Enojno" - }, "sidebarSort": { "sectionTitle": "Razvrščanje v stranski vrstici", "sectionDesc": "Nastavi možnosti razvrščanja za imena knjižnic in polic v levem meniju.", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Potrdi ustvarjanje naslovnic po meri" }, "toast": { - "sortSavedSummary": "Razvrščanje shranjeno", - "sortSavedGlobalDetail": "Privzeta konfiguracija razvrščanja je shranjena.", - "sortSavedEntityDetail": "Razvrščanje za {{ entityType }} je shranjeno.", "regenCoverStartedSummary": "Ustvarjanje naslovnic se je začelo", "regenCoverStartedDetail": "Ponovno ustvarjanje naslovnic za {{ count }} knjig(e). Osveži stran, ko bo postopek končan.", "customCoverStartedSummary": "Ustvarjanje naslovnic po meri se je začelo", "customCoverStartedDetail": "Ustvarjanje naslovnic po meri za {{ count }} knjig(e).", "failedSummary": "Napaka", "regenCoverFailedDetail": "Ni bilo mogoče začeti ponovnega ustvarjanja naslovnic.", - "customCoverFailedDetail": "Ni bilo mogoče začeti ustvarjanja naslovnic po meri.", - "unshelveSuccessDetail": "Police s knjigami so posodobljene", - "unshelveFailedDetail": "Napaka pri posodabljanju polic", - "noEligibleBooksSummary": "Ni primernih knjig", - "noEligibleBooksDetail": "Izbrane knjige morajo biti v eni datoteki (brez alternativnih formatov).", - "multipleLibrariesSummary": "Več knjižnic", - "multipleLibrariesDetail": "Vse izbrane knjige morajo biti iz iste knjižnice." + "customCoverFailedDetail": "Ni bilo mogoče začeti ustvarjanja naslovnic po meri." }, "loading": { - "deleting": "Brisanje {{ count }} knjig(e)...", - "unshelving": "Odstranjevanje {{ count }} knjig(e) s polic..." + "deleting": "Brisanje {{ count }} knjig(e)..." }, "labels": { "allBooks": "Vse knjige", - "unshelvedBooks": "Knjige brez polic", - "unshelvedBooksFiltered": "Knjige brez polic (filtrirano)", - "filteredSuffix": "(Filtrirano)", - "seriesCollapsedInfo": "Prikazovanje {{ count }} {{ itemWord }} (zbirke so strnjene)", - "item": "element", - "items": "elementov", - "selected": "izbrano", - "setAsDefault": "Nastavi kot privzeto?", - "save": "Shrani", - "collapseSeries": "Strni zbirke", - "gridColumns": "Stolpci mreže", - "bookTypeOverlay": "Oznaka formata knjige", - "noBooks": "Ta zbirka nima knjig!", - "failedLibrary": "Napaka pri nalaganju knjig iz knjižnice!", - "failedShelf": "Napaka pri nalaganju knjig s police!", - "failedBooks": "", - "activeFilters": "{{ count }} aktivnih filtrov" - }, - "tooltip": { - "clearFilters": "Počisti uporabljene filtre", - "visibleColumns": "Vidni stolpci", - "selectSorting": "Izberi razvrščanje", - "toggleView": "Preklopi med mrežnim in tabelarnim prikazom", - "search": "Išči", - "toggleSidebar": "Preklopi stransko vrstico s filtri", - "metadataActions": "Dejanja nad metapodatki", - "assignToShelf": "Dodaj na polico", - "removeFromShelf": "Odstrani s te police", - "lockUnlockMetadata": "Zakleni/Odkleni metapodatke", - "organizeFiles": "Organiziraj datoteke", - "attachToBook": "Pripni k drugi knjigi", - "moreActions": "Več dejanj", - "selectAll": "Izberi vse knjige", - "deselectAll": "Počisti izbor vseh knjig", - "deleteSelected": "Izbriši izbrane knjige" - }, - "placeholder": { - "selectColumns": "Izberi stolpce", - "search": "Naslov, avtor, zbirka, žanr ali ISBN..." + "unshelvedBooks": "Knjige brez polic" } }, "card": { @@ -3079,36 +3017,6 @@ "deletingLibrary": "Brisanje knjižnice '{{ name }}'..." } }, - "columnPref": { - "columns": { - "readStatus": "Prebrano", - "title": "Naslov", - "authors": "Avtorji", - "publisher": "Založba", - "seriesName": "Zbirka", - "seriesNumber": "Št. v zbirki", - "categories": "Žanri", - "publishedDate": "Objavljeno", - "lastReadTime": "Zadnje brano", - "addedOn": "Dodano", - "fileName": "Ime datoteke", - "fileSizeKb": "Velikost", - "language": "Jezik", - "isbn": "", - "pageCount": "Strani", - "amazonRating": "", - "amazonReviewCount": "AZ št.", - "goodreadsRating": "", - "goodreadsReviewCount": "GR št.", - "hardcoverRating": "", - "hardcoverReviewCount": "HC št.", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "Nastavitve shranjene", - "savedDetail": "Tvoja razporeditev stolpcev je shranjena." - } - }, "coverPref": { "toast": { "savedSummary": "Velikost naslovnic shranjena", @@ -3117,12 +3025,6 @@ "saveFailedDetail": "Lokalno shranjevanje nastavitev velikosti naslovnic ni uspelo." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Shranjevanje ni uspelo", - "saveFailedDetail": "Lokalno shranjevanje nastavitev filtrov ni uspelo." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Ali si prepričan, da želiš izbrisati vseh {{ count }} ocen za to knjigo? Te akcije ni mogoče preklicati.", @@ -3280,41 +3182,7 @@ } }, "filter": { - "title": "Filtri", "showingFirst100": "Prikazanih prvih 100 elementov", - "footerNote": "Opomba: Na kategorijo filtra je prikazanih največ 100 elementov", - "labels": { - "author": "Avtor", - "category": "Žanr", - "series": "Zbirka", - "bookType": "Oblika datoteke", - "readStatus": "Status branja", - "personalRating": "Osebna ocena", - "publisher": "Založba", - "matchScore": "Ujemanje metapodatkov", - "library": "Knjižnica", - "shelf": "Polica", - "shelfStatus": "Status police", - "tag": "Oznaka", - "publishedDate": "Leto izida", - "fileSize": "Velikost datoteke", - "amazonRating": "Amazon ocena", - "goodreadsRating": "Goodreads ocena", - "hardcoverRating": "Hardcover ocena", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "Jezik", - "pageCount": "Število strani", - "mood": "Vzdušje", - "ageRating": "Starostna omejitev", - "contentRating": "Ocena vsebine", - "narrator": "Pripovedovalec", - "comicCharacter": "Stripovski lik", - "comicTeam": "Stripovska ekipa", - "comicLocation": "Stripovska lokacija", - "comicCreator": "Stripovski ustvarjalec" - }, "readStatus": { "unread": "Neprebrano", "reading": "Berem", @@ -3367,14 +3235,6 @@ "shelfStatus": { "shelved": "Na polici", "unshelved": "Brez police" - }, - "comicRoles": { - "penciller": "Risar", - "inker": "Črnilo", - "colorist": "Barvalec", - "letterer": "Pisec", - "coverArtist": "Avtor naslovnice", - "editor": "Urednik" } }, "shelfAssigner": { @@ -3437,27 +3297,6 @@ "updateFailedDetail": "Prišlo je do napake pri posodabljanju police. Poskusi znova." } }, - "table": { - "label": "", - "bookCoverAlt": "Naslovnica knjige", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "", - "locked": "Zaklenjeno", - "unlocked": "Odklenjeno", - "toast": { - "metadataLockedSummary": "Metapodatki zaklenjeni", - "metadataLockedDetail": "Metapodatki knjige so bili uspešno zaklenjeni.", - "metadataUnlockedSummary": "Metapodatki odklenjeni", - "metadataUnlockedDetail": "Metapodatki knjige so bili uspešno odklenjeni.", - "lockFailedSummary": "Zaklepanje ni uspelo", - "lockFailedDetail": "Prišlo je do napake pri zaklepanju metapodatkov.", - "unlockFailedSummary": "Odklepanje ni uspelo", - "unlockFailedDetail": "Prišlo je do napake pri odklepanju metapodatkov." - } - }, "lockUnlockDialog": { "title": "Zakleni ali odkleni metapodatke", "selectedCount": "Izbranih knjig: {{ count }}", @@ -3478,42 +3317,7 @@ } }, "sorting": { - "sortOrder": "Vrstni red", - "removeTooltip": "Odstrani", - "addSortFieldPlaceholder": "Dodaj polje za razvrščanje...", - "saveAsDefault": "Shrani kot privzeto", - "ascendingTooltip": "Naraščajoče - klikni za spremembo", - "descendingTooltip": "Padajoče - klikni za spremembo", - "options": { - "title": "Naslov", - "fileName": "Ime datoteke", - "filePath": "Pot datoteke", - "author": "Avtor", - "authorSurnameVorname": "Avtor (Priimek)", - "seriesName": "Ime zbirke", - "seriesNumber": "Številka v zbirki", - "lastReadTime": "Zadnje brano", - "personalRating": "Osebna ocena", - "addedOn": "Dodano dne", - "fileSizeKb": "Velikost datoteke", - "locked": "Zaklenjeno", - "publisher": "Založba", - "publishedDate": "Datum izida", - "readStatus": "Status branja", - "dateFinished": "Datum dokončanja", - "readingProgress": "Napredek branja", - "bookType": "Oblika datoteke", - "amazonRating": "Amazon ocena", - "amazonReviewCount": "", - "goodreadsRating": "Goodreads ocena", - "goodreadsReviewCount": "", - "hardcoverRating": "Hardcover ocena", - "hardcoverReviewCount": "", - "ranobedbRating": "Ranobedb ocena", - "narrator": "Pripovedovalec", - "pageCount": "Strani", - "random": "Naključno" - } + "saveAsDefault": "Shrani kot privzeto" }, "fileAttacher": { "title": "Pripni datoteko k drugi knjigi", diff --git a/frontend/src/i18n/sv.json b/frontend/src/i18n/sv.json index 0ea0e8175..fc43b77bf 100644 --- a/frontend/src/i18n/sv.json +++ b/frontend/src/i18n/sv.json @@ -556,20 +556,6 @@ "tableSortConfig": "Sorteringskonfiguration", "formatOverlay": "Filformats-overlay" }, - "filter": { - "sectionTitle": "Filterinställningar", - "sectionDesc": "Konfigurera standardalternativ för filterkontroller som visas i sidopanelen.", - "filterMode": "Filterläge", - "filterModeDesc": "Välj standardläge för att kombinera filter valda från höger filterpanel.", - "visibleFilters": "Synliga filter", - "visibleFiltersDesc": "Välj vilka filter som visas i sidopanelen och dra för att ändra ordning. Mellan {{min}} och {{max}} filter.", - "selectionCount": "{{count}} av {{total}} valda", - "addFilter": "Lägg till filter...", - "resetToDefaults": "Återställ till standard", - "modeAnd": "Och", - "modeOr": "Eller", - "modeSingle": "Enskild" - }, "sidebarSort": { "sectionTitle": "Sidopanelens biblioteks- och hyllsortering", "sectionDesc": "Konfigurera sorteringsalternativ för dina biblioteks- och hyllnamn som visas i vänstra menysidopanelen.", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Bekräfta anpassad omslagsgenerering" }, "toast": { - "sortSavedSummary": "Sortering sparad", - "sortSavedGlobalDetail": "Standardsorteringskonfiguration sparad.", - "sortSavedEntityDetail": "Sorteringskonfiguration sparad för denna {{ entityType }}.", "regenCoverStartedSummary": "Omslagsåterskapning startad", "regenCoverStartedDetail": "Återskapar omslag för {{ count }} bok/böcker. Uppdatera sidan när det är klart.", "customCoverStartedSummary": "Anpassad omslagsgenerering startad", "customCoverStartedDetail": "Genererar anpassade omslag för {{ count }} bok/böcker.", "failedSummary": "Misslyckades", "regenCoverFailedDetail": "Kunde inte starta omslagsåterskapning.", - "customCoverFailedDetail": "Kunde inte starta anpassad omslagsgenerering.", - "unshelveSuccessDetail": "Böckers hyllor uppdaterade", - "unshelveFailedDetail": "Kunde inte uppdatera böckers hyllor", - "noEligibleBooksSummary": "Inga kvalificerade böcker", - "noEligibleBooksDetail": "Valda böcker måste vara enfilsböcker (inga alternativa format).", - "multipleLibrariesSummary": "Flera bibliotek", - "multipleLibrariesDetail": "Alla valda böcker måste vara från samma bibliotek." + "customCoverFailedDetail": "Kunde inte starta anpassad omslagsgenerering." }, "loading": { - "deleting": "Raderar {{ count }} bok/böcker...", - "unshelving": "Tar bort {{ count }} bok/böcker från hyllor..." + "deleting": "Raderar {{ count }} bok/böcker..." }, "labels": { "allBooks": "Alla böcker", - "unshelvedBooks": "Osorterade böcker", - "unshelvedBooksFiltered": "Osorterade böcker (filtrerade)", - "filteredSuffix": "(Filtrerade)", - "seriesCollapsedInfo": "Visar {{ count }} {{ itemWord }} (serier kollapsade)", - "item": "objekt", - "items": "objekt", - "selected": "valda", - "setAsDefault": "Ange som standard?", - "save": "Spara", - "collapseSeries": "Kollapsa serier", - "gridColumns": "Rutnätskolumner", - "bookTypeOverlay": "Filformats-overlay", - "noBooks": "Denna samling har inga böcker!", - "failedLibrary": "Kunde inte ladda bibliotekets böcker!", - "failedShelf": "Kunde inte ladda hyllans böcker!", - "failedBooks": "", - "activeFilters": "{{ count }} aktiva filter" - }, - "tooltip": { - "clearFilters": "Rensa tillämpade filter", - "visibleColumns": "Synliga kolumner", - "selectSorting": "Välj sortering", - "toggleView": "Växla mellan rutnäts- och tabellvy", - "search": "Sök", - "toggleSidebar": "Växla sidopanelfilter", - "metadataActions": "Metadataåtgärder", - "assignToShelf": "Tilldela till hylla", - "removeFromShelf": "Ta bort från denna hylla", - "lockUnlockMetadata": "Lås/lås upp metadata", - "organizeFiles": "Organisera filer", - "attachToBook": "Bifoga till annan bok", - "moreActions": "Fler åtgärder", - "selectAll": "Välj alla böcker", - "deselectAll": "Avmarkera alla böcker", - "deleteSelected": "Radera valda böcker" - }, - "placeholder": { - "selectColumns": "Välj kolumner", - "search": "Titel, författare, serie, genre eller ISBN..." + "unshelvedBooks": "Osorterade böcker" } }, "card": { @@ -3078,36 +3016,6 @@ "deletingLibrary": "Raderar biblioteket '{{ name }}'..." } }, - "columnPref": { - "columns": { - "readStatus": "Läst", - "title": "Titel", - "authors": "Författare", - "publisher": "Förlag", - "seriesName": "Serie", - "seriesNumber": "Serie #", - "categories": "Genrer", - "publishedDate": "Utgiven", - "lastReadTime": "Senast läst", - "addedOn": "Tillagd", - "fileName": "Filnamn", - "fileSizeKb": "Filstorlek", - "language": "Språk", - "isbn": "", - "pageCount": "Sidor", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "Inställningar sparade", - "savedDetail": "Din kolumnlayout har sparats." - } - }, "coverPref": { "toast": { "savedSummary": "Omslagsstorlek sparad", @@ -3116,12 +3024,6 @@ "saveFailedDetail": "Kunde inte spara omslagsstorleksinställning lokalt." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Sparning misslyckades", - "saveFailedDetail": "Kunde inte spara sidopanelfilterinställning lokalt." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Är du säker på att du vill radera alla {{ count }} recensioner för denna bok? Denna åtgärd kan inte ångras.", @@ -3279,41 +3181,7 @@ } }, "filter": { - "title": "Filter", "showingFirst100": "Visar de första 100 objekten", - "footerNote": "Obs: De 100 främsta objekten visas per filterkategori", - "labels": { - "author": "Författare", - "category": "", - "series": "Serie", - "bookType": "Filformat", - "readStatus": "Lässtatus", - "personalRating": "Personligt betyg", - "publisher": "Förlag", - "matchScore": "Metadatamatchningspoäng", - "library": "Bibliotek", - "shelf": "Hylla", - "shelfStatus": "Hyllstatus", - "tag": "Tagg", - "publishedDate": "Utgivningsår", - "fileSize": "Filstorlek", - "amazonRating": "Amazon-betyg", - "goodreadsRating": "Goodreads-betyg", - "hardcoverRating": "Hardcover-betyg", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "Språk", - "pageCount": "Sidantal", - "mood": "Stämning", - "ageRating": "Åldersbetyg", - "contentRating": "Innehållsbetyg", - "narrator": "Uppläsare", - "comicCharacter": "Serietidningskaraktär", - "comicTeam": "Serietidningsteam", - "comicLocation": "Serietidningsplats", - "comicCreator": "Serietidningsskapare" - }, "readStatus": { "unread": "Oläst", "reading": "Läser", @@ -3366,14 +3234,6 @@ "shelfStatus": { "shelved": "Hyllad", "unshelved": "Osorterad" - }, - "comicRoles": { - "penciller": "Tecknare", - "inker": "Tuschare", - "colorist": "Kolorist", - "letterer": "Textsättare", - "coverArtist": "Omslagskonstnär", - "editor": "Redaktör" } }, "shelfAssigner": { @@ -3436,27 +3296,6 @@ "updateFailedDetail": "Ett fel uppstod vid uppdatering av hyllan. Försök igen." } }, - "table": { - "label": "", - "bookCoverAlt": "Bokomslag", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "", - "locked": "Låst", - "unlocked": "Upplåst", - "toast": { - "metadataLockedSummary": "Metadata låst", - "metadataLockedDetail": "Bokmetadata har låsts.", - "metadataUnlockedSummary": "Metadata upplåst", - "metadataUnlockedDetail": "Bokmetadata har låsts upp.", - "lockFailedSummary": "Låsning misslyckades", - "lockFailedDetail": "Ett fel uppstod vid låsning av metadata.", - "unlockFailedSummary": "Upplåsning misslyckades", - "unlockFailedDetail": "Ett fel uppstod vid upplåsning av metadata." - } - }, "lockUnlockDialog": { "title": "Lås eller lås upp metadata", "selectedCount": "{{ count }} bok/böcker valda", @@ -3477,42 +3316,7 @@ } }, "sorting": { - "sortOrder": "Sorteringsordning", - "removeTooltip": "Ta bort", - "addSortFieldPlaceholder": "Lägg till sorteringsfält...", - "saveAsDefault": "Spara som standard", - "ascendingTooltip": "Stigande - klicka för att ändra", - "descendingTooltip": "Fallande - klicka för att ändra", - "options": { - "title": "Titel", - "fileName": "Filnamn", - "filePath": "Filsökväg", - "author": "Författare", - "authorSurnameVorname": "Författare (efternamn)", - "seriesName": "Serienamn", - "seriesNumber": "Serienummer", - "lastReadTime": "Senast läst", - "personalRating": "Personligt betyg", - "addedOn": "Tillagd", - "fileSizeKb": "Filstorlek", - "locked": "Låst", - "publisher": "Förlag", - "publishedDate": "Utgivningsdatum", - "readStatus": "Lässtatus", - "dateFinished": "Avslutad datum", - "readingProgress": "Läsframsteg", - "bookType": "Filformat", - "amazonRating": "Amazon-betyg", - "amazonReviewCount": "", - "goodreadsRating": "Goodreads-betyg", - "goodreadsReviewCount": "", - "hardcoverRating": "Hardcover-betyg", - "hardcoverReviewCount": "", - "ranobedbRating": "Ranobedb-betyg", - "narrator": "Uppläsare", - "pageCount": "Sidor", - "random": "Slumpmässig" - } + "saveAsDefault": "Spara som standard" }, "fileAttacher": { "title": "Bifoga fil till annan bok", diff --git a/frontend/src/i18n/uk.json b/frontend/src/i18n/uk.json index 530279f46..55289dc7d 100644 --- a/frontend/src/i18n/uk.json +++ b/frontend/src/i18n/uk.json @@ -556,20 +556,6 @@ "editSort": "Редагувати сортування", "tableSortConfig": "Конфігурація сортування" }, - "filter": { - "sectionTitle": "Налаштування фільтрів", - "sectionDesc": "Налаштуйте параметри за замовчуванням для елементів керування фільтрами, що відображаються у бічній панелі.", - "filterMode": "Режим фільтрації", - "filterModeDesc": "Виберіть режим за замовчуванням для поєднання фільтрів, вибраних у правій бічній панелі фільтрів.", - "visibleFilters": "Видимі фільтри", - "visibleFiltersDesc": "Виберіть, які фільтри з'являтимуться на бічній панелі, і перетягніть їх для зміни порядку. Від {{min}} до {{max}} фільтрів.", - "selectionCount": "Вибрано {{count}} із {{total}}", - "addFilter": "Додати фільтр...", - "resetToDefaults": "Скинути до стандартних", - "modeAnd": "І", - "modeOr": "Або", - "modeSingle": "Одиночний" - }, "sidebarSort": { "sectionTitle": "Налаштування сортування бібліотек і полиць у бічній панелі", "sectionDesc": "Налаштуйте параметри сортування назв бібліотек і полиць, що відображаються в лівому меню бічної панелі.", @@ -2736,68 +2722,20 @@ "customCoverHeader": "Підтвердження генерації власних обкладинок" }, "toast": { - "sortSavedSummary": "Сортування збережено", - "sortSavedGlobalDetail": "Конфігурацію сортування за замовчуванням збережено.", - "sortSavedEntityDetail": "Конфігурацію сортування для цього {{ entityType }} збережено.", "regenCoverStartedSummary": "Перегенерацію обкладинок розпочато", "regenCoverStartedDetail": "Перегенерування обкладинок для {{ count }} кн. Оновіть сторінку після завершення.", "customCoverStartedSummary": "Запущено генерацію власних обкладинок", "customCoverStartedDetail": "Генерація власних обкладинок для {{ count }} кн.", "failedSummary": "Не вдалося", "regenCoverFailedDetail": "Не вдалося розпочати перегенерацію обкладинок.", - "customCoverFailedDetail": "Не вдалося розпочати створення власних обкладинок.", - "unshelveSuccessDetail": "Книжкові полиці оновлено", - "unshelveFailedDetail": "Не вдалося оновити книжкові полиці", - "noEligibleBooksSummary": "Немає відповідних книг", - "noEligibleBooksDetail": "Вибрані книги мають складатися з одного файлу (без альтернативних форматів).", - "multipleLibrariesSummary": "Кілька бібліотек", - "multipleLibrariesDetail": "Усі вибрані книги мають бути з однієї бібліотеки." + "customCoverFailedDetail": "Не вдалося розпочати створення власних обкладинок." }, "loading": { - "deleting": "Видалення {{ count }} кн...", - "unshelving": "Вилучення {{ count }} кн. з полиць..." + "deleting": "Видалення {{ count }} кн..." }, "labels": { "allBooks": "Усі книги", - "unshelvedBooks": "Вилучені з полиць", - "unshelvedBooksFiltered": "Вилучені з полиць (відфільтровані)", - "filteredSuffix": "(Відфільтровані)", - "seriesCollapsedInfo": "Відображено {{ count }} {{ itemWord }} (серії згорнуто)", - "item": "eлемент", - "items": "елементи", - "selected": "вибрано", - "setAsDefault": "Встановити за замовчуванням?", - "save": "Зберегти", - "collapseSeries": "Згорнути серії", - "gridColumns": "Стовпці сітки", - "bookTypeOverlay": "Накладення типу книги", - "noBooks": "У цій колекції немає книг!", - "failedLibrary": "Не вдалося завантажити книги з бібліотеки!", - "failedShelf": "Не вдалося завантажити книги з полиці!", - "failedBooks": "", - "activeFilters": "{{ count }} активних фільтрів" - }, - "tooltip": { - "clearFilters": "Очистити застосовані фільтри", - "visibleColumns": "Видимі стовпці", - "selectSorting": "Вибрати сортування", - "toggleView": "Переключити вигляд (сітка/таблиця)", - "search": "Пошук", - "toggleSidebar": "Показати/приховати фільтри", - "metadataActions": "Дії з метаданими", - "assignToShelf": "Додати на полицю", - "removeFromShelf": "Прибрати з цієї полиці", - "lockUnlockMetadata": "Заблокувати/Розблокувати метадані", - "organizeFiles": "Організувати файли", - "attachToBook": "Приєднати до іншої книги", - "moreActions": "Додаткові дії", - "selectAll": "Вибрати всі книги", - "deselectAll": "Зняти виділення з усіх книг", - "deleteSelected": "Видалити вибрані книги" - }, - "placeholder": { - "selectColumns": "Вибрати стовпці", - "search": "Назва, автор, серія, жанр або ISBN..." + "unshelvedBooks": "Вилучені з полиць" } }, "card": { @@ -3079,36 +3017,6 @@ "deletingLibrary": "Видалення бібліотеки '{{ name }}'..." } }, - "columnPref": { - "columns": { - "readStatus": "Статус", - "title": "Назва", - "authors": "Автори", - "publisher": "Видавець", - "seriesName": "Серія", - "seriesNumber": "№ у серії", - "categories": "Жанри", - "publishedDate": "Опубліковано", - "lastReadTime": "Останнє читання", - "addedOn": "Додано", - "fileName": "Назва файлу", - "fileSizeKb": "Розмір файлу", - "language": "Мова", - "isbn": "", - "pageCount": "Сторінки", - "amazonRating": "", - "amazonReviewCount": "", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "Налаштування збережено", - "savedDetail": "Схему стовпців збережено." - } - }, "coverPref": { "toast": { "savedSummary": "Розмір обкладинки збережено", @@ -3117,12 +3025,6 @@ "saveFailedDetail": "Не вдалося локально зберегти налаштування розміру обкладинки." } }, - "filterPref": { - "toast": { - "saveFailedSummary": "Не вдалося зберегти", - "saveFailedDetail": "Не вдалося локально зберегти налаштування фільтра бокової панелі." - } - }, "reviews": { "confirm": { "deleteAllMessage": "Ви впевнені, що хочете видалити всі {{ count }} відгуків для цієї книги? Цю дію неможливо скасувати.", @@ -3280,41 +3182,7 @@ } }, "filter": { - "title": "Фільтри", "showingFirst100": "Показано перші 100 елементів", - "footerNote": "Примітка: у кожній категорії фільтра показано топ-100 елементів", - "labels": { - "author": "Автор", - "category": "Жанр", - "series": "Серія", - "bookType": "Тип книги", - "readStatus": "Статус читання", - "personalRating": "Особистий рейтинг", - "publisher": "Видавець", - "matchScore": "Оцінка збігу метаданих", - "library": "Бібліотека", - "shelf": "Полиця", - "shelfStatus": "Статус полиці", - "tag": "Тег", - "publishedDate": "Рік видання", - "fileSize": "Розмір файлу", - "amazonRating": "Рейтинг Amazon", - "goodreadsRating": "Рейтинг Goodreads", - "hardcoverRating": "Рейтинг Hardcover", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "Мова", - "pageCount": "Кількість сторінок", - "mood": "Настрій", - "ageRating": "Віковий рейтинг", - "contentRating": "Рейтинг контенту", - "narrator": "Оповідач", - "comicCharacter": "Персонаж коміксу", - "comicTeam": "Команда коміксу", - "comicLocation": "Локація коміксу", - "comicCreator": "Творець коміксу" - }, "readStatus": { "unread": "Не прочитано", "reading": "Читаю", @@ -3367,14 +3235,6 @@ "shelfStatus": { "shelved": "На полиці", "unshelved": "Поза полицями" - }, - "comicRoles": { - "penciller": "Пенсилер", - "inker": "Тушувальник", - "colorist": "Колорист", - "letterer": "Леттерер", - "coverArtist": "Художник обкладинки", - "editor": "Редактор" } }, "shelfAssigner": { @@ -3437,27 +3297,6 @@ "updateFailedDetail": "Під час оновлення полиці сталася помилка. Спробуйте ще раз." } }, - "table": { - "label": "", - "bookCoverAlt": "Обкладинка книги", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "Статус: {{ status }}", - "locked": "Заблоковано", - "unlocked": "Розблоковано", - "toast": { - "metadataLockedSummary": "Метадані заблоковано", - "metadataLockedDetail": "Метадані книги успішно заблоковано.", - "metadataUnlockedSummary": "Метадані розблоковано", - "metadataUnlockedDetail": "Метадані книги успішно розблоковано.", - "lockFailedSummary": "Не вдалося заблокувати", - "lockFailedDetail": "Під час блокування метаданих сталася помилка.", - "unlockFailedSummary": "Не вдалося розблокувати", - "unlockFailedDetail": "Під час розблокування метаданих сталася помилка." - } - }, "lockUnlockDialog": { "title": "Блокування або розблокування метаданих", "selectedCount": "Вибрано {{ count }} кн.", @@ -3478,42 +3317,7 @@ } }, "sorting": { - "sortOrder": "Порядок сортування", - "removeTooltip": "Видалити", - "addSortFieldPlaceholder": "Додайте поле сортування...", - "saveAsDefault": "Зберегти як значення за замовчуванням", - "ascendingTooltip": "За зростанням - натисніть, щоб змінити", - "descendingTooltip": "За спаданням - натисніть, щоб змінити", - "options": { - "title": "Назва", - "fileName": "Назва файлу", - "filePath": "Шлях до файлу", - "author": "Автор", - "authorSurnameVorname": "Автор (Прізвище)", - "seriesName": "Назва серії", - "seriesNumber": "Номер у серії", - "lastReadTime": "Останнє читання", - "personalRating": "Особистий рейтинг", - "addedOn": "Додано", - "fileSizeKb": "Розмір файлу", - "locked": "Заблоковано", - "publisher": "Видавець", - "publishedDate": "Дата публікації", - "readStatus": "Статус читання", - "dateFinished": "Дата завершення", - "readingProgress": "Прогрес читання", - "bookType": "Тип книги", - "amazonRating": "Рейтинг Amazon", - "amazonReviewCount": "", - "goodreadsRating": "Рейтинг Goodreads", - "goodreadsReviewCount": "", - "hardcoverRating": "Рейтинг Hardcover", - "hardcoverReviewCount": "", - "ranobedbRating": "Рейтинг Ranobedb", - "narrator": "Оповідач", - "pageCount": "Сторінки", - "random": "Випадково" - } + "saveAsDefault": "Зберегти як значення за замовчуванням" }, "fileAttacher": { "title": "Прикріпити файл до іншої книги", diff --git a/frontend/src/i18n/zh.json b/frontend/src/i18n/zh.json index 43b6ef3d5..37611ea38 100644 --- a/frontend/src/i18n/zh.json +++ b/frontend/src/i18n/zh.json @@ -556,20 +556,6 @@ "tableSortConfig": "排序配置", "formatOverlay": "图书类型标识" }, - "filter": { - "sectionTitle": "筛选偏好", - "sectionDesc": "配置侧边栏中显示的筛选控件的默认选项。", - "filterMode": "筛选模式", - "filterModeDesc": "选择从右侧筛选侧边栏中选择的筛选器的默认组合模式。", - "visibleFilters": "可见筛选器", - "visibleFiltersDesc": "选择哪些筛选器出现在侧边栏中,并拖动以重新排序。{{min}} 到 {{max}} 个筛选器。", - "selectionCount": "已选择 {{count}}/{{total}}", - "addFilter": "添加筛选器...", - "resetToDefaults": "重置为默认值", - "modeAnd": "且", - "modeOr": "或", - "modeSingle": "单选" - }, "sidebarSort": { "sectionTitle": "侧边栏书库和书架排序偏好", "sectionDesc": "配置左侧菜单侧边栏中显示的书库和书架名称的排序选项。", @@ -2736,68 +2722,20 @@ "customCoverHeader": "确认生成自定义封面" }, "toast": { - "sortSavedSummary": "排序已保存", - "sortSavedGlobalDetail": "默认排序配置已保存。", - "sortSavedEntityDetail": "此 {{ entityType }} 的排序配置已保存。", "regenCoverStartedSummary": "封面重新生成已开始", "regenCoverStartedDetail": "正在为 {{ count }} 本书重新生成封面。完成后请刷新页面。", "customCoverStartedSummary": "自定义封面生成已开始", "customCoverStartedDetail": "正在为 {{ count }} 本书生成自定义封面。", "failedSummary": "失败", "regenCoverFailedDetail": "无法开始封面重新生成。", - "customCoverFailedDetail": "无法开始自定义封面生成。", - "unshelveSuccessDetail": "图书书架已更新", - "unshelveFailedDetail": "更新图书书架失败", - "noEligibleBooksSummary": "没有符合条件的图书", - "noEligibleBooksDetail": "所选图书必须是单文件图书(没有替代格式)。", - "multipleLibrariesSummary": "多个书库", - "multipleLibrariesDetail": "所有选中的图书必须来自同一个书库。" + "customCoverFailedDetail": "无法开始自定义封面生成。" }, "loading": { - "deleting": "正在删除 {{ count }} 本书...", - "unshelving": "正在移出 {{ count }} 本书..." + "deleting": "正在删除 {{ count }} 本书..." }, "labels": { "allBooks": "所有图书", - "unshelvedBooks": "未上架的图书", - "unshelvedBooksFiltered": "未上架的图书(已筛选)", - "filteredSuffix": "(已筛选)", - "seriesCollapsedInfo": "显示 {{ count }} 个{{ itemWord }}(系列已折叠)", - "item": "项目", - "items": "项目", - "selected": "已选择", - "setAsDefault": "设为默认?", - "save": "保存", - "collapseSeries": "折叠系列", - "gridColumns": "网格列数", - "bookTypeOverlay": "图书类型标识", - "noBooks": "此集合没有图书!", - "failedLibrary": "加载书库图书失败!", - "failedShelf": "加载书架图书失败!", - "failedBooks": "", - "activeFilters": "{{ count }} 个活跃筛选条件" - }, - "tooltip": { - "clearFilters": "清除已应用的筛选条件", - "visibleColumns": "可见列", - "selectSorting": "选择排序", - "toggleView": "在网格视图和表格视图之间切换", - "search": "搜索", - "toggleSidebar": "切换侧边栏筛选", - "metadataActions": "元数据操作", - "assignToShelf": "分配到书架", - "removeFromShelf": "从此书架移除", - "lockUnlockMetadata": "锁定/解锁元数据", - "organizeFiles": "整理文件", - "attachToBook": "附加到其他图书", - "moreActions": "更多操作", - "selectAll": "选择所有图书", - "deselectAll": "取消选择所有图书", - "deleteSelected": "删除选中的图书" - }, - "placeholder": { - "selectColumns": "选择列", - "search": "标题、作者、系列、类型或 ISBN..." + "unshelvedBooks": "未上架的图书" } }, "card": { @@ -3076,36 +3014,6 @@ "deletingLibrary": "正在删除书库「{{ name }}」..." } }, - "columnPref": { - "columns": { - "readStatus": "阅读", - "title": "标题", - "authors": "作者", - "publisher": "出版社", - "seriesName": "系列", - "seriesNumber": "系列编号", - "categories": "类型", - "publishedDate": "出版日期", - "lastReadTime": "最后阅读", - "addedOn": "添加时间", - "fileName": "文件名", - "fileSizeKb": "文件大小", - "language": "语言", - "isbn": "", - "pageCount": "页数", - "amazonRating": "亚马逊", - "amazonReviewCount": "亚马逊 #", - "goodreadsRating": "", - "goodreadsReviewCount": "", - "hardcoverRating": "", - "hardcoverReviewCount": "", - "ranobedbRating": "" - }, - "toast": { - "savedSummary": "偏好已保存", - "savedDetail": "您的列布局已保存。" - } - }, "coverPref": { "toast": { "savedSummary": "封面大小已保存", @@ -3114,12 +3022,6 @@ "saveFailedDetail": "无法在本地保存封面大小偏好。" } }, - "filterPref": { - "toast": { - "saveFailedSummary": "保存失败", - "saveFailedDetail": "无法在本地保存侧边栏筛选偏好。" - } - }, "reviews": { "confirm": { "deleteAllMessage": "确定要删除此图书的全部 {{ count }} 条评论吗?此操作无法撤销。", @@ -3277,41 +3179,7 @@ } }, "filter": { - "title": "筛选条件", "showingFirst100": "显示前 100 项", - "footerNote": "注意:每个筛选类别最多显示 100 项", - "labels": { - "author": "作者", - "category": "类型", - "series": "系列", - "bookType": "图书类型", - "readStatus": "阅读状态", - "personalRating": "个人评分", - "publisher": "出版社", - "matchScore": "元数据匹配分数", - "library": "书库", - "shelf": "书架", - "shelfStatus": "书架状态", - "tag": "标签", - "publishedDate": "出版年份", - "fileSize": "文件大小", - "amazonRating": "亚马逊评分", - "goodreadsRating": "Goodreads 评分", - "hardcoverRating": "Hardcover 评分", - "lubimyczytacRating": "", - "ranobedbRating": "", - "audibleRating": "", - "language": "语言", - "pageCount": "页数", - "mood": "情绪", - "ageRating": "年龄分级", - "contentRating": "内容分级", - "narrator": "讲述者", - "comicCharacter": "漫画角色", - "comicTeam": "漫画团队", - "comicLocation": "漫画地点", - "comicCreator": "漫画创作者" - }, "readStatus": { "unread": "未读", "reading": "阅读中", @@ -3364,14 +3232,6 @@ "shelfStatus": { "shelved": "已上架", "unshelved": "未上架" - }, - "comicRoles": { - "penciller": "铅笔画师", - "inker": "墨线画师", - "colorist": "上色师", - "letterer": "文字师", - "coverArtist": "封面画师", - "editor": "编辑" } }, "shelfAssigner": { @@ -3434,27 +3294,6 @@ "updateFailedDetail": "更新书架时发生错误。请重试。" } }, - "table": { - "label": "", - "bookCoverAlt": "图书封面", - "selectBook": "", - "selectBookFallback": "", - "noRating": "", - "ratingOutOf": "", - "statusWithPrefix": "状态:{{ status }}", - "locked": "已锁定", - "unlocked": "已解锁", - "toast": { - "metadataLockedSummary": "元数据已锁定", - "metadataLockedDetail": "图书元数据已成功锁定。", - "metadataUnlockedSummary": "元数据已解锁", - "metadataUnlockedDetail": "图书元数据已成功解锁。", - "lockFailedSummary": "锁定失败", - "lockFailedDetail": "锁定元数据时发生错误。", - "unlockFailedSummary": "解锁失败", - "unlockFailedDetail": "解锁元数据时发生错误。" - } - }, "lockUnlockDialog": { "title": "锁定或解锁元数据", "selectedCount": "已选择 {{ count }} 本书", @@ -3475,42 +3314,7 @@ } }, "sorting": { - "sortOrder": "排序顺序", - "removeTooltip": "移除", - "addSortFieldPlaceholder": "添加排序字段...", - "saveAsDefault": "保存为默认", - "ascendingTooltip": "升序 - 点击更改", - "descendingTooltip": "降序 - 点击更改", - "options": { - "title": "标题", - "fileName": "文件名", - "filePath": "文件路径", - "author": "作者", - "authorSurnameVorname": "作者(姓氏)", - "seriesName": "系列名称", - "seriesNumber": "系列编号", - "lastReadTime": "最后阅读", - "personalRating": "个人评分", - "addedOn": "添加时间", - "fileSizeKb": "文件大小", - "locked": "已锁定", - "publisher": "出版社", - "publishedDate": "出版日期", - "readStatus": "阅读状态", - "dateFinished": "完成日期", - "readingProgress": "阅读进度", - "bookType": "图书类型", - "amazonRating": "亚马逊评分", - "amazonReviewCount": "亚马逊 #", - "goodreadsRating": "Goodreads 评分", - "goodreadsReviewCount": "", - "hardcoverRating": "Hardcover 评分", - "hardcoverReviewCount": "", - "ranobedbRating": "Ranobedb 评分", - "narrator": "讲述者", - "pageCount": "页数", - "random": "随机" - } + "saveAsDefault": "保存为默认" }, "fileAttacher": { "title": "将文件附加到其他图书",