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)),
|
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)),
|
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_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
|
// ADMIN + MANAGE_GLOBAL_PREFERENCES
|
||||||
COVER_CROPPING_SETTINGS ("cover_cropping_settings", true, false, List.of(PermissionType.ADMIN, PermissionType.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 MetadataPublicReviewsSettings metadataPublicReviewsSettings;
|
||||||
private KoboSettings koboSettings;
|
private KoboSettings koboSettings;
|
||||||
private CoverCroppingSettings coverCroppingSettings;
|
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.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.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.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.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.uploadPattern(settingPersistenceHelper.getOrCreateSetting(AppSettingKey.UPLOAD_FILE_PATTERN, "{authors}/<{series}/><{seriesIndex}. >{title}< - {authors}>< ({year})>"));
|
||||||
builder.similarBookRecommendation(Boolean.parseBoolean(settingPersistenceHelper.getOrCreateSetting(AppSettingKey.SIMILAR_BOOK_RECOMMENDATION, "true")));
|
builder.similarBookRecommendation(Boolean.parseBoolean(settingPersistenceHelper.getOrCreateSetting(AppSettingKey.SIMILAR_BOOK_RECOMMENDATION, "true")));
|
||||||
|
|||||||
+21
@@ -301,4 +301,25 @@ public class SettingPersistenceHelper {
|
|||||||
.smartCroppingEnabled(false)
|
.smartCroppingEnabled(false)
|
||||||
.build();
|
.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>
|
</div>
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('asin')) {
|
||||||
<label for="asin">Amazon ASIN</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="asin">Amazon ASIN</label>
|
||||||
<input pSize="small" pInputText id="asin" formControlName="asin"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['asinLocked']) {
|
<input pSize="small" pInputText id="asin" formControlName="asin"/>
|
||||||
<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-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 (book.metadata!['asinLocked']) {
|
||||||
}
|
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('asin')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('amazonRating')) {
|
||||||
<label for="amazonRating">Amazon ★</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="amazonRating">Amazon ★</label>
|
||||||
<input pSize="small" pInputText id="amazonRating" formControlName="amazonRating"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['amazonRatingLocked']) {
|
<input pSize="small" pInputText id="amazonRating" formControlName="amazonRating"/>
|
||||||
<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-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 (book.metadata!['amazonRatingLocked']) {
|
||||||
}
|
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('amazonReviewCount')) {
|
||||||
<label for="amazonRatingCount">Amazon #</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="amazonRatingCount">Amazon #</label>
|
||||||
<input pSize="small" pInputText id="amazonRatingCount" formControlName="amazonReviewCount"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['amazonReviewCountLocked']) {
|
<input pSize="small" pInputText id="amazonRatingCount" formControlName="amazonReviewCount"/>
|
||||||
<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-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 (book.metadata!['amazonReviewCountLocked']) {
|
||||||
}
|
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('googleId')) {
|
||||||
<label for="googleId">Google Books ID</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="googleId">Google Books ID</label>
|
||||||
<input pSize="small" pInputText id="googleId" formControlName="googleId"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['googleIdLocked']) {
|
<input pSize="small" pInputText id="googleId" formControlName="googleId"/>
|
||||||
<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-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 (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>
|
@if (isFieldVisible('goodreadsId')) {
|
||||||
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-row metadata-ids-row">
|
<label for="goodreadsId">Goodreads ID</label>
|
||||||
<div class="field-group metadata-id-field">
|
<div class="field-with-lock">
|
||||||
<label for="goodreadsId">Goodreads ID</label>
|
<input pSize="small" pInputText id="goodreadsId" formControlName="goodreadsId"/>
|
||||||
<div class="field-with-lock">
|
@if (!book.metadata!['goodreadsIdLocked']) {
|
||||||
<input pSize="small" pInputText id="goodreadsId" formControlName="goodreadsId"/>
|
<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-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 (book.metadata!['goodreadsIdLocked']) {
|
}
|
||||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="warn"></p-button>
|
</div>
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('goodreadsRating')) {
|
||||||
<label for="goodreadsRating">Goodreads ★</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="goodreadsRating">Goodreads ★</label>
|
||||||
<input pSize="small" pInputText id="goodreadsRating" formControlName="goodreadsRating"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['goodreadsRatingLocked']) {
|
<input pSize="small" pInputText id="goodreadsRating" formControlName="goodreadsRating"/>
|
||||||
<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-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 (book.metadata!['goodreadsRatingLocked']) {
|
||||||
}
|
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('goodreadsReviewCount')) {
|
||||||
<label for="goodreadsReviewCount">Goodreads #</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="goodreadsReviewCount">Goodreads #</label>
|
||||||
<input pSize="small" pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['goodreadsReviewCountLocked']) {
|
<input pSize="small" pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount"/>
|
||||||
<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-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 (book.metadata!['goodreadsReviewCountLocked']) {
|
||||||
}
|
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('hardcoverId')) {
|
||||||
<label for="hardcoverId">Hardcover ID</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="hardcoverId">Hardcover ID</label>
|
||||||
<input pSize="small" pInputText id="hardcoverId" formControlName="hardcoverId"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['hardcoverIdLocked']) {
|
<input pSize="small" pInputText id="hardcoverId" formControlName="hardcoverId"/>
|
||||||
<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-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 (book.metadata!['hardcoverIdLocked']) {
|
||||||
}
|
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('hardcoverBookId')) {
|
||||||
<label for="hardcoverBookId">Hardcover Book ID</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="hardcoverBookId">Hardcover Book ID</label>
|
||||||
<input pSize="small" pInputText id="hardcoverBookId" formControlName="hardcoverBookId"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['hardcoverBookIdLocked']) {
|
<input pSize="small" pInputText id="hardcoverBookId" formControlName="hardcoverBookId"/>
|
||||||
<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-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 (book.metadata!['hardcoverBookIdLocked']) {
|
||||||
}
|
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverBookId')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('hardcoverRating')) {
|
||||||
<label for="hardcoverRating">Hardcover ★</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="hardcoverRating">Hardcover ★</label>
|
||||||
<input pSize="small" pInputText id="hardcoverRating" formControlName="hardcoverRating"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['hardcoverRatingLocked']) {
|
<input pSize="small" pInputText id="hardcoverRating" formControlName="hardcoverRating"/>
|
||||||
<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-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 (book.metadata!['hardcoverRatingLocked']) {
|
||||||
}
|
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('hardcoverReviewCount')) {
|
||||||
<label for="hardcoverReviewCount">Hardcover #</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="hardcoverReviewCount">Hardcover #</label>
|
||||||
<input pSize="small" pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['hardcoverReviewCountLocked']) {
|
<input pSize="small" pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount"/>
|
||||||
<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-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 (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>
|
@if (isFieldVisible('lubimyczytacId')) {
|
||||||
|
<div class="field-group metadata-id-field">
|
||||||
<div class="flex flex-col md:flex-row w-full gap-4 mt-2 pb-1">
|
<label for="lubimyczytacId">Lubimyczytac ID</label>
|
||||||
<div class="field-group metadata-id-field">
|
<div class="field-with-lock">
|
||||||
<label for="lubimyczytacId">LC ID</label>
|
<input pSize="small" pInputText id="lubimyczytacId" formControlName="lubimyczytacId"/>
|
||||||
<div class="field-with-lock">
|
@if (!book.metadata!['lubimyczytacIdLocked']) {
|
||||||
<input pSize="small" pInputText id="lubimyczytacId" formControlName="lubimyczytacId"/>
|
<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-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 (book.metadata!['lubimyczytacIdLocked']) {
|
}
|
||||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('lubimyczytacId')" severity="warn"></p-button>
|
</div>
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('lubimyczytacRating')) {
|
||||||
<label for="lubimyczytacRating">LC ★</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="lubimyczytacRating">Lubimyczytac ★</label>
|
||||||
<input pSize="small" pInputText id="lubimyczytacRating" formControlName="lubimyczytacRating"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['lubimyczytacRatingLocked']) {
|
<input pSize="small" pInputText id="lubimyczytacRating" formControlName="lubimyczytacRating"/>
|
||||||
<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-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 (book.metadata!['lubimyczytacRatingLocked']) {
|
||||||
}
|
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('lubimyczytacRating')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="field-group metadata-id-field">
|
@if (isFieldVisible('comicvineId')) {
|
||||||
<label for="comicvineId">Comicvine ID</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="field-with-lock">
|
<label for="comicvineId">Comicvine ID</label>
|
||||||
<input pSize="small" pInputText id="comicvineId" formControlName="comicvineId"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['comicvineIdLocked']) {
|
<input pSize="small" pInputText id="comicvineId" formControlName="comicvineId"/>
|
||||||
<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-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 (book.metadata!['comicvineIdLocked']) {
|
||||||
}
|
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('comicvineId')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="flex flex-col gap-1 md:w-1/6">
|
@if (isFieldVisible('ranobedbId')) {
|
||||||
<label class="text-sm" for="ranobedbId">Ranobedb ID</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="flex withbutton">
|
<label for="ranobedbId">Ranobedb ID</label>
|
||||||
<input pSize="small" pInputText id="ranobedbId" formControlName="ranobedbId" class="w-full"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['ranobedbIdLocked']) {
|
<input pSize="small" pInputText id="ranobedbId" formControlName="ranobedbId"/>
|
||||||
<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-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 (book.metadata!['ranobedbIdLocked']) {
|
||||||
}
|
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('ranobedbId')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
<div class="flex flex-col gap-1 md:w-1/6">
|
@if (isFieldVisible('ranobedbRating')) {
|
||||||
<label class="text-sm" for="ranobedbRating">Ranobedb ★</label>
|
<div class="field-group metadata-id-field">
|
||||||
<div class="flex withbutton">
|
<label for="ranobedbRating">Ranobedb ★</label>
|
||||||
<input pSize="small" pInputText id="ranobedbRating" formControlName="ranobedbRating" class="w-full"/>
|
<div class="field-with-lock">
|
||||||
@if (!book.metadata!['ranobedbRatingLocked']) {
|
<input pSize="small" pInputText id="ranobedbRating" formControlName="ranobedbRating"/>
|
||||||
<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-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 (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>
|
</div>
|
||||||
|
|
||||||
<div class="description-section">
|
<div class="description-section">
|
||||||
|
|||||||
+8
-5
@@ -238,16 +238,19 @@ label {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.metadata-ids-row {
|
.metadata-ids-row {
|
||||||
@media (min-width: 768px) {
|
display: grid;
|
||||||
.field-group {
|
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||||
width: calc(100% / 6);
|
gap: 1rem;
|
||||||
}
|
width: 100%;
|
||||||
|
|
||||||
|
.metadata-id-field {
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.metadata-id-field {
|
.metadata-id-field {
|
||||||
@media (min-width: 768px) {
|
@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 {BookMetadataHostService} from '../../../../../shared/service/book-metadata-host.service';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import {UserService} from '../../../../settings/user-management/user.service';
|
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({
|
@Component({
|
||||||
selector: "app-metadata-editor",
|
selector: "app-metadata-editor",
|
||||||
@@ -70,6 +72,7 @@ export class MetadataEditorComponent implements OnInit {
|
|||||||
private router = inject(Router);
|
private router = inject(Router);
|
||||||
private userService = inject(UserService);
|
private userService = inject(UserService);
|
||||||
private destroyRef = inject(DestroyRef);
|
private destroyRef = inject(DestroyRef);
|
||||||
|
private appSettingsService = inject(AppSettingsService);
|
||||||
|
|
||||||
metadataForm: FormGroup;
|
metadataForm: FormGroup;
|
||||||
currentBookId!: number;
|
currentBookId!: number;
|
||||||
@@ -98,6 +101,25 @@ export class MetadataEditorComponent implements OnInit {
|
|||||||
filteredSeries: string[] = [];
|
filteredSeries: string[] = [];
|
||||||
private metadataCenterViewMode: 'route' | 'dialog' = 'route';
|
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();
|
navigationState$ = this.bookNavigationService.getNavigationState();
|
||||||
|
|
||||||
filterCategories(event: { query: string }) {
|
filterCategories(event: { query: string }) {
|
||||||
@@ -239,6 +261,17 @@ export class MetadataEditorComponent implements OnInit {
|
|||||||
this.metadataCenterViewMode = userState.user?.userSettings.metadataCenterViewMode ?? 'route';
|
this.metadataCenterViewMode = userState.user?.userSettings.metadataCenterViewMode ?? 'route';
|
||||||
this.autoSaveEnabled = userState.user?.userSettings.autoSaveMetadata ?? false;
|
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 {
|
private prepareAutoComplete(): void {
|
||||||
@@ -493,9 +526,7 @@ export class MetadataEditorComponent implements OnInit {
|
|||||||
this.updateMetadata(false);
|
this.updateMetadata(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private buildMetadataWrapper(
|
private buildMetadataWrapper(shouldLockAllFields?: boolean): MetadataUpdateWrapper {
|
||||||
shouldLockAllFields?: boolean
|
|
||||||
): MetadataUpdateWrapper {
|
|
||||||
const form = this.metadataForm;
|
const form = this.metadataForm;
|
||||||
|
|
||||||
const metadata: BookMetadata = {
|
const metadata: BookMetadata = {
|
||||||
@@ -839,5 +870,9 @@ export class MetadataEditorComponent implements OnInit {
|
|||||||
return position ? `${position.current} of ${position.total}` : '';
|
return position ? `${position.current} of ${position.total}` : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isFieldVisible(field: keyof MetadataProviderSpecificFields): boolean {
|
||||||
|
return this.providerSpecificFields[field] ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
protected readonly sample = sample;
|
protected readonly sample = sample;
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-23
@@ -1,23 +1,23 @@
|
|||||||
@if (book$ | async; as book) {
|
@if (book$ | async; as book) {
|
||||||
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="flex flex-col h-full w-full">
|
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="form-container">
|
||||||
<div class="flex-grow overflow-auto p-0 md:p-4">
|
<div class="form-content">
|
||||||
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
<div class="metadata-header">
|
||||||
<p class="ml-3 text-lg">Current Metadata</p>
|
<p class="metadata-header-text">Current Metadata</p>
|
||||||
<p-button
|
<p-button
|
||||||
severity="success"
|
severity="info"
|
||||||
icon='pi pi-angle-left'
|
icon='pi pi-angle-left'
|
||||||
[ngStyle]="{'padding-left': '3rem', 'padding-right': '0.5rem'}"
|
class="button-left"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
pTooltip="Move all missing fields" tooltipPosition="bottom"
|
pTooltip="Move all missing fields" tooltipPosition="bottom"
|
||||||
(onClick)="copyMissing()"></p-button>
|
(onClick)="copyMissing()"></p-button>
|
||||||
<p-button
|
<p-button
|
||||||
severity="success"
|
severity="info"
|
||||||
icon='pi pi-angle-double-left'
|
icon='pi pi-angle-double-left'
|
||||||
[ngStyle]="{'padding-left': '0.5rem', 'padding-right': '2rem'}"
|
class="button-double-left"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
pTooltip="Move all fields" tooltipPosition="bottom"
|
pTooltip="Move all fields" tooltipPosition="bottom"
|
||||||
(onClick)="copyAll()"></p-button>
|
(onClick)="copyAll()"></p-button>
|
||||||
<p class="text-lg">Fetched Metadata</p>
|
<p class="metadata-header-text">Fetched Metadata</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label class="label"></label>
|
<label class="label"></label>
|
||||||
@@ -103,9 +103,9 @@
|
|||||||
@if (metadataForm.get(field.lockedKey)?.value) {
|
@if (metadataForm.get(field.lockedKey)?.value) {
|
||||||
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
<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
|
<p-autoComplete
|
||||||
class="w-full"
|
class="autocomplete-full-width"
|
||||||
formControlName="{{field.controlName}}"
|
formControlName="{{field.controlName}}"
|
||||||
[multiple]="true"
|
[multiple]="true"
|
||||||
[dropdown]="false"
|
[dropdown]="false"
|
||||||
@@ -131,12 +131,12 @@
|
|||||||
(mouseenter)="onMouseEnter(field.controlName)"
|
(mouseenter)="onMouseEnter(field.controlName)"
|
||||||
(mouseleave)="onMouseLeave(field.controlName)"/>
|
(mouseleave)="onMouseLeave(field.controlName)"/>
|
||||||
|
|
||||||
<div class="w-full px-4">
|
<div class="autocomplete-container">
|
||||||
<p-autoComplete
|
<p-autoComplete
|
||||||
[ngModel]="fetchedMetadata[field.fetchedKey] ?? []"
|
[ngModel]="fetchedMetadata[field.fetchedKey] ?? []"
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
[disabled]="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>
|
</p-autoComplete>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -198,33 +198,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
<div class="metadata-header">
|
||||||
<p class="ml-3 text-lg">Current Metadata</p>
|
<p class="metadata-header-text">Current Metadata</p>
|
||||||
<p-button
|
<p-button
|
||||||
severity="success"
|
severity="info"
|
||||||
icon='pi pi-angle-left'
|
icon='pi pi-angle-left'
|
||||||
[ngStyle]="{'padding-left': '3rem', 'padding-right': '0.5rem'}"
|
class="button-left"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
pTooltip="Move all missing fields" tooltipPosition="bottom"
|
pTooltip="Move all missing fields" tooltipPosition="bottom"
|
||||||
(onClick)="copyMissing()"></p-button>
|
(onClick)="copyMissing()"></p-button>
|
||||||
<p-button
|
<p-button
|
||||||
severity="success"
|
severity="info"
|
||||||
icon='pi pi-angle-double-left'
|
icon='pi pi-angle-double-left'
|
||||||
[ngStyle]="{'padding-left': '0.5rem', 'padding-right': '2rem'}"
|
class="button-double-left"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
pTooltip="Move all fields" tooltipPosition="bottom"
|
pTooltip="Move all fields" tooltipPosition="bottom"
|
||||||
(onClick)="copyAll()"></p-button>
|
(onClick)="copyAll()"></p-button>
|
||||||
<p class="text-lg">Fetched Metadata</p>
|
<p class="metadata-header-text">Fetched Metadata</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@if (!reviewMode) {
|
@if (!reviewMode) {
|
||||||
<div class="mt-auto">
|
<div class="form-footer">
|
||||||
<p-divider></p-divider>
|
<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>
|
<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="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-button label="Lock All" icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()"></p-button>
|
||||||
<p-divider layout="vertical"/>
|
<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 {
|
.form-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -7,7 +49,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
width: 7rem;
|
width: 8rem;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,6 +67,16 @@
|
|||||||
margin: 0 1rem;
|
margin: 0 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.autocomplete-container {
|
||||||
|
width: 100%;
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.autocomplete-full-width {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.thumbnail {
|
.thumbnail {
|
||||||
width: 15.625rem;
|
width: 15.625rem;
|
||||||
height: 21.875rem;
|
height: 21.875rem;
|
||||||
@@ -54,10 +106,31 @@
|
|||||||
--p-button-outlined-primary-color: #E32636;
|
--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 {
|
::ng-deep .p-inputchips {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.flex.flex-col.h-full.w-full {
|
@keyframes fadeIn {
|
||||||
animation: fadeIn 0.3s ease-in;
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+63
-22
@@ -4,7 +4,7 @@ import {MessageService} from 'primeng/api';
|
|||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {InputText} from 'primeng/inputtext';
|
import {InputText} from 'primeng/inputtext';
|
||||||
import {AsyncPipe, NgClass, NgStyle} from '@angular/common';
|
import {AsyncPipe, NgClass} from '@angular/common';
|
||||||
import {Divider} from 'primeng/divider';
|
import {Divider} from 'primeng/divider';
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {Tooltip} from 'primeng/tooltip';
|
import {Tooltip} from 'primeng/tooltip';
|
||||||
@@ -13,10 +13,11 @@ import {BookService} from '../../../../book/service/book.service';
|
|||||||
import {Textarea} from 'primeng/textarea';
|
import {Textarea} from 'primeng/textarea';
|
||||||
import {filter, map, take} from 'rxjs/operators';
|
import {filter, map, take} from 'rxjs/operators';
|
||||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||||
import {AutoComplete} from 'primeng/autocomplete';
|
import {AutoComplete, AutoCompleteSelectEvent} from 'primeng/autocomplete';
|
||||||
import {AutoCompleteSelectEvent} from 'primeng/autocomplete';
|
|
||||||
import {Image} from 'primeng/image';
|
import {Image} from 'primeng/image';
|
||||||
import {LazyLoadImageModule} from 'ng-lazyload-image';
|
import {LazyLoadImageModule} from 'ng-lazyload-image';
|
||||||
|
import {AppSettingsService} from '../../../../../shared/service/app-settings.service';
|
||||||
|
import {MetadataProviderSpecificFields} from '../../../../../shared/model/app-settings.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-metadata-picker',
|
selector: 'app-metadata-picker',
|
||||||
@@ -30,7 +31,6 @@ import {LazyLoadImageModule} from 'ng-lazyload-image';
|
|||||||
Divider,
|
Divider,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
NgClass,
|
NgClass,
|
||||||
NgStyle,
|
|
||||||
Tooltip,
|
Tooltip,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
Textarea,
|
Textarea,
|
||||||
@@ -66,23 +66,23 @@ export class MetadataPickerComponent implements OnInit {
|
|||||||
{label: 'Language', controlName: 'language', lockedKey: 'languageLocked', fetchedKey: 'language'},
|
{label: 'Language', controlName: 'language', lockedKey: 'languageLocked', fetchedKey: 'language'},
|
||||||
{label: 'ISBN-10', controlName: 'isbn10', lockedKey: 'isbn10Locked', fetchedKey: 'isbn10'},
|
{label: 'ISBN-10', controlName: 'isbn10', lockedKey: 'isbn10Locked', fetchedKey: 'isbn10'},
|
||||||
{label: 'ISBN-13', controlName: 'isbn13', lockedKey: 'isbn13Locked', fetchedKey: 'isbn13'},
|
{label: 'ISBN-13', controlName: 'isbn13', lockedKey: 'isbn13Locked', fetchedKey: 'isbn13'},
|
||||||
{label: 'ASIN', controlName: 'asin', lockedKey: 'asinLocked', fetchedKey: 'asin'},
|
{label: 'Pages', controlName: 'pageCount', lockedKey: 'pageCountLocked', fetchedKey: 'pageCount'},
|
||||||
{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: 'Google ID', controlName: 'googleId', lockedKey: 'googleIdLocked', fetchedKey: 'googleId'},
|
{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;
|
@Input() reviewMode!: boolean;
|
||||||
@@ -131,6 +131,9 @@ export class MetadataPickerComponent implements OnInit {
|
|||||||
private bookService = inject(BookService);
|
private bookService = inject(BookService);
|
||||||
protected urlHelper = inject(UrlHelperService);
|
protected urlHelper = inject(UrlHelperService);
|
||||||
private destroyRef = inject(DestroyRef);
|
private destroyRef = inject(DestroyRef);
|
||||||
|
private appSettingsService = inject(AppSettingsService);
|
||||||
|
|
||||||
|
private enabledProviderFields: MetadataProviderSpecificFields | null = null;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.metadataForm = new FormGroup({
|
this.metadataForm = new FormGroup({
|
||||||
@@ -205,6 +208,17 @@ export class MetadataPickerComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
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$
|
this.bookService.bookState$
|
||||||
.pipe(
|
.pipe(
|
||||||
@@ -318,7 +332,6 @@ export class MetadataPickerComponent implements OnInit {
|
|||||||
coverLocked: metadata.coverLocked || false,
|
coverLocked: metadata.coverLocked || false,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Always enable all fields before applying locked state
|
|
||||||
Object.keys(this.metadataForm.controls).forEach((key) => {
|
Object.keys(this.metadataForm.controls).forEach((key) => {
|
||||||
if (!key.endsWith('Locked')) {
|
if (!key.endsWith('Locked')) {
|
||||||
this.metadataForm.get(key)?.enable({emitEvent: false});
|
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) {
|
onAutoCompleteSelect(fieldName: string, event: AutoCompleteSelectEvent) {
|
||||||
const values = (this.metadataForm.get(fieldName)?.value as string[]) || [];
|
const values = (this.metadataForm.get(fieldName)?.value as string[]) || [];
|
||||||
if (!values.includes(event.value as string)) {
|
if (!values.includes(event.value as string)) {
|
||||||
@@ -387,7 +428,7 @@ export class MetadataPickerComponent implements OnInit {
|
|||||||
onSave(): void {
|
onSave(): void {
|
||||||
this.isSaving = true;
|
this.isSaving = true;
|
||||||
const updatedBookMetadata = this.buildMetadataWrapper(undefined);
|
const updatedBookMetadata = this.buildMetadataWrapper(undefined);
|
||||||
this.bookService.updateBookMetadata(this.currentBookId, updatedBookMetadata, true).subscribe({
|
this.bookService.updateBookMetadata(this.currentBookId, updatedBookMetadata, false).subscribe({
|
||||||
next: (bookMetadata) => {
|
next: (bookMetadata) => {
|
||||||
this.isSaving = false;
|
this.isSaving = false;
|
||||||
Object.keys(this.copiedFields).forEach((field) => {
|
Object.keys(this.copiedFields).forEach((field) => {
|
||||||
|
|||||||
+2
-2
@@ -21,7 +21,7 @@
|
|||||||
[options]="providers"
|
[options]="providers"
|
||||||
formControlName="provider"
|
formControlName="provider"
|
||||||
placeholder="Select providers"
|
placeholder="Select providers"
|
||||||
[styleClass]="'custom-multiselect'">
|
class="'custom-multiselect'">
|
||||||
</p-multiselect>
|
</p-multiselect>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
type="submit"
|
type="submit"
|
||||||
[disabled]="!isSearchEnabled || loading"
|
[disabled]="!isSearchEnabled || loading"
|
||||||
icon="pi pi-search"
|
icon="pi pi-search"
|
||||||
[styleClass]="'custom-search-button'">
|
class="'custom-search-button'">
|
||||||
</p-button>
|
</p-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+18
-5
@@ -74,6 +74,23 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
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.subscription.add(
|
||||||
this.route.paramMap
|
this.route.paramMap
|
||||||
.pipe(
|
.pipe(
|
||||||
@@ -94,11 +111,6 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
|||||||
distinctUntilChanged(([prevBook], [currBook]) => prevBook?.id === currBook?.id)
|
distinctUntilChanged(([prevBook], [currBook]) => prevBook?.id === currBook?.id)
|
||||||
)
|
)
|
||||||
.subscribe(([book, settings]) => {
|
.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!);
|
this.resetFormFromBook(book!);
|
||||||
|
|
||||||
if (settings!.autoBookSearch) {
|
if (settings!.autoBookSearch) {
|
||||||
@@ -127,6 +139,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.cancelRequest$.next();
|
this.cancelRequest$.next();
|
||||||
|
this.cancelRequest$.complete();
|
||||||
this.subscription.unsubscribe();
|
this.subscription.unsubscribe();
|
||||||
this.selectedFetchedMetadata$.complete();
|
this.selectedFetchedMetadata$.complete();
|
||||||
}
|
}
|
||||||
|
|||||||
+37
-12
@@ -25,17 +25,23 @@ export class MetadataAdvancedFetchOptionsComponent implements OnChanges {
|
|||||||
'title', 'subtitle', 'description', 'authors', 'publisher', 'publishedDate',
|
'title', 'subtitle', 'description', 'authors', 'publisher', 'publishedDate',
|
||||||
'seriesName', 'seriesNumber', 'seriesTotal', 'isbn13', 'isbn10',
|
'seriesName', 'seriesNumber', 'seriesTotal', 'isbn13', 'isbn10',
|
||||||
'language', 'categories', 'cover', 'pageCount',
|
'language', 'categories', 'cover', 'pageCount',
|
||||||
'asin', 'goodreadsId', 'comicvineId', 'hardcoverId', 'googleId', 'lubimyczytacId', 'ranobedbId',
|
'asin', 'amazonRating', 'amazonReviewCount',
|
||||||
'amazonRating', 'amazonReviewCount', 'goodreadsRating', 'goodreadsReviewCount',
|
'googleId',
|
||||||
'hardcoverRating', 'hardcoverReviewCount', 'lubimyczytacRating', 'ranobedbRating',
|
'goodreadsId', 'goodreadsRating', 'goodreadsReviewCount',
|
||||||
'moods', 'tags'
|
'hardcoverId', 'hardcoverRating', 'hardcoverReviewCount', 'moods', 'tags',
|
||||||
|
'comicvineId',
|
||||||
|
'lubimyczytacId', 'lubimyczytacRating',
|
||||||
|
'ranobedbId', 'ranobedbRating'
|
||||||
];
|
];
|
||||||
|
|
||||||
providerSpecificFields: (keyof FieldOptions)[] = [
|
providerSpecificFields: (keyof FieldOptions)[] = [
|
||||||
'asin', 'goodreadsId', 'comicvineId', 'hardcoverId', 'googleId', 'lubimyczytacId', 'ranobedbId',
|
'asin', 'amazonRating', 'amazonReviewCount',
|
||||||
'amazonRating', 'amazonReviewCount', 'goodreadsRating', 'goodreadsReviewCount',
|
'googleId',
|
||||||
'hardcoverRating', 'hardcoverReviewCount', 'lubimyczytacRating', 'ranobedbRating',
|
'goodreadsId', 'goodreadsRating', 'goodreadsReviewCount',
|
||||||
'moods', 'tags'
|
'hardcoverId', 'hardcoverRating', 'hardcoverReviewCount', 'moods', 'tags',
|
||||||
|
'comicvineId',
|
||||||
|
'lubimyczytacId', 'lubimyczytacRating',
|
||||||
|
'ranobedbId', 'ranobedbRating',
|
||||||
];
|
];
|
||||||
|
|
||||||
nonProviderSpecificFields: (keyof FieldOptions)[] = [
|
nonProviderSpecificFields: (keyof FieldOptions)[] = [
|
||||||
@@ -64,9 +70,28 @@ export class MetadataAdvancedFetchOptionsComponent implements OnChanges {
|
|||||||
private justSubmitted = false;
|
private justSubmitted = false;
|
||||||
|
|
||||||
private providerSpecificFieldsList = [
|
private providerSpecificFieldsList = [
|
||||||
'asin', 'goodreadsId','comicvineId', 'hardcoverId', 'googleId', 'lubimyczytacId', 'ranobedbId',
|
// Amazon
|
||||||
'amazonRating', 'amazonReviewCount', 'goodreadsRating', 'goodreadsReviewCount',
|
'asin', 'amazonRating', 'amazonReviewCount',
|
||||||
'hardcoverRating', 'hardcoverReviewCount', 'lubimyczytacRating', 'ranobedbRating',
|
|
||||||
|
// Google
|
||||||
|
'googleId',
|
||||||
|
|
||||||
|
// Goodreads
|
||||||
|
'goodreadsId', 'goodreadsRating', 'goodreadsReviewCount',
|
||||||
|
|
||||||
|
// Hardcover
|
||||||
|
'hardcoverId', 'hardcoverRating', 'hardcoverReviewCount',
|
||||||
|
|
||||||
|
// Comicvine
|
||||||
|
'comicvineId',
|
||||||
|
|
||||||
|
// Lubimyczytac
|
||||||
|
'lubimyczytacId', 'lubimyczytacRating',
|
||||||
|
|
||||||
|
// Ranobedb
|
||||||
|
'ranobedbId', 'ranobedbRating',
|
||||||
|
|
||||||
|
// Generic provider-specific
|
||||||
'moods', 'tags'
|
'moods', 'tags'
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -231,7 +256,7 @@ export class MetadataAdvancedFetchOptionsComponent implements OnChanges {
|
|||||||
'goodreadsReviewCount': 'Goodreads Review Count',
|
'goodreadsReviewCount': 'Goodreads Review Count',
|
||||||
'hardcoverRating': 'Hardcover Rating',
|
'hardcoverRating': 'Hardcover Rating',
|
||||||
'hardcoverReviewCount': 'Hardcover Review Count',
|
'hardcoverReviewCount': 'Hardcover Review Count',
|
||||||
'lubimyczytacId': 'LC ID',
|
'lubimyczytacId': 'Lubimyczytac ID',
|
||||||
'lubimyczytacRating': 'Lubimyczytac Rating',
|
'lubimyczytacRating': 'Lubimyczytac Rating',
|
||||||
'ranobedbId': 'Ranobedb ID',
|
'ranobedbId': 'Ranobedb ID',
|
||||||
'ranobedbRating': 'Ranobedb Rating',
|
'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">
|
<div class="settings-card">
|
||||||
<p class="text-lg flex items-center gap-2">
|
<div class="section-header">
|
||||||
Recalculate Metadata Scores:
|
<h3 class="section-title">
|
||||||
<i
|
<i class="pi pi-sliders-h"></i>
|
||||||
class="pi pi-info-circle text-blue-500"
|
Metadata Match Weights
|
||||||
pTooltip="Recomputes match scores for all books based on the latest weights."
|
</h3>
|
||||||
tooltipPosition="right"
|
<p class="section-description">
|
||||||
style="cursor: help;"
|
Configure how important each metadata field is when computing match scores. Higher weights make fields more influential in determining the overall match quality.
|
||||||
></i>
|
</p>
|
||||||
</p>
|
</div>
|
||||||
|
|
||||||
<p-button
|
<div class="section-body">
|
||||||
class="pl-4"
|
<div class="preferences-section">
|
||||||
type="button"
|
<div class="action-section">
|
||||||
icon="pi pi-refresh"
|
<div class="action-content">
|
||||||
label="Recalculate"
|
<div class="action-info">
|
||||||
[disabled]="isRecalculating"
|
<span class="action-label">Recalculate Metadata Scores</span>
|
||||||
(click)="recalculate()"
|
<span class="action-description">
|
||||||
outlined
|
<i class="pi pi-info-circle"></i>
|
||||||
></p-button>
|
Recomputes match scores for all books based on the latest weights.
|
||||||
</div>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
<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>
|
</div>
|
||||||
}
|
<p-button
|
||||||
|
type="button"
|
||||||
|
icon="pi pi-refresh"
|
||||||
|
label="Recalculate"
|
||||||
|
[disabled]="isRecalculating"
|
||||||
|
(click)="recalculate()"
|
||||||
|
outlined
|
||||||
|
></p-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 flex justify-end">
|
|
||||||
<p-button
|
<div class="weights-section">
|
||||||
type="button"
|
<div class="weights-header">
|
||||||
severity="success"
|
<span class="weights-icon pi pi-sliders-v"></span>
|
||||||
label="Save"
|
<h4 class="weights-label">Metadata Field Weights</h4>
|
||||||
icon="pi pi-save"
|
</div>
|
||||||
outlined
|
|
||||||
[disabled]="isSaving"
|
<form [formGroup]="form" class="weights-form">
|
||||||
(click)="save()">
|
<div class="weights-grid">
|
||||||
</p-button>
|
@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>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+199
@@ -2,3 +2,202 @@
|
|||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
border-radius: var(--card-border);
|
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 {MessageService} from 'primeng/api';
|
||||||
import {MetadataMatchWeightsService} from '../../../../shared/service/metadata-match-weights.service';
|
import {MetadataMatchWeightsService} from '../../../../shared/service/metadata-match-weights.service';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {Tooltip} from 'primeng/tooltip';
|
|
||||||
import {filter, take} from 'rxjs/operators';
|
import {filter, take} from 'rxjs/operators';
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {AppSettingKey, AppSettings} from '../../../../shared/model/app-settings.model';
|
import {AppSettingKey, AppSettings} from '../../../../shared/model/app-settings.model';
|
||||||
@@ -16,7 +15,6 @@ import {InputNumber} from 'primeng/inputnumber';
|
|||||||
imports: [
|
imports: [
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
Button,
|
Button,
|
||||||
Tooltip,
|
|
||||||
InputNumber
|
InputNumber
|
||||||
],
|
],
|
||||||
templateUrl: './metadata-match-weights-component.html',
|
templateUrl: './metadata-match-weights-component.html',
|
||||||
|
|||||||
+178
-158
@@ -1,171 +1,191 @@
|
|||||||
<div class="metadata-settings">
|
<div class="metadata-settings">
|
||||||
<div class="setting-item">
|
<div class="settings-card">
|
||||||
<div class="setting-info">
|
<div class="section-header">
|
||||||
<label class="setting-label">Enabled Metadata Providers</label>
|
<h3 class="section-title">
|
||||||
<p class="setting-description">
|
<i class="pi pi-cloud"></i>
|
||||||
<i class="pi pi-info-circle"></i>
|
Metadata Providers
|
||||||
Enable or configure third-party metadata sources for enhanced book information. Each provider offers different types of data and coverage.
|
</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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="providers-list">
|
<div class="section-body">
|
||||||
<div class="provider-item">
|
<div>
|
||||||
<div class="provider-control">
|
<h4 class="provider-group-title">Providers with Configuration</h4>
|
||||||
<div class="provider-info">
|
|
||||||
<p-checkbox [(ngModel)]="amazonEnabled" [binary]="true"></p-checkbox>
|
|
||||||
<label class="provider-label">Amazon</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="provider-config">
|
<div class="setting-item">
|
||||||
<div class="config-field">
|
<div class="setting-info">
|
||||||
<label class="config-label">Region</label>
|
<label class="setting-label">Amazon</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>
|
</div>
|
||||||
<p class="config-description">
|
<div class="setting-item setting-item-indented">
|
||||||
<i class="pi pi-info-circle"></i>
|
<div class="setting-info">
|
||||||
Providing your Amazon session cookie allows the app to access richer book metadata and bypass rate limits. Optional but recommended for best results.
|
<div class="setting-label-row">
|
||||||
</p>
|
<label class="setting-label">Enabled:</label>
|
||||||
<input
|
<p-toggleswitch [(ngModel)]="amazonEnabled"></p-toggleswitch>
|
||||||
type="text"
|
</div>
|
||||||
pInputText
|
@if (amazonEnabled) {
|
||||||
placeholder="Paste your Amazon cookie"
|
<div class="provider-config-fields">
|
||||||
fluid
|
<div class="config-field">
|
||||||
class="max-w-[60rem]"
|
<label class="config-label">Region</label>
|
||||||
[(ngModel)]="amazonCookie"/>
|
<p-select
|
||||||
</div>
|
[options]="amazonDomains"
|
||||||
</div>
|
[(ngModel)]="selectedAmazonDomain"
|
||||||
</div>
|
placeholder="Select Domain"
|
||||||
|
class="config-select">
|
||||||
|
</p-select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="provider-item">
|
<div class="config-field">
|
||||||
<div class="provider-control">
|
<div class="config-label-row">
|
||||||
<div class="provider-info">
|
<label class="config-label">Cookie (Optional, but highly recommended)</label>
|
||||||
<p-checkbox [(ngModel)]="goodreadsEnabled" [binary]="true"></p-checkbox>
|
<app-external-doc-link docType="amazonCookie"></app-external-doc-link>
|
||||||
<label class="provider-label">Goodreads</label>
|
</div>
|
||||||
</div>
|
<p class="config-description">
|
||||||
</div>
|
<i class="pi pi-info-circle"></i>
|
||||||
</div>
|
<span>Providing your Amazon session cookie allows the app to access richer book metadata and bypass rate limits.</span>
|
||||||
|
</p>
|
||||||
<div class="provider-item">
|
<input
|
||||||
<div class="provider-control">
|
type="text"
|
||||||
<div class="provider-info">
|
pInputText
|
||||||
<p-checkbox [(ngModel)]="googleEnabled" [binary]="true"></p-checkbox>
|
placeholder="Paste your Amazon cookie"
|
||||||
<label class="provider-label">Google</label>
|
[(ngModel)]="amazonCookie"
|
||||||
</div>
|
class="config-input"/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="provider-config">
|
}
|
||||||
<div class="config-field">
|
</div>
|
||||||
<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>
|
</div>
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
pInputText
|
|
||||||
placeholder="Enter Hardcover API token"
|
|
||||||
fluid
|
|
||||||
class="max-w-[60rem]"
|
|
||||||
[(ngModel)]="hardcoverToken"
|
|
||||||
(ngModelChange)="onTokenChange($event)"/>
|
|
||||||
</div>
|
</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>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+200
-17
@@ -1,22 +1,144 @@
|
|||||||
.metadata-settings {
|
.metadata-settings {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
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 {
|
.setting-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
flex-direction: column;
|
||||||
gap: 2rem;
|
padding-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid var(--p-content-border-color);
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
padding-bottom: 0;
|
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) {
|
@media (max-width: 768px) {
|
||||||
flex-direction: column;
|
gap: 0.5rem;
|
||||||
gap: 1rem;
|
|
||||||
|
&.setting-item-indented {
|
||||||
|
max-width: 100%;
|
||||||
|
margin-left: 0;
|
||||||
|
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,15 +149,30 @@
|
|||||||
.setting-label {
|
.setting-label {
|
||||||
display: block;
|
display: block;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--p-text-color);
|
color: var(--text-color);
|
||||||
font-size: 1rem;
|
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 {
|
.setting-description {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 0.5rem;
|
gap: 0.375rem;
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
@@ -44,7 +181,11 @@
|
|||||||
.pi {
|
.pi {
|
||||||
margin-top: 0.125rem;
|
margin-top: 0.125rem;
|
||||||
flex-shrink: 0;
|
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;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.provider-config-fields {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1rem;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.config-field {
|
.config-field {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -98,7 +247,7 @@
|
|||||||
|
|
||||||
.config-label {
|
.config-label {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: var(--p-text-color);
|
color: var(--text-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,27 +264,61 @@
|
|||||||
.config-description {
|
.config-description {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 0.5rem;
|
gap: 0.375rem;
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.8125rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
.pi {
|
.pi {
|
||||||
margin-top: 0.125rem;
|
margin-top: 0.125rem;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
color: var(--p-primary-color);
|
font-size: 0.8125rem;
|
||||||
|
color: var(--primary-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.config-select {
|
::ng-deep .config-select {
|
||||||
width: 100%;
|
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 {
|
.setting-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-end;
|
||||||
padding-top: 1rem;
|
}
|
||||||
|
|
||||||
|
.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 {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {TableModule} from 'primeng/table';
|
import {TableModule} from 'primeng/table';
|
||||||
import {Checkbox} from 'primeng/checkbox';
|
|
||||||
import {InputText} from 'primeng/inputtext';
|
import {InputText} from 'primeng/inputtext';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {AppSettingsService} from '../../../../shared/service/app-settings.service';
|
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 {MessageService} from 'primeng/api';
|
||||||
import {AppSettingKey} from '../../../../shared/model/app-settings.model';
|
import {AppSettingKey} from '../../../../shared/model/app-settings.model';
|
||||||
import {Select} from 'primeng/select';
|
import {Select} from 'primeng/select';
|
||||||
import {ExternalDocLinkComponent} from '../../../../shared/components/external-doc-link/external-doc-link.component';
|
import {ExternalDocLinkComponent} from '../../../../shared/components/external-doc-link/external-doc-link.component';
|
||||||
|
import { ToggleSwitchModule } from 'primeng/toggleswitch';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-metadata-provider-settings',
|
selector: 'app-metadata-provider-settings',
|
||||||
imports: [
|
imports: [
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
TableModule,
|
TableModule,
|
||||||
Checkbox,
|
|
||||||
InputText,
|
InputText,
|
||||||
Button,
|
Button,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
Select,
|
Select,
|
||||||
ExternalDocLinkComponent
|
ExternalDocLinkComponent,
|
||||||
|
ToggleSwitchModule
|
||||||
],
|
],
|
||||||
templateUrl: './metadata-provider-settings.component.html',
|
templateUrl: './metadata-provider-settings.component.html',
|
||||||
styleUrl: './metadata-provider-settings.component.scss'
|
styleUrl: './metadata-provider-settings.component.scss'
|
||||||
@@ -81,6 +82,7 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
|||||||
|
|
||||||
private appSettingsService = inject(AppSettingsService);
|
private appSettingsService = inject(AppSettingsService);
|
||||||
private messageService = inject(MessageService);
|
private messageService = inject(MessageService);
|
||||||
|
private destroyRef = inject(DestroyRef);
|
||||||
|
|
||||||
private appSettings$ = this.appSettingsService.appSettings$;
|
private appSettings$ = this.appSettingsService.appSettings$;
|
||||||
|
|
||||||
@@ -88,7 +90,7 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
|||||||
this.appSettings$
|
this.appSettings$
|
||||||
.pipe(
|
.pipe(
|
||||||
filter(settings => settings != null),
|
filter(settings => settings != null),
|
||||||
take(1)
|
takeUntilDestroyed(this.destroyRef)
|
||||||
)
|
)
|
||||||
.subscribe(settings => {
|
.subscribe(settings => {
|
||||||
const metadataProviderSettings = settings!.metadataProviderSettings;
|
const metadataProviderSettings = settings!.metadataProviderSettings;
|
||||||
@@ -117,9 +119,6 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
|||||||
|
|
||||||
onComicTokenChange(newToken: string): void {
|
onComicTokenChange(newToken: string): void {
|
||||||
this.comicvineToken = newToken;
|
this.comicvineToken = newToken;
|
||||||
if (!newToken.trim()) {
|
|
||||||
this.comicvineEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
saveSettings(): void {
|
saveSettings(): void {
|
||||||
@@ -132,12 +131,10 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
|||||||
cookie: this.amazonCookie,
|
cookie: this.amazonCookie,
|
||||||
domain: this.selectedAmazonDomain
|
domain: this.selectedAmazonDomain
|
||||||
},
|
},
|
||||||
|
|
||||||
comicvine: {
|
comicvine: {
|
||||||
enabled: this.comicvineEnabled,
|
enabled: this.comicvineEnabled,
|
||||||
apiKey: this.comicvineToken.trim()
|
apiKey: this.comicvineToken.trim()
|
||||||
},
|
},
|
||||||
|
|
||||||
goodReads: {enabled: this.goodreadsEnabled},
|
goodReads: {enabled: this.goodreadsEnabled},
|
||||||
google: {
|
google: {
|
||||||
enabled: this.googleEnabled,
|
enabled: this.googleEnabled,
|
||||||
|
|||||||
+111
-123
@@ -1,12 +1,15 @@
|
|||||||
<div class="preferences-section">
|
<div class="settings-card">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<h3 class="section-title">
|
<h3 class="section-title">
|
||||||
<i class="pi pi-save"></i>
|
<i class="pi pi-save"></i>
|
||||||
Metadata Persistence
|
Metadata Persistence
|
||||||
</h3>
|
</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>
|
||||||
|
|
||||||
<div class="settings-card">
|
<div class="section-notice">
|
||||||
<div class="warning-notice">
|
<div class="warning-notice">
|
||||||
<i class="pi pi-exclamation-triangle"></i>
|
<i class="pi pi-exclamation-triangle"></i>
|
||||||
<div>
|
<div>
|
||||||
@@ -14,149 +17,134 @@
|
|||||||
incomplete writes, or permanent data loss. Github issues related to network storage will not be supported.
|
incomplete writes, or permanent data loss. Github issues related to network storage will not be supported.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="info-notice unsupported-formats-note">
|
||||||
<div class="info-notice unsupported-formats-note" style="margin-bottom: 1rem;">
|
|
||||||
<i class="pi pi-info-circle"></i>
|
<i class="pi pi-info-circle"></i>
|
||||||
<div>
|
<div>
|
||||||
<strong>Note:</strong> Writing metadata is <b>not supported</b> for FB2, AZW3, and MOBI formats.
|
<strong>Note:</strong> Writing metadata is <b>not supported</b> for FB2, AZW3, and MOBI formats.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section-body">
|
||||||
<div class="setting-item">
|
<div class="setting-item">
|
||||||
<div class="setting-info">
|
<label class="setting-label">Write Metadata to EPUB</label>
|
||||||
<label class="setting-label">Write Metadata to EPUB</label>
|
<p class="setting-description">
|
||||||
<p class="setting-description">
|
<i class="pi pi-info-circle"></i>
|
||||||
<i class="pi pi-info-circle"></i>
|
<span>Write metadata directly into EPUB files when editing book information.</span>
|
||||||
Write metadata directly into EPUB files when editing book information.
|
</p>
|
||||||
</p>
|
<div class="setting-item setting-item-indented">
|
||||||
<div class="setting-item setting-item-indented">
|
<div class="setting-label-row">
|
||||||
<div class="setting-info">
|
<label class="setting-label">Enabled:</label>
|
||||||
<div class="setting-label-row">
|
<p-toggleswitch
|
||||||
<label class="setting-label">Enabled:</label>
|
[ngModel]="metadataPersistence.saveToOriginalFile.epub.enabled"
|
||||||
<p-toggleswitch
|
(onChange)="onSaveToOriginalFileToggle('epub')">
|
||||||
[ngModel]="metadataPersistence.saveToOriginalFile.epub.enabled"
|
</p-toggleswitch>
|
||||||
(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>
|
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
<div class="setting-item">
|
<div class="setting-item">
|
||||||
<div class="setting-info">
|
<label class="setting-label">Write Metadata to CBX</label>
|
||||||
<label class="setting-label">Write Metadata to CBX</label>
|
<p class="setting-description">
|
||||||
<p class="setting-description">
|
<i class="pi pi-info-circle"></i>
|
||||||
<i class="pi pi-info-circle"></i>
|
<span>Write metadata directly into CBX files when editing book information.</span>
|
||||||
Write metadata directly into CBX files when editing book information.
|
</p>
|
||||||
</p>
|
<div class="setting-item setting-item-indented">
|
||||||
<div class="setting-item setting-item-indented">
|
<div class="setting-label-row">
|
||||||
<div class="setting-info">
|
<label class="setting-label">Enabled:</label>
|
||||||
<div class="setting-label-row">
|
<p-toggleswitch
|
||||||
<label class="setting-label">Enabled:</label>
|
[ngModel]="metadataPersistence.saveToOriginalFile.cbx.enabled"
|
||||||
<p-toggleswitch
|
(onChange)="onSaveToOriginalFileToggle('cbx')">
|
||||||
[ngModel]="metadataPersistence.saveToOriginalFile.cbx.enabled"
|
</p-toggleswitch>
|
||||||
(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>
|
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
<div class="setting-item">
|
<div class="setting-item">
|
||||||
<div class="setting-info">
|
<label class="setting-label">Write Metadata to PDF</label>
|
||||||
<label class="setting-label">Write Metadata to PDF</label>
|
<p class="setting-description">
|
||||||
<p class="setting-description">
|
<i class="pi pi-info-circle"></i>
|
||||||
<i class="pi pi-info-circle"></i>
|
<span>Write metadata directly into PDF files when editing book information. <br>
|
||||||
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>
|
||||||
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>
|
||||||
</p>
|
<div class="setting-item setting-item-indented">
|
||||||
<div class="setting-item setting-item-indented">
|
<div class="setting-label-row">
|
||||||
<div class="setting-info">
|
<label class="setting-label">Enabled:</label>
|
||||||
<div class="setting-label-row">
|
<p-toggleswitch
|
||||||
<label class="setting-label">Enabled:</label>
|
[ngModel]="metadataPersistence.saveToOriginalFile.pdf.enabled"
|
||||||
<p-toggleswitch
|
(onChange)="onSaveToOriginalFileToggle('pdf')">
|
||||||
[ngModel]="metadataPersistence.saveToOriginalFile.pdf.enabled"
|
</p-toggleswitch>
|
||||||
(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>
|
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
<div class="setting-item">
|
<div class="setting-item">
|
||||||
<div class="setting-info">
|
<label class="setting-label">Auto-Move Files on Metadata Update</label>
|
||||||
<label class="setting-label">Auto-Move Files on Metadata Update</label>
|
<p class="setting-description">
|
||||||
<p class="setting-description">
|
<i class="pi pi-info-circle"></i>
|
||||||
<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>
|
||||||
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>
|
||||||
</p>
|
<div class="setting-item setting-item-indented">
|
||||||
<div class="setting-item setting-item-indented">
|
<div class="setting-label-row">
|
||||||
<div class="setting-info">
|
<label class="setting-label">Enabled:</label>
|
||||||
<div class="setting-label-row">
|
<p-toggleswitch
|
||||||
<label class="setting-label">Enabled:</label>
|
[ngModel]="metadataPersistence.moveFilesToLibraryPattern"
|
||||||
<p-toggleswitch
|
(onChange)="onPersistenceToggle('moveFilesToLibraryPattern')">
|
||||||
[ngModel]="metadataPersistence.moveFilesToLibraryPattern"
|
</p-toggleswitch>
|
||||||
(onChange)="onPersistenceToggle('moveFilesToLibraryPattern')">
|
|
||||||
</p-toggleswitch>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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 {
|
.section-header {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
border-bottom: var(--card-border);
|
||||||
|
border-bottom-color: var(--p-content-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-title {
|
.section-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
font-size: 1.125rem;
|
font-size: 1.25rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--p-text-color);
|
color: var(--text-color);
|
||||||
margin: 0;
|
margin: 0 0 0.5rem 0;
|
||||||
|
|
||||||
.pi {
|
.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 {
|
.settings-card {
|
||||||
border: 1px solid var(--p-content-border-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
background: var(--p-content-background);
|
|
||||||
padding: 1.5rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
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 {
|
.setting-item {
|
||||||
display: flex;
|
padding-bottom: 1rem;
|
||||||
align-items: flex-start;
|
border-bottom: 1px solid var(--p-content-border-color);
|
||||||
gap: 2rem;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
@@ -48,94 +65,67 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.setting-item-indented {
|
&.setting-item-indented {
|
||||||
margin-top: 1rem;
|
margin-top: 0.5rem;
|
||||||
margin-left: 1.5rem;
|
margin-left: 0;
|
||||||
padding-left: 1rem;
|
padding: 0.75rem 0.75rem 0.625rem 0.75rem;
|
||||||
border-left: 2px solid var(--p-border-color);
|
border-left: 3px solid var(--primary-color);
|
||||||
|
border-bottom: none;
|
||||||
|
background: var(--p-surface-800);
|
||||||
|
border-radius: 6px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: '';
|
display: none;
|
||||||
position: absolute;
|
|
||||||
left: -2px;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
width: 2px;
|
|
||||||
background: var(--p-primary-color);
|
|
||||||
opacity: 0.3;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
flex-direction: column;
|
gap: 0.5rem;
|
||||||
gap: 1rem;
|
|
||||||
|
|
||||||
&.setting-item-indented {
|
&.setting-item-indented {
|
||||||
margin-left: 1rem;
|
margin-left: 0;
|
||||||
padding-left: 0.75rem;
|
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.setting-info {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
|
|
||||||
.setting-label {
|
.setting-label {
|
||||||
display: block;
|
display: block;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--p-text-color);
|
color: var(--text-color);
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.375rem;
|
||||||
|
letter-spacing: -0.01em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-label-row {
|
.setting-label-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 0.75rem;
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.setting-label {
|
.setting-label {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
font-size: 0.9375rem;
|
||||||
|
color: var(--text-color-secondary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-description {
|
.setting-description {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 0.5rem;
|
gap: 0.375rem;
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin: 0;
|
margin: 0 0 0.5rem 0;
|
||||||
|
|
||||||
.pi {
|
.pi {
|
||||||
margin-top: 0.125rem;
|
margin-top: 0.125rem;
|
||||||
flex-shrink: 0;
|
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;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
|
font-size: 0.9375rem;
|
||||||
font-size: 0.9rem;
|
line-height: 1.5;
|
||||||
line-height: 1.55;
|
padding: 0.75rem 1rem;
|
||||||
|
border-radius: 8px;
|
||||||
padding: 0.875rem 1rem;
|
background: color-mix(in srgb, var(--ground-background) 85%, var(--p-red-600) 15%);
|
||||||
border-radius: 10px;
|
border: 1px solid color-mix(in srgb, var(--p-red-500) 30%, transparent 70%);
|
||||||
|
border-left: 3px solid var(--p-red-500);
|
||||||
background: color-mix(
|
color: var(--text-color);
|
||||||
in srgb,
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
|
||||||
var(--p-surface-900) 85%,
|
|
||||||
var(--p-red-600) 15%
|
|
||||||
);
|
|
||||||
|
|
||||||
border-left: 4px solid var(--p-red-500);
|
|
||||||
|
|
||||||
color: var(--p-text-color);
|
|
||||||
|
|
||||||
.pi-exclamation-triangle {
|
.pi-exclamation-triangle {
|
||||||
color: var(--p-red-400);
|
color: var(--p-red-400);
|
||||||
margin-top: 0.15rem;
|
margin-top: 0.125rem;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
font-size: 1.125rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
strong {
|
strong {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: var(--p-red-300);
|
color: var(--p-red-300);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.nested-settings {
|
@media (max-width: 768px) {
|
||||||
margin-top: 1rem;
|
padding: 0.625rem 0.75rem;
|
||||||
margin-left: 1.5rem;
|
gap: 0.625rem;
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-notice.unsupported-formats-note {
|
.info-notice.unsupported-formats-note {
|
||||||
background: color-mix(
|
background: color-mix(in srgb, var(--ground-background) 90%, var(--p-blue-600) 10%);
|
||||||
in srgb,
|
border: 1px solid color-mix(in srgb, var(--p-blue-400) 30%, transparent 70%);
|
||||||
var(--p-surface-900) 90%,
|
border-left: 3px solid var(--p-blue-400);
|
||||||
var(--p-blue-600) 10%
|
color: var(--text-color);
|
||||||
);
|
|
||||||
border-left: 4px solid var(--p-blue-400);
|
|
||||||
color: var(--p-text-color);
|
|
||||||
padding: 0.75rem 1rem;
|
padding: 0.75rem 1rem;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
|
||||||
.pi-info-circle {
|
.pi-info-circle {
|
||||||
color: var(--p-blue-400);
|
color: var(--p-blue-400);
|
||||||
margin-top: 0.15rem;
|
margin-top: 0.125rem;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
font-size: 1.125rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
strong {
|
strong {
|
||||||
color: var(--p-blue-300);
|
color: var(--p-blue-300);
|
||||||
font-weight: 700;
|
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="w-full h-[calc(100dvh-10.5rem)] md:h-[calc(100dvh-11.65rem)] overflow-y-auto">
|
||||||
<div class="settings-header">
|
<app-metadata-persistence-settings-component></app-metadata-persistence-settings-component>
|
||||||
<h2 class="settings-title">
|
<div class="pt-10"><hr></div>
|
||||||
<i class="pi pi-sliders-h"></i>
|
<div class="preferences-section">
|
||||||
Metadata Settings
|
<div class="settings-card">
|
||||||
</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="section-header">
|
<div class="section-header">
|
||||||
<h3 class="section-title">
|
<h3 class="section-title">
|
||||||
<i class="pi pi-download"></i>
|
<i class="pi pi-download"></i>
|
||||||
Auto-Download Metadata
|
Auto-Download Metadata
|
||||||
</h3>
|
</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>
|
||||||
|
|
||||||
<div class="settings-card">
|
<div class="setting-item">
|
||||||
<div class="setting-item">
|
<div class="setting-info">
|
||||||
<div class="setting-info">
|
<div class="setting-label-row">
|
||||||
<div class="setting-label-row">
|
<label class="setting-label">Auto-Download for BookDrop Files</label>
|
||||||
<label class="setting-label">Auto-Download for BookDrop Files</label>
|
<p-toggleswitch
|
||||||
<p-toggleswitch
|
[(ngModel)]="metadataDownloadOnBookdrop"
|
||||||
[(ngModel)]="metadataDownloadOnBookdrop"
|
(onChange)="onMetadataDownloadOnBookdropToggle($event.checked)">
|
||||||
(onChange)="onMetadataDownloadOnBookdropToggle($event.checked)">
|
</p-toggleswitch>
|
||||||
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
|
<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>
|
</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 {
|
.settings-header {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
@@ -49,13 +31,6 @@
|
|||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preferences-section {
|
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
|
||||||
padding: 0 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-header {
|
.section-header {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
|
||||||
@@ -69,10 +44,17 @@
|
|||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
|
|
||||||
.pi {
|
.pi {
|
||||||
color: var(--p-primary-color);
|
|
||||||
margin-top: 0.125rem;
|
margin-top: 0.125rem;
|
||||||
flex-shrink: 0;
|
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;
|
padding: 1.5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
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 {
|
.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 {MetadataMatchWeightsComponent} from '../global-preferences/metadata-match-weights/metadata-match-weights-component';
|
||||||
import {MetadataPersistenceSettingsComponent} from './metadata-persistence-settings/metadata-persistence-settings-component';
|
import {MetadataPersistenceSettingsComponent} from './metadata-persistence-settings/metadata-persistence-settings-component';
|
||||||
import {PublicReviewsSettingsComponent} from './public-reviews-settings/public-reviews-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({
|
@Component({
|
||||||
selector: 'app-metadata-settings-component',
|
selector: 'app-metadata-settings-component',
|
||||||
@@ -22,7 +23,8 @@ import {PublicReviewsSettingsComponent} from './public-reviews-settings/public-r
|
|||||||
MetadataMatchWeightsComponent,
|
MetadataMatchWeightsComponent,
|
||||||
ToggleSwitch,
|
ToggleSwitch,
|
||||||
MetadataPersistenceSettingsComponent,
|
MetadataPersistenceSettingsComponent,
|
||||||
PublicReviewsSettingsComponent
|
PublicReviewsSettingsComponent,
|
||||||
|
MetadataProviderFieldSelectorComponent
|
||||||
],
|
],
|
||||||
templateUrl: './metadata-settings-component.html',
|
templateUrl: './metadata-settings-component.html',
|
||||||
styleUrl: './metadata-settings-component.scss'
|
styleUrl: './metadata-settings-component.scss'
|
||||||
|
|||||||
+83
-68
@@ -1,80 +1,95 @@
|
|||||||
<div class="reviews-settings">
|
<div class="settings-card">
|
||||||
<div class="setting-item">
|
<div class="section-header">
|
||||||
<div class="setting-info">
|
<h3 class="section-title">
|
||||||
<div class="setting-label-row">
|
<i class="pi pi-star"></i>
|
||||||
<label class="setting-label">Download Public Reviews</label>
|
Public Reviews
|
||||||
<p-toggleswitch
|
</h3>
|
||||||
[(ngModel)]="publicReviewSettings.downloadEnabled"
|
<p class="section-description">
|
||||||
(onChange)="onPublicReviewsToggle($event.checked)">
|
Configure automatic downloading of user reviews from external platforms. Reviews can be fetched from Amazon, Goodreads, and Hardcover for offline access.
|
||||||
</p-toggleswitch>
|
</p>
|
||||||
</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>
|
</div>
|
||||||
|
|
||||||
@if (publicReviewSettings.downloadEnabled) {
|
<div class="section-body">
|
||||||
<div class="setting-item">
|
<div class="reviews-settings">
|
||||||
<div class="setting-info">
|
<div class="setting-item">
|
||||||
<div class="setting-label-row">
|
<div class="setting-info">
|
||||||
<label class="setting-label">Auto Download on Book Open</label>
|
<div class="setting-label-row">
|
||||||
<p-toggleswitch
|
<label class="setting-label">Download Public Reviews</label>
|
||||||
[(ngModel)]="publicReviewSettings.autoDownloadEnabled"
|
<p-toggleswitch
|
||||||
(onChange)="onAutoDownloadToggle($event.checked)">
|
[(ngModel)]="publicReviewSettings.downloadEnabled"
|
||||||
</p-toggleswitch>
|
(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>
|
||||||
<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>
|
||||||
|
|
||||||
<div class="providers-list">
|
@if (publicReviewSettings.downloadEnabled) {
|
||||||
@for (provider of publicReviewSettings.providers; track provider.provider) {
|
<div class="setting-item">
|
||||||
<div class="provider-item">
|
<div class="setting-info">
|
||||||
<div class="provider-setting">
|
<div class="setting-label-row">
|
||||||
<div class="provider-label-row">
|
<label class="setting-label">Auto Download on Book Open</label>
|
||||||
<label class="provider-label">{{ provider.provider }}</label>
|
<p-toggleswitch
|
||||||
<div class="provider-controls">
|
[(ngModel)]="publicReviewSettings.autoDownloadEnabled"
|
||||||
<p-toggleswitch
|
(onChange)="onAutoDownloadToggle($event.checked)">
|
||||||
[(ngModel)]="provider.enabled"
|
</p-toggleswitch>
|
||||||
(onChange)="onProviderToggle(provider.provider, $event.checked)">
|
</div>
|
||||||
</p-toggleswitch>
|
<p class="setting-description">
|
||||||
@if (provider.enabled) {
|
<i class="pi pi-info-circle"></i>
|
||||||
<div class="max-reviews-control">
|
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.
|
||||||
<label class="max-reviews-label">Max Reviews:</label>
|
</p>
|
||||||
<input
|
</div>
|
||||||
type="number"
|
</div>
|
||||||
class="max-reviews-input"
|
|
||||||
min="1"
|
<div class="review-sources-section">
|
||||||
max="10"
|
<div class="sources-header">
|
||||||
[(ngModel)]="provider.maxReviews"
|
<span class="group-icon pi pi-database"></span>
|
||||||
(blur)="onMaxReviewsChange(provider.provider, provider.maxReviews)"
|
<h4 class="subsection-title">Review Sources</h4>
|
||||||
title="Number of reviews to download (1-10)">
|
</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>
|
</div>
|
||||||
</div>
|
}
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
@if (publicReviewSettings.providers.length === 0) {
|
@if (publicReviewSettings.providers.length === 0) {
|
||||||
<div class="no-providers-message">
|
<div class="no-providers-message">
|
||||||
<i class="pi pi-exclamation-triangle"></i>
|
<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>
|
<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>
|
||||||
}
|
</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 {
|
.reviews-settings {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -9,6 +63,7 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
padding-bottom: 1.5rem;
|
padding-bottom: 1.5rem;
|
||||||
|
border-bottom: 1px solid var(--p-content-border-color);
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
@@ -77,48 +132,66 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.review-sources-section {
|
.review-sources-section {
|
||||||
padding-left: 2rem;
|
padding-top: 1rem;
|
||||||
margin-top: -1rem;
|
margin-top: 0.5rem;
|
||||||
|
border-top: 1px solid var(--p-content-border-color);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.sources-header {
|
.sources-header {
|
||||||
.subsection-title {
|
display: flex;
|
||||||
font-size: 1rem;
|
align-items: center;
|
||||||
font-weight: 600;
|
gap: 0.5rem;
|
||||||
color: var(--p-text-color);
|
padding-bottom: 0.5rem;
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
|
.group-icon {
|
||||||
|
color: var(--primary-color);
|
||||||
|
font-size: 0.9375rem;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.subsection-description {
|
.subsection-title {
|
||||||
color: var(--p-text-muted-color);
|
font-size: 0.9375rem;
|
||||||
font-size: 0.875rem;
|
font-weight: 600;
|
||||||
line-height: 1.5;
|
color: var(--p-text-color);
|
||||||
margin: 0;
|
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 {
|
.providers-list {
|
||||||
display: flex;
|
display: grid;
|
||||||
flex-direction: column;
|
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||||
gap: 1rem;
|
gap: 0.875rem;
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.provider-item {
|
.provider-item {
|
||||||
width: 25rem;
|
background: var(--card-background);
|
||||||
border-radius: 6px;
|
border: 1px solid var(--p-content-border-color);
|
||||||
padding: 0.75rem;
|
border-radius: 8px;
|
||||||
background: var(--p-surface-800);
|
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) {
|
@media (max-width: 768px) {
|
||||||
width: 100%;
|
padding: 0.75rem;
|
||||||
max-width: none;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,6 +209,9 @@
|
|||||||
.provider-label-row {
|
.provider-label-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -145,14 +221,9 @@
|
|||||||
|
|
||||||
.provider-label {
|
.provider-label {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
width: 6rem;
|
|
||||||
color: var(--p-text-color);
|
color: var(--p-text-color);
|
||||||
|
font-size: 0.875rem;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
width: auto;
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.provider-controls {
|
.provider-controls {
|
||||||
@@ -209,8 +280,10 @@
|
|||||||
|
|
||||||
.max-reviews-input {
|
.max-reviews-input {
|
||||||
width: 4rem;
|
width: 4rem;
|
||||||
padding: 0.25rem;
|
padding: 0.375rem 0.5rem;
|
||||||
|
border: 1px solid var(--p-content-border-color);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
background: var(--p-surface-800);
|
||||||
color: var(--p-text-color);
|
color: var(--p-text-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
+45
-53
@@ -1,64 +1,56 @@
|
|||||||
<div class="main-container enclosing-container">
|
<div class="settings-card">
|
||||||
<div class="settings-header">
|
<div class="section-header">
|
||||||
<h2 class="settings-title">
|
<h3 class="section-title">
|
||||||
<i class="pi pi-sort-alt"></i>
|
<i class="pi pi-filter"></i>
|
||||||
Filter Preferences
|
Filter Preferences
|
||||||
</h2>
|
</h3>
|
||||||
<p class="settings-description">
|
<p class="section-description">
|
||||||
Configure default options for filter controls shown in the sidebar.
|
Configure default options for filter controls shown in the sidebar.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="settings-content">
|
<div class="section-body">
|
||||||
<div class="preferences-section">
|
<div class="setting-item">
|
||||||
<div class="settings-card">
|
<div class="setting-info">
|
||||||
<div class="setting-item">
|
<label class="setting-label">Filter Mode</label>
|
||||||
<div class="setting-info">
|
<p class="setting-description">
|
||||||
<div class="setting-label-row">
|
<i class="pi pi-info-circle"></i>
|
||||||
<label class="setting-label">
|
<span>Choose the default mode for combining filters selected from the right filter sidebar.</span>
|
||||||
Filter Mode
|
</p>
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
</div>
|
||||||
pTooltip="Choose the default mode for combining filters selected from the filter sidebar."
|
<div class="setting-item setting-item-indented">
|
||||||
tooltipPosition="right"
|
<div class="setting-info">
|
||||||
style="cursor: pointer;">
|
<div class="setting-label-row">
|
||||||
</i>
|
<p-select
|
||||||
</label>
|
size="small"
|
||||||
<p-select
|
[options]="filterModes"
|
||||||
size="small"
|
[(ngModel)]="selectedFilterMode"
|
||||||
[options]="filterModes"
|
(ngModelChange)="onFilterModeChange()"
|
||||||
[(ngModel)]="selectedFilterMode"
|
appendTo="body">
|
||||||
(ngModelChange)="onFilterModeChange()"
|
</p-select>
|
||||||
appendTo="body">
|
|
||||||
</p-select>
|
|
||||||
</div>
|
|
||||||
<p class="setting-description">
|
|
||||||
Choose the default mode for combining filters selected from the right filter sidebar.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="setting-item">
|
<div class="setting-item">
|
||||||
<div class="setting-info">
|
<div class="setting-info">
|
||||||
<div class="setting-label-row">
|
<label class="setting-label">Sorting Mode</label>
|
||||||
<label class="setting-label">
|
<p class="setting-description">
|
||||||
Sorting Mode
|
<i class="pi pi-info-circle"></i>
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
<span>Choose how filter options are sorted in the sidebar.</span>
|
||||||
pTooltip="Choose how filter options are sorted in the sidebar."
|
</p>
|
||||||
tooltipPosition="right"
|
</div>
|
||||||
style="cursor: pointer;">
|
<div class="setting-item setting-item-indented">
|
||||||
</i>
|
<div class="setting-info">
|
||||||
</label>
|
<div class="setting-label-row">
|
||||||
<p-select
|
<p-select
|
||||||
size="small"
|
size="small"
|
||||||
[options]="filterSortingModes"
|
[options]="filterSortingModes"
|
||||||
[(ngModel)]="selectedFilterSortingMode"
|
[(ngModel)]="selectedFilterSortingMode"
|
||||||
(ngModelChange)="onFilterSortingModeChange()"
|
(ngModelChange)="onFilterSortingModeChange()"
|
||||||
appendTo="body">
|
appendTo="body">
|
||||||
</p-select>
|
</p-select>
|
||||||
</div>
|
|
||||||
<p class="setting-description">
|
|
||||||
Choose how filter options are sorted in the sidebar.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+71
-60
@@ -1,77 +1,89 @@
|
|||||||
.main-container {
|
.section-header {
|
||||||
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: 1rem;
|
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;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.75rem;
|
gap: 0.5rem;
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
font-weight: 700;
|
font-weight: 600;
|
||||||
color: var(--p-text-color);
|
color: var(--text-color);
|
||||||
margin: 0 0 0.75rem 0;
|
margin: 0 0 0.5rem 0;
|
||||||
|
|
||||||
.pi {
|
.pi {
|
||||||
color: var(--p-primary-color);
|
color: var(--primary-color);
|
||||||
font-size: 1.25rem;
|
font-size: 1.125rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-description {
|
.section-description {
|
||||||
color: var(--p-text-muted-color);
|
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin-bottom: 1rem;
|
color: var(--p-text-muted-color);
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-content {
|
.section-body {
|
||||||
display: flex;
|
padding-left: 1rem;
|
||||||
flex-direction: column;
|
|
||||||
gap: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.preferences-section {
|
> .setting-item {
|
||||||
@media (min-width: 768px) {
|
margin-bottom: 0.75rem;
|
||||||
padding: 0 1rem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-card {
|
.settings-card {
|
||||||
border: 1px solid var(--p-content-border-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
background: var(--p-content-background);
|
|
||||||
padding: 1.5rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1rem;
|
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 {
|
.setting-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
flex-direction: column;
|
||||||
gap: 2rem;
|
gap: 0.5rem;
|
||||||
padding: 0.25rem 0;
|
padding-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid var(--p-content-border-color);
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
padding-bottom: 0;
|
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) {
|
@media (max-width: 768px) {
|
||||||
flex-direction: column;
|
gap: 0.5rem;
|
||||||
gap: 1rem;
|
|
||||||
|
&.setting-item-indented {
|
||||||
|
margin-left: 0;
|
||||||
|
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,54 +92,53 @@
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
||||||
.setting-label {
|
.setting-label {
|
||||||
display: flex;
|
display: block;
|
||||||
align-items: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--p-text-color);
|
color: var(--text-color);
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.375rem;
|
||||||
|
letter-spacing: -0.01em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-label-row {
|
.setting-label-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 0.75rem;
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.setting-label {
|
.setting-label {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
min-width: 120px;
|
font-size: 0.9375rem;
|
||||||
|
color: var(--text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
p-select {
|
p-select {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
min-width: 180px;
|
min-width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-description {
|
.setting-description {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 0.375rem;
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-control {
|
.pi {
|
||||||
flex-shrink: 0;
|
margin-top: 0.125rem;
|
||||||
display: flex;
|
flex-shrink: 0;
|
||||||
flex-direction: column;
|
font-size: 0.875rem;
|
||||||
gap: 0.75rem;
|
}
|
||||||
align-items: flex-end;
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
.pi-info-circle {
|
||||||
align-items: flex-start;
|
color: var(--primary-color);
|
||||||
width: 100%;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-3
@@ -1,7 +1,6 @@
|
|||||||
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {Select} from 'primeng/select';
|
import {Select} from 'primeng/select';
|
||||||
import {Tooltip} from 'primeng/tooltip';
|
import {BookFilterMode, FilterSortingMode, User, UserService, UserSettings, UserState} from '../../user-management/user.service';
|
||||||
import {BookFilterMode, FilterSortingMode, SidebarLibrarySorting, SidebarShelfSorting, User, UserService, UserSettings, UserState} from '../../user-management/user.service';
|
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
import {Observable, Subject} from 'rxjs';
|
import {Observable, Subject} from 'rxjs';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
@@ -11,7 +10,6 @@ import {filter, takeUntil} from 'rxjs/operators';
|
|||||||
selector: 'app-filter-preferences',
|
selector: 'app-filter-preferences',
|
||||||
imports: [
|
imports: [
|
||||||
Select,
|
Select,
|
||||||
Tooltip,
|
|
||||||
FormsModule
|
FormsModule
|
||||||
],
|
],
|
||||||
templateUrl: './filter-preferences.component.html',
|
templateUrl: './filter-preferences.component.html',
|
||||||
|
|||||||
+65
-73
@@ -1,86 +1,78 @@
|
|||||||
<div class="main-container enclosing-container">
|
<div class="settings-card">
|
||||||
<div class="settings-header">
|
<div class="section-header">
|
||||||
<h2 class="settings-title">
|
<h3 class="section-title">
|
||||||
<i class="pi pi-cog"></i>
|
<i class="pi pi-cog"></i>
|
||||||
View Preferences
|
View Preferences
|
||||||
</h2>
|
</h3>
|
||||||
<p class="settings-description">
|
<p class="section-description">
|
||||||
Customize how you view metadata and series information.
|
Customize how you view metadata and series information.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="settings-content">
|
<div class="section-body">
|
||||||
<div class="preferences-section">
|
<div class="setting-item">
|
||||||
<div class="settings-card">
|
<div class="setting-info">
|
||||||
<div class="setting-item">
|
<label class="setting-label">Metadata Center Display Mode</label>
|
||||||
<div class="setting-info">
|
<p class="setting-description">
|
||||||
<div class="setting-label-row">
|
<i class="pi pi-info-circle"></i>
|
||||||
<label class="setting-label">
|
<span>Choose whether to open the Metadata Center in the current page or as a popup dialog window.</span>
|
||||||
Metadata Center Display Mode
|
</p>
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
</div>
|
||||||
pTooltip="Choose whether to open the Metadata Center in the current page or as a popup dialog window."
|
<div class="setting-item setting-item-indented">
|
||||||
tooltipPosition="right"
|
<div class="setting-info">
|
||||||
style="cursor: pointer;">
|
<div class="setting-label-row">
|
||||||
</i>
|
<div class="button-group">
|
||||||
</label>
|
<button
|
||||||
<div class="button-group">
|
type="button"
|
||||||
<button
|
class="option-button"
|
||||||
type="button"
|
[class.selected]="viewMode === 'route'"
|
||||||
class="option-button"
|
(click)="onViewModeChange('route')">
|
||||||
[class.selected]="viewMode === 'route'"
|
<i class="pi pi-window-maximize"></i>
|
||||||
(click)="onViewModeChange('route')">
|
<span class="option-text">Open in Page</span>
|
||||||
<i class="pi pi-window-maximize"></i>
|
</button>
|
||||||
<span class="option-text">Open in Page</span>
|
<button
|
||||||
</button>
|
type="button"
|
||||||
<button
|
class="option-button"
|
||||||
type="button"
|
[class.selected]="viewMode === 'dialog'"
|
||||||
class="option-button"
|
(click)="onViewModeChange('dialog')">
|
||||||
[class.selected]="viewMode === 'dialog'"
|
<i class="pi pi-external-link"></i>
|
||||||
(click)="onViewModeChange('dialog')">
|
<span class="option-text">Open in Dialog</span>
|
||||||
<i class="pi pi-external-link"></i>
|
</button>
|
||||||
<span class="option-text">Open in Dialog</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
<!-- Series View Mode Setting -->
|
</div>
|
||||||
<div class="setting-item">
|
</div>
|
||||||
<div class="setting-info">
|
|
||||||
<div class="setting-label-row">
|
<div class="setting-item">
|
||||||
<label class="setting-label">
|
<div class="setting-info">
|
||||||
Series View Mode
|
<label class="setting-label">Series View Mode</label>
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
<p class="setting-description">
|
||||||
pTooltip="Enable or disable the series view mode for displaying series information."
|
<i class="pi pi-info-circle"></i>
|
||||||
tooltipPosition="right"
|
<span>Enable or disable the series view mode for displaying series information.</span>
|
||||||
style="cursor: pointer;">
|
</p>
|
||||||
</i>
|
</div>
|
||||||
</label>
|
<div class="setting-item setting-item-indented">
|
||||||
<div class="button-group">
|
<div class="setting-info">
|
||||||
<button
|
<div class="setting-label-row">
|
||||||
type="button"
|
<div class="button-group">
|
||||||
class="option-button"
|
<button
|
||||||
[class.selected]="seriesViewMode === true"
|
type="button"
|
||||||
(click)="onSeriesViewModeChange(true)">
|
class="option-button"
|
||||||
<i class="pi pi-check-circle"></i>
|
[class.selected]="seriesViewMode === true"
|
||||||
<span class="option-text">Enabled</span>
|
(click)="onSeriesViewModeChange(true)">
|
||||||
</button>
|
<i class="pi pi-check-circle"></i>
|
||||||
<button
|
<span class="option-text">Enabled</span>
|
||||||
type="button"
|
</button>
|
||||||
class="option-button"
|
<button
|
||||||
[class.selected]="seriesViewMode === false"
|
type="button"
|
||||||
(click)="onSeriesViewModeChange(false)">
|
class="option-button"
|
||||||
<i class="pi pi-times-circle"></i>
|
[class.selected]="seriesViewMode === false"
|
||||||
<span class="option-text">Disabled</span>
|
(click)="onSeriesViewModeChange(false)">
|
||||||
</button>
|
<i class="pi pi-times-circle"></i>
|
||||||
</div>
|
<span class="option-text">Disabled</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p class="setting-description">
|
|
||||||
Enable or disable the series view mode for displaying series information.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+87
-38
@@ -1,14 +1,8 @@
|
|||||||
.main-container {
|
.main-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 1rem;
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.enclosing-container {
|
|
||||||
border-color: var(--p-content-border-color);
|
|
||||||
background: var(--p-content-background);
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-header {
|
.settings-header {
|
||||||
margin-top: 1.25rem;
|
margin-top: 1.25rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
@@ -36,42 +30,98 @@
|
|||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.section-body {
|
||||||
|
padding-left: 1rem;
|
||||||
|
|
||||||
|
> .setting-item {
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.settings-content {
|
.settings-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preferences-section {
|
.section-header {
|
||||||
@media (min-width: 768px) {
|
margin-bottom: 1rem;
|
||||||
padding: 0 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 {
|
.settings-card {
|
||||||
border: 1px solid var(--p-content-border-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
background: var(--p-content-background);
|
|
||||||
padding: 1.5rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
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 {
|
.setting-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
flex-direction: column;
|
||||||
gap: 2rem;
|
gap: 0.5rem;
|
||||||
padding: 0.25rem 0;
|
padding-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid var(--p-content-border-color);
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
padding-bottom: 0;
|
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) {
|
@media (max-width: 768px) {
|
||||||
flex-direction: column;
|
gap: 0.5rem;
|
||||||
gap: 1rem;
|
|
||||||
|
&.setting-item-indented {
|
||||||
|
margin-left: 0;
|
||||||
|
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,47 +130,46 @@
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
||||||
.setting-label {
|
.setting-label {
|
||||||
display: flex;
|
display: block;
|
||||||
align-items: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--p-text-color);
|
color: var(--text-color);
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.375rem;
|
||||||
|
letter-spacing: -0.01em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-label-row {
|
.setting-label-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 0.75rem;
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.setting-label {
|
.setting-label {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
min-width: 150px;
|
font-size: 0.9375rem;
|
||||||
|
color: var(--text-color-secondary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-description {
|
.setting-description {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 0.375rem;
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-control {
|
.pi {
|
||||||
flex-shrink: 0;
|
margin-top: 0.125rem;
|
||||||
display: flex;
|
flex-shrink: 0;
|
||||||
flex-direction: column;
|
font-size: 0.875rem;
|
||||||
gap: 0.75rem;
|
}
|
||||||
align-items: flex-end;
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
.pi-info-circle {
|
||||||
align-items: flex-start;
|
color: var(--primary-color);
|
||||||
width: 100%;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-2
@@ -1,5 +1,4 @@
|
|||||||
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {Tooltip} from 'primeng/tooltip';
|
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {UserService} from '../../user-management/user.service';
|
import {UserService} from '../../user-management/user.service';
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
@@ -9,7 +8,6 @@ import {Subject} from 'rxjs';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-meta-center-view-mode-component',
|
selector: 'app-meta-center-view-mode-component',
|
||||||
imports: [
|
imports: [
|
||||||
Tooltip,
|
|
||||||
FormsModule
|
FormsModule
|
||||||
],
|
],
|
||||||
templateUrl: './meta-center-view-mode-component.html',
|
templateUrl: './meta-center-view-mode-component.html',
|
||||||
|
|||||||
+67
-62
@@ -1,77 +1,82 @@
|
|||||||
<div class="main-container enclosing-container">
|
<div class="settings-card">
|
||||||
<div class="settings-header">
|
<div class="section-header">
|
||||||
<h2 class="settings-title">
|
<h3 class="section-title">
|
||||||
<i class="pi pi-sort-alt"></i>
|
<i class="pi pi-sort-alt"></i>
|
||||||
Sidebar Library and Shelf Sorting Preference
|
Sidebar Library and Shelf Sorting Preference
|
||||||
</h2>
|
</h3>
|
||||||
<p class="settings-description">
|
<p class="section-description">
|
||||||
Configure sorting options for your library and shelves names shown in the left menu sidebar.
|
Configure sorting options for your library and shelves names shown in the left menu sidebar.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="settings-content">
|
<div class="section-body">
|
||||||
<div class="preferences-section">
|
<div class="setting-item">
|
||||||
<div class="settings-card">
|
<div class="setting-info">
|
||||||
<div class="setting-item">
|
<label class="setting-label">Library</label>
|
||||||
<div class="setting-info">
|
<p class="setting-description">
|
||||||
<div class="setting-label-row">
|
<i class="pi pi-info-circle"></i>
|
||||||
<label class="setting-label">
|
<span>Choose how library names are sorted and displayed in the sidebar.</span>
|
||||||
Library
|
</p>
|
||||||
</label>
|
</div>
|
||||||
<p-select
|
<div class="setting-item setting-item-indented">
|
||||||
size="small"
|
<div class="setting-info">
|
||||||
[options]="sortingOptions"
|
<div class="setting-label-row">
|
||||||
[(ngModel)]="selectedLibrarySorting"
|
<p-select
|
||||||
(ngModelChange)="onLibrarySortingChange()"
|
size="small"
|
||||||
appendTo="body"
|
[options]="sortingOptions"
|
||||||
placeholder="Select Sorting">
|
[(ngModel)]="selectedLibrarySorting"
|
||||||
</p-select>
|
(ngModelChange)="onLibrarySortingChange()"
|
||||||
</div>
|
appendTo="body"
|
||||||
<p class="setting-description">
|
placeholder="Select Sorting">
|
||||||
Choose how library names are sorted and displayed in the sidebar.
|
</p-select>
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="setting-item">
|
<div class="setting-item">
|
||||||
<div class="setting-info">
|
<div class="setting-info">
|
||||||
<div class="setting-label-row">
|
<label class="setting-label">Shelf</label>
|
||||||
<label class="setting-label">
|
<p class="setting-description">
|
||||||
Shelf
|
<i class="pi pi-info-circle"></i>
|
||||||
</label>
|
<span>Choose how shelf names are sorted and displayed in the sidebar.</span>
|
||||||
<p-select
|
</p>
|
||||||
size="small"
|
</div>
|
||||||
[options]="sortingOptions"
|
<div class="setting-item setting-item-indented">
|
||||||
[(ngModel)]="selectedShelfSorting"
|
<div class="setting-info">
|
||||||
(ngModelChange)="onShelfSortingChange()"
|
<div class="setting-label-row">
|
||||||
appendTo="body"
|
<p-select
|
||||||
placeholder="Select Sorting">
|
size="small"
|
||||||
</p-select>
|
[options]="sortingOptions"
|
||||||
</div>
|
[(ngModel)]="selectedShelfSorting"
|
||||||
<p class="setting-description">
|
(ngModelChange)="onShelfSortingChange()"
|
||||||
Choose how shelf names are sorted and displayed in the sidebar.
|
appendTo="body"
|
||||||
</p>
|
placeholder="Select Sorting">
|
||||||
|
</p-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="setting-item">
|
<div class="setting-item">
|
||||||
<div class="setting-info">
|
<div class="setting-info">
|
||||||
<div class="setting-label-row">
|
<label class="setting-label">Magic Shelf</label>
|
||||||
<label class="setting-label">
|
<p class="setting-description">
|
||||||
Magic Shelf
|
<i class="pi pi-info-circle"></i>
|
||||||
</label>
|
<span>Choose how magic shelf names are sorted and displayed in the sidebar.</span>
|
||||||
<p-select
|
</p>
|
||||||
size="small"
|
</div>
|
||||||
[options]="sortingOptions"
|
<div class="setting-item setting-item-indented">
|
||||||
[(ngModel)]="selectedMagicShelfSorting"
|
<div class="setting-info">
|
||||||
(ngModelChange)="onMagicShelfSortingChange()"
|
<div class="setting-label-row">
|
||||||
appendTo="body"
|
<p-select
|
||||||
placeholder="Select Sorting">
|
size="small"
|
||||||
</p-select>
|
[options]="sortingOptions"
|
||||||
</div>
|
[(ngModel)]="selectedMagicShelfSorting"
|
||||||
<p class="setting-description">
|
(ngModelChange)="onMagicShelfSortingChange()"
|
||||||
Choose how magic shelf names are sorted and displayed in the sidebar.
|
appendTo="body"
|
||||||
</p>
|
placeholder="Select Sorting">
|
||||||
|
</p-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+88
-38
@@ -1,14 +1,8 @@
|
|||||||
.main-container {
|
.main-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 1rem;
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.enclosing-container {
|
|
||||||
border-color: var(--p-content-border-color);
|
|
||||||
background: var(--p-content-background);
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-header {
|
.settings-header {
|
||||||
margin-top: 1.25rem;
|
margin-top: 1.25rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
@@ -42,36 +36,93 @@
|
|||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preferences-section {
|
.section-header {
|
||||||
@media (min-width: 768px) {
|
margin-bottom: 1rem;
|
||||||
padding: 0 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 {
|
.settings-card {
|
||||||
border: 1px solid var(--p-content-border-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
background: var(--p-content-background);
|
|
||||||
padding: 1.5rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1rem;
|
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 {
|
.setting-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
flex-direction: column;
|
||||||
gap: 2rem;
|
gap: 0.5rem;
|
||||||
padding: 0.25rem 0;
|
padding-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid var(--p-content-border-color);
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
padding-bottom: 0;
|
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) {
|
@media (max-width: 768px) {
|
||||||
flex-direction: column;
|
gap: 0.5rem;
|
||||||
gap: 1rem;
|
|
||||||
|
&.setting-item-indented {
|
||||||
|
margin-left: 0;
|
||||||
|
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,54 +131,53 @@
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
||||||
.setting-label {
|
.setting-label {
|
||||||
display: flex;
|
display: block;
|
||||||
align-items: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--p-text-color);
|
color: var(--text-color);
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.375rem;
|
||||||
|
letter-spacing: -0.01em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-label-row {
|
.setting-label-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 0.75rem;
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.setting-label {
|
.setting-label {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
min-width: 120px;
|
font-size: 0.9375rem;
|
||||||
|
color: var(--text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
p-select {
|
p-select {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
min-width: 180px;
|
min-width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-description {
|
.setting-description {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 0.375rem;
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-control {
|
.pi {
|
||||||
flex-shrink: 0;
|
margin-top: 0.125rem;
|
||||||
display: flex;
|
flex-shrink: 0;
|
||||||
flex-direction: column;
|
font-size: 0.875rem;
|
||||||
gap: 0.75rem;
|
}
|
||||||
align-items: flex-end;
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
.pi-info-circle {
|
||||||
align-items: flex-start;
|
color: var(--primary-color);
|
||||||
width: 100%;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+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>
|
<app-view-preferences></app-view-preferences>
|
||||||
<div class="pt-8">
|
<div class="pt-10"><hr></div>
|
||||||
<p-divider></p-divider>
|
|
||||||
</div>
|
|
||||||
<app-filter-preferences></app-filter-preferences>
|
<app-filter-preferences></app-filter-preferences>
|
||||||
<div class="pt-8">
|
<div class="pt-10"><hr></div>
|
||||||
<p-divider></p-divider>
|
|
||||||
</div>
|
|
||||||
<app-sidebar-sorting-preferences></app-sidebar-sorting-preferences>
|
<app-sidebar-sorting-preferences></app-sidebar-sorting-preferences>
|
||||||
<div class="pt-8">
|
<div class="pt-10"><hr></div>
|
||||||
<p-divider></p-divider>
|
|
||||||
</div>
|
|
||||||
<app-meta-center-view-mode-component></app-meta-center-view-mode-component>
|
<app-meta-center-view-mode-component></app-meta-center-view-mode-component>
|
||||||
<div class="pt-8">
|
|
||||||
<p-divider></p-divider>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
-2
@@ -1,5 +1,4 @@
|
|||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {Divider} from 'primeng/divider';
|
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {TableModule} from 'primeng/table';
|
import {TableModule} from 'primeng/table';
|
||||||
import {ToastModule} from 'primeng/toast';
|
import {ToastModule} from 'primeng/toast';
|
||||||
@@ -12,7 +11,6 @@ import {FilterPreferencesComponent} from './filter-preferences/filter-preference
|
|||||||
selector: 'app-view-preferences-parent',
|
selector: 'app-view-preferences-parent',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [
|
imports: [
|
||||||
Divider,
|
|
||||||
FormsModule,
|
FormsModule,
|
||||||
TableModule,
|
TableModule,
|
||||||
ToastModule,
|
ToastModule,
|
||||||
|
|||||||
+92
-138
@@ -1,153 +1,107 @@
|
|||||||
<div class="main-container enclosing-container">
|
<div class="settings-card">
|
||||||
<div class="settings-header">
|
<div class="section-header">
|
||||||
<h2 class="settings-title">
|
<h3 class="section-title">
|
||||||
<i class="pi pi-table"></i>
|
<i class="pi pi-table"></i>
|
||||||
Library and Shelf View & Sort Preferences
|
Library and Shelf View & Sort Preferences
|
||||||
</h2>
|
</h3>
|
||||||
<p class="settings-description">
|
<p class="section-description">
|
||||||
Configure default and per-library/shelf preferences for sorting and view mode (grid or table) in the browser.
|
Configure default and per-library/shelf preferences for sorting and view mode (grid or table) in the browser.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="settings-content">
|
<div class="section-body">
|
||||||
<div class="preferences-section">
|
<div class="setting-item">
|
||||||
<div class="section-header">
|
<label class="setting-label">Default Preferences</label>
|
||||||
<h3 class="section-title">
|
<p class="setting-description">
|
||||||
<i class="pi pi-cog"></i>
|
<i class="pi pi-info-circle"></i>
|
||||||
Default Settings
|
<span>Configure the default sorting field, direction, and view mode for all libraries and shelves.</span>
|
||||||
</h3>
|
</p>
|
||||||
<p class="section-description">
|
<div class="setting-controls">
|
||||||
Set the default sorting and view preferences that will apply to all libraries and shelves unless overridden.
|
<p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||||
</p>
|
[(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>
|
||||||
|
|
||||||
<div class="settings-card">
|
<div class="setting-item">
|
||||||
<div class="setting-item">
|
<label class="setting-label">Auto-save on Navigation</label>
|
||||||
<div class="setting-info">
|
<p class="setting-description">
|
||||||
<div class="setting-label-row">
|
<i class="pi pi-info-circle"></i>
|
||||||
<label class="setting-label">Default Preferences</label>
|
<span>Automatically save changes when navigating to the next or previous book in the metadata editor.</span>
|
||||||
<div class="select-group">
|
</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"
|
<p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||||
[(ngModel)]="selectedSort" placeholder="Sort By" class="select-item" appendTo="body"></p-select>
|
[(ngModel)]="override.sort" [style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||||
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="selectedSortDir"
|
</td>
|
||||||
placeholder="Direction" class="select-item" appendTo="body"></p-select>
|
<td>
|
||||||
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="selectedView"
|
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="override.sortDir"
|
||||||
placeholder="View Mode" class="select-item" appendTo="body"></p-select>
|
[style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||||
</div>
|
</td>
|
||||||
</div>
|
<td>
|
||||||
<p class="setting-description">
|
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="override.view"
|
||||||
Configure the default sorting field, direction, and view mode for all libraries and shelves.
|
[style]="{'width': '100%'}" appendTo="body"></p-select>
|
||||||
</p>
|
</td>
|
||||||
</div>
|
<td style="text-align: center;">
|
||||||
</div>
|
<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="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">
|
<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>
|
</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 {
|
.section-header {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
border-bottom: var(--card-border);
|
||||||
|
border-bottom-color: var(--p-content-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-title {
|
.section-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
font-size: 1.125rem;
|
font-size: 1.25rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--p-text-color);
|
color: var(--text-color);
|
||||||
margin: 0 0 0.5rem 0;
|
margin: 0 0 0.5rem 0;
|
||||||
|
|
||||||
.pi {
|
.pi {
|
||||||
color: var(--p-primary-color);
|
color: var(--primary-color);
|
||||||
|
font-size: 1.125rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-description {
|
.section-description {
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
gap: 0.5rem;
|
|
||||||
color: var(--p-text-muted-color);
|
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
|
color: var(--p-text-muted-color);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
.pi {
|
|
||||||
color: var(--p-primary-color);
|
|
||||||
margin-top: 0.125rem;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-card {
|
.settings-card {
|
||||||
border: 1px solid var(--p-content-border-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
background: var(--p-content-background);
|
|
||||||
padding: 1.5rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1rem;
|
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 {
|
.setting-item {
|
||||||
display: flex;
|
padding-bottom: 1rem;
|
||||||
align-items: flex-start;
|
border-bottom: 1px solid var(--p-content-border-color);
|
||||||
gap: 2rem;
|
|
||||||
padding: 0.25rem 0;
|
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
padding-bottom: 0;
|
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;
|
border-bottom: none;
|
||||||
|
background: var(--p-surface-800);
|
||||||
|
border-radius: 6px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
flex-direction: column;
|
gap: 0.5rem;
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-info {
|
&.setting-item-indented {
|
||||||
flex: 1;
|
margin-left: 0;
|
||||||
min-width: 0;
|
padding: 0.625rem 0.625rem 0.5rem 0.625rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.setting-label {
|
.setting-label {
|
||||||
display: block;
|
display: block;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--p-text-color);
|
color: var(--text-color);
|
||||||
font-size: 1rem;
|
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;
|
|
||||||
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%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-description {
|
.setting-description {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 0.375rem;
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
line-height: 1.5;
|
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 {
|
.setting-controls {
|
||||||
flex-shrink: 0;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
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;
|
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
width: 100%;
|
flex-wrap: wrap;
|
||||||
}
|
margin-top: 0.5rem;
|
||||||
|
margin-left: 0;
|
||||||
.select-item {
|
padding: 0.75rem;
|
||||||
min-width: 140px;
|
border-left: 3px solid var(--primary-color);
|
||||||
|
background: var(--p-surface-800);
|
||||||
|
border-radius: 6px;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@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 {
|
.save-section {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
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 {
|
export interface MetadataMatchWeights {
|
||||||
title: number;
|
title: number;
|
||||||
@@ -158,6 +158,26 @@ export interface AppSettings {
|
|||||||
coverCroppingSettings: CoverCroppingSettings;
|
coverCroppingSettings: CoverCroppingSettings;
|
||||||
metadataDownloadOnBookdrop: boolean;
|
metadataDownloadOnBookdrop: boolean;
|
||||||
telemetryEnabled: 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 {
|
export enum AppSettingKey {
|
||||||
@@ -179,4 +199,5 @@ export enum AppSettingKey {
|
|||||||
KOBO_SETTINGS = 'KOBO_SETTINGS',
|
KOBO_SETTINGS = 'KOBO_SETTINGS',
|
||||||
COVER_CROPPING_SETTINGS = 'COVER_CROPPING_SETTINGS',
|
COVER_CROPPING_SETTINGS = 'COVER_CROPPING_SETTINGS',
|
||||||
TELEMETRY_ENABLED = 'TELEMETRY_ENABLED',
|
TELEMETRY_ENABLED = 'TELEMETRY_ENABLED',
|
||||||
|
METADATA_PROVIDER_SPECIFIC_FIELDS = 'METADATA_PROVIDER_SPECIFIC_FIELDS',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,25 @@ describe('AppSettingsService', () => {
|
|||||||
smartCroppingEnabled: false
|
smartCroppingEnabled: false
|
||||||
},
|
},
|
||||||
metadataDownloadOnBookdrop: 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 = {
|
const mockPublicSettings: PublicAppSettings = {
|
||||||
@@ -457,7 +475,25 @@ describe('AppSettingsService - API Contract Tests', () => {
|
|||||||
smartCroppingEnabled: false
|
smartCroppingEnabled: false
|
||||||
},
|
},
|
||||||
metadataDownloadOnBookdrop: 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));
|
httpClientMock.get.mockReturnValue(of(mockSettings));
|
||||||
service['fetchAppSettings']().subscribe(settings => {
|
service['fetchAppSettings']().subscribe(settings => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {inject, Injectable, Injector} from '@angular/core';
|
import {inject, Injectable, Injector} from '@angular/core';
|
||||||
import {HttpClient} from '@angular/common/http';
|
import {HttpClient} from '@angular/common/http';
|
||||||
import {BehaviorSubject, Observable, of} from 'rxjs';
|
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 {API_CONFIG} from '../../core/config/api-config';
|
||||||
import {AppSettings, OidcProviderDetails} from '../model/app-settings.model';
|
import {AppSettings, OidcProviderDetails} from '../model/app-settings.model';
|
||||||
import {AuthService} from './auth.service';
|
import {AuthService} from './auth.service';
|
||||||
@@ -99,20 +99,8 @@ export class AppSettingsService {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
return this.http.put<void>(this.apiUrl, payload).pipe(
|
return this.http.put<void>(this.apiUrl, payload).pipe(
|
||||||
tap(() => {
|
switchMap(() => this.fetchAppSettings()),
|
||||||
const current = this.appSettingsSubject.value;
|
map(() => void 0),
|
||||||
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();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
catchError(err => {
|
catchError(err => {
|
||||||
console.error('Error saving settings:', err);
|
console.error('Error saving settings:', err);
|
||||||
return of();
|
return of();
|
||||||
|
|||||||
@@ -25,3 +25,4 @@
|
|||||||
/* Code, Mark & Selection */
|
/* Code, Mark & Selection */
|
||||||
--code-background: var(--p-surface-900);
|
--code-background: var(--p-surface-900);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user