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:
+18
-2
@@ -7,9 +7,10 @@ import {MessageService} from 'primeng/api';
|
||||
|
||||
import {AppSettingsService} from '../../../shared/service/app-settings.service';
|
||||
import {BookService} from '../../book/service/book.service';
|
||||
import {AppSettingKey, AppSettings} from '../../../shared/model/app-settings.model';
|
||||
import {AppSettingKey, AppSettings, CoverCroppingSettings} from '../../../shared/model/app-settings.model';
|
||||
import {filter, take} from 'rxjs/operators';
|
||||
import {InputText} from 'primeng/inputtext';
|
||||
import {Slider} from 'primeng/slider';
|
||||
|
||||
@Component({
|
||||
selector: 'app-global-preferences',
|
||||
@@ -18,7 +19,8 @@ import {InputText} from 'primeng/inputtext';
|
||||
Button,
|
||||
ToggleSwitch,
|
||||
FormsModule,
|
||||
InputText
|
||||
InputText,
|
||||
Slider
|
||||
],
|
||||
templateUrl: './global-preferences.component.html',
|
||||
styleUrl: './global-preferences.component.scss'
|
||||
@@ -30,6 +32,13 @@ export class GlobalPreferencesComponent implements OnInit {
|
||||
similarBookRecommendation: false,
|
||||
};
|
||||
|
||||
coverCroppingSettings: CoverCroppingSettings = {
|
||||
verticalCroppingEnabled: false,
|
||||
horizontalCroppingEnabled: false,
|
||||
aspectRatioThreshold: 2.5,
|
||||
smartCroppingEnabled: false
|
||||
};
|
||||
|
||||
private appSettingsService = inject(AppSettingsService);
|
||||
private bookService = inject(BookService);
|
||||
private messageService = inject(MessageService);
|
||||
@@ -49,6 +58,9 @@ export class GlobalPreferencesComponent implements OnInit {
|
||||
if (settings?.maxFileUploadSizeInMb) {
|
||||
this.maxFileUploadSizeInMb = settings.maxFileUploadSizeInMb;
|
||||
}
|
||||
if (settings?.coverCroppingSettings) {
|
||||
this.coverCroppingSettings = {...settings.coverCroppingSettings};
|
||||
}
|
||||
this.toggles.autoBookSearch = settings.autoBookSearch ?? false;
|
||||
this.toggles.similarBookRecommendation = settings.similarBookRecommendation ?? false;
|
||||
});
|
||||
@@ -68,6 +80,10 @@ export class GlobalPreferencesComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
onCoverCroppingChange(): void {
|
||||
this.saveSetting(AppSettingKey.COVER_CROPPING_SETTINGS, this.coverCroppingSettings);
|
||||
}
|
||||
|
||||
saveCacheSize(): void {
|
||||
if (!this.cbxCacheValue || this.cbxCacheValue <= 0) {
|
||||
this.showMessage('error', 'Invalid Input', 'Please enter a valid cache size in MB.');
|
||||
|
||||
Reference in New Issue
Block a user