Add BookDate card stack animations and thumbnail caching

Implements pure CSS card stack animations for BookDate recommendations, including smooth exit and advance transitions. Adds local caching of library cover thumbnails during scans, updates database schema and API to serve cached covers, and enhances BookDate to support 'favorites' scope with a book picker modal. Updates admin settings validation logic for Prowlarr, improves indexer state management, and documents new features and backend changes.
This commit is contained in:
kikootwo
2026-01-20 17:28:27 -05:00
parent 2d9ed5c76a
commit ac2ad8aac2
33 changed files with 2371 additions and 707 deletions
@@ -16,8 +16,16 @@ const apiMock = vi.hoisted(() => ({
triggerABSScan: vi.fn(),
}));
const configServiceMock = vi.hoisted(() => ({
getMany: vi.fn(),
}));
vi.mock('@/lib/services/audiobookshelf/api', () => apiMock);
vi.mock('@/lib/services/config.service', () => ({
getConfigService: () => configServiceMock,
}));
describe('AudiobookshelfLibraryService', () => {
beforeEach(() => {
vi.clearAllMocks();
@@ -147,4 +155,42 @@ describe('AudiobookshelfLibraryService', () => {
expect(apiMock.triggerABSScan).toHaveBeenCalledWith('lib-1');
});
it('returns cover caching params for Audiobookshelf backend', async () => {
configServiceMock.getMany.mockResolvedValue({
'audiobookshelf.server_url': 'http://abs:13378',
'audiobookshelf.api_token': 'abs-token-456',
});
const service = new AudiobookshelfLibraryService();
const params = await service.getCoverCachingParams();
expect(params).toEqual({
backendBaseUrl: 'http://abs:13378',
authToken: 'abs-token-456',
backendMode: 'audiobookshelf',
});
});
it('throws when getting cover caching params without server URL', async () => {
configServiceMock.getMany.mockResolvedValue({
'audiobookshelf.server_url': null,
'audiobookshelf.api_token': 'token',
});
const service = new AudiobookshelfLibraryService();
await expect(service.getCoverCachingParams()).rejects.toThrow('Audiobookshelf server configuration is incomplete');
});
it('throws when getting cover caching params without API token', async () => {
configServiceMock.getMany.mockResolvedValue({
'audiobookshelf.server_url': 'http://abs',
'audiobookshelf.api_token': null,
});
const service = new AudiobookshelfLibraryService();
await expect(service.getCoverCachingParams()).rejects.toThrow('Audiobookshelf server configuration is incomplete');
});
});