feat: add additional cover art actions and settings (#1938)

* feat: add cover image auto cropping when oversized

* feat: add smart cropping to ignore sections of constant colours in cover images

* fix: description implied cbx files would be excluded from cover regeneration when they are not

* feat: add options to bulk edit cover images in the library view

* fix: resolve issues with batching requests and data validation for cover images
This commit is contained in:
CounterClops
2025-12-19 11:20:50 -07:00
committed by GitHub
parent 4e6842c189
commit 54108754f9
26 changed files with 745 additions and 37 deletions
@@ -22,7 +22,8 @@ export class BookMenuService {
autoFetchMetadata: () => void,
fetchMetadata: () => void,
bulkEditMetadata: () => void,
multiBookEditMetadata: () => void): MenuItem[] {
multiBookEditMetadata: () => void,
regenerateCovers: () => void): MenuItem[] {
return [
{
label: 'Auto Fetch Metadata',
@@ -43,6 +44,11 @@ export class BookMenuService {
label: 'Multi-Book Metadata Editor',
icon: 'pi pi-clone',
command: multiBookEditMetadata
},
{
label: 'Regenerate Covers',
icon: 'pi pi-image',
command: regenerateCovers
}
];
}
@@ -432,6 +432,17 @@ export class BookService {
return this.http.post<void>(`${this.url}/${bookId}/regenerate-cover`, {});
}
regenerateCoversForBooks(bookIds: number[]): Observable<void> {
return this.http.post<void>(`${this.url}/bulk-regenerate-covers`, { bookIds });
}
bulkUploadCover(bookIds: number[], file: File): Observable<void> {
const formData = new FormData();
formData.append('file', file);
formData.append('bookIds', bookIds.join(','));
return this.http.post<void>(`${this.url}/bulk-upload-cover`, formData);
}
/*------------------ All the metadata related calls go here ------------------*/