Move quick book metadata update to a new tab
This commit is contained in:
+4
-17
@@ -1,8 +1,6 @@
|
|||||||
<div class="w-full h-[calc(100vh-12.1rem)] overflow-y-auto border rounded-lg p-4 enclosing-container">
|
<div class="w-full h-[calc(100vh-12.1rem)] overflow-y-auto border rounded-lg p-4 enclosing-container">
|
||||||
<p class="text-3xl font-semibold">Preferences</p>
|
|
||||||
<p-divider></p-divider>
|
|
||||||
|
|
||||||
<p class="text-xl pb-4 pt-4">
|
<p class="text-xl pb-4 pt-6">
|
||||||
Book Reader Settings: Global or Per-Book
|
Book Reader Settings: Global or Per-Book
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
pTooltip="Choose whether you want to apply the same settings (like font, theme, spread, zoom, etc.) to all your books by default, or have individual setting for each book."
|
pTooltip="Choose whether you want to apply the same settings (like font, theme, spread, zoom, etc.) to all your books by default, or have individual setting for each book."
|
||||||
@@ -40,11 +38,11 @@
|
|||||||
<label [for]="item">{{ item }}</label>
|
<label [for]="item">{{ item }}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
<p class="text-xl pb-4 pt-4">
|
|
||||||
|
<p class="text-xl pb-6 pt-6">
|
||||||
PDF Reader: Global Preferences
|
PDF Reader: Global Preferences
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
pTooltip="These settings apply globally to all PDFs. You can customize how PDFs are displayed, including page spread type, zoom level, and sidebar visibility."
|
pTooltip="These settings apply globally to all PDFs. You can customize how PDFs are displayed, including page spread type, zoom level, and sidebar visibility."
|
||||||
@@ -93,7 +91,7 @@
|
|||||||
|
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
|
|
||||||
<p class="text-xl pb-4 pt-4">
|
<p class="text-xl pb-6 pt-6">
|
||||||
Epub Reader: Global Preferences
|
Epub Reader: Global Preferences
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
pTooltip="These settings apply globally to all EPUBs. Customize how EPUBs are displayed, including themes, font types, and font sizes." tooltipPosition="right"
|
pTooltip="These settings apply globally to all EPUBs. Customize how EPUBs are displayed, including themes, font types, and font sizes." tooltipPosition="right"
|
||||||
@@ -135,15 +133,4 @@
|
|||||||
<p-button icon="pi pi-plus" rounded="true" (click)="increaseFontSize()"></p-button>
|
<p-button icon="pi pi-plus" rounded="true" (click)="increaseFontSize()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p-divider></p-divider>
|
|
||||||
<p class="text-xl pb-4 pt-4">
|
|
||||||
Quick Book Match Preferences
|
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
|
||||||
pTooltip="Choose whether you want to apply the same settings (like font, theme, spread, zoom, etc.) to all your books by default, or have individual setting for each book."
|
|
||||||
tooltipPosition="right"
|
|
||||||
style="cursor: pointer;">
|
|
||||||
</i>
|
|
||||||
</p>
|
|
||||||
<app-metadata-advanced-fetch-options (metadataOptionsSubmitted)="onMetadataSubmit($event)" [currentMetadataOptions]="currentMetadataOptions"></app-metadata-advanced-fetch-options>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-7
@@ -16,7 +16,7 @@ import {MetadataRefreshOptions} from '../../../../metadata/model/request/metadat
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-book-preferences',
|
selector: 'app-book-preferences',
|
||||||
templateUrl: './book-preferences.component.html',
|
templateUrl: './book-preferences.component.html',
|
||||||
imports: [Select, FormsModule, NgForOf, ToggleSwitch, RadioButton, Divider, Button, Tooltip, MetadataAdvancedFetchOptionsComponent],
|
imports: [Select, FormsModule, NgForOf, ToggleSwitch, RadioButton, Divider, Button, Tooltip],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
styleUrls: ['./book-preferences.component.scss']
|
styleUrls: ['./book-preferences.component.scss']
|
||||||
})
|
})
|
||||||
@@ -58,13 +58,11 @@ export class BookPreferences implements OnInit {
|
|||||||
private appSettingsService = inject(AppSettingsService);
|
private appSettingsService = inject(AppSettingsService);
|
||||||
appSettings$: Observable<AppSettings | null> = this.appSettingsService.appSettings$;
|
appSettings$: Observable<AppSettings | null> = this.appSettingsService.appSettings$;
|
||||||
individualOrGlobal = ['global', 'individual'];
|
individualOrGlobal = ['global', 'individual'];
|
||||||
currentMetadataOptions!: MetadataRefreshOptions;
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.appSettings$.subscribe(settings => {
|
this.appSettings$.subscribe(settings => {
|
||||||
if (settings) {
|
if (settings) {
|
||||||
this.populateSettings(settings);
|
this.populateSettings(settings);
|
||||||
this.currentMetadataOptions = settings.metadataRefreshOptions;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -135,8 +133,4 @@ export class BookPreferences implements OnInit {
|
|||||||
this.onFontSizeChange();
|
this.onFontSizeChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMetadataSubmit(metadataRefreshOptions: MetadataRefreshOptions) {
|
|
||||||
this.appSettingsService.saveAppSetting('quick_book_match', 'all_books', metadataRefreshOptions)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
<p class="text-xl pb-4 pt-4">
|
||||||
|
Quick Book Match Preferences
|
||||||
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
|
pTooltip="Choose how metadata fields (title, description, authors, categories, cover) are retrieved by setting priority providers. You can apply the same provider settings to all fields or customize them individually. Enable ‘Refresh Covers’ to update book covers, and ‘Merge Categories’ to consolidate categories/genres from all sources while preserving the existing categories/genres in the book."
|
||||||
|
tooltipPosition="right"
|
||||||
|
style="cursor: pointer;">
|
||||||
|
</i>
|
||||||
|
</p>
|
||||||
|
<app-metadata-advanced-fetch-options (metadataOptionsSubmitted)="onMetadataSubmit($event)" [currentMetadataOptions]="currentMetadataOptions"></app-metadata-advanced-fetch-options>
|
||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
|
import {MetadataAdvancedFetchOptionsComponent} from '../../../../metadata/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component';
|
||||||
|
import {MetadataRefreshOptions} from '../../../../metadata/model/request/metadata-refresh-options.model';
|
||||||
|
import {AppSettingsService} from '../../../service/app-settings.service';
|
||||||
|
import {Observable} from 'rxjs';
|
||||||
|
import {AppSettings} from '../../../model/app-settings.model';
|
||||||
|
import {Tooltip} from 'primeng/tooltip';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-metadata-settings',
|
||||||
|
imports: [
|
||||||
|
MetadataAdvancedFetchOptionsComponent,
|
||||||
|
Tooltip
|
||||||
|
],
|
||||||
|
templateUrl: './metadata-settings.component.html',
|
||||||
|
styleUrl: './metadata-settings.component.scss'
|
||||||
|
})
|
||||||
|
export class MetadataSettingsComponent implements OnInit {
|
||||||
|
|
||||||
|
currentMetadataOptions!: MetadataRefreshOptions;
|
||||||
|
|
||||||
|
private appSettingsService = inject(AppSettingsService);
|
||||||
|
appSettings$: Observable<AppSettings | null> = this.appSettingsService.appSettings$;
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.appSettings$.subscribe(settings => {
|
||||||
|
if (settings) {
|
||||||
|
this.currentMetadataOptions = settings.metadataRefreshOptions;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onMetadataSubmit(metadataRefreshOptions: MetadataRefreshOptions) {
|
||||||
|
this.appSettingsService.saveAppSetting('quick_book_match', 'all_books', metadataRefreshOptions)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,10 @@
|
|||||||
<p-tablist>
|
<p-tablist>
|
||||||
<p-tab value="0">Book Preferences</p-tab>
|
<p-tab value="0">Book Preferences</p-tab>
|
||||||
<ng-container *ngIf="userData.permissions.admin">
|
<ng-container *ngIf="userData.permissions.admin">
|
||||||
<p-tab value="1">Admin</p-tab>
|
<p-tab value="1">Quick Metadata</p-tab>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="userData.permissions.admin">
|
||||||
|
<p-tab value="2">Admin Panel</p-tab>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</p-tablist>
|
</p-tablist>
|
||||||
|
|
||||||
@@ -13,6 +16,11 @@
|
|||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
<ng-container *ngIf="userData.permissions.admin">
|
<ng-container *ngIf="userData.permissions.admin">
|
||||||
<p-tabpanel value="1">
|
<p-tabpanel value="1">
|
||||||
|
<app-metadata-settings></app-metadata-settings>
|
||||||
|
</p-tabpanel>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="userData.permissions.admin">
|
||||||
|
<p-tabpanel value="2">
|
||||||
<app-admin></app-admin>
|
<app-admin></app-admin>
|
||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import {BookPreferences} from './book-preferences/book-preferences.component';
|
|||||||
import {AdminComponent} from './admin/admin.component';
|
import {AdminComponent} from './admin/admin.component';
|
||||||
import {UserService} from '../../../user.service';
|
import {UserService} from '../../../user.service';
|
||||||
import {AsyncPipe, NgIf} from '@angular/common';
|
import {AsyncPipe, NgIf} from '@angular/common';
|
||||||
|
import {MetadataAdvancedFetchOptionsComponent} from "../../../metadata/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component";
|
||||||
|
import {MetadataRefreshOptions} from '../../../metadata/model/request/metadata-refresh-options.model';
|
||||||
|
import {AppSettingsService} from '../../service/app-settings.service';
|
||||||
|
import {MetadataSettingsComponent} from './metadata-settings/metadata-settings.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-settings',
|
selector: 'app-settings',
|
||||||
@@ -16,7 +20,8 @@ import {AsyncPipe, NgIf} from '@angular/common';
|
|||||||
BookPreferences,
|
BookPreferences,
|
||||||
AdminComponent,
|
AdminComponent,
|
||||||
NgIf,
|
NgIf,
|
||||||
AsyncPipe
|
AsyncPipe,
|
||||||
|
MetadataSettingsComponent
|
||||||
],
|
],
|
||||||
templateUrl: './settings.component.html',
|
templateUrl: './settings.component.html',
|
||||||
styleUrl: './settings.component.scss'
|
styleUrl: './settings.component.scss'
|
||||||
|
|||||||
Reference in New Issue
Block a user