mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 21:00:09 +00:00
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:
@@ -20,8 +20,10 @@ import {
|
||||
triggerABSScan,
|
||||
} from '../audiobookshelf/api';
|
||||
import { ABSLibraryItem } from '../audiobookshelf/types';
|
||||
import { getConfigService } from '@/lib/services/config.service';
|
||||
|
||||
export class AudiobookshelfLibraryService implements ILibraryService {
|
||||
private configService = getConfigService();
|
||||
|
||||
async testConnection(): Promise<LibraryConnectionResult> {
|
||||
try {
|
||||
@@ -87,6 +89,34 @@ export class AudiobookshelfLibraryService implements ILibraryService {
|
||||
await triggerABSScan(libraryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parameters needed for caching library covers
|
||||
* @returns Parameters for ThumbnailCacheService.cacheLibraryThumbnail()
|
||||
*/
|
||||
async getCoverCachingParams(): Promise<{
|
||||
backendBaseUrl: string;
|
||||
authToken: string;
|
||||
backendMode: 'plex' | 'audiobookshelf';
|
||||
}> {
|
||||
const config = await this.configService.getMany([
|
||||
'audiobookshelf.server_url',
|
||||
'audiobookshelf.api_token',
|
||||
]);
|
||||
|
||||
const serverUrl = config['audiobookshelf.server_url'];
|
||||
const authToken = config['audiobookshelf.api_token'];
|
||||
|
||||
if (!serverUrl || !authToken) {
|
||||
throw new Error('Audiobookshelf server configuration is incomplete');
|
||||
}
|
||||
|
||||
return {
|
||||
backendBaseUrl: serverUrl,
|
||||
authToken: authToken,
|
||||
backendMode: 'audiobookshelf',
|
||||
};
|
||||
}
|
||||
|
||||
private mapABSItemToLibraryItem(item: ABSLibraryItem): LibraryItem {
|
||||
const metadata = item.media.metadata;
|
||||
return {
|
||||
|
||||
@@ -220,6 +220,28 @@ export class PlexLibraryService implements ILibraryService {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parameters needed for caching library covers
|
||||
* @returns Parameters for ThumbnailCacheService.cacheLibraryThumbnail()
|
||||
*/
|
||||
async getCoverCachingParams(): Promise<{
|
||||
backendBaseUrl: string;
|
||||
authToken: string;
|
||||
backendMode: 'plex' | 'audiobookshelf';
|
||||
}> {
|
||||
const config = await this.configService.getPlexConfig();
|
||||
|
||||
if (!config.serverUrl || !config.authToken) {
|
||||
throw new Error('Plex server configuration is incomplete');
|
||||
}
|
||||
|
||||
return {
|
||||
backendBaseUrl: config.serverUrl,
|
||||
authToken: config.authToken,
|
||||
backendMode: 'plex',
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Map Plex audiobook to generic LibraryItem interface
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user