feat(metadata): add configurable enabled fields for metadata editor and picker + UI tweaks (#2299)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
+1
@@ -25,6 +25,7 @@ public enum AppSettingKey {
|
||||
UPLOAD_FILE_PATTERN ("upload_file_pattern", false, false, List.of(PermissionType.ADMIN, PermissionType.MANAGE_METADATA_CONFIG)),
|
||||
MOVE_FILE_PATTERN ("move_file_pattern", false, false, List.of(PermissionType.ADMIN, PermissionType.MANAGE_METADATA_CONFIG)),
|
||||
METADATA_DOWNLOAD_ON_BOOKDROP ("metadata_download_on_bookdrop", false, false, List.of(PermissionType.ADMIN, PermissionType.MANAGE_METADATA_CONFIG)),
|
||||
METADATA_PROVIDER_SPECIFIC_FIELDS ("metadata_provider_specific_fields", true, false, List.of(PermissionType.ADMIN, PermissionType.MANAGE_METADATA_CONFIG)),
|
||||
|
||||
// ADMIN + MANAGE_GLOBAL_PREFERENCES
|
||||
COVER_CROPPING_SETTINGS ("cover_cropping_settings", true, false, List.of(PermissionType.ADMIN, PermissionType.MANAGE_GLOBAL_PREFERENCES)),
|
||||
|
||||
+1
@@ -33,4 +33,5 @@ public class AppSettings {
|
||||
private MetadataPublicReviewsSettings metadataPublicReviewsSettings;
|
||||
private KoboSettings koboSettings;
|
||||
private CoverCroppingSettings coverCroppingSettings;
|
||||
private MetadataProviderSpecificFields metadataProviderSpecificFields;
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.adityachandel.booklore.model.dto.settings;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class MetadataProviderSpecificFields {
|
||||
private Boolean asin;
|
||||
private Boolean amazonRating;
|
||||
private Boolean amazonReviewCount;
|
||||
private Boolean googleId;
|
||||
private Boolean goodreadsId;
|
||||
private Boolean goodreadsRating;
|
||||
private Boolean goodreadsReviewCount;
|
||||
private Boolean hardcoverId;
|
||||
private Boolean hardcoverBookId;
|
||||
private Boolean hardcoverRating;
|
||||
private Boolean hardcoverReviewCount;
|
||||
private Boolean comicvineId;
|
||||
private Boolean lubimyczytacId;
|
||||
private Boolean lubimyczytacRating;
|
||||
private Boolean ranobedbId;
|
||||
private Boolean ranobedbRating;
|
||||
}
|
||||
+9
-1
@@ -128,7 +128,15 @@ public class AppSettingService {
|
||||
builder.metadataPublicReviewsSettings(settingPersistenceHelper.getJsonSetting(settingsMap, AppSettingKey.METADATA_PUBLIC_REVIEWS_SETTINGS, MetadataPublicReviewsSettings.class, settingPersistenceHelper.getDefaultMetadataPublicReviewsSettings(), true));
|
||||
builder.koboSettings(settingPersistenceHelper.getJsonSetting(settingsMap, AppSettingKey.KOBO_SETTINGS, KoboSettings.class, settingPersistenceHelper.getDefaultKoboSettings(), true));
|
||||
builder.coverCroppingSettings(settingPersistenceHelper.getJsonSetting(settingsMap, AppSettingKey.COVER_CROPPING_SETTINGS, CoverCroppingSettings.class, settingPersistenceHelper.getDefaultCoverCroppingSettings(), true));
|
||||
|
||||
builder.metadataProviderSpecificFields(
|
||||
settingPersistenceHelper.getJsonSetting(
|
||||
settingsMap,
|
||||
AppSettingKey.METADATA_PROVIDER_SPECIFIC_FIELDS,
|
||||
MetadataProviderSpecificFields.class,
|
||||
settingPersistenceHelper.getDefaultMetadataProviderSpecificFields(),
|
||||
true
|
||||
)
|
||||
);
|
||||
builder.autoBookSearch(Boolean.parseBoolean(settingPersistenceHelper.getOrCreateSetting(AppSettingKey.AUTO_BOOK_SEARCH, "true")));
|
||||
builder.uploadPattern(settingPersistenceHelper.getOrCreateSetting(AppSettingKey.UPLOAD_FILE_PATTERN, "{authors}/<{series}/><{seriesIndex}. >{title}< - {authors}>< ({year})>"));
|
||||
builder.similarBookRecommendation(Boolean.parseBoolean(settingPersistenceHelper.getOrCreateSetting(AppSettingKey.SIMILAR_BOOK_RECOMMENDATION, "true")));
|
||||
|
||||
+21
@@ -301,4 +301,25 @@ public class SettingPersistenceHelper {
|
||||
.smartCroppingEnabled(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
public MetadataProviderSpecificFields getDefaultMetadataProviderSpecificFields() {
|
||||
MetadataProviderSpecificFields fields = new MetadataProviderSpecificFields();
|
||||
fields.setAsin(true);
|
||||
fields.setAmazonRating(true);
|
||||
fields.setAmazonReviewCount(true);
|
||||
fields.setGoogleId(true);
|
||||
fields.setGoodreadsId(true);
|
||||
fields.setGoodreadsRating(true);
|
||||
fields.setGoodreadsReviewCount(true);
|
||||
fields.setHardcoverId(true);
|
||||
fields.setHardcoverBookId(true);
|
||||
fields.setHardcoverRating(true);
|
||||
fields.setHardcoverReviewCount(true);
|
||||
fields.setComicvineId(true);
|
||||
fields.setLubimyczytacId(true);
|
||||
fields.setLubimyczytacRating(true);
|
||||
fields.setRanobedbId(true);
|
||||
fields.setRanobedbRating(true);
|
||||
return fields;
|
||||
}
|
||||
}
|
||||
|
||||
-155
@@ -1,155 +0,0 @@
|
||||
<div class="p-4 w-[54rem]">
|
||||
<p class="mb-4 text-gray-300">
|
||||
This will restore the embedded metadata and cover (if available) from a saved backup for the selected book.
|
||||
</p>
|
||||
|
||||
@if (book) {
|
||||
<div class="mb-4">
|
||||
<p class="font-semibold text-gray-300 pb-2">Book to Restore:</p>
|
||||
<div class="border p-3 rounded space-y-1 custom-table">
|
||||
<div><strong>ID:</strong> {{ book.id }}</div>
|
||||
<div><strong>Current Title:</strong> {{ book.metadata?.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (backupMetadata) {
|
||||
<div class="mb-4">
|
||||
<p class="font-semibold text-gray-300 pb-2">Backup Metadata Preview:</p>
|
||||
<div class="p-6 rounded custom-table text-sm text-gray-400 flex flex-col gap-6">
|
||||
|
||||
<div class="flex">
|
||||
<div class="flex-1 space-y-1">
|
||||
@if (backupMetadata.title) {
|
||||
<div><strong>Title:</strong> {{ backupMetadata.title }}</div>
|
||||
}
|
||||
@if (backupMetadata.subtitle) {
|
||||
<div><strong>Subtitle:</strong> {{ backupMetadata.subtitle }}</div>
|
||||
}
|
||||
@if (backupMetadata.authors!.length) {
|
||||
<div><strong>Authors:</strong> {{ backupMetadata.authors!.join(', ') }}</div>
|
||||
}
|
||||
@if (backupMetadata.publisher) {
|
||||
<div><strong>Publisher:</strong> {{ backupMetadata.publisher }}</div>
|
||||
}
|
||||
@if (backupMetadata.publishedDate) {
|
||||
<div><strong>Published Date:</strong> {{ backupMetadata.publishedDate }}</div>
|
||||
}
|
||||
@if (backupMetadata.seriesName) {
|
||||
<div><strong>Series Name:</strong> {{ backupMetadata.seriesName }}</div>
|
||||
}
|
||||
@if (backupMetadata.seriesNumber !== null) {
|
||||
<div><strong>Series Number:</strong> {{ backupMetadata.seriesNumber }}</div>
|
||||
}
|
||||
@if (backupMetadata.seriesTotal !== null) {
|
||||
<div><strong>Series Total:</strong> {{ backupMetadata.seriesTotal }}</div>
|
||||
}
|
||||
@if (backupMetadata.isbn13) {
|
||||
<div><strong>ISBN-13:</strong> {{ backupMetadata.isbn13 }}</div>
|
||||
}
|
||||
@if (backupMetadata.isbn10) {
|
||||
<div><strong>ISBN-10:</strong> {{ backupMetadata.isbn10 }}</div>
|
||||
}
|
||||
@if (backupMetadata.pageCount !== null) {
|
||||
<div><strong>Page Count:</strong> {{ backupMetadata.pageCount }}</div>
|
||||
}
|
||||
@if (backupMetadata.language) {
|
||||
<div><strong>Language:</strong> {{ backupMetadata.language }}</div>
|
||||
}
|
||||
@if (backupMetadata.asin) {
|
||||
<div><strong>ASIN:</strong> {{ backupMetadata.asin }}</div>
|
||||
}
|
||||
@if (backupMetadata.amazonRating !== null) {
|
||||
<div><strong>Amazon Rating:</strong> {{ backupMetadata.amazonRating }}</div>
|
||||
}
|
||||
@if (backupMetadata.amazonReviewCount !== null) {
|
||||
<div><strong>Amazon Review Count:</strong> {{ backupMetadata.amazonReviewCount }}</div>
|
||||
}
|
||||
@if (backupMetadata.comicvineId) {
|
||||
<div><strong>Comicvine ID:</strong> {{ backupMetadata.comicvineId }}</div>
|
||||
}
|
||||
@if (backupMetadata.goodreadsId) {
|
||||
<div><strong>Goodreads ID:</strong> {{ backupMetadata.goodreadsId }}</div>
|
||||
}
|
||||
@if (backupMetadata.goodreadsRating !== null) {
|
||||
<div><strong>Goodreads Rating:</strong> {{ backupMetadata.goodreadsRating }}</div>
|
||||
}
|
||||
@if (backupMetadata.goodreadsReviewCount !== null) {
|
||||
<div><strong>Goodreads Review Count:</strong> {{ backupMetadata.goodreadsReviewCount }}</div>
|
||||
}
|
||||
@if (backupMetadata.hardcoverId) {
|
||||
<div><strong>Hardcover ID:</strong> {{ backupMetadata.hardcoverId }}</div>
|
||||
}
|
||||
@if (backupMetadata.hardcoverBookId !== null) {
|
||||
<div><strong>Hardcover Book ID:</strong> {{ backupMetadata.hardcoverBookId }}</div>
|
||||
}
|
||||
@if (backupMetadata.hardcoverRating !== null) {
|
||||
<div><strong>Hardcover Rating:</strong> {{ backupMetadata.hardcoverRating }}</div>
|
||||
}
|
||||
@if (backupMetadata.hardcoverReviewCount !== null) {
|
||||
<div><strong>Hardcover Review Count:</strong> {{ backupMetadata.hardcoverReviewCount }}</div>
|
||||
}
|
||||
@if (backupMetadata.ranobedbId) {
|
||||
<div><strong>Ranobedb ID:</strong> {{ backupMetadata.ranobedbId }}</div>
|
||||
}
|
||||
@if (backupMetadata.ranobedbRating !== null) {
|
||||
<div><strong>Ranobedb Rating:</strong> {{ backupMetadata.ranobedbRating }}</div>
|
||||
}
|
||||
@if (backupMetadata.googleId) {
|
||||
<div><strong>Google Books ID:</strong> {{ backupMetadata.googleId }}</div>
|
||||
}
|
||||
@if (backupMetadata.categories && backupMetadata.categories.length) {
|
||||
<div><strong>Categories:</strong> {{ backupMetadata.categories.join(', ') }}</div>
|
||||
}
|
||||
</div>
|
||||
<div class="w-48 flex-shrink-0">
|
||||
<div class="font-semibold text-gray-300 pb-2">Backup Cover Preview:</div>
|
||||
<div class="bg-gray-900 border p-2 rounded flex justify-center">
|
||||
<img
|
||||
[src]="urlHelperService.getBackupCoverUrl(book?.id!)"
|
||||
alt="Backup Cover"
|
||||
class="max-h-80 object-contain rounded shadow"
|
||||
onerror="this.src='assets/images/missing-cover.jpg'"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (backupMetadata.description) {
|
||||
<div class="text-sm text-gray-400">
|
||||
<div class="font-semibold text-gray-300 pb-1">Description:</div>
|
||||
{{ backupMetadata.description }}
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (!backupMetadata) {
|
||||
<div class="mb-4">
|
||||
<div class="p-4 border border-yellow-700 rounded bg-yellow-900 text-yellow-300 text-sm shadow-sm">
|
||||
<p class="font-medium mb-1 text-yellow-200">No backup available</p>
|
||||
<p>We couldn't find a saved backup for this book. Metadata and cover cannot be restored.</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="flex justify-end gap-3 mt-6">
|
||||
<p-button
|
||||
severity="info"
|
||||
outlined
|
||||
label="Cancel"
|
||||
(onClick)="dynamicDialogRef.close()"
|
||||
icon="pi pi-times">
|
||||
</p-button>
|
||||
|
||||
<p-button
|
||||
outlined
|
||||
severity="danger"
|
||||
label="Restore"
|
||||
(onClick)="onRestore()"
|
||||
icon="pi pi-refresh"
|
||||
[disabled]="!backupMetadata">
|
||||
</p-button>
|
||||
</div>
|
||||
</div>
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
.custom-table {
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--card-border);
|
||||
}
|
||||
-67
@@ -1,67 +0,0 @@
|
||||
import {Component, inject, OnInit} from '@angular/core';
|
||||
import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {Button} from 'primeng/button';
|
||||
import {BookService} from '../../../service/book.service';
|
||||
import {Book, BookMetadata} from '../../../model/book.model';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {UrlHelperService} from '../../../../../shared/service/url-helper.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-metadata-restore-dialog-component',
|
||||
standalone: true,
|
||||
imports: [Button],
|
||||
templateUrl: './metadata-restore-dialog-component.html',
|
||||
styleUrl: './metadata-restore-dialog-component.scss'
|
||||
})
|
||||
export class MetadataRestoreDialogComponent implements OnInit {
|
||||
|
||||
bookId!: number;
|
||||
book!: Book | undefined;
|
||||
backupMetadata: BookMetadata | null = null;
|
||||
|
||||
private dynamicDialogConfig = inject(DynamicDialogConfig);
|
||||
protected dynamicDialogRef = inject(DynamicDialogRef);
|
||||
protected bookService = inject(BookService);
|
||||
private messageService = inject(MessageService);
|
||||
protected urlHelperService = inject(UrlHelperService);
|
||||
|
||||
ngOnInit(): void {
|
||||
this.bookId = this.dynamicDialogConfig.data.bookId;
|
||||
this.book = this.bookService.getBookByIdFromState(this.bookId);
|
||||
|
||||
this.bookService.getBackupMetadata(this.bookId).subscribe({
|
||||
next: (data) => {
|
||||
this.backupMetadata = data;
|
||||
},
|
||||
error: err => {
|
||||
this.messageService.add({
|
||||
severity: 'warn',
|
||||
summary: 'No Backup Found',
|
||||
detail: err?.error?.message || 'Backup metadata could not be retrieved.'
|
||||
});
|
||||
this.backupMetadata = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onRestore(): void {
|
||||
this.bookService.restoreMetadata(this.bookId).subscribe({
|
||||
next: () => {
|
||||
this.messageService.add({
|
||||
severity: 'success',
|
||||
summary: 'Restore Successful',
|
||||
detail: `Metadata restored for book ID ${this.bookId}`
|
||||
});
|
||||
this.dynamicDialogRef.close({ action: 'restore', bookId: this.bookId });
|
||||
},
|
||||
error: err => {
|
||||
const errorMessage = err?.error?.message || err?.message || 'Unknown error';
|
||||
this.messageService.add({
|
||||
severity: 'error',
|
||||
summary: 'Restore Failed',
|
||||
detail: `Failed to restore metadata: ${errorMessage}`
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+208
-182
@@ -372,204 +372,230 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="asin">Amazon ASIN</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="asin" formControlName="asin"/>
|
||||
@if (!book.metadata!['asinLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('asin')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['asinLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('asin')" severity="warn"></p-button>
|
||||
}
|
||||
@if (isFieldVisible('asin')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="asin">Amazon ASIN</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="asin" formControlName="asin"/>
|
||||
@if (!book.metadata!['asinLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('asin')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['asinLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('asin')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="amazonRating">Amazon ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="amazonRating" formControlName="amazonRating"/>
|
||||
@if (!book.metadata!['amazonRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['amazonRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('amazonRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="amazonRating">Amazon ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="amazonRating" formControlName="amazonRating"/>
|
||||
@if (!book.metadata!['amazonRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['amazonRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="amazonRatingCount">Amazon #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="amazonRatingCount" formControlName="amazonReviewCount"/>
|
||||
@if (!book.metadata!['amazonReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['amazonReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('amazonReviewCount')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="amazonRatingCount">Amazon #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="amazonRatingCount" formControlName="amazonReviewCount"/>
|
||||
@if (!book.metadata!['amazonReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['amazonReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="googleId">Google Books ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="googleId" formControlName="googleId"/>
|
||||
@if (!book.metadata!['googleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('googleId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['googleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('googleId')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('googleId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="googleId">Google Books ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="googleId" formControlName="googleId"/>
|
||||
@if (!book.metadata!['googleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('googleId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['googleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('googleId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-row metadata-ids-row">
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsId">Goodreads ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsId" formControlName="goodreadsId"/>
|
||||
@if (!book.metadata!['goodreadsIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['goodreadsIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('goodreadsId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsId">Goodreads ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsId" formControlName="goodreadsId"/>
|
||||
@if (!book.metadata!['goodreadsIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['goodreadsIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsRating">Goodreads ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsRating" formControlName="goodreadsRating"/>
|
||||
@if (!book.metadata!['goodreadsRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['goodreadsRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('goodreadsRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsRating">Goodreads ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsRating" formControlName="goodreadsRating"/>
|
||||
@if (!book.metadata!['goodreadsRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['goodreadsRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsReviewCount">Goodreads #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount"/>
|
||||
@if (!book.metadata!['goodreadsReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['goodreadsReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('goodreadsReviewCount')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsReviewCount">Goodreads #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount"/>
|
||||
@if (!book.metadata!['goodreadsReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['goodreadsReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverId">Hardcover ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverId" formControlName="hardcoverId"/>
|
||||
@if (!book.metadata!['hardcoverIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('hardcoverId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverId">Hardcover ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverId" formControlName="hardcoverId"/>
|
||||
@if (!book.metadata!['hardcoverIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverBookId">Hardcover Book ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverBookId" formControlName="hardcoverBookId"/>
|
||||
@if (!book.metadata!['hardcoverBookIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverBookId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverBookIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverBookId')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('hardcoverBookId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverBookId">Hardcover Book ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverBookId" formControlName="hardcoverBookId"/>
|
||||
@if (!book.metadata!['hardcoverBookIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverBookId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverBookIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverBookId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverRating">Hardcover ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverRating" formControlName="hardcoverRating"/>
|
||||
@if (!book.metadata!['hardcoverRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('hardcoverRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverRating">Hardcover ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverRating" formControlName="hardcoverRating"/>
|
||||
@if (!book.metadata!['hardcoverRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverReviewCount">Hardcover #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount"/>
|
||||
@if (!book.metadata!['hardcoverReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('hardcoverReviewCount')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverReviewCount">Hardcover #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount"/>
|
||||
@if (!book.metadata!['hardcoverReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col md:flex-row w-full gap-4 mt-2 pb-1">
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="lubimyczytacId">LC ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="lubimyczytacId" formControlName="lubimyczytacId"/>
|
||||
@if (!book.metadata!['lubimyczytacIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('lubimyczytacId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['lubimyczytacIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('lubimyczytacId')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('lubimyczytacId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="lubimyczytacId">Lubimyczytac ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="lubimyczytacId" formControlName="lubimyczytacId"/>
|
||||
@if (!book.metadata!['lubimyczytacIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('lubimyczytacId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['lubimyczytacIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('lubimyczytacId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="lubimyczytacRating">LC ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="lubimyczytacRating" formControlName="lubimyczytacRating"/>
|
||||
@if (!book.metadata!['lubimyczytacRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('lubimyczytacRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['lubimyczytacRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('lubimyczytacRating')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('lubimyczytacRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="lubimyczytacRating">Lubimyczytac ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="lubimyczytacRating" formControlName="lubimyczytacRating"/>
|
||||
@if (!book.metadata!['lubimyczytacRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('lubimyczytacRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['lubimyczytacRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('lubimyczytacRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="comicvineId">Comicvine ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="comicvineId" formControlName="comicvineId"/>
|
||||
@if (!book.metadata!['comicvineIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('comicvineId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['comicvineIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('comicvineId')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('comicvineId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="comicvineId">Comicvine ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="comicvineId" formControlName="comicvineId"/>
|
||||
@if (!book.metadata!['comicvineIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('comicvineId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['comicvineIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('comicvineId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 md:w-1/6">
|
||||
<label class="text-sm" for="ranobedbId">Ranobedb ID</label>
|
||||
<div class="flex withbutton">
|
||||
<input pSize="small" pInputText id="ranobedbId" formControlName="ranobedbId" class="w-full"/>
|
||||
@if (!book.metadata!['ranobedbIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('ranobedbId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['ranobedbIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('ranobedbId')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('ranobedbId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="ranobedbId">Ranobedb ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="ranobedbId" formControlName="ranobedbId"/>
|
||||
@if (!book.metadata!['ranobedbIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('ranobedbId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['ranobedbIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('ranobedbId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 md:w-1/6">
|
||||
<label class="text-sm" for="ranobedbRating">Ranobedb ★</label>
|
||||
<div class="flex withbutton">
|
||||
<input pSize="small" pInputText id="ranobedbRating" formControlName="ranobedbRating" class="w-full"/>
|
||||
@if (!book.metadata!['ranobedbRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('ranobedbRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['ranobedbRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('ranobedbRating')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
@if (isFieldVisible('ranobedbRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="ranobedbRating">Ranobedb ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="ranobedbRating" formControlName="ranobedbRating"/>
|
||||
@if (!book.metadata!['ranobedbRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('ranobedbRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['ranobedbRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('ranobedbRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="description-section">
|
||||
|
||||
+8
-5
@@ -238,16 +238,19 @@ label {
|
||||
}
|
||||
|
||||
.metadata-ids-row {
|
||||
@media (min-width: 768px) {
|
||||
.field-group {
|
||||
width: calc(100% / 6);
|
||||
}
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 1rem;
|
||||
width: 100%;
|
||||
|
||||
.metadata-id-field {
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.metadata-id-field {
|
||||
@media (min-width: 768px) {
|
||||
width: calc(100% / 6);
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+38
-3
@@ -27,6 +27,8 @@ import {BookNavigationService} from '../../../../book/service/book-navigation.se
|
||||
import {BookMetadataHostService} from '../../../../../shared/service/book-metadata-host.service';
|
||||
import {Router} from '@angular/router';
|
||||
import {UserService} from '../../../../settings/user-management/user.service';
|
||||
import {AppSettingsService} from '../../../../../shared/service/app-settings.service';
|
||||
import {MetadataProviderSpecificFields} from '../../../../../shared/model/app-settings.model';
|
||||
|
||||
@Component({
|
||||
selector: "app-metadata-editor",
|
||||
@@ -70,6 +72,7 @@ export class MetadataEditorComponent implements OnInit {
|
||||
private router = inject(Router);
|
||||
private userService = inject(UserService);
|
||||
private destroyRef = inject(DestroyRef);
|
||||
private appSettingsService = inject(AppSettingsService);
|
||||
|
||||
metadataForm: FormGroup;
|
||||
currentBookId!: number;
|
||||
@@ -98,6 +101,25 @@ export class MetadataEditorComponent implements OnInit {
|
||||
filteredSeries: string[] = [];
|
||||
private metadataCenterViewMode: 'route' | 'dialog' = 'route';
|
||||
|
||||
providerSpecificFields: MetadataProviderSpecificFields = {
|
||||
asin: true,
|
||||
amazonRating: true,
|
||||
amazonReviewCount: true,
|
||||
googleId: true,
|
||||
goodreadsId: true,
|
||||
goodreadsRating: true,
|
||||
goodreadsReviewCount: true,
|
||||
hardcoverId: true,
|
||||
hardcoverBookId: true,
|
||||
hardcoverRating: true,
|
||||
hardcoverReviewCount: true,
|
||||
comicvineId: true,
|
||||
lubimyczytacId: true,
|
||||
lubimyczytacRating: true,
|
||||
ranobedbId: true,
|
||||
ranobedbRating: true,
|
||||
};
|
||||
|
||||
navigationState$ = this.bookNavigationService.getNavigationState();
|
||||
|
||||
filterCategories(event: { query: string }) {
|
||||
@@ -239,6 +261,17 @@ export class MetadataEditorComponent implements OnInit {
|
||||
this.metadataCenterViewMode = userState.user?.userSettings.metadataCenterViewMode ?? 'route';
|
||||
this.autoSaveEnabled = userState.user?.userSettings.autoSaveMetadata ?? false;
|
||||
});
|
||||
|
||||
this.appSettingsService.appSettings$
|
||||
.pipe(
|
||||
filter(settings => !!settings),
|
||||
takeUntilDestroyed(this.destroyRef)
|
||||
)
|
||||
.subscribe(settings => {
|
||||
if (settings?.metadataProviderSpecificFields) {
|
||||
this.providerSpecificFields = settings.metadataProviderSpecificFields;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private prepareAutoComplete(): void {
|
||||
@@ -493,9 +526,7 @@ export class MetadataEditorComponent implements OnInit {
|
||||
this.updateMetadata(false);
|
||||
}
|
||||
|
||||
private buildMetadataWrapper(
|
||||
shouldLockAllFields?: boolean
|
||||
): MetadataUpdateWrapper {
|
||||
private buildMetadataWrapper(shouldLockAllFields?: boolean): MetadataUpdateWrapper {
|
||||
const form = this.metadataForm;
|
||||
|
||||
const metadata: BookMetadata = {
|
||||
@@ -839,5 +870,9 @@ export class MetadataEditorComponent implements OnInit {
|
||||
return position ? `${position.current} of ${position.total}` : '';
|
||||
}
|
||||
|
||||
isFieldVisible(field: keyof MetadataProviderSpecificFields): boolean {
|
||||
return this.providerSpecificFields[field] ?? false;
|
||||
}
|
||||
|
||||
protected readonly sample = sample;
|
||||
}
|
||||
|
||||
+23
-23
@@ -1,23 +1,23 @@
|
||||
@if (book$ | async; as book) {
|
||||
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="flex flex-col h-full w-full">
|
||||
<div class="flex-grow overflow-auto p-0 md:p-4">
|
||||
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
||||
<p class="ml-3 text-lg">Current Metadata</p>
|
||||
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="form-container">
|
||||
<div class="form-content">
|
||||
<div class="metadata-header">
|
||||
<p class="metadata-header-text">Current Metadata</p>
|
||||
<p-button
|
||||
severity="success"
|
||||
severity="info"
|
||||
icon='pi pi-angle-left'
|
||||
[ngStyle]="{'padding-left': '3rem', 'padding-right': '0.5rem'}"
|
||||
class="button-left"
|
||||
[outlined]="true"
|
||||
pTooltip="Move all missing fields" tooltipPosition="bottom"
|
||||
(onClick)="copyMissing()"></p-button>
|
||||
<p-button
|
||||
severity="success"
|
||||
severity="info"
|
||||
icon='pi pi-angle-double-left'
|
||||
[ngStyle]="{'padding-left': '0.5rem', 'padding-right': '2rem'}"
|
||||
class="button-double-left"
|
||||
[outlined]="true"
|
||||
pTooltip="Move all fields" tooltipPosition="bottom"
|
||||
(onClick)="copyAll()"></p-button>
|
||||
<p class="text-lg">Fetched Metadata</p>
|
||||
<p class="metadata-header-text">Fetched Metadata</p>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label class="label"></label>
|
||||
@@ -103,9 +103,9 @@
|
||||
@if (metadataForm.get(field.lockedKey)?.value) {
|
||||
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
||||
}
|
||||
<div class="w-full px-4">
|
||||
<div class="autocomplete-container">
|
||||
<p-autoComplete
|
||||
class="w-full"
|
||||
class="autocomplete-full-width"
|
||||
formControlName="{{field.controlName}}"
|
||||
[multiple]="true"
|
||||
[dropdown]="false"
|
||||
@@ -131,12 +131,12 @@
|
||||
(mouseenter)="onMouseEnter(field.controlName)"
|
||||
(mouseleave)="onMouseLeave(field.controlName)"/>
|
||||
|
||||
<div class="w-full px-4">
|
||||
<div class="autocomplete-container">
|
||||
<p-autoComplete
|
||||
[ngModel]="fetchedMetadata[field.fetchedKey] ?? []"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
[disabled]="true"
|
||||
[multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" class="w-full">
|
||||
[multiple]="true" [typeahead]="false" [dropdown]="false" [forceSelection]="false" class="autocomplete-full-width">
|
||||
</p-autoComplete>
|
||||
</div>
|
||||
</div>
|
||||
@@ -198,33 +198,33 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
||||
<p class="ml-3 text-lg">Current Metadata</p>
|
||||
<div class="metadata-header">
|
||||
<p class="metadata-header-text">Current Metadata</p>
|
||||
<p-button
|
||||
severity="success"
|
||||
severity="info"
|
||||
icon='pi pi-angle-left'
|
||||
[ngStyle]="{'padding-left': '3rem', 'padding-right': '0.5rem'}"
|
||||
class="button-left"
|
||||
[outlined]="true"
|
||||
pTooltip="Move all missing fields" tooltipPosition="bottom"
|
||||
(onClick)="copyMissing()"></p-button>
|
||||
<p-button
|
||||
severity="success"
|
||||
severity="info"
|
||||
icon='pi pi-angle-double-left'
|
||||
[ngStyle]="{'padding-left': '0.5rem', 'padding-right': '2rem'}"
|
||||
class="button-double-left"
|
||||
[outlined]="true"
|
||||
pTooltip="Move all fields" tooltipPosition="bottom"
|
||||
(onClick)="copyAll()"></p-button>
|
||||
<p class="text-lg">Fetched Metadata</p>
|
||||
<p class="metadata-header-text">Fetched Metadata</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (!reviewMode) {
|
||||
<div class="mt-auto">
|
||||
<div class="form-footer">
|
||||
<p-divider></p-divider>
|
||||
<div class="flex justify-between px-2 pt-4">
|
||||
<div class="footer-buttons">
|
||||
<p-button label="To Metadata List" icon="pi pi-arrow-left" severity="info" (onClick)="goBackClick()"></p-button>
|
||||
<div class="flex gap-x-4 justify-end">
|
||||
<div class="footer-buttons-right">
|
||||
<p-button label="Unlock All" icon="pi pi-lock-open" [outlined]="true" severity="success" (onClick)="unlockAll()"></p-button>
|
||||
<p-button label="Lock All" icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()"></p-button>
|
||||
<p-divider layout="vertical"/>
|
||||
|
||||
+76
-3
@@ -1,3 +1,45 @@
|
||||
.form-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
animation: fadeIn 0.3s ease-in;
|
||||
}
|
||||
|
||||
.form-content {
|
||||
flex-grow: 1;
|
||||
overflow: auto;
|
||||
padding: 0;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
padding: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.metadata-header {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding-bottom: 0.75rem;
|
||||
padding-left: 9.25rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.metadata-header-text {
|
||||
margin-left: 0.75rem;
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
|
||||
.button-left {
|
||||
padding-left: 3rem;
|
||||
padding-right: 0.5rem;
|
||||
}
|
||||
|
||||
.button-double-left {
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 2rem;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -7,7 +49,7 @@
|
||||
}
|
||||
|
||||
.label {
|
||||
width: 7rem;
|
||||
width: 8rem;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@@ -25,6 +67,16 @@
|
||||
margin: 0 1rem;
|
||||
}
|
||||
|
||||
.autocomplete-container {
|
||||
width: 100%;
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
.autocomplete-full-width {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.thumbnail {
|
||||
width: 15.625rem;
|
||||
height: 21.875rem;
|
||||
@@ -54,10 +106,31 @@
|
||||
--p-button-outlined-primary-color: #E32636;
|
||||
}
|
||||
|
||||
.form-footer {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.footer-buttons {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 1rem 0.5rem 0;
|
||||
}
|
||||
|
||||
.footer-buttons-right {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
::ng-deep .p-inputchips {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.flex.flex-col.h-full.w-full {
|
||||
animation: fadeIn 0.3s ease-in;
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
+63
-22
@@ -4,7 +4,7 @@ import {MessageService} from 'primeng/api';
|
||||
import {Button} from 'primeng/button';
|
||||
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
import {InputText} from 'primeng/inputtext';
|
||||
import {AsyncPipe, NgClass, NgStyle} from '@angular/common';
|
||||
import {AsyncPipe, NgClass} from '@angular/common';
|
||||
import {Divider} from 'primeng/divider';
|
||||
import {Observable} from 'rxjs';
|
||||
import {Tooltip} from 'primeng/tooltip';
|
||||
@@ -13,10 +13,11 @@ import {BookService} from '../../../../book/service/book.service';
|
||||
import {Textarea} from 'primeng/textarea';
|
||||
import {filter, map, take} from 'rxjs/operators';
|
||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||
import {AutoComplete} from 'primeng/autocomplete';
|
||||
import {AutoCompleteSelectEvent} from 'primeng/autocomplete';
|
||||
import {AutoComplete, AutoCompleteSelectEvent} from 'primeng/autocomplete';
|
||||
import {Image} from 'primeng/image';
|
||||
import {LazyLoadImageModule} from 'ng-lazyload-image';
|
||||
import {AppSettingsService} from '../../../../../shared/service/app-settings.service';
|
||||
import {MetadataProviderSpecificFields} from '../../../../../shared/model/app-settings.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-metadata-picker',
|
||||
@@ -30,7 +31,6 @@ import {LazyLoadImageModule} from 'ng-lazyload-image';
|
||||
Divider,
|
||||
ReactiveFormsModule,
|
||||
NgClass,
|
||||
NgStyle,
|
||||
Tooltip,
|
||||
AsyncPipe,
|
||||
Textarea,
|
||||
@@ -66,23 +66,23 @@ export class MetadataPickerComponent implements OnInit {
|
||||
{label: 'Language', controlName: 'language', lockedKey: 'languageLocked', fetchedKey: 'language'},
|
||||
{label: 'ISBN-10', controlName: 'isbn10', lockedKey: 'isbn10Locked', fetchedKey: 'isbn10'},
|
||||
{label: 'ISBN-13', controlName: 'isbn13', lockedKey: 'isbn13Locked', fetchedKey: 'isbn13'},
|
||||
{label: 'ASIN', controlName: 'asin', lockedKey: 'asinLocked', fetchedKey: 'asin'},
|
||||
{label: 'Amz Reviews', controlName: 'amazonReviewCount', lockedKey: 'amazonReviewCountLocked', fetchedKey: 'amazonReviewCount'},
|
||||
{label: 'Amz Rating', controlName: 'amazonRating', lockedKey: 'amazonRatingLocked', fetchedKey: 'amazonRating'},
|
||||
{label: 'Comicvine ID', controlName: 'comicvineId', lockedKey: 'comicvineIdLocked', fetchedKey: 'comicvineId'},
|
||||
{label: 'Goodreads ID', controlName: 'goodreadsId', lockedKey: 'goodreadsIdLocked', fetchedKey: 'goodreadsId'},
|
||||
{label: 'GR Reviews', controlName: 'goodreadsReviewCount', lockedKey: 'goodreadsReviewCountLocked', fetchedKey: 'goodreadsReviewCount'},
|
||||
{label: 'GR Rating', controlName: 'goodreadsRating', lockedKey: 'goodreadsRatingLocked', fetchedKey: 'goodreadsRating'},
|
||||
{label: 'Hardcover ID', controlName: 'hardcoverId', lockedKey: 'hardcoverIdLocked', fetchedKey: 'hardcoverId'},
|
||||
{label: 'Hardcover Book ID', controlName: 'hardcoverBookId', lockedKey: 'hardcoverBookIdLocked', fetchedKey: 'hardcoverBookId'},
|
||||
{label: 'HC Reviews', controlName: 'hardcoverReviewCount', lockedKey: 'hardcoverReviewCountLocked', fetchedKey: 'hardcoverReviewCount'},
|
||||
{label: 'HC Rating', controlName: 'hardcoverRating', lockedKey: 'hardcoverRatingLocked', fetchedKey: 'hardcoverRating'},
|
||||
{label: 'LC ID', controlName: 'lubimyczytacId', lockedKey: 'lubimyczytacIdLocked', fetchedKey: 'lubimyczytacId'},
|
||||
{label: 'LC Rating', controlName: 'lubimyczytacRating', lockedKey: 'lubimyczytacRatingLocked', fetchedKey: 'lubimyczytacRating'},
|
||||
{label: 'Ranobedb ID', controlName: 'ranobedbId', lockedKey: 'ranobedbIdLocked', fetchedKey: 'ranobedbId'},
|
||||
{label: 'RD Rating', controlName: 'ranobedbRating', lockedKey: 'ranobedbRatingLocked', fetchedKey: 'ranobedbRating'},
|
||||
{label: 'Pages', controlName: 'pageCount', lockedKey: 'pageCountLocked', fetchedKey: 'pageCount'},
|
||||
{label: 'Google ID', controlName: 'googleId', lockedKey: 'googleIdLocked', fetchedKey: 'googleId'},
|
||||
{label: 'Pages', controlName: 'pageCount', lockedKey: 'pageCountLocked', fetchedKey: 'pageCount'}
|
||||
{label: 'ASIN', controlName: 'asin', lockedKey: 'asinLocked', fetchedKey: 'asin'},
|
||||
{label: 'Amazon #', controlName: 'amazonReviewCount', lockedKey: 'amazonReviewCountLocked', fetchedKey: 'amazonReviewCount'},
|
||||
{label: 'Amazon ★', controlName: 'amazonRating', lockedKey: 'amazonRatingLocked', fetchedKey: 'amazonRating'},
|
||||
{label: 'Goodreads ID', controlName: 'goodreadsId', lockedKey: 'goodreadsIdLocked', fetchedKey: 'goodreadsId'},
|
||||
{label: 'Goodreads ★', controlName: 'goodreadsReviewCount', lockedKey: 'goodreadsReviewCountLocked', fetchedKey: 'goodreadsReviewCount'},
|
||||
{label: 'Goodreads #', controlName: 'goodreadsRating', lockedKey: 'goodreadsRatingLocked', fetchedKey: 'goodreadsRating'},
|
||||
{label: 'HC Book ID', controlName: 'hardcoverBookId', lockedKey: 'hardcoverBookIdLocked', fetchedKey: 'hardcoverBookId'},
|
||||
{label: 'Hardcover ID', controlName: 'hardcoverId', lockedKey: 'hardcoverIdLocked', fetchedKey: 'hardcoverId'},
|
||||
{label: 'Hardcover #', controlName: 'hardcoverReviewCount', lockedKey: 'hardcoverReviewCountLocked', fetchedKey: 'hardcoverReviewCount'},
|
||||
{label: 'Hardcover ★', controlName: 'hardcoverRating', lockedKey: 'hardcoverRatingLocked', fetchedKey: 'hardcoverRating'},
|
||||
{label: 'Comicvine ID', controlName: 'comicvineId', lockedKey: 'comicvineIdLocked', fetchedKey: 'comicvineId'},
|
||||
{label: 'LB ID', controlName: 'lubimyczytacId', lockedKey: 'lubimyczytacIdLocked', fetchedKey: 'lubimyczytacId'},
|
||||
{label: 'LB ★', controlName: 'lubimyczytacRating', lockedKey: 'lubimyczytacRatingLocked', fetchedKey: 'lubimyczytacRating'},
|
||||
{label: 'Ranobedb ID', controlName: 'ranobedbId', lockedKey: 'ranobedbIdLocked', fetchedKey: 'ranobedbId'},
|
||||
{label: 'Ranobedb ★', controlName: 'ranobedbRating', lockedKey: 'ranobedbRatingLocked', fetchedKey: 'ranobedbRating'}
|
||||
];
|
||||
|
||||
@Input() reviewMode!: boolean;
|
||||
@@ -131,6 +131,9 @@ export class MetadataPickerComponent implements OnInit {
|
||||
private bookService = inject(BookService);
|
||||
protected urlHelper = inject(UrlHelperService);
|
||||
private destroyRef = inject(DestroyRef);
|
||||
private appSettingsService = inject(AppSettingsService);
|
||||
|
||||
private enabledProviderFields: MetadataProviderSpecificFields | null = null;
|
||||
|
||||
constructor() {
|
||||
this.metadataForm = new FormGroup({
|
||||
@@ -205,6 +208,17 @@ export class MetadataPickerComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.appSettingsService.appSettings$
|
||||
.pipe(
|
||||
filter(settings => !!settings?.metadataProviderSpecificFields),
|
||||
take(1)
|
||||
)
|
||||
.subscribe(settings => {
|
||||
if (settings?.metadataProviderSpecificFields) {
|
||||
this.enabledProviderFields = settings.metadataProviderSpecificFields;
|
||||
this.filterMetadataFields();
|
||||
}
|
||||
});
|
||||
|
||||
this.bookService.bookState$
|
||||
.pipe(
|
||||
@@ -318,7 +332,6 @@ export class MetadataPickerComponent implements OnInit {
|
||||
coverLocked: metadata.coverLocked || false,
|
||||
});
|
||||
|
||||
// Always enable all fields before applying locked state
|
||||
Object.keys(this.metadataForm.controls).forEach((key) => {
|
||||
if (!key.endsWith('Locked')) {
|
||||
this.metadataForm.get(key)?.enable({emitEvent: false});
|
||||
@@ -362,6 +375,34 @@ export class MetadataPickerComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
private filterMetadataFields(): void {
|
||||
if (!this.enabledProviderFields) return;
|
||||
|
||||
const providerFieldMap: Record<string, keyof MetadataProviderSpecificFields> = {
|
||||
'asin': 'asin',
|
||||
'amazonRating': 'amazonRating',
|
||||
'amazonReviewCount': 'amazonReviewCount',
|
||||
'googleId': 'googleId',
|
||||
'goodreadsId': 'goodreadsId',
|
||||
'goodreadsRating': 'goodreadsRating',
|
||||
'goodreadsReviewCount': 'goodreadsReviewCount',
|
||||
'hardcoverId': 'hardcoverId',
|
||||
'hardcoverBookId': 'hardcoverId',
|
||||
'hardcoverRating': 'hardcoverRating',
|
||||
'hardcoverReviewCount': 'hardcoverReviewCount',
|
||||
'comicvineId': 'comicvineId',
|
||||
'lubimyczytacId': 'lubimyczytacId',
|
||||
'lubimyczytacRating': 'lubimyczytacRating',
|
||||
'ranobedbId': 'ranobedbId',
|
||||
'ranobedbRating': 'ranobedbRating'
|
||||
};
|
||||
|
||||
this.metadataFieldsBottom = this.metadataFieldsBottom.filter(field => {
|
||||
const providerKey = providerFieldMap[field.controlName];
|
||||
return !providerKey || this.enabledProviderFields![providerKey];
|
||||
});
|
||||
}
|
||||
|
||||
onAutoCompleteSelect(fieldName: string, event: AutoCompleteSelectEvent) {
|
||||
const values = (this.metadataForm.get(fieldName)?.value as string[]) || [];
|
||||
if (!values.includes(event.value as string)) {
|
||||
@@ -387,7 +428,7 @@ export class MetadataPickerComponent implements OnInit {
|
||||
onSave(): void {
|
||||
this.isSaving = true;
|
||||
const updatedBookMetadata = this.buildMetadataWrapper(undefined);
|
||||
this.bookService.updateBookMetadata(this.currentBookId, updatedBookMetadata, true).subscribe({
|
||||
this.bookService.updateBookMetadata(this.currentBookId, updatedBookMetadata, false).subscribe({
|
||||
next: (bookMetadata) => {
|
||||
this.isSaving = false;
|
||||
Object.keys(this.copiedFields).forEach((field) => {
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@
|
||||
[options]="providers"
|
||||
formControlName="provider"
|
||||
placeholder="Select providers"
|
||||
[styleClass]="'custom-multiselect'">
|
||||
class="'custom-multiselect'">
|
||||
</p-multiselect>
|
||||
</div>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
type="submit"
|
||||
[disabled]="!isSearchEnabled || loading"
|
||||
icon="pi pi-search"
|
||||
[styleClass]="'custom-search-button'">
|
||||
class="'custom-search-button'">
|
||||
</p-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+18
-5
@@ -74,6 +74,23 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.subscription.add(
|
||||
this.appSettings$
|
||||
.pipe(filter(settings => !!settings))
|
||||
.subscribe(settings => {
|
||||
const providerSettings = settings!.metadataProviderSettings ?? {};
|
||||
this.providers = Object.entries(providerSettings)
|
||||
.filter(([_, value]) => !!value && typeof value === 'object' && 'enabled' in value && (value as any).enabled)
|
||||
.map(([key]) => key.charAt(0).toUpperCase() + key.slice(1));
|
||||
|
||||
const currentProviders = this.form.get('provider')?.value || [];
|
||||
const validProviders = currentProviders.filter((p: string) => this.providers.includes(p));
|
||||
if (validProviders.length !== currentProviders.length) {
|
||||
this.form.patchValue({provider: validProviders.length > 0 ? validProviders : null});
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
this.subscription.add(
|
||||
this.route.paramMap
|
||||
.pipe(
|
||||
@@ -94,11 +111,6 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
distinctUntilChanged(([prevBook], [currBook]) => prevBook?.id === currBook?.id)
|
||||
)
|
||||
.subscribe(([book, settings]) => {
|
||||
const providerSettings = settings?.metadataProviderSettings ?? {};
|
||||
this.providers = Object.entries(providerSettings)
|
||||
.filter(([_, value]) => !!value && typeof value === 'object' && 'enabled' in value && (value as any).enabled)
|
||||
.map(([key]) => key.charAt(0).toUpperCase() + key.slice(1));
|
||||
|
||||
this.resetFormFromBook(book!);
|
||||
|
||||
if (settings!.autoBookSearch) {
|
||||
@@ -127,6 +139,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.cancelRequest$.next();
|
||||
this.cancelRequest$.complete();
|
||||
this.subscription.unsubscribe();
|
||||
this.selectedFetchedMetadata$.complete();
|
||||
}
|
||||
|
||||
+37
-12
@@ -25,17 +25,23 @@ export class MetadataAdvancedFetchOptionsComponent implements OnChanges {
|
||||
'title', 'subtitle', 'description', 'authors', 'publisher', 'publishedDate',
|
||||
'seriesName', 'seriesNumber', 'seriesTotal', 'isbn13', 'isbn10',
|
||||
'language', 'categories', 'cover', 'pageCount',
|
||||
'asin', 'goodreadsId', 'comicvineId', 'hardcoverId', 'googleId', 'lubimyczytacId', 'ranobedbId',
|
||||
'amazonRating', 'amazonReviewCount', 'goodreadsRating', 'goodreadsReviewCount',
|
||||
'hardcoverRating', 'hardcoverReviewCount', 'lubimyczytacRating', 'ranobedbRating',
|
||||
'moods', 'tags'
|
||||
'asin', 'amazonRating', 'amazonReviewCount',
|
||||
'googleId',
|
||||
'goodreadsId', 'goodreadsRating', 'goodreadsReviewCount',
|
||||
'hardcoverId', 'hardcoverRating', 'hardcoverReviewCount', 'moods', 'tags',
|
||||
'comicvineId',
|
||||
'lubimyczytacId', 'lubimyczytacRating',
|
||||
'ranobedbId', 'ranobedbRating'
|
||||
];
|
||||
|
||||
providerSpecificFields: (keyof FieldOptions)[] = [
|
||||
'asin', 'goodreadsId', 'comicvineId', 'hardcoverId', 'googleId', 'lubimyczytacId', 'ranobedbId',
|
||||
'amazonRating', 'amazonReviewCount', 'goodreadsRating', 'goodreadsReviewCount',
|
||||
'hardcoverRating', 'hardcoverReviewCount', 'lubimyczytacRating', 'ranobedbRating',
|
||||
'moods', 'tags'
|
||||
'asin', 'amazonRating', 'amazonReviewCount',
|
||||
'googleId',
|
||||
'goodreadsId', 'goodreadsRating', 'goodreadsReviewCount',
|
||||
'hardcoverId', 'hardcoverRating', 'hardcoverReviewCount', 'moods', 'tags',
|
||||
'comicvineId',
|
||||
'lubimyczytacId', 'lubimyczytacRating',
|
||||
'ranobedbId', 'ranobedbRating',
|
||||
];
|
||||
|
||||
nonProviderSpecificFields: (keyof FieldOptions)[] = [
|
||||
@@ -64,9 +70,28 @@ export class MetadataAdvancedFetchOptionsComponent implements OnChanges {
|
||||
private justSubmitted = false;
|
||||
|
||||
private providerSpecificFieldsList = [
|
||||
'asin', 'goodreadsId','comicvineId', 'hardcoverId', 'googleId', 'lubimyczytacId', 'ranobedbId',
|
||||
'amazonRating', 'amazonReviewCount', 'goodreadsRating', 'goodreadsReviewCount',
|
||||
'hardcoverRating', 'hardcoverReviewCount', 'lubimyczytacRating', 'ranobedbRating',
|
||||
// Amazon
|
||||
'asin', 'amazonRating', 'amazonReviewCount',
|
||||
|
||||
// Google
|
||||
'googleId',
|
||||
|
||||
// Goodreads
|
||||
'goodreadsId', 'goodreadsRating', 'goodreadsReviewCount',
|
||||
|
||||
// Hardcover
|
||||
'hardcoverId', 'hardcoverRating', 'hardcoverReviewCount',
|
||||
|
||||
// Comicvine
|
||||
'comicvineId',
|
||||
|
||||
// Lubimyczytac
|
||||
'lubimyczytacId', 'lubimyczytacRating',
|
||||
|
||||
// Ranobedb
|
||||
'ranobedbId', 'ranobedbRating',
|
||||
|
||||
// Generic provider-specific
|
||||
'moods', 'tags'
|
||||
];
|
||||
|
||||
@@ -231,7 +256,7 @@ export class MetadataAdvancedFetchOptionsComponent implements OnChanges {
|
||||
'goodreadsReviewCount': 'Goodreads Review Count',
|
||||
'hardcoverRating': 'Hardcover Rating',
|
||||
'hardcoverReviewCount': 'Hardcover Review Count',
|
||||
'lubimyczytacId': 'LC ID',
|
||||
'lubimyczytacId': 'Lubimyczytac ID',
|
||||
'lubimyczytacRating': 'Lubimyczytac Rating',
|
||||
'ranobedbId': 'Ranobedb ID',
|
||||
'ranobedbRating': 'Ranobedb Rating',
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
<div class="settings-card">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-list"></i>
|
||||
Enabled Fields in Metadata Editor & Picker
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Select which metadata fields to display when editing book information or picking metadata from providers. Disabled fields will be hidden from the interface.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="section-body">
|
||||
<div class="preferences-section">
|
||||
<div class="provider-groups-container">
|
||||
@for (group of providerGroups; track group.label) {
|
||||
<div class="provider-group">
|
||||
<div class="group-header">
|
||||
<span class="group-icon pi pi-database"></span>
|
||||
<h4 class="group-label">{{ group.label }}</h4>
|
||||
</div>
|
||||
<div class="field-list">
|
||||
@for (field of group.fields; track field) {
|
||||
<div class="field-checkbox">
|
||||
<p-toggleswitch
|
||||
[inputId]="field"
|
||||
[ngModel]="selectedFields.includes(field)"
|
||||
(ngModelChange)="toggleField(field, $event)">
|
||||
</p-toggleswitch>
|
||||
<label [for]="field">{{ fieldLabels[field] || field }}</label>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 2rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: var(--card-border);
|
||||
border-bottom-color: var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--primary-color);
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-description {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
color: var(--p-text-muted-color);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.provider-groups-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
|
||||
gap: 1rem;
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
.provider-group {
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 0.875rem;
|
||||
transition: all 0.2s ease;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
&:hover {
|
||||
border-color: color-mix(in srgb, var(--primary-color) 40%, var(--p-content-border-color) 60%);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.group-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 0.75rem;
|
||||
padding-bottom: 0.625rem;
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
|
||||
.group-icon {
|
||||
color: var(--primary-color);
|
||||
font-size: 0.9375rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.group-label {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
}
|
||||
|
||||
.field-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.field-checkbox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.625rem;
|
||||
padding: 0.2rem 0.5rem;
|
||||
border-radius: 5px;
|
||||
transition: background-color 0.15s ease;
|
||||
|
||||
&:hover {
|
||||
background: color-mix(in srgb, var(--p-surface-800) 70%, transparent 30%);
|
||||
}
|
||||
|
||||
label {
|
||||
cursor: pointer;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 400;
|
||||
user-select: none;
|
||||
color: var(--text-color);
|
||||
margin-bottom: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.375rem 0.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-body {
|
||||
|
||||
> .setting-item {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
gap: 0.875rem;
|
||||
}
|
||||
}
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
import {Component, inject, Input, OnInit} from '@angular/core';
|
||||
import {ToggleSwitchModule} from 'primeng/toggleswitch';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {AppSettingsService} from '../../../../shared/service/app-settings.service';
|
||||
import {AppSettingKey, MetadataProviderSpecificFields} from '../../../../shared/model/app-settings.model';
|
||||
import {filter, take} from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'app-metadata-provider-field-selector',
|
||||
standalone: true,
|
||||
imports: [ToggleSwitchModule, FormsModule],
|
||||
templateUrl: './metadata-provider-field-selector.component.html',
|
||||
styleUrl: './metadata-provider-field-selector.component.scss'
|
||||
})
|
||||
export class MetadataProviderFieldSelectorComponent implements OnInit {
|
||||
@Input() selectedFields: string[] = [];
|
||||
|
||||
private appSettingsService = inject(AppSettingsService);
|
||||
|
||||
providerGroups: { label: string, fields: string[] }[] = [
|
||||
{
|
||||
label: 'Amazon',
|
||||
fields: ['asin', 'amazonRating', 'amazonReviewCount']
|
||||
},
|
||||
{
|
||||
label: 'Google Books',
|
||||
fields: ['googleId']
|
||||
},
|
||||
{
|
||||
label: 'Goodreads',
|
||||
fields: ['goodreadsId', 'goodreadsRating', 'goodreadsReviewCount']
|
||||
},
|
||||
{
|
||||
label: 'Hardcover',
|
||||
fields: ['hardcoverId', 'hardcoverBookId', 'hardcoverRating', 'hardcoverReviewCount']
|
||||
},
|
||||
{
|
||||
label: 'Comicvine',
|
||||
fields: ['comicvineId']
|
||||
},
|
||||
{
|
||||
label: 'Lubimyczytac',
|
||||
fields: ['lubimyczytacId', 'lubimyczytacRating']
|
||||
},
|
||||
{
|
||||
label: 'Ranobedb',
|
||||
fields: ['ranobedbId', 'ranobedbRating']
|
||||
}
|
||||
];
|
||||
|
||||
fieldLabels: Record<string, string> = {
|
||||
'asin': 'Amazon ASIN',
|
||||
'amazonRating': 'Amazon Rating',
|
||||
'amazonReviewCount': 'Amazon Review Count',
|
||||
'googleId': 'Google Books ID',
|
||||
'goodreadsId': 'Goodreads ID',
|
||||
'goodreadsRating': 'Goodreads Rating',
|
||||
'goodreadsReviewCount': 'Goodreads Review Count',
|
||||
'hardcoverId': 'Hardcover ID',
|
||||
'hardcoverBookId': 'Hardcover Book ID',
|
||||
'hardcoverRating': 'Hardcover Rating',
|
||||
'hardcoverReviewCount': 'Hardcover Review Count',
|
||||
'comicvineId': 'Comicvine ID',
|
||||
'lubimyczytacId': 'Lubimyczytac ID',
|
||||
'lubimyczytacRating': 'Lubimyczytac Rating',
|
||||
'ranobedbId': 'Ranobedb ID',
|
||||
'ranobedbRating': 'Ranobedb Rating',
|
||||
};
|
||||
|
||||
private readonly allFieldNames: (keyof MetadataProviderSpecificFields)[] = [
|
||||
'asin', 'amazonRating', 'amazonReviewCount',
|
||||
'googleId',
|
||||
'goodreadsId', 'goodreadsRating', 'goodreadsReviewCount',
|
||||
'hardcoverId', 'hardcoverBookId', 'hardcoverRating', 'hardcoverReviewCount',
|
||||
'comicvineId',
|
||||
'lubimyczytacId', 'lubimyczytacRating',
|
||||
'ranobedbId', 'ranobedbRating'
|
||||
];
|
||||
|
||||
ngOnInit(): void {
|
||||
this.appSettingsService.appSettings$
|
||||
.pipe(
|
||||
filter(settings => !!settings?.metadataProviderSpecificFields),
|
||||
take(1)
|
||||
)
|
||||
.subscribe(settings => {
|
||||
if (settings?.metadataProviderSpecificFields) {
|
||||
this.selectedFields = this.toFieldArray(settings.metadataProviderSpecificFields);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
toggleField(field: string, checked: boolean) {
|
||||
this.selectedFields = checked
|
||||
? [...this.selectedFields, field]
|
||||
: this.selectedFields.filter(f => f !== field);
|
||||
|
||||
this.appSettingsService.saveSettings([{
|
||||
key: AppSettingKey.METADATA_PROVIDER_SPECIFIC_FIELDS ?? 'metadataProviderSpecificFields',
|
||||
newValue: this.toFieldState(this.selectedFields)
|
||||
}]).subscribe();
|
||||
}
|
||||
|
||||
private toFieldArray(fieldState: MetadataProviderSpecificFields): string[] {
|
||||
const selectedFields: string[] = [];
|
||||
for (const [field, enabled] of Object.entries(fieldState)) {
|
||||
if (enabled) {
|
||||
selectedFields.push(field);
|
||||
}
|
||||
}
|
||||
return selectedFields;
|
||||
}
|
||||
|
||||
private toFieldState(selectedFields: string[]): MetadataProviderSpecificFields {
|
||||
const fieldState: any = {};
|
||||
for (const field of this.allFieldNames) {
|
||||
fieldState[field] = selectedFields.includes(field);
|
||||
}
|
||||
return fieldState;
|
||||
}
|
||||
}
|
||||
+67
-60
@@ -1,66 +1,73 @@
|
||||
<div class="flex pb-8">
|
||||
<p class="text-lg flex items-center gap-2">
|
||||
Recalculate Metadata Scores:
|
||||
<i
|
||||
class="pi pi-info-circle text-blue-500"
|
||||
pTooltip="Recomputes match scores for all books based on the latest weights."
|
||||
tooltipPosition="right"
|
||||
style="cursor: help;"
|
||||
></i>
|
||||
</p>
|
||||
<div class="settings-card">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-sliders-h"></i>
|
||||
Metadata Match Weights
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Configure how important each metadata field is when computing match scores. Higher weights make fields more influential in determining the overall match quality.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p-button
|
||||
class="pl-4"
|
||||
type="button"
|
||||
icon="pi pi-refresh"
|
||||
label="Recalculate"
|
||||
[disabled]="isRecalculating"
|
||||
(click)="recalculate()"
|
||||
outlined
|
||||
></p-button>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="text-lg flex items-center gap-2">
|
||||
Metadata Field Weights
|
||||
<i
|
||||
class="pi pi-info-circle text-blue-500"
|
||||
pTooltip="Adjust how important each metadata field is when computing match scores. Higher weights make fields more influential."
|
||||
tooltipPosition="right"
|
||||
style="cursor: help;"
|
||||
></i>
|
||||
</p>
|
||||
|
||||
<div class="flex flex-col space-y-6 p-4">
|
||||
<div class="p-4 space-y-4 max-w-4xl custom-border">
|
||||
<form [formGroup]="form">
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-y-4 gap-x-6">
|
||||
@for (key of orderedKeys; track key) {
|
||||
<div class="flex text-sm items-center gap-2">
|
||||
<label class="capitalize w-full max-w-[150px]">
|
||||
{{ labelMap[key] }}
|
||||
</label>
|
||||
<p-inputNumber
|
||||
[formControlName]="key"
|
||||
[min]="0"
|
||||
[max]="10"
|
||||
fluid
|
||||
[showButtons]="true"
|
||||
/>
|
||||
<div class="section-body">
|
||||
<div class="preferences-section">
|
||||
<div class="action-section">
|
||||
<div class="action-content">
|
||||
<div class="action-info">
|
||||
<span class="action-label">Recalculate Metadata Scores</span>
|
||||
<span class="action-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Recomputes match scores for all books based on the latest weights.
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
<p-button
|
||||
type="button"
|
||||
icon="pi pi-refresh"
|
||||
label="Recalculate"
|
||||
[disabled]="isRecalculating"
|
||||
(click)="recalculate()"
|
||||
outlined
|
||||
></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 flex justify-end">
|
||||
<p-button
|
||||
type="button"
|
||||
severity="success"
|
||||
label="Save"
|
||||
icon="pi pi-save"
|
||||
outlined
|
||||
[disabled]="isSaving"
|
||||
(click)="save()">
|
||||
</p-button>
|
||||
|
||||
<div class="weights-section">
|
||||
<div class="weights-header">
|
||||
<span class="weights-icon pi pi-sliders-v"></span>
|
||||
<h4 class="weights-label">Metadata Field Weights</h4>
|
||||
</div>
|
||||
|
||||
<form [formGroup]="form" class="weights-form">
|
||||
<div class="weights-grid">
|
||||
@for (key of orderedKeys; track key) {
|
||||
<div class="weight-field">
|
||||
<label class="field-label">
|
||||
{{ labelMap[key] }}
|
||||
</label>
|
||||
<p-inputNumber
|
||||
size="small"
|
||||
[formControlName]="key"
|
||||
[min]="0"
|
||||
[max]="10"
|
||||
fluid
|
||||
[showButtons]="true"
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<p-button
|
||||
type="button"
|
||||
severity="success"
|
||||
label="Save Weights"
|
||||
icon="pi pi-save"
|
||||
outlined
|
||||
[disabled]="isSaving"
|
||||
(click)="save()">
|
||||
</p-button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+199
@@ -2,3 +2,202 @@
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--card-border);
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
gap: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 2rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: var(--card-border);
|
||||
border-bottom-color: var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--primary-color);
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-description {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
color: var(--p-text-muted-color);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.action-section {
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: color-mix(in srgb, var(--primary-color) 40%, var(--p-content-border-color) 60%);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
.action-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.action-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.375rem;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.action-label {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.action-description {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--p-text-muted-color);
|
||||
line-height: 1.4;
|
||||
|
||||
.pi {
|
||||
font-size: 0.875rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.weights-section {
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 0.875rem;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: color-mix(in srgb, var(--primary-color) 40%, var(--p-content-border-color) 60%);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.weights-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.625rem;
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
|
||||
.weights-icon {
|
||||
color: var(--primary-color);
|
||||
font-size: 0.9375rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.weights-label {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
}
|
||||
|
||||
.weights-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.weights-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
||||
gap: 1rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.weight-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.375rem;
|
||||
|
||||
.field-label {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-color);
|
||||
text-transform: capitalize;
|
||||
}
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-top: 1rem;
|
||||
border-top: 1px solid var(--p-content-border-color);
|
||||
|
||||
@media (max-width: 768px) {
|
||||
justify-content: stretch;
|
||||
|
||||
p-button {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.section-body {
|
||||
|
||||
> .setting-item {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -3,7 +3,6 @@ import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from '@angular/
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {MetadataMatchWeightsService} from '../../../../shared/service/metadata-match-weights.service';
|
||||
import {Button} from 'primeng/button';
|
||||
import {Tooltip} from 'primeng/tooltip';
|
||||
import {filter, take} from 'rxjs/operators';
|
||||
import {Observable} from 'rxjs';
|
||||
import {AppSettingKey, AppSettings} from '../../../../shared/model/app-settings.model';
|
||||
@@ -16,7 +15,6 @@ import {InputNumber} from 'primeng/inputnumber';
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
Button,
|
||||
Tooltip,
|
||||
InputNumber
|
||||
],
|
||||
templateUrl: './metadata-match-weights-component.html',
|
||||
|
||||
+178
-158
@@ -1,171 +1,191 @@
|
||||
<div class="metadata-settings">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Enabled Metadata Providers</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Enable or configure third-party metadata sources for enhanced book information. Each provider offers different types of data and coverage.
|
||||
<div class="settings-card">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-cloud"></i>
|
||||
Metadata Providers
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Configure which online sources to use for fetching book metadata. Enable providers and set up their API tokens or cookies to access richer book information.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="providers-list">
|
||||
<div class="provider-item">
|
||||
<div class="provider-control">
|
||||
<div class="provider-info">
|
||||
<p-checkbox [(ngModel)]="amazonEnabled" [binary]="true"></p-checkbox>
|
||||
<label class="provider-label">Amazon</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section-body">
|
||||
<div>
|
||||
<h4 class="provider-group-title">Providers with Configuration</h4>
|
||||
|
||||
<div class="provider-config">
|
||||
<div class="config-field">
|
||||
<label class="config-label">Region</label>
|
||||
<p-select
|
||||
[options]="amazonDomains"
|
||||
[(ngModel)]="selectedAmazonDomain"
|
||||
placeholder="Select Domain"
|
||||
class="config-select">
|
||||
</p-select>
|
||||
</div>
|
||||
|
||||
<div class="config-field">
|
||||
<div class="config-label-row">
|
||||
<label class="config-label">Cookie (Optional, but highly recommended)</label>
|
||||
<app-external-doc-link docType="amazonCookie"></app-external-doc-link>
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Amazon</label>
|
||||
</div>
|
||||
<p class="config-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Providing your Amazon session cookie allows the app to access richer book metadata and bypass rate limits. Optional but recommended for best results.
|
||||
</p>
|
||||
<input
|
||||
type="text"
|
||||
pInputText
|
||||
placeholder="Paste your Amazon cookie"
|
||||
fluid
|
||||
class="max-w-[60rem]"
|
||||
[(ngModel)]="amazonCookie"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch [(ngModel)]="amazonEnabled"></p-toggleswitch>
|
||||
</div>
|
||||
@if (amazonEnabled) {
|
||||
<div class="provider-config-fields">
|
||||
<div class="config-field">
|
||||
<label class="config-label">Region</label>
|
||||
<p-select
|
||||
[options]="amazonDomains"
|
||||
[(ngModel)]="selectedAmazonDomain"
|
||||
placeholder="Select Domain"
|
||||
class="config-select">
|
||||
</p-select>
|
||||
</div>
|
||||
|
||||
<div class="provider-item">
|
||||
<div class="provider-control">
|
||||
<div class="provider-info">
|
||||
<p-checkbox [(ngModel)]="goodreadsEnabled" [binary]="true"></p-checkbox>
|
||||
<label class="provider-label">Goodreads</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="provider-item">
|
||||
<div class="provider-control">
|
||||
<div class="provider-info">
|
||||
<p-checkbox [(ngModel)]="googleEnabled" [binary]="true"></p-checkbox>
|
||||
<label class="provider-label">Google</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="provider-config">
|
||||
<div class="config-field">
|
||||
<label class="config-label">Language restriction</label>
|
||||
<p-select
|
||||
[options]="googleLanguages"
|
||||
[(ngModel)]="selectedGoogleLanguage"
|
||||
[showClear]="!!selectedGoogleLanguage"
|
||||
placeholder="Select Language"
|
||||
class="config-select">
|
||||
</p-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="provider-item">
|
||||
<div class="provider-control">
|
||||
<div class="provider-info">
|
||||
<p-checkbox
|
||||
[binary]="true"
|
||||
[(ngModel)]="hardcoverEnabled"
|
||||
[disabled]="!hardcoverToken">
|
||||
</p-checkbox>
|
||||
<label class="provider-label">Hardcover</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="provider-config">
|
||||
<div class="config-field">
|
||||
<div class="config-label-row">
|
||||
<label class="config-label">API Token</label>
|
||||
<app-external-doc-link docType="hardcover"></app-external-doc-link>
|
||||
<div class="config-field">
|
||||
<div class="config-label-row">
|
||||
<label class="config-label">Cookie (Optional, but highly recommended)</label>
|
||||
<app-external-doc-link docType="amazonCookie"></app-external-doc-link>
|
||||
</div>
|
||||
<p class="config-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Providing your Amazon session cookie allows the app to access richer book metadata and bypass rate limits.</span>
|
||||
</p>
|
||||
<input
|
||||
type="text"
|
||||
pInputText
|
||||
placeholder="Paste your Amazon cookie"
|
||||
[(ngModel)]="amazonCookie"
|
||||
class="config-input"/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
pInputText
|
||||
placeholder="Enter Hardcover API token"
|
||||
fluid
|
||||
class="max-w-[60rem]"
|
||||
[(ngModel)]="hardcoverToken"
|
||||
(ngModelChange)="onTokenChange($event)"/>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Google Books</label>
|
||||
</div>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch [(ngModel)]="googleEnabled"></p-toggleswitch>
|
||||
</div>
|
||||
@if (googleEnabled) {
|
||||
<div class="provider-config-fields">
|
||||
<div class="config-field">
|
||||
<label class="config-label">Language Restriction</label>
|
||||
<p-select
|
||||
[options]="googleLanguages"
|
||||
[(ngModel)]="selectedGoogleLanguage"
|
||||
[showClear]="!!selectedGoogleLanguage"
|
||||
placeholder="Select Language"
|
||||
class="config-select">
|
||||
</p-select>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Hardcover</label>
|
||||
</div>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch
|
||||
[(ngModel)]="hardcoverEnabled"
|
||||
[disabled]="!hardcoverToken">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
@if (hardcoverEnabled) {
|
||||
<div class="provider-config-fields">
|
||||
<div class="config-field">
|
||||
<div class="config-label-row">
|
||||
<label class="config-label">API Token</label>
|
||||
<app-external-doc-link docType="hardcover"></app-external-doc-link>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
pInputText
|
||||
placeholder="Enter Hardcover API token"
|
||||
[(ngModel)]="hardcoverToken"
|
||||
(ngModelChange)="onTokenChange($event)"
|
||||
class="config-input"/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Comic Vine</label>
|
||||
</div>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch [(ngModel)]="comicvineEnabled"></p-toggleswitch>
|
||||
</div>
|
||||
@if (comicvineEnabled) {
|
||||
<div class="provider-config-fields">
|
||||
<div class="config-field">
|
||||
<label class="config-label">API Token</label>
|
||||
<input
|
||||
type="text"
|
||||
pInputText
|
||||
placeholder="Enter Comic Vine API token"
|
||||
[(ngModel)]="comicvineToken"
|
||||
(ngModelChange)="onComicTokenChange($event)"
|
||||
class="config-input"/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4 class="provider-group-title">Ready-to-Use Providers</h4>
|
||||
|
||||
<div class="simple-providers-grid">
|
||||
<div class="simple-provider-item">
|
||||
<div class="simple-provider-header">
|
||||
<label class="setting-label">Goodreads</label>
|
||||
<p-toggleswitch [(ngModel)]="goodreadsEnabled"></p-toggleswitch>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="simple-provider-item">
|
||||
<div class="simple-provider-header">
|
||||
<label class="setting-label">Douban</label>
|
||||
<p-toggleswitch [(ngModel)]="doubanEnabled"></p-toggleswitch>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="simple-provider-item">
|
||||
<div class="simple-provider-header">
|
||||
<label class="setting-label">Lubimyczytac</label>
|
||||
<p-toggleswitch [(ngModel)]="lubimyCzytacEnabled"></p-toggleswitch>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="simple-provider-item">
|
||||
<div class="simple-provider-header">
|
||||
<label class="setting-label">Ranobedb</label>
|
||||
<p-toggleswitch [(ngModel)]="ranobedbEnabled"></p-toggleswitch>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-actions">
|
||||
<p-button label="Save Configurations" icon="pi pi-save" severity="success" [outlined]="true" (click)="saveSettings()"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="provider-item">
|
||||
<div class="provider-control">
|
||||
<div class="provider-info">
|
||||
<p-checkbox
|
||||
[binary]="true"
|
||||
[(ngModel)]="comicvineEnabled"
|
||||
[disabled]="!comicvineToken">
|
||||
</p-checkbox>
|
||||
<label class="provider-label">Comic Vine</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="provider-config">
|
||||
<div class="config-field">
|
||||
<label class="config-label">API Token</label>
|
||||
<input
|
||||
type="text"
|
||||
pInputText
|
||||
placeholder="Enter Comic Vine API token"
|
||||
fluid
|
||||
class="max-w-[60rem]"
|
||||
[(ngModel)]="comicvineToken"
|
||||
(ngModelChange)="onComicTokenChange($event)"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="provider-item">
|
||||
<div class="provider-control">
|
||||
<div class="provider-info">
|
||||
<p-checkbox [(ngModel)]="doubanEnabled" [binary]="true"></p-checkbox>
|
||||
<label class="provider-label">Douban</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="provider-item">
|
||||
<div class="provider-control">
|
||||
<div class="provider-info">
|
||||
<p-checkbox [(ngModel)]="lubimyCzytacEnabled" [binary]="true"></p-checkbox>
|
||||
<label class="provider-label">Lubimyczytac</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="provider-item">
|
||||
<div class="provider-control">
|
||||
<div class="provider-info">
|
||||
<p-checkbox [(ngModel)]="ranobedbEnabled" [binary]="true"></p-checkbox>
|
||||
<label class="provider-label">Ranobedb</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-actions">
|
||||
<p-button label="Save" icon="pi pi-save" severity="success" [outlined]="true" (click)="saveSettings()"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+200
-17
@@ -1,22 +1,144 @@
|
||||
.metadata-settings {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: var(--card-border);
|
||||
border-bottom-color: var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--primary-color);
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-description {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
color: var(--p-text-muted-color);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
gap: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
.provider-group-title {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0 0 0.25rem 0;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.provider-group-description {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--p-text-muted-color);
|
||||
margin: 0 0 0.75rem 0;
|
||||
}
|
||||
|
||||
.simple-providers-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 1rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.simple-provider-item {
|
||||
background: var(--p-surface-800);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 6px;
|
||||
padding: 0.875rem 1rem;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--primary-color);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.simple-provider-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
|
||||
.setting-label {
|
||||
margin: 0;
|
||||
font-weight: 500;
|
||||
color: var(--text-color);
|
||||
font-size: 0.9375rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
flex-direction: column;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
&.setting-item-indented {
|
||||
display: inline-flex;
|
||||
margin-top: 0.5rem;
|
||||
margin-left: 0;
|
||||
padding: 0.75rem 0.75rem 0.625rem 0.75rem;
|
||||
border-left: 3px solid var(--primary-color);
|
||||
border-bottom: none;
|
||||
background: var(--p-surface-800);
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
gap: 0.5rem;
|
||||
|
||||
&.setting-item-indented {
|
||||
max-width: 100%;
|
||||
margin-left: 0;
|
||||
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,15 +149,30 @@
|
||||
.setting-label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
color: var(--text-color);
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
margin-bottom: 0.375rem;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.setting-label-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.setting-label {
|
||||
margin-bottom: 0;
|
||||
flex-shrink: 0;
|
||||
font-size: 0.9375rem;
|
||||
color: var(--text-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.setting-description {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.5rem;
|
||||
gap: 0.375rem;
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
@@ -44,7 +181,11 @@
|
||||
.pi {
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
color: var(--p-primary-color);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.pi-info-circle {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,12 +226,20 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
align-items: flex-start;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.provider-config-fields {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.config-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -98,7 +247,7 @@
|
||||
|
||||
.config-label {
|
||||
font-weight: 500;
|
||||
color: var(--p-text-color);
|
||||
color: var(--text-color);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
@@ -115,27 +264,61 @@
|
||||
.config-description {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.5rem;
|
||||
gap: 0.375rem;
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
|
||||
.pi {
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
color: var(--p-primary-color);
|
||||
font-size: 0.8125rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.config-select {
|
||||
::ng-deep .config-select {
|
||||
width: 100%;
|
||||
max-width: 13rem;
|
||||
max-width: 20rem;
|
||||
}
|
||||
|
||||
.config-input {
|
||||
width: 100%;
|
||||
max-width: 40rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 6px;
|
||||
background: var(--ground-background);
|
||||
color: var(--text-color);
|
||||
font-size: 0.9375rem;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--primary-color);
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: var(--primary-color);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 15%, transparent 85%);
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: var(--p-text-muted-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.setting-actions {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
padding-top: 1rem;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.section-body {
|
||||
padding-left: 1rem;
|
||||
|
||||
> .setting-item {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
+8
-11
@@ -1,27 +1,28 @@
|
||||
import {Component, inject, OnInit} from '@angular/core';
|
||||
import {Component, DestroyRef, inject, OnInit} from '@angular/core';
|
||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
import {TableModule} from 'primeng/table';
|
||||
import {Checkbox} from 'primeng/checkbox';
|
||||
import {InputText} from 'primeng/inputtext';
|
||||
import {Button} from 'primeng/button';
|
||||
import {AppSettingsService} from '../../../../shared/service/app-settings.service';
|
||||
import {filter, take} from 'rxjs/operators';
|
||||
import {filter} from 'rxjs/operators';
|
||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {AppSettingKey} from '../../../../shared/model/app-settings.model';
|
||||
import {Select} from 'primeng/select';
|
||||
import {ExternalDocLinkComponent} from '../../../../shared/components/external-doc-link/external-doc-link.component';
|
||||
import { ToggleSwitchModule } from 'primeng/toggleswitch';
|
||||
|
||||
@Component({
|
||||
selector: 'app-metadata-provider-settings',
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
TableModule,
|
||||
Checkbox,
|
||||
InputText,
|
||||
Button,
|
||||
FormsModule,
|
||||
Select,
|
||||
ExternalDocLinkComponent
|
||||
ExternalDocLinkComponent,
|
||||
ToggleSwitchModule
|
||||
],
|
||||
templateUrl: './metadata-provider-settings.component.html',
|
||||
styleUrl: './metadata-provider-settings.component.scss'
|
||||
@@ -81,6 +82,7 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
||||
|
||||
private appSettingsService = inject(AppSettingsService);
|
||||
private messageService = inject(MessageService);
|
||||
private destroyRef = inject(DestroyRef);
|
||||
|
||||
private appSettings$ = this.appSettingsService.appSettings$;
|
||||
|
||||
@@ -88,7 +90,7 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
||||
this.appSettings$
|
||||
.pipe(
|
||||
filter(settings => settings != null),
|
||||
take(1)
|
||||
takeUntilDestroyed(this.destroyRef)
|
||||
)
|
||||
.subscribe(settings => {
|
||||
const metadataProviderSettings = settings!.metadataProviderSettings;
|
||||
@@ -117,9 +119,6 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
||||
|
||||
onComicTokenChange(newToken: string): void {
|
||||
this.comicvineToken = newToken;
|
||||
if (!newToken.trim()) {
|
||||
this.comicvineEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
saveSettings(): void {
|
||||
@@ -132,12 +131,10 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
||||
cookie: this.amazonCookie,
|
||||
domain: this.selectedAmazonDomain
|
||||
},
|
||||
|
||||
comicvine: {
|
||||
enabled: this.comicvineEnabled,
|
||||
apiKey: this.comicvineToken.trim()
|
||||
},
|
||||
|
||||
goodReads: {enabled: this.goodreadsEnabled},
|
||||
google: {
|
||||
enabled: this.googleEnabled,
|
||||
|
||||
+111
-123
@@ -1,12 +1,15 @@
|
||||
<div class="preferences-section">
|
||||
<div class="settings-card">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-save"></i>
|
||||
Metadata Persistence
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Configure how metadata is written to original files and how files are moved or renamed when metadata changes.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<div class="section-notice">
|
||||
<div class="warning-notice">
|
||||
<i class="pi pi-exclamation-triangle"></i>
|
||||
<div>
|
||||
@@ -14,149 +17,134 @@
|
||||
incomplete writes, or permanent data loss. Github issues related to network storage will not be supported.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-notice unsupported-formats-note" style="margin-bottom: 1rem;">
|
||||
<div class="info-notice unsupported-formats-note">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<div>
|
||||
<strong>Note:</strong> Writing metadata is <b>not supported</b> for FB2, AZW3, and MOBI formats.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section-body">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Write Metadata to EPUB</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Write metadata directly into EPUB files when editing book information.
|
||||
</p>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch
|
||||
[ngModel]="metadataPersistence.saveToOriginalFile.epub.enabled"
|
||||
(onChange)="onSaveToOriginalFileToggle('epub')">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
@if (metadataPersistence.saveToOriginalFile.epub.enabled) {
|
||||
<div class="filesize-input" style="margin-top: 0.5rem;">
|
||||
<label>Max File Size (MB):</label>
|
||||
<input
|
||||
type="number"
|
||||
[(ngModel)]="metadataPersistence.saveToOriginalFile.epub.maxFileSizeInMb"
|
||||
(change)="onFilesizeChange('epub')"
|
||||
min="1"
|
||||
max="1000"
|
||||
class="filesize-field">
|
||||
<i
|
||||
class="pi pi-info-circle text-blue-500"
|
||||
pTooltip="Only files up to this size (MB) will be updated. Larger files are ignored."
|
||||
tooltipPosition="right"
|
||||
style="cursor: help; margin-left: 4px;"
|
||||
></i>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<label class="setting-label">Write Metadata to EPUB</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Write metadata directly into EPUB files when editing book information.</span>
|
||||
</p>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch
|
||||
[ngModel]="metadataPersistence.saveToOriginalFile.epub.enabled"
|
||||
(onChange)="onSaveToOriginalFileToggle('epub')">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
@if (metadataPersistence.saveToOriginalFile.epub.enabled) {
|
||||
<div class="filesize-input">
|
||||
<label>Max File Size (MB):</label>
|
||||
<input
|
||||
type="number"
|
||||
[(ngModel)]="metadataPersistence.saveToOriginalFile.epub.maxFileSizeInMb"
|
||||
(change)="onFilesizeChange('epub')"
|
||||
min="1"
|
||||
max="1000"
|
||||
class="filesize-field">
|
||||
<i
|
||||
class="pi pi-info-circle text-blue-500"
|
||||
pTooltip="Only files up to this size (MB) will be updated. Larger files are ignored."
|
||||
tooltipPosition="right"
|
||||
style="cursor: help;"
|
||||
></i>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Write Metadata to CBX</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Write metadata directly into CBX files when editing book information.
|
||||
</p>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch
|
||||
[ngModel]="metadataPersistence.saveToOriginalFile.cbx.enabled"
|
||||
(onChange)="onSaveToOriginalFileToggle('cbx')">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
@if (metadataPersistence.saveToOriginalFile.cbx.enabled) {
|
||||
<div class="filesize-input" style="margin-top: 0.5rem;">
|
||||
<label>Max File Size (MB):</label>
|
||||
<input
|
||||
type="number"
|
||||
[(ngModel)]="metadataPersistence.saveToOriginalFile.cbx.maxFileSizeInMb"
|
||||
(change)="onFilesizeChange('cbx')"
|
||||
min="1"
|
||||
max="1000"
|
||||
class="filesize-field">
|
||||
<i
|
||||
class="pi pi-info-circle text-blue-500"
|
||||
pTooltip="Only files up to this size (MB) will be updated. Larger files are ignored."
|
||||
tooltipPosition="right"
|
||||
style="cursor: help; margin-left: 4px;"
|
||||
></i>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<label class="setting-label">Write Metadata to CBX</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Write metadata directly into CBX files when editing book information.</span>
|
||||
</p>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch
|
||||
[ngModel]="metadataPersistence.saveToOriginalFile.cbx.enabled"
|
||||
(onChange)="onSaveToOriginalFileToggle('cbx')">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
@if (metadataPersistence.saveToOriginalFile.cbx.enabled) {
|
||||
<div class="filesize-input">
|
||||
<label>Max File Size (MB):</label>
|
||||
<input
|
||||
type="number"
|
||||
[(ngModel)]="metadataPersistence.saveToOriginalFile.cbx.maxFileSizeInMb"
|
||||
(change)="onFilesizeChange('cbx')"
|
||||
min="1"
|
||||
max="1000"
|
||||
class="filesize-field">
|
||||
<i
|
||||
class="pi pi-info-circle text-blue-500"
|
||||
pTooltip="Only files up to this size (MB) will be updated. Larger files are ignored."
|
||||
tooltipPosition="right"
|
||||
style="cursor: help;"
|
||||
></i>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Write Metadata to PDF</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Write metadata directly into PDF files when editing book information. <br>
|
||||
Note: PDFs do not support embedded covers, and only a limited set of metadata can be updated (Title, Authors, Publisher, Categories, Description, Language, Published Date). This is a limitation of the PDF format.
|
||||
</p>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch
|
||||
[ngModel]="metadataPersistence.saveToOriginalFile.pdf.enabled"
|
||||
(onChange)="onSaveToOriginalFileToggle('pdf')">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
@if (metadataPersistence.saveToOriginalFile.pdf.enabled) {
|
||||
<div class="filesize-input" style="margin-top: 0.5rem;">
|
||||
<label>Max File Size (MB):</label>
|
||||
<input
|
||||
type="number"
|
||||
[(ngModel)]="metadataPersistence.saveToOriginalFile.pdf.maxFileSizeInMb"
|
||||
(change)="onFilesizeChange('pdf')"
|
||||
min="1"
|
||||
max="1000"
|
||||
class="filesize-field">
|
||||
<i
|
||||
class="pi pi-info-circle text-blue-500"
|
||||
pTooltip="Only files up to this size (MB) will be updated. Larger files are ignored."
|
||||
tooltipPosition="right"
|
||||
style="cursor: help; margin-left: 4px;"
|
||||
></i>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<label class="setting-label">Write Metadata to PDF</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Write metadata directly into PDF files when editing book information. <br>
|
||||
<strong>Note:</strong> PDFs do not support embedded covers, and only a limited set of metadata can be updated (Title, Authors, Publisher, Categories, Description, Language, Published Date). This is a limitation of the PDF format.</span>
|
||||
</p>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch
|
||||
[ngModel]="metadataPersistence.saveToOriginalFile.pdf.enabled"
|
||||
(onChange)="onSaveToOriginalFileToggle('pdf')">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
@if (metadataPersistence.saveToOriginalFile.pdf.enabled) {
|
||||
<div class="filesize-input">
|
||||
<label>Max File Size (MB):</label>
|
||||
<input
|
||||
type="number"
|
||||
[(ngModel)]="metadataPersistence.saveToOriginalFile.pdf.maxFileSizeInMb"
|
||||
(change)="onFilesizeChange('pdf')"
|
||||
min="1"
|
||||
max="1000"
|
||||
class="filesize-field">
|
||||
<i
|
||||
class="pi pi-info-circle text-blue-500"
|
||||
pTooltip="Only files up to this size (MB) will be updated. Larger files are ignored."
|
||||
tooltipPosition="right"
|
||||
style="cursor: help;"
|
||||
></i>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Auto-Move Files on Metadata Update</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Automatically move and rename files according to their library's naming pattern when metadata is updated, either through manual editing or auto-fetch operations.
|
||||
</p>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch
|
||||
[ngModel]="metadataPersistence.moveFilesToLibraryPattern"
|
||||
(onChange)="onPersistenceToggle('moveFilesToLibraryPattern')">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
</div>
|
||||
<label class="setting-label">Auto-Move Files on Metadata Update</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Automatically move and rename files according to their library's naming pattern when metadata is updated, either through manual editing or auto-fetch operations.</span>
|
||||
</p>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Enabled:</label>
|
||||
<p-toggleswitch
|
||||
[ngModel]="metadataPersistence.moveFilesToLibraryPattern"
|
||||
(onChange)="onPersistenceToggle('moveFilesToLibraryPattern')">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+127
-136
@@ -1,46 +1,63 @@
|
||||
.enclosing-container {
|
||||
border-color: var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: var(--card-border);
|
||||
border-bottom-color: var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 1.125rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
margin: 0;
|
||||
color: var(--text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
color: var(--primary-color);
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-description {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
color: var(--p-text-muted-color);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
background: var(--p-content-background);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
gap: 1rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
gap: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-notice {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.section-body {
|
||||
padding-left: 1rem;
|
||||
> .setting-item {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
flex-wrap: wrap;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
@@ -48,94 +65,67 @@
|
||||
}
|
||||
|
||||
&.setting-item-indented {
|
||||
margin-top: 1rem;
|
||||
margin-left: 1.5rem;
|
||||
padding-left: 1rem;
|
||||
border-left: 2px solid var(--p-border-color);
|
||||
margin-top: 0.5rem;
|
||||
margin-left: 0;
|
||||
padding: 0.75rem 0.75rem 0.625rem 0.75rem;
|
||||
border-left: 3px solid var(--primary-color);
|
||||
border-bottom: none;
|
||||
background: var(--p-surface-800);
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: -2px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 2px;
|
||||
background: var(--p-primary-color);
|
||||
opacity: 0.3;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
gap: 0.5rem;
|
||||
|
||||
&.setting-item-indented {
|
||||
margin-left: 1rem;
|
||||
padding-left: 0.75rem;
|
||||
margin-left: 0;
|
||||
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.setting-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
.setting-label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
color: var(--text-color);
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
margin-bottom: 0.375rem;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.setting-label-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
gap: 0.75rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.setting-label {
|
||||
margin-bottom: 0;
|
||||
flex-shrink: 0;
|
||||
font-size: 0.9375rem;
|
||||
color: var(--text-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.setting-description {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.5rem;
|
||||
gap: 0.375rem;
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
font-size: 0.875rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.pi-exclamation-triangle {
|
||||
color: var(--p-orange-500);
|
||||
}
|
||||
|
||||
.pi-info-circle {
|
||||
color: var(--p-primary-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.setting-control {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
align-items: flex-end;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,99 +133,100 @@
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.75rem;
|
||||
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.55;
|
||||
|
||||
padding: 0.875rem 1rem;
|
||||
border-radius: 10px;
|
||||
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--p-surface-900) 85%,
|
||||
var(--p-red-600) 15%
|
||||
);
|
||||
|
||||
border-left: 4px solid var(--p-red-500);
|
||||
|
||||
color: var(--p-text-color);
|
||||
font-size: 0.9375rem;
|
||||
line-height: 1.5;
|
||||
padding: 0.75rem 1rem;
|
||||
border-radius: 8px;
|
||||
background: color-mix(in srgb, var(--ground-background) 85%, var(--p-red-600) 15%);
|
||||
border: 1px solid color-mix(in srgb, var(--p-red-500) 30%, transparent 70%);
|
||||
border-left: 3px solid var(--p-red-500);
|
||||
color: var(--text-color);
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
|
||||
|
||||
.pi-exclamation-triangle {
|
||||
color: var(--p-red-400);
|
||||
margin-top: 0.15rem;
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
|
||||
strong {
|
||||
font-weight: 700;
|
||||
color: var(--p-red-300);
|
||||
}
|
||||
}
|
||||
|
||||
.nested-settings {
|
||||
margin-top: 1rem;
|
||||
margin-left: 1.5rem;
|
||||
padding-left: 1rem;
|
||||
border-left: 2px solid var(--surface-border);
|
||||
}
|
||||
|
||||
.format-setting {
|
||||
margin-bottom: 1rem;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.filesize-input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
|
||||
label {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.filesize-field {
|
||||
width: 100px;
|
||||
padding: 0.5rem;
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 6px;
|
||||
background: var(--p-content-background);
|
||||
color: var(--p-text-color);
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: var(--p-primary-color);
|
||||
box-shadow: 0 0 0 2px var(--p-primary-color-transparent);
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.625rem 0.75rem;
|
||||
gap: 0.625rem;
|
||||
}
|
||||
}
|
||||
|
||||
.info-notice.unsupported-formats-note {
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--p-surface-900) 90%,
|
||||
var(--p-blue-600) 10%
|
||||
);
|
||||
border-left: 4px solid var(--p-blue-400);
|
||||
color: var(--p-text-color);
|
||||
background: color-mix(in srgb, var(--ground-background) 90%, var(--p-blue-600) 10%);
|
||||
border: 1px solid color-mix(in srgb, var(--p-blue-400) 30%, transparent 70%);
|
||||
border-left: 3px solid var(--p-blue-400);
|
||||
color: var(--text-color);
|
||||
padding: 0.75rem 1rem;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.75rem;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 1rem;
|
||||
|
||||
.pi-info-circle {
|
||||
color: var(--p-blue-400);
|
||||
margin-top: 0.15rem;
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
|
||||
strong {
|
||||
color: var(--p-blue-300);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.625rem 0.75rem;
|
||||
gap: 0.625rem;
|
||||
}
|
||||
}
|
||||
|
||||
.filesize-input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.625rem;
|
||||
margin-top: 0.5rem;
|
||||
|
||||
label {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-color-secondary);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.filesize-field {
|
||||
width: 100px;
|
||||
padding: 0.375rem 0.625rem;
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 6px;
|
||||
background: var(--ground-background);
|
||||
color: var(--text-color);
|
||||
font-size: 0.9375rem;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--primary-color);
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: var(--primary-color);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 15%, transparent 85%);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
gap: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
+25
-70
@@ -1,83 +1,38 @@
|
||||
<div class="main-container enclosing-container">
|
||||
<div class="settings-header">
|
||||
<h2 class="settings-title">
|
||||
<i class="pi pi-sliders-h"></i>
|
||||
Metadata Settings
|
||||
</h2>
|
||||
<p class="settings-description">
|
||||
Configure how metadata is retrieved, stored, and managed for your books. Set up automatic downloads, persistence options, and provider preferences.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-content">
|
||||
<div class="preferences-section">
|
||||
<div class="w-full h-[calc(100dvh-10.5rem)] md:h-[calc(100dvh-11.65rem)] overflow-y-auto">
|
||||
<app-metadata-persistence-settings-component></app-metadata-persistence-settings-component>
|
||||
<div class="pt-10"><hr></div>
|
||||
<div class="preferences-section">
|
||||
<div class="settings-card">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-download"></i>
|
||||
Auto-Download Metadata
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
<i class="pi pi-exclamation-triangle"></i>
|
||||
Automatically downloads metadata from your configured sources when files are added to the Bookdrop folder. Use with caution if adding many files at once as metadata fetching can take time.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Auto-Download for BookDrop Files</label>
|
||||
<p-toggleswitch
|
||||
[(ngModel)]="metadataDownloadOnBookdrop"
|
||||
(onChange)="onMetadataDownloadOnBookdropToggle($event.checked)">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-exclamation-triangle"></i>
|
||||
Automatically downloads metadata from your configured sources (Amazon, Goodreads, etc.) when files are added to the Bookdrop folder. Use with caution if adding many files at once as metadata fetching can take time.
|
||||
</p>
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Auto-Download for BookDrop Files</label>
|
||||
<p-toggleswitch
|
||||
[(ngModel)]="metadataDownloadOnBookdrop"
|
||||
(onChange)="onMetadataDownloadOnBookdropToggle($event.checked)">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="metadata-persistence-section">
|
||||
<app-metadata-persistence-settings-component></app-metadata-persistence-settings-component>
|
||||
</div>
|
||||
|
||||
<div class="preferences-section">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-cloud"></i>
|
||||
Metadata Providers
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<app-metadata-provider-settings></app-metadata-provider-settings>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="preferences-section">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-star"></i>
|
||||
Public Reviews
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<app-public-reviews-settings-component></app-public-reviews-settings-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="preferences-section">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-sliders-h"></i>
|
||||
Metadata Match Weights
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<app-metadata-match-weights-component></app-metadata-match-weights-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pt-10"><hr></div>
|
||||
<app-metadata-provider-settings></app-metadata-provider-settings>
|
||||
<div class="pt-10"><hr></div>
|
||||
<app-metadata-provider-field-selector></app-metadata-provider-field-selector>
|
||||
<div class="pt-10"><hr></div>
|
||||
<app-public-reviews-settings-component></app-public-reviews-settings-component>
|
||||
<div class="pt-10"><hr></div>
|
||||
<app-metadata-match-weights-component></app-metadata-match-weights-component>
|
||||
</div>
|
||||
|
||||
+19
-27
@@ -1,21 +1,3 @@
|
||||
.main-container {
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
height: calc(100dvh - 10.5rem);
|
||||
overflow-y: auto;
|
||||
border-width: 1px;
|
||||
border-radius: 0.5rem;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
height: calc(100dvh - 11.65rem);
|
||||
}
|
||||
}
|
||||
|
||||
.enclosing-container {
|
||||
border-color: var(--p-content-border-color);
|
||||
background: var(--p-content-background);
|
||||
}
|
||||
|
||||
.settings-header {
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
@@ -49,13 +31,6 @@
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.preferences-section {
|
||||
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 1rem;
|
||||
|
||||
@@ -69,10 +44,17 @@
|
||||
gap: 0.5rem;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.pi-exclamation-triangle {
|
||||
color: var(--p-orange-500);
|
||||
}
|
||||
|
||||
.pi-info-circle {
|
||||
color: var(--p-primary-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +79,17 @@
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
gap: 1rem;
|
||||
|
||||
.section-header {
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
margin-bottom: 0;
|
||||
|
||||
+ .setting-item {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
|
||||
+3
-1
@@ -11,6 +11,7 @@ import {ToggleSwitch} from 'primeng/toggleswitch';
|
||||
import {MetadataMatchWeightsComponent} from '../global-preferences/metadata-match-weights/metadata-match-weights-component';
|
||||
import {MetadataPersistenceSettingsComponent} from './metadata-persistence-settings/metadata-persistence-settings-component';
|
||||
import {PublicReviewsSettingsComponent} from './public-reviews-settings/public-reviews-settings-component';
|
||||
import {MetadataProviderFieldSelectorComponent} from '../../metadata/component/metadata-provider-field-selector/metadata-provider-field-selector.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-metadata-settings-component',
|
||||
@@ -22,7 +23,8 @@ import {PublicReviewsSettingsComponent} from './public-reviews-settings/public-r
|
||||
MetadataMatchWeightsComponent,
|
||||
ToggleSwitch,
|
||||
MetadataPersistenceSettingsComponent,
|
||||
PublicReviewsSettingsComponent
|
||||
PublicReviewsSettingsComponent,
|
||||
MetadataProviderFieldSelectorComponent
|
||||
],
|
||||
templateUrl: './metadata-settings-component.html',
|
||||
styleUrl: './metadata-settings-component.scss'
|
||||
|
||||
+83
-68
@@ -1,80 +1,95 @@
|
||||
<div class="reviews-settings">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Download Public Reviews</label>
|
||||
<p-toggleswitch
|
||||
[(ngModel)]="publicReviewSettings.downloadEnabled"
|
||||
(onChange)="onPublicReviewsToggle($event.checked)">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Enable downloading user reviews from configured platforms (Amazon, Goodreads, Hardcover). Reviews will be stored with your books for offline access.
|
||||
</p>
|
||||
</div>
|
||||
<div class="settings-card">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-star"></i>
|
||||
Public Reviews
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Configure automatic downloading of user reviews from external platforms. Reviews can be fetched from Amazon, Goodreads, and Hardcover for offline access.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@if (publicReviewSettings.downloadEnabled) {
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Auto Download on Book Open</label>
|
||||
<p-toggleswitch
|
||||
[(ngModel)]="publicReviewSettings.autoDownloadEnabled"
|
||||
(onChange)="onAutoDownloadToggle($event.checked)">
|
||||
</p-toggleswitch>
|
||||
<div class="section-body">
|
||||
<div class="reviews-settings">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Download Public Reviews</label>
|
||||
<p-toggleswitch
|
||||
[(ngModel)]="publicReviewSettings.downloadEnabled"
|
||||
(onChange)="onPublicReviewsToggle($event.checked)">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Enable downloading user reviews from configured platforms (Amazon, Goodreads, Hardcover). Reviews will be stored with your books for offline access.
|
||||
</p>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Automatically fetch reviews when you open a book's details page. When disabled, reviews will only be downloaded manually or during metadata refresh, reducing background network activity and improving performance.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="review-sources-section">
|
||||
<div class="sources-header">
|
||||
<h4 class="subsection-title">Review Sources</h4>
|
||||
<p class="subsection-description">Configure which platforms to download reviews from and set limits for each source.</p>
|
||||
</div>
|
||||
|
||||
<div class="providers-list">
|
||||
@for (provider of publicReviewSettings.providers; track provider.provider) {
|
||||
<div class="provider-item">
|
||||
<div class="provider-setting">
|
||||
<div class="provider-label-row">
|
||||
<label class="provider-label">{{ provider.provider }}</label>
|
||||
<div class="provider-controls">
|
||||
<p-toggleswitch
|
||||
[(ngModel)]="provider.enabled"
|
||||
(onChange)="onProviderToggle(provider.provider, $event.checked)">
|
||||
</p-toggleswitch>
|
||||
@if (provider.enabled) {
|
||||
<div class="max-reviews-control">
|
||||
<label class="max-reviews-label">Max Reviews:</label>
|
||||
<input
|
||||
type="number"
|
||||
class="max-reviews-input"
|
||||
min="1"
|
||||
max="10"
|
||||
[(ngModel)]="provider.maxReviews"
|
||||
(blur)="onMaxReviewsChange(provider.provider, provider.maxReviews)"
|
||||
title="Number of reviews to download (1-10)">
|
||||
@if (publicReviewSettings.downloadEnabled) {
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Auto Download on Book Open</label>
|
||||
<p-toggleswitch
|
||||
[(ngModel)]="publicReviewSettings.autoDownloadEnabled"
|
||||
(onChange)="onAutoDownloadToggle($event.checked)">
|
||||
</p-toggleswitch>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
Automatically fetch reviews when you open a book's details page. When disabled, reviews will only be downloaded manually or during metadata refresh, reducing background network activity and improving performance.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="review-sources-section">
|
||||
<div class="sources-header">
|
||||
<span class="group-icon pi pi-database"></span>
|
||||
<h4 class="subsection-title">Review Sources</h4>
|
||||
</div>
|
||||
<p class="subsection-description">Configure which platforms to download reviews from and set limits for each source.</p>
|
||||
|
||||
<div class="providers-list">
|
||||
@for (provider of publicReviewSettings.providers; track provider.provider) {
|
||||
<div class="provider-item">
|
||||
<div class="provider-setting">
|
||||
<div class="provider-label-row">
|
||||
<label class="provider-label">{{ provider.provider }}</label>
|
||||
<div class="provider-controls">
|
||||
<p-toggleswitch
|
||||
[(ngModel)]="provider.enabled"
|
||||
(onChange)="onProviderToggle(provider.provider, $event.checked)">
|
||||
</p-toggleswitch>
|
||||
@if (provider.enabled) {
|
||||
<div class="max-reviews-control">
|
||||
<label class="max-reviews-label">Max Reviews:</label>
|
||||
<input
|
||||
type="number"
|
||||
class="max-reviews-input"
|
||||
min="1"
|
||||
max="10"
|
||||
[(ngModel)]="provider.maxReviews"
|
||||
(blur)="onMaxReviewsChange(provider.provider, provider.maxReviews)"
|
||||
title="Number of reviews to download (1-10)">
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@if (publicReviewSettings.providers.length === 0) {
|
||||
<div class="no-providers-message">
|
||||
<i class="pi pi-exclamation-triangle"></i>
|
||||
<span>No review sources available. Please ensure metadata providers are configured in the Provider Settings section above.</span>
|
||||
@if (publicReviewSettings.providers.length === 0) {
|
||||
<div class="no-providers-message">
|
||||
<i class="pi pi-exclamation-triangle"></i>
|
||||
<span>No review sources available. Please ensure metadata providers are configured in the Provider Settings section above.</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+104
-31
@@ -1,3 +1,57 @@
|
||||
.settings-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
gap: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: var(--card-border);
|
||||
border-bottom-color: var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.section-body {
|
||||
padding-left: 1rem;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--primary-color);
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-description {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
color: var(--p-text-muted-color);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.reviews-settings {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -9,6 +63,7 @@
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
padding-bottom: 1.5rem;
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
@@ -77,48 +132,66 @@
|
||||
}
|
||||
|
||||
.review-sources-section {
|
||||
padding-left: 2rem;
|
||||
margin-top: -1rem;
|
||||
padding-top: 1rem;
|
||||
margin-top: 0.5rem;
|
||||
border-top: 1px solid var(--p-content-border-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.sources-header {
|
||||
.subsection-title {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
margin-bottom: 0.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
|
||||
.group-icon {
|
||||
color: var(--primary-color);
|
||||
font-size: 0.9375rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.subsection-description {
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
.subsection-title {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
margin: 0;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
}
|
||||
|
||||
.subsection-description {
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0 0 1rem 0;
|
||||
}
|
||||
|
||||
.providers-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||
gap: 0.875rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.provider-item {
|
||||
width: 25rem;
|
||||
border-radius: 6px;
|
||||
padding: 0.75rem;
|
||||
background: var(--p-surface-800);
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 0.875rem;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: color-mix(in srgb, var(--primary-color) 40%, var(--p-content-border-color) 60%);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
padding: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,6 +209,9 @@
|
||||
.provider-label-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
gap: 1rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
@@ -145,14 +221,9 @@
|
||||
|
||||
.provider-label {
|
||||
font-weight: 500;
|
||||
width: 6rem;
|
||||
color: var(--p-text-color);
|
||||
font-size: 0.875rem;
|
||||
flex-shrink: 0;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
width: auto;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.provider-controls {
|
||||
@@ -209,8 +280,10 @@
|
||||
|
||||
.max-reviews-input {
|
||||
width: 4rem;
|
||||
padding: 0.25rem;
|
||||
padding: 0.375rem 0.5rem;
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 4px;
|
||||
background: var(--p-surface-800);
|
||||
color: var(--p-text-color);
|
||||
font-size: 0.875rem;
|
||||
text-align: center;
|
||||
|
||||
+45
-53
@@ -1,64 +1,56 @@
|
||||
<div class="main-container enclosing-container">
|
||||
<div class="settings-header">
|
||||
<h2 class="settings-title">
|
||||
<i class="pi pi-sort-alt"></i>
|
||||
<div class="settings-card">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-filter"></i>
|
||||
Filter Preferences
|
||||
</h2>
|
||||
<p class="settings-description">
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Configure default options for filter controls shown in the sidebar.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-content">
|
||||
<div class="preferences-section">
|
||||
<div class="settings-card">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">
|
||||
Filter Mode
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Choose the default mode for combining filters selected from the filter sidebar."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</label>
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="filterModes"
|
||||
[(ngModel)]="selectedFilterMode"
|
||||
(ngModelChange)="onFilterModeChange()"
|
||||
appendTo="body">
|
||||
</p-select>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Choose the default mode for combining filters selected from the right filter sidebar.
|
||||
</p>
|
||||
<div class="section-body">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Filter Mode</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Choose the default mode for combining filters selected from the right filter sidebar.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="filterModes"
|
||||
[(ngModel)]="selectedFilterMode"
|
||||
(ngModelChange)="onFilterModeChange()"
|
||||
appendTo="body">
|
||||
</p-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">
|
||||
Sorting Mode
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Choose how filter options are sorted in the sidebar."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</label>
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="filterSortingModes"
|
||||
[(ngModel)]="selectedFilterSortingMode"
|
||||
(ngModelChange)="onFilterSortingModeChange()"
|
||||
appendTo="body">
|
||||
</p-select>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Choose how filter options are sorted in the sidebar.
|
||||
</p>
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Sorting Mode</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Choose how filter options are sorted in the sidebar.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="filterSortingModes"
|
||||
[(ngModel)]="selectedFilterSortingMode"
|
||||
(ngModelChange)="onFilterSortingModeChange()"
|
||||
appendTo="body">
|
||||
</p-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+71
-60
@@ -1,77 +1,89 @@
|
||||
.main-container {
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.enclosing-container {
|
||||
border-color: var(--p-content-border-color);
|
||||
background: var(--p-content-background);
|
||||
}
|
||||
|
||||
.settings-header {
|
||||
margin-top: 1rem;
|
||||
.section-header {
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: var(--card-border);
|
||||
border-bottom-color: var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.settings-title {
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
gap: 0.5rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: var(--p-text-color);
|
||||
margin: 0 0 0.75rem 0;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
font-size: 1.25rem;
|
||||
color: var(--primary-color);
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-description {
|
||||
color: var(--p-text-muted-color);
|
||||
.section-description {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--p-text-muted-color);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.settings-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
}
|
||||
.section-body {
|
||||
padding-left: 1rem;
|
||||
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 1rem;
|
||||
> .setting-item {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
background: var(--p-content-background);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
gap: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
padding: 0.25rem 0;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
&.setting-item-indented {
|
||||
margin-top: 0.5rem;
|
||||
margin-left: 0;
|
||||
padding: 0.75rem 0.75rem 0.625rem 0.75rem;
|
||||
border-left: 3px solid var(--primary-color);
|
||||
border-bottom: none;
|
||||
background: var(--p-surface-800);
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
gap: 0.5rem;
|
||||
|
||||
&.setting-item-indented {
|
||||
margin-left: 0;
|
||||
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,54 +92,53 @@
|
||||
min-width: 0;
|
||||
|
||||
.setting-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
color: var(--text-color);
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
margin-bottom: 0.375rem;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.setting-label-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
gap: 0.75rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.setting-label {
|
||||
margin-bottom: 0;
|
||||
flex-shrink: 0;
|
||||
min-width: 120px;
|
||||
font-size: 0.9375rem;
|
||||
color: var(--text-color-secondary);
|
||||
}
|
||||
|
||||
p-select {
|
||||
min-width: 200px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
min-width: 180px;
|
||||
min-width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.setting-description {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.375rem;
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-control {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
align-items: flex-end;
|
||||
.pi {
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
.pi-info-circle {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-4
@@ -1,7 +1,6 @@
|
||||
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
||||
import {Select} from 'primeng/select';
|
||||
import {Tooltip} from 'primeng/tooltip';
|
||||
import {BookFilterMode, FilterSortingMode, SidebarLibrarySorting, SidebarShelfSorting, User, UserService, UserSettings, UserState} from '../../user-management/user.service';
|
||||
import {BookFilterMode, FilterSortingMode, User, UserService, UserSettings, UserState} from '../../user-management/user.service';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {Observable, Subject} from 'rxjs';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
@@ -11,7 +10,6 @@ import {filter, takeUntil} from 'rxjs/operators';
|
||||
selector: 'app-filter-preferences',
|
||||
imports: [
|
||||
Select,
|
||||
Tooltip,
|
||||
FormsModule
|
||||
],
|
||||
templateUrl: './filter-preferences.component.html',
|
||||
@@ -32,7 +30,7 @@ export class FilterPreferencesComponent implements OnInit, OnDestroy {
|
||||
|
||||
selectedFilterMode: BookFilterMode = 'and';
|
||||
selectedFilterSortingMode: FilterSortingMode = 'alphabetical';
|
||||
|
||||
|
||||
private readonly userService = inject(UserService);
|
||||
private readonly messageService = inject(MessageService);
|
||||
private readonly destroy$ = new Subject<void>();
|
||||
|
||||
+65
-73
@@ -1,86 +1,78 @@
|
||||
<div class="main-container enclosing-container">
|
||||
<div class="settings-header">
|
||||
<h2 class="settings-title">
|
||||
<div class="settings-card">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-cog"></i>
|
||||
View Preferences
|
||||
</h2>
|
||||
<p class="settings-description">
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Customize how you view metadata and series information.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-content">
|
||||
<div class="preferences-section">
|
||||
<div class="settings-card">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">
|
||||
Metadata Center Display Mode
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Choose whether to open the Metadata Center in the current page or as a popup dialog window."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</label>
|
||||
<div class="button-group">
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="viewMode === 'route'"
|
||||
(click)="onViewModeChange('route')">
|
||||
<i class="pi pi-window-maximize"></i>
|
||||
<span class="option-text">Open in Page</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="viewMode === 'dialog'"
|
||||
(click)="onViewModeChange('dialog')">
|
||||
<i class="pi pi-external-link"></i>
|
||||
<span class="option-text">Open in Dialog</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="section-body">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Metadata Center Display Mode</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Choose whether to open the Metadata Center in the current page or as a popup dialog window.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<div class="button-group">
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="viewMode === 'route'"
|
||||
(click)="onViewModeChange('route')">
|
||||
<i class="pi pi-window-maximize"></i>
|
||||
<span class="option-text">Open in Page</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="viewMode === 'dialog'"
|
||||
(click)="onViewModeChange('dialog')">
|
||||
<i class="pi pi-external-link"></i>
|
||||
<span class="option-text">Open in Dialog</span>
|
||||
</button>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Choose whether to open the Metadata Center in the current page or as a popup dialog window.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Series View Mode Setting -->
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">
|
||||
Series View Mode
|
||||
<i class="pi pi-info-circle text-sky-600"
|
||||
pTooltip="Enable or disable the series view mode for displaying series information."
|
||||
tooltipPosition="right"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
</label>
|
||||
<div class="button-group">
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="seriesViewMode === true"
|
||||
(click)="onSeriesViewModeChange(true)">
|
||||
<i class="pi pi-check-circle"></i>
|
||||
<span class="option-text">Enabled</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="seriesViewMode === false"
|
||||
(click)="onSeriesViewModeChange(false)">
|
||||
<i class="pi pi-times-circle"></i>
|
||||
<span class="option-text">Disabled</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Series View Mode</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Enable or disable the series view mode for displaying series information.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<div class="button-group">
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="seriesViewMode === true"
|
||||
(click)="onSeriesViewModeChange(true)">
|
||||
<i class="pi pi-check-circle"></i>
|
||||
<span class="option-text">Enabled</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="option-button"
|
||||
[class.selected]="seriesViewMode === false"
|
||||
(click)="onSeriesViewModeChange(false)">
|
||||
<i class="pi pi-times-circle"></i>
|
||||
<span class="option-text">Disabled</span>
|
||||
</button>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Enable or disable the series view mode for displaying series information.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+87
-38
@@ -1,14 +1,8 @@
|
||||
.main-container {
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.enclosing-container {
|
||||
border-color: var(--p-content-border-color);
|
||||
background: var(--p-content-background);
|
||||
}
|
||||
|
||||
.settings-header {
|
||||
margin-top: 1.25rem;
|
||||
margin-bottom: 1rem;
|
||||
@@ -36,42 +30,98 @@
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.section-body {
|
||||
padding-left: 1rem;
|
||||
|
||||
> .setting-item {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 1rem;
|
||||
.section-header {
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: var(--card-border);
|
||||
border-bottom-color: var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--primary-color);
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-description {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
color: var(--p-text-muted-color);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
background: var(--p-content-background);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
gap: 1rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
gap: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
padding: 0.25rem 0;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
&.setting-item-indented {
|
||||
margin-top: 0.5rem;
|
||||
margin-left: 0;
|
||||
padding: 0.75rem 0.75rem 0.625rem 0.75rem;
|
||||
border-left: 3px solid var(--primary-color);
|
||||
border-bottom: none;
|
||||
background: var(--p-surface-800);
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
gap: 0.5rem;
|
||||
|
||||
&.setting-item-indented {
|
||||
margin-left: 0;
|
||||
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,47 +130,46 @@
|
||||
min-width: 0;
|
||||
|
||||
.setting-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
color: var(--text-color);
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
margin-bottom: 0.375rem;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.setting-label-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
gap: 0.75rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.setting-label {
|
||||
margin-bottom: 0;
|
||||
flex-shrink: 0;
|
||||
min-width: 150px;
|
||||
font-size: 0.9375rem;
|
||||
color: var(--text-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.setting-description {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.375rem;
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-control {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
align-items: flex-end;
|
||||
.pi {
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
.pi-info-circle {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-2
@@ -1,5 +1,4 @@
|
||||
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
||||
import {Tooltip} from 'primeng/tooltip';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {UserService} from '../../user-management/user.service';
|
||||
import {MessageService} from 'primeng/api';
|
||||
@@ -9,7 +8,6 @@ import {Subject} from 'rxjs';
|
||||
@Component({
|
||||
selector: 'app-meta-center-view-mode-component',
|
||||
imports: [
|
||||
Tooltip,
|
||||
FormsModule
|
||||
],
|
||||
templateUrl: './meta-center-view-mode-component.html',
|
||||
|
||||
+67
-62
@@ -1,77 +1,82 @@
|
||||
<div class="main-container enclosing-container">
|
||||
<div class="settings-header">
|
||||
<h2 class="settings-title">
|
||||
<div class="settings-card">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-sort-alt"></i>
|
||||
Sidebar Library and Shelf Sorting Preference
|
||||
</h2>
|
||||
<p class="settings-description">
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Configure sorting options for your library and shelves names shown in the left menu sidebar.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-content">
|
||||
<div class="preferences-section">
|
||||
<div class="settings-card">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">
|
||||
Library
|
||||
</label>
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="sortingOptions"
|
||||
[(ngModel)]="selectedLibrarySorting"
|
||||
(ngModelChange)="onLibrarySortingChange()"
|
||||
appendTo="body"
|
||||
placeholder="Select Sorting">
|
||||
</p-select>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Choose how library names are sorted and displayed in the sidebar.
|
||||
</p>
|
||||
<div class="section-body">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Library</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Choose how library names are sorted and displayed in the sidebar.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="sortingOptions"
|
||||
[(ngModel)]="selectedLibrarySorting"
|
||||
(ngModelChange)="onLibrarySortingChange()"
|
||||
appendTo="body"
|
||||
placeholder="Select Sorting">
|
||||
</p-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">
|
||||
Shelf
|
||||
</label>
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="sortingOptions"
|
||||
[(ngModel)]="selectedShelfSorting"
|
||||
(ngModelChange)="onShelfSortingChange()"
|
||||
appendTo="body"
|
||||
placeholder="Select Sorting">
|
||||
</p-select>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Choose how shelf names are sorted and displayed in the sidebar.
|
||||
</p>
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Shelf</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Choose how shelf names are sorted and displayed in the sidebar.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="sortingOptions"
|
||||
[(ngModel)]="selectedShelfSorting"
|
||||
(ngModelChange)="onShelfSortingChange()"
|
||||
appendTo="body"
|
||||
placeholder="Select Sorting">
|
||||
</p-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">
|
||||
Magic Shelf
|
||||
</label>
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="sortingOptions"
|
||||
[(ngModel)]="selectedMagicShelfSorting"
|
||||
(ngModelChange)="onMagicShelfSortingChange()"
|
||||
appendTo="body"
|
||||
placeholder="Select Sorting">
|
||||
</p-select>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Choose how magic shelf names are sorted and displayed in the sidebar.
|
||||
</p>
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Magic Shelf</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Choose how magic shelf names are sorted and displayed in the sidebar.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="setting-item setting-item-indented">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<p-select
|
||||
size="small"
|
||||
[options]="sortingOptions"
|
||||
[(ngModel)]="selectedMagicShelfSorting"
|
||||
(ngModelChange)="onMagicShelfSortingChange()"
|
||||
appendTo="body"
|
||||
placeholder="Select Sorting">
|
||||
</p-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+88
-38
@@ -1,14 +1,8 @@
|
||||
.main-container {
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.enclosing-container {
|
||||
border-color: var(--p-content-border-color);
|
||||
background: var(--p-content-background);
|
||||
}
|
||||
|
||||
.settings-header {
|
||||
margin-top: 1.25rem;
|
||||
margin-bottom: 1rem;
|
||||
@@ -42,36 +36,93 @@
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 1rem;
|
||||
.section-header {
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: var(--card-border);
|
||||
border-bottom-color: var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.section-body {
|
||||
padding-left: 1rem;
|
||||
|
||||
> .setting-item {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--primary-color);
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-description {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
color: var(--p-text-muted-color);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
background: var(--p-content-background);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
gap: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
padding: 0.25rem 0;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
&.setting-item-indented {
|
||||
margin-top: 0.5rem;
|
||||
margin-left: 0;
|
||||
padding: 0.75rem 0.75rem 0.625rem 0.75rem;
|
||||
border-left: 3px solid var(--primary-color);
|
||||
border-bottom: none;
|
||||
background: var(--p-surface-800);
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
gap: 0.5rem;
|
||||
|
||||
&.setting-item-indented {
|
||||
margin-left: 0;
|
||||
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,54 +131,53 @@
|
||||
min-width: 0;
|
||||
|
||||
.setting-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
color: var(--text-color);
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
margin-bottom: 0.375rem;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.setting-label-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
gap: 0.75rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.setting-label {
|
||||
margin-bottom: 0;
|
||||
flex-shrink: 0;
|
||||
min-width: 120px;
|
||||
font-size: 0.9375rem;
|
||||
color: var(--text-color-secondary);
|
||||
}
|
||||
|
||||
p-select {
|
||||
min-width: 200px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
min-width: 180px;
|
||||
min-width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.setting-description {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.375rem;
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-control {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
align-items: flex-end;
|
||||
.pi {
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
.pi-info-circle {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-13
@@ -1,18 +1,9 @@
|
||||
<div class="w-full h-[calc(100dvh-10.5rem)] md:h-[calc(100dvh-11.65rem)] overflow-y-auto border rounded-lg enclosing-container">
|
||||
<div class="w-full h-[calc(100dvh-10.5rem)] md:h-[calc(100dvh-11.65rem)] overflow-y-auto">
|
||||
<app-view-preferences></app-view-preferences>
|
||||
<div class="pt-8">
|
||||
<p-divider></p-divider>
|
||||
</div>
|
||||
<div class="pt-10"><hr></div>
|
||||
<app-filter-preferences></app-filter-preferences>
|
||||
<div class="pt-8">
|
||||
<p-divider></p-divider>
|
||||
</div>
|
||||
<div class="pt-10"><hr></div>
|
||||
<app-sidebar-sorting-preferences></app-sidebar-sorting-preferences>
|
||||
<div class="pt-8">
|
||||
<p-divider></p-divider>
|
||||
</div>
|
||||
<div class="pt-10"><hr></div>
|
||||
<app-meta-center-view-mode-component></app-meta-center-view-mode-component>
|
||||
<div class="pt-8">
|
||||
<p-divider></p-divider>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
-2
@@ -1,5 +1,4 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {Divider} from 'primeng/divider';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {TableModule} from 'primeng/table';
|
||||
import {ToastModule} from 'primeng/toast';
|
||||
@@ -12,7 +11,6 @@ import {FilterPreferencesComponent} from './filter-preferences/filter-preference
|
||||
selector: 'app-view-preferences-parent',
|
||||
standalone: true,
|
||||
imports: [
|
||||
Divider,
|
||||
FormsModule,
|
||||
TableModule,
|
||||
ToastModule,
|
||||
|
||||
+92
-138
@@ -1,153 +1,107 @@
|
||||
<div class="main-container enclosing-container">
|
||||
<div class="settings-header">
|
||||
<h2 class="settings-title">
|
||||
<div class="settings-card">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-table"></i>
|
||||
Library and Shelf View & Sort Preferences
|
||||
</h2>
|
||||
<p class="settings-description">
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Configure default and per-library/shelf preferences for sorting and view mode (grid or table) in the browser.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-content">
|
||||
<div class="preferences-section">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-cog"></i>
|
||||
Default Settings
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Set the default sorting and view preferences that will apply to all libraries and shelves unless overridden.
|
||||
</p>
|
||||
<div class="section-body">
|
||||
<div class="setting-item">
|
||||
<label class="setting-label">Default Preferences</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Configure the default sorting field, direction, and view mode for all libraries and shelves.</span>
|
||||
</p>
|
||||
<div class="setting-controls">
|
||||
<p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||
[(ngModel)]="selectedSort" placeholder="Sort By" appendTo="body"></p-select>
|
||||
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="selectedSortDir"
|
||||
placeholder="Direction" appendTo="body"></p-select>
|
||||
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="selectedView"
|
||||
placeholder="View Mode" appendTo="body"></p-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<div class="setting-item">
|
||||
<div class="setting-info">
|
||||
<div class="setting-label-row">
|
||||
<label class="setting-label">Default Preferences</label>
|
||||
<div class="select-group">
|
||||
<div class="setting-item">
|
||||
<label class="setting-label">Auto-save on Navigation</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Automatically save changes when navigating to the next or previous book in the metadata editor.</span>
|
||||
</p>
|
||||
<div class="setting-controls">
|
||||
<label class="control-label">Enabled:</label>
|
||||
<p-toggleswitch [(ngModel)]="autoSaveMetadata"></p-toggleswitch>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting-item">
|
||||
<label class="setting-label">Override Management</label>
|
||||
<p class="setting-description">
|
||||
<i class="pi pi-info-circle"></i>
|
||||
<span>Add custom preferences for specific libraries or shelves. These will override your default settings.</span>
|
||||
</p>
|
||||
<div class="setting-controls">
|
||||
<p-button label="Add Override" outlined size="small" (onClick)="addOverride()"
|
||||
severity="success" icon="pi pi-plus" [disabled]="availableLibraries.length === 0"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (overrides.length > 0) {
|
||||
<div class="overrides-table">
|
||||
<p-table [value]="overrides" [tableStyle]="{'width': '100%'}">
|
||||
<ng-template pTemplate="header">
|
||||
<tr>
|
||||
<th style="min-width: 150px; max-width: 220px;">Type</th>
|
||||
<th style="min-width: 220px; max-width: 280px;">Name</th>
|
||||
<th style="min-width: 190px; max-width: 250px;">Sort By</th>
|
||||
<th style="min-width: 125px;">Direction</th>
|
||||
<th style="min-width: 125px;">View Mode</th>
|
||||
<th style="width: 75px; text-align: center;">Actions</th>
|
||||
</tr>
|
||||
</ng-template>
|
||||
<ng-template pTemplate="body" let-override let-rowIndex="rowIndex">
|
||||
<tr>
|
||||
<td>
|
||||
<p-select size="small" [options]="entityTypeOptions" [(ngModel)]="override.entityType"
|
||||
[style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td>
|
||||
@if (override.entityType) {
|
||||
<p-select size="small"
|
||||
[options]="getAvailableEntities(rowIndex, override.entityType)"
|
||||
[(ngModel)]="override.library"
|
||||
optionLabel="label" optionValue="value"
|
||||
[style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||
[(ngModel)]="selectedSort" placeholder="Sort By" class="select-item" appendTo="body"></p-select>
|
||||
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="selectedSortDir"
|
||||
placeholder="Direction" class="select-item" appendTo="body"></p-select>
|
||||
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="selectedView"
|
||||
placeholder="View Mode" class="select-item" appendTo="body"></p-select>
|
||||
</div>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Configure the default sorting field, direction, and view mode for all libraries and shelves.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
[(ngModel)]="override.sort" [style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td>
|
||||
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="override.sortDir"
|
||||
[style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td>
|
||||
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="override.view"
|
||||
[style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<p-button icon="pi pi-trash" severity="danger" size="small" [outlined]="true"
|
||||
(onClick)="removeOverride(rowIndex)" [pTooltip]="'Remove override'" tooltipPosition="left"></p-button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="preferences-section">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-pencil"></i>
|
||||
Metadata Editor Settings
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Configure behavior for the metadata editor.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<div class="setting-item no-border">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Auto-save on Navigation</label>
|
||||
<p class="setting-description">
|
||||
Automatically save changes when navigating to the next or previous book in the metadata editor.
|
||||
</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<p-toggleswitch [(ngModel)]="autoSaveMetadata"></p-toggleswitch>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="preferences-section">
|
||||
<div class="section-header">
|
||||
<h3 class="section-title">
|
||||
<i class="pi pi-list"></i>
|
||||
Specific Overrides
|
||||
</h3>
|
||||
<p class="section-description">
|
||||
Create specific sorting and view preferences for individual libraries or shelves that override the default settings.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-card">
|
||||
<div class="setting-item no-border">
|
||||
<div class="setting-info">
|
||||
<label class="setting-label">Override Management</label>
|
||||
<p class="setting-description">
|
||||
Add custom preferences for specific libraries or shelves. These will override your default settings.
|
||||
</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<p-button label="Add Override" outlined size="small" (onClick)="addOverride()"
|
||||
severity="success" icon="pi pi-plus" [disabled]="availableLibraries.length === 0"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (overrides.length > 0) {
|
||||
<div class="overrides-table">
|
||||
<p-table [value]="overrides" [tableStyle]="{'width': '100%'}">
|
||||
<ng-template pTemplate="header">
|
||||
<tr>
|
||||
<th style="min-width: 150px; max-width: 220px;">Type</th>
|
||||
<th style="min-width: 220px; max-width: 280px;">Name</th>
|
||||
<th style="min-width: 190px; max-width: 250px;">Sort By</th>
|
||||
<th style="min-width: 125px;">Direction</th>
|
||||
<th style="min-width: 125px;">View Mode</th>
|
||||
<th style="width: 75px; text-align: center;">Actions</th>
|
||||
</tr>
|
||||
</ng-template>
|
||||
<ng-template pTemplate="body" let-override let-rowIndex="rowIndex">
|
||||
<tr>
|
||||
<td>
|
||||
<p-select size="small" [options]="entityTypeOptions" [(ngModel)]="override.entityType"
|
||||
[style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td>
|
||||
@if (override.entityType) {
|
||||
<p-select size="small"
|
||||
[options]="getAvailableEntities(rowIndex, override.entityType)"
|
||||
[(ngModel)]="override.library"
|
||||
optionLabel="label" optionValue="value"
|
||||
[style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
<p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||
[(ngModel)]="override.sort" [style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td>
|
||||
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="override.sortDir"
|
||||
[style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td>
|
||||
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="override.view"
|
||||
[style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<p-button icon="pi pi-trash" severity="danger" size="small" [outlined]="true"
|
||||
(onClick)="removeOverride(rowIndex)" [pTooltip]="'Remove override'" tooltipPosition="left"></p-button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="save-section">
|
||||
<p-button label="Save Settings" icon="pi pi-save" severity="success" (onClick)="saveSettings()"></p-button>
|
||||
<p-button label="Save Settings" icon="pi pi-save" outlined severity="success" (onClick)="saveSettings()"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+87
-144
@@ -1,201 +1,144 @@
|
||||
.main-container {
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.enclosing-container {
|
||||
border-color: var(--p-content-border-color);
|
||||
background: var(--p-content-background);
|
||||
}
|
||||
|
||||
.settings-header {
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.settings-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: var(--p-text-color);
|
||||
margin: 0 0 0.75rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-description {
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.settings-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.preferences-section {
|
||||
@media (min-width: 768px) {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.5rem;
|
||||
border-bottom: var(--card-border);
|
||||
border-bottom-color: var(--p-content-border-color);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 1.125rem;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
color: var(--text-color);
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
color: var(--primary-color);
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-description {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.5rem;
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
color: var(--p-text-muted-color);
|
||||
margin: 0;
|
||||
|
||||
.pi {
|
||||
color: var(--p-primary-color);
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-card {
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
background: var(--p-content-background);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 1.5rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
padding: 0.75rem;
|
||||
gap: 0.875rem;
|
||||
}
|
||||
}
|
||||
|
||||
.section-body {
|
||||
padding-left: 1rem;
|
||||
|
||||
> .setting-item {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 2rem;
|
||||
padding: 0.25rem 0;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--p-content-border-color);
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
&.no-border {
|
||||
&.setting-item-indented {
|
||||
margin-top: 0.5rem;
|
||||
margin-left: 0;
|
||||
padding: 0.75rem 0.75rem 0.625rem 0.75rem;
|
||||
border-left: 3px solid var(--primary-color);
|
||||
border-bottom: none;
|
||||
background: var(--p-surface-800);
|
||||
border-radius: 6px;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
gap: 0.5rem;
|
||||
|
||||
.setting-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
&.setting-item-indented {
|
||||
margin-left: 0;
|
||||
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: var(--p-text-color);
|
||||
color: var(--text-color);
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.setting-label-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.setting-label {
|
||||
margin-bottom: 0;
|
||||
flex-shrink: 0;
|
||||
min-width: 180px;
|
||||
}
|
||||
|
||||
.select-group {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.select-item {
|
||||
min-width: 140px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
min-width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
margin-bottom: 0.375rem;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.setting-description {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.375rem;
|
||||
color: var(--p-text-muted-color);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
margin: 0 0 0.5rem 0;
|
||||
|
||||
.pi {
|
||||
margin-top: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
font-size: 0.875rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.setting-control {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
align-items: flex-end;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.select-group {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
.setting-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.select-item {
|
||||
min-width: 140px;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 0.5rem;
|
||||
margin-left: 0;
|
||||
padding: 0.75rem;
|
||||
border-left: 3px solid var(--primary-color);
|
||||
background: var(--p-surface-800);
|
||||
border-radius: 6px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
min-width: 100%;
|
||||
padding: 0.625rem;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.control-label {
|
||||
font-size: 0.9375rem;
|
||||
color: var(--text-color-secondary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
p-select {
|
||||
min-width: 140px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
min-width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -239,5 +182,5 @@
|
||||
.save-section {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
padding: 0 1rem;
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { MetadataRefreshOptions } from '../../features/metadata/model/request/metadata-refresh-options.model';
|
||||
import {MetadataRefreshOptions} from '../../features/metadata/model/request/metadata-refresh-options.model';
|
||||
|
||||
export interface MetadataMatchWeights {
|
||||
title: number;
|
||||
@@ -158,6 +158,26 @@ export interface AppSettings {
|
||||
coverCroppingSettings: CoverCroppingSettings;
|
||||
metadataDownloadOnBookdrop: boolean;
|
||||
telemetryEnabled: boolean;
|
||||
metadataProviderSpecificFields: MetadataProviderSpecificFields;
|
||||
}
|
||||
|
||||
export interface MetadataProviderSpecificFields {
|
||||
asin: boolean;
|
||||
amazonRating: boolean;
|
||||
amazonReviewCount: boolean;
|
||||
googleId: boolean;
|
||||
goodreadsId: boolean;
|
||||
goodreadsRating: boolean;
|
||||
goodreadsReviewCount: boolean;
|
||||
hardcoverId: boolean;
|
||||
hardcoverBookId: boolean;
|
||||
hardcoverRating: boolean;
|
||||
hardcoverReviewCount: boolean;
|
||||
comicvineId: boolean;
|
||||
lubimyczytacId: boolean;
|
||||
lubimyczytacRating: boolean;
|
||||
ranobedbId: boolean;
|
||||
ranobedbRating: boolean;
|
||||
}
|
||||
|
||||
export enum AppSettingKey {
|
||||
@@ -179,4 +199,5 @@ export enum AppSettingKey {
|
||||
KOBO_SETTINGS = 'KOBO_SETTINGS',
|
||||
COVER_CROPPING_SETTINGS = 'COVER_CROPPING_SETTINGS',
|
||||
TELEMETRY_ENABLED = 'TELEMETRY_ENABLED',
|
||||
METADATA_PROVIDER_SPECIFIC_FIELDS = 'METADATA_PROVIDER_SPECIFIC_FIELDS',
|
||||
}
|
||||
|
||||
@@ -105,7 +105,25 @@ describe('AppSettingsService', () => {
|
||||
smartCroppingEnabled: false
|
||||
},
|
||||
metadataDownloadOnBookdrop: false,
|
||||
telemetryEnabled: false
|
||||
telemetryEnabled: false,
|
||||
metadataProviderSpecificFields: {
|
||||
asin: false,
|
||||
amazonRating: false,
|
||||
amazonReviewCount: false,
|
||||
googleId: false,
|
||||
goodreadsId: false,
|
||||
goodreadsRating: false,
|
||||
goodreadsReviewCount: false,
|
||||
hardcoverId: false,
|
||||
hardcoverBookId: false,
|
||||
hardcoverRating: false,
|
||||
hardcoverReviewCount: false,
|
||||
comicvineId: false,
|
||||
lubimyczytacId: false,
|
||||
lubimyczytacRating: false,
|
||||
ranobedbId: false,
|
||||
ranobedbRating: false
|
||||
}
|
||||
};
|
||||
|
||||
const mockPublicSettings: PublicAppSettings = {
|
||||
@@ -457,7 +475,25 @@ describe('AppSettingsService - API Contract Tests', () => {
|
||||
smartCroppingEnabled: false
|
||||
},
|
||||
metadataDownloadOnBookdrop: false,
|
||||
telemetryEnabled: false
|
||||
telemetryEnabled: false,
|
||||
metadataProviderSpecificFields: {
|
||||
asin: false,
|
||||
amazonRating: false,
|
||||
amazonReviewCount: false,
|
||||
googleId: false,
|
||||
goodreadsId: false,
|
||||
goodreadsRating: false,
|
||||
goodreadsReviewCount: false,
|
||||
hardcoverId: false,
|
||||
hardcoverBookId: false,
|
||||
hardcoverRating: false,
|
||||
hardcoverReviewCount: false,
|
||||
comicvineId: false,
|
||||
lubimyczytacId: false,
|
||||
lubimyczytacRating: false,
|
||||
ranobedbId: false,
|
||||
ranobedbRating: false
|
||||
}
|
||||
};
|
||||
httpClientMock.get.mockReturnValue(of(mockSettings));
|
||||
service['fetchAppSettings']().subscribe(settings => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {inject, Injectable, Injector} from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {BehaviorSubject, Observable, of} from 'rxjs';
|
||||
import {catchError, finalize, shareReplay, tap} from 'rxjs/operators';
|
||||
import {catchError, finalize, map, shareReplay, switchMap, tap} from 'rxjs/operators';
|
||||
import {API_CONFIG} from '../../core/config/api-config';
|
||||
import {AppSettings, OidcProviderDetails} from '../model/app-settings.model';
|
||||
import {AuthService} from './auth.service';
|
||||
@@ -99,20 +99,8 @@ export class AppSettingsService {
|
||||
}));
|
||||
|
||||
return this.http.put<void>(this.apiUrl, payload).pipe(
|
||||
tap(() => {
|
||||
const current = this.appSettingsSubject.value;
|
||||
if (current) {
|
||||
settings.forEach(s => (current as any)[s.key] = s.newValue);
|
||||
this.appSettingsSubject.next({...current});
|
||||
this.syncPublicSettings(current);
|
||||
} else {
|
||||
this.loading$ = this.fetchAppSettings().pipe(
|
||||
shareReplay(1),
|
||||
finalize(() => (this.loading$ = null))
|
||||
);
|
||||
this.loading$.subscribe();
|
||||
}
|
||||
}),
|
||||
switchMap(() => this.fetchAppSettings()),
|
||||
map(() => void 0),
|
||||
catchError(err => {
|
||||
console.error('Error saving settings:', err);
|
||||
return of();
|
||||
|
||||
@@ -25,3 +25,4 @@
|
||||
/* Code, Mark & Selection */
|
||||
--code-background: var(--p-surface-900);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user