Support Hardcover as metadata provider
This commit is contained in:
committed by
Aditya Chandel
parent
d56d8181d0
commit
da6decb349
+20
-4
@@ -194,7 +194,7 @@
|
||||
|
||||
<!-- Review Count, Rating, Page Count -->
|
||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<div class="flex flex-col gap-1 w-1/6">
|
||||
<label for="amazonRatingCount">Amazon Rating Count</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="amazonRatingCount" formControlName="amazonReviewCount" class="w-full"/>
|
||||
@@ -202,7 +202,7 @@
|
||||
<p-button *ngIf="metadata['amazonReviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<div class="flex flex-col gap-1 w-1/6">
|
||||
<label for="amazonRating">Amazon Rating</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="amazonRating" formControlName="amazonRating" class="w-full"/>
|
||||
@@ -210,7 +210,7 @@
|
||||
<p-button *ngIf="metadata['amazonRatingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<div class="flex flex-col gap-1 w-1/6">
|
||||
<label for="goodreadsReviewCount">Goodreads Rating Count</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount" class="w-full"/>
|
||||
@@ -218,7 +218,7 @@
|
||||
<p-button *ngIf="metadata['goodreadsReviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/4">
|
||||
<div class="flex flex-col gap-1 w-1/6">
|
||||
<label for="goodreadsRating">Goodreads Rating</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="goodreadsRating" formControlName="goodreadsRating" class="w-full"/>
|
||||
@@ -226,6 +226,22 @@
|
||||
<p-button *ngIf="metadata['goodreadsRatingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/6">
|
||||
<label for="hardcoverReviewCount">Hardcover Rating Count</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['hardcoverReviewCountLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['hardcoverReviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1 w-1/6">
|
||||
<label for="hardcoverRating">Hardcover Rating</label>
|
||||
<div class="flex justify-between items-center gap-2">
|
||||
<input pInputText id="hardcoverRating" formControlName="hardcoverRating" class="w-full"/>
|
||||
<p-button *ngIf="!metadata['hardcoverRatingLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="success"></p-button>
|
||||
<p-button *ngIf="metadata['hardcoverRatingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="warn"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
+14
@@ -79,6 +79,8 @@ export class MetadataEditorComponent implements OnInit {
|
||||
amazonReviewCount: new FormControl(''),
|
||||
goodreadsRating: new FormControl(''),
|
||||
goodreadsReviewCount: new FormControl(''),
|
||||
hardcoverRating: new FormControl(''),
|
||||
hardcoverReviewCount: new FormControl(''),
|
||||
seriesName: new FormControl(''),
|
||||
seriesNumber: new FormControl(''),
|
||||
seriesTotal: new FormControl(''),
|
||||
@@ -101,6 +103,8 @@ export class MetadataEditorComponent implements OnInit {
|
||||
amazonReviewCountLocked: new FormControl(false),
|
||||
goodreadsRatingLocked: new FormControl(false),
|
||||
goodreadsReviewCountLocked: new FormControl(false),
|
||||
hardcoverRatingLocked: new FormControl(false),
|
||||
hardcoverReviewCountLocked: new FormControl(false),
|
||||
seriesNameLocked: new FormControl(false),
|
||||
seriesNumberLocked: new FormControl(false),
|
||||
seriesTotalLocked: new FormControl(false),
|
||||
@@ -137,6 +141,8 @@ export class MetadataEditorComponent implements OnInit {
|
||||
amazonReviewCount: metadata.amazonReviewCount || null,
|
||||
goodreadsRating: metadata.goodreadsRating || null,
|
||||
goodreadsReviewCount: metadata.goodreadsReviewCount || null,
|
||||
hardcoverRating: metadata.hardcoverRating || null,
|
||||
hardcoverReviewCount: metadata.hardcoverReviewCount || null,
|
||||
seriesName: metadata.seriesName || null,
|
||||
seriesNumber: metadata.seriesNumber || null,
|
||||
seriesTotal: metadata.seriesTotal || null,
|
||||
@@ -159,6 +165,8 @@ export class MetadataEditorComponent implements OnInit {
|
||||
amazonReviewCountLocked: metadata.amazonReviewCountLocked || false,
|
||||
goodreadsRatingLocked: metadata.goodreadsRatingLocked || false,
|
||||
goodreadsReviewCountLocked: metadata.goodreadsReviewCountLocked || false,
|
||||
hardcoverRatingLocked: metadata.hardcoverRatingLocked || false,
|
||||
hardcoverReviewCountLocked: metadata.hardcoverReviewCountLocked || false,
|
||||
seriesNameLocked: metadata.seriesNameLocked || false,
|
||||
seriesNumberLocked: metadata.seriesNumberLocked || false,
|
||||
seriesTotalLocked: metadata.seriesTotalLocked || false,
|
||||
@@ -180,6 +188,8 @@ export class MetadataEditorComponent implements OnInit {
|
||||
{ key: 'amazonRatingLocked', control: 'amazonRating' },
|
||||
{ key: 'goodreadsReviewCountLocked', control: 'goodreadsReviewCount' },
|
||||
{ key: 'goodreadsRatingLocked', control: 'goodreadsRating' },
|
||||
{ key: 'hardcoverReviewCountLocked', control: 'hardcoverReviewCount' },
|
||||
{ key: 'hardcoverRatingLocked', control: 'hardcoverRating' },
|
||||
{ key: 'pageCountLocked', control: 'pageCount' },
|
||||
{ key: 'descriptionLocked', control: 'description' },
|
||||
{ key: 'seriesNameLocked', control: 'seriesName' },
|
||||
@@ -295,6 +305,8 @@ export class MetadataEditorComponent implements OnInit {
|
||||
amazonReviewCount: this.metadataForm.get('amazonReviewCount')?.value,
|
||||
goodreadsRating: this.metadataForm.get('goodreadsRating')?.value,
|
||||
goodreadsReviewCount: this.metadataForm.get('goodreadsReviewCount')?.value,
|
||||
hardcoverRating: this.metadataForm.get('hardcoverRating')?.value,
|
||||
hardcoverReviewCount: this.metadataForm.get('hardcoverReviewCount')?.value,
|
||||
language: this.metadataForm.get('language')?.value,
|
||||
seriesName: this.metadataForm.get('seriesName')?.value,
|
||||
seriesNumber: this.metadataForm.get('seriesNumber')?.value,
|
||||
@@ -318,6 +330,8 @@ export class MetadataEditorComponent implements OnInit {
|
||||
amazonReviewCountLocked: this.metadataForm.get('amazonReviewCountLocked')?.value,
|
||||
goodreadsRatingLocked: this.metadataForm.get('goodreadsRatingLocked')?.value,
|
||||
goodreadsReviewCountLocked: this.metadataForm.get('goodreadsReviewCountLocked')?.value,
|
||||
hardcoverRatingLocked: this.metadataForm.get('hardcoverRatingLocked')?.value,
|
||||
hardcoverReviewCountLocked: this.metadataForm.get('hardcoverReviewCountLocked')?.value,
|
||||
seriesNameLocked: this.metadataForm.get('seriesNameLocked')?.value,
|
||||
seriesNumberLocked: this.metadataForm.get('seriesNumberLocked')?.value,
|
||||
seriesTotalLocked: this.metadataForm.get('seriesTotalLocked')?.value,
|
||||
|
||||
+16
@@ -59,6 +59,8 @@ export class MetadataPickerComponent implements OnInit {
|
||||
{label: 'Amazon Rating', controlName: 'amazonRating', lockedKey: 'amazonRatingLocked', fetchedKey: 'amazonRating'},
|
||||
{label: 'Goodreads Reviews', controlName: 'goodreadsReviewCount', lockedKey: 'goodreadsReviewCountLocked', fetchedKey: 'goodreadsReviewCount'},
|
||||
{label: 'Goodreads Rating', controlName: 'goodreadsRating', lockedKey: 'goodreadsRatingLocked', fetchedKey: 'goodreadsRating'},
|
||||
{label: 'Hardcover Reviews', controlName: 'hardcoverReviewCount', lockedKey: 'hardcoverReviewCountLocked', fetchedKey: 'hardcoverReviewCount'},
|
||||
{label: 'Hardcover Rating', controlName: 'hardcoverRating', lockedKey: 'hardcoverRatingLocked', fetchedKey: 'hardcoverRating'},
|
||||
{label: 'Pages', controlName: 'pageCount', lockedKey: 'pageCountLocked', fetchedKey: 'pageCount'}
|
||||
];
|
||||
|
||||
@@ -96,6 +98,8 @@ export class MetadataPickerComponent implements OnInit {
|
||||
amazonReviewCount: new FormControl(''),
|
||||
goodreadsRating: new FormControl(''),
|
||||
goodreadsReviewCount: new FormControl(''),
|
||||
hardcoverRating: new FormControl(''),
|
||||
hardcoverReviewCount: new FormControl(''),
|
||||
seriesName: new FormControl(''),
|
||||
seriesNumber: new FormControl(''),
|
||||
seriesTotal: new FormControl(''),
|
||||
@@ -117,6 +121,8 @@ export class MetadataPickerComponent implements OnInit {
|
||||
amazonReviewCountLocked: new FormControl(false),
|
||||
goodreadsRatingLocked: new FormControl(false),
|
||||
goodreadsReviewCountLocked: new FormControl(false),
|
||||
hardcoverRatingLocked: new FormControl(false),
|
||||
hardcoverReviewCountLocked: new FormControl(false),
|
||||
seriesNameLocked: new FormControl(false),
|
||||
seriesNumberLocked: new FormControl(false),
|
||||
seriesTotalLocked: new FormControl(false),
|
||||
@@ -147,6 +153,8 @@ export class MetadataPickerComponent implements OnInit {
|
||||
amazonReviewCount: metadata.amazonReviewCount || null,
|
||||
goodreadsRating: metadata.goodreadsRating || null,
|
||||
goodreadsReviewCount: metadata.goodreadsReviewCount || null,
|
||||
hardcoverRating: metadata.hardcoverRating || null,
|
||||
hardcoverReviewCount: metadata.hardcoverReviewCount || null,
|
||||
seriesName: metadata.seriesName || null,
|
||||
seriesNumber: metadata.seriesNumber || null,
|
||||
seriesTotal: metadata.seriesTotal || null,
|
||||
@@ -168,6 +176,8 @@ export class MetadataPickerComponent implements OnInit {
|
||||
amazonReviewCountLocked: metadata.amazonReviewCountLocked || false,
|
||||
goodreadsRatingLocked: metadata.goodreadsRatingLocked || false,
|
||||
goodreadsReviewCountLocked: metadata.goodreadsReviewCountLocked || false,
|
||||
hardcoverRatingLocked: metadata.hardcoverRatingLocked || false,
|
||||
hardcoverReviewCountLocked: metadata.hardcoverReviewCountLocked || false,
|
||||
seriesNameLocked: metadata.seriesNameLocked || false,
|
||||
seriesNumberLocked: metadata.seriesNumberLocked || false,
|
||||
seriesTotalLocked: metadata.seriesTotalLocked || false,
|
||||
@@ -188,6 +198,8 @@ export class MetadataPickerComponent implements OnInit {
|
||||
if (metadata.amazonRatingLocked) this.metadataForm.get('amazonRating')?.disable();
|
||||
if (metadata.goodreadsReviewCountLocked) this.metadataForm.get('goodreadsReviewCount')?.disable();
|
||||
if (metadata.goodreadsRatingLocked) this.metadataForm.get('goodreadsRating')?.disable();
|
||||
if (metadata.hardcoverReviewCountLocked) this.metadataForm.get('hardcoverReviewCount')?.disable();
|
||||
if (metadata.hardcoverRatingLocked) this.metadataForm.get('hardcoverRating')?.disable();
|
||||
if (metadata.pageCountLocked) this.metadataForm.get('pageCount')?.disable();
|
||||
if (metadata.descriptionLocked) this.metadataForm.get('description')?.disable();
|
||||
if (metadata.seriesNameLocked) this.metadataForm.get('seriesName')?.disable();
|
||||
@@ -234,6 +246,8 @@ export class MetadataPickerComponent implements OnInit {
|
||||
amazonReviewCount: this.metadataForm.get('amazonReviewCount')?.value || this.copiedFields['amazonReviewCount'] ? this.getNumberOrCopied('amazonReviewCount') : null,
|
||||
goodreadsRating: this.metadataForm.get('goodreadsRating')?.value || this.copiedFields['goodreadsRating'] ? this.getNumberOrCopied('goodreadsRating') : null,
|
||||
goodreadsReviewCount: this.metadataForm.get('goodreadsReviewCount')?.value || this.copiedFields['goodreadsReviewCount'] ? this.getNumberOrCopied('goodreadsReviewCount') : null,
|
||||
hardcoverRating: this.metadataForm.get('hardcoverRating')?.value || this.copiedFields['hardcoverRating'] ? this.getNumberOrCopied('hardcoverRating') : null,
|
||||
hardcoverReviewCount: this.metadataForm.get('hardcoverReviewCount')?.value || this.copiedFields['hardcoverReviewCount'] ? this.getNumberOrCopied('hardcoverReviewCount') : null,
|
||||
seriesName: this.metadataForm.get('seriesName')?.value || this.copiedFields['seriesName'] ? this.getValueOrCopied('seriesName') : '',
|
||||
seriesNumber: this.metadataForm.get('seriesNumber')?.value || this.copiedFields['seriesNumber'] ? this.getNumberOrCopied('seriesNumber') : null,
|
||||
seriesTotal: this.metadataForm.get('seriesTotal')?.value || this.copiedFields['seriesTotal'] ? this.getNumberOrCopied('seriesTotal') : null,
|
||||
@@ -255,6 +269,8 @@ export class MetadataPickerComponent implements OnInit {
|
||||
amazonReviewCountLocked: this.metadataForm.get('amazonReviewCountLocked')?.value,
|
||||
goodreadsRatingLocked: this.metadataForm.get('goodreadsRatingLocked')?.value,
|
||||
goodreadsReviewCountLocked: this.metadataForm.get('goodreadsReviewCountLocked')?.value,
|
||||
hardcoverRatingLocked: this.metadataForm.get('hardcoverRatingLocked')?.value,
|
||||
hardcoverReviewCountLocked: this.metadataForm.get('hardcoverReviewCountLocked')?.value,
|
||||
seriesNameLocked: this.metadataForm.get('seriesNameLocked')?.value,
|
||||
seriesNumberLocked: this.metadataForm.get('seriesNumberLocked')?.value,
|
||||
seriesTotalLocked: this.metadataForm.get('seriesTotalLocked')?.value,
|
||||
|
||||
+15
-9
@@ -4,7 +4,6 @@ import {Button} from 'primeng/button';
|
||||
import {InputText} from 'primeng/inputtext';
|
||||
import {Divider} from 'primeng/divider';
|
||||
import {NgForOf, NgIf} from '@angular/common';
|
||||
import {MetadataProvider} from '../../model/provider.model';
|
||||
import {FetchMetadataRequest} from '../../model/request/fetch-metadata-request.model';
|
||||
import {ProgressSpinner} from 'primeng/progressspinner';
|
||||
import {MetadataPickerComponent} from '../metadata-picker/metadata-picker.component';
|
||||
@@ -12,11 +11,11 @@ import {BookMetadataCenterService} from '../book-metadata-center.service';
|
||||
import {MultiSelect} from 'primeng/multiselect';
|
||||
import {Book, BookMetadata} from '../../../model/book.model';
|
||||
import {BookService} from '../../../service/book.service';
|
||||
import {combineLatest, Observable, Subscription, Subject, takeUntil} from 'rxjs';
|
||||
import {combineLatest, Observable, Subject, Subscription, takeUntil} from 'rxjs';
|
||||
import {AppSettings} from '../../../../core/model/app-settings.model';
|
||||
import {AppSettingsService} from '../../../../core/service/app-settings.service';
|
||||
import {distinctUntilChanged, filter, switchMap} from 'rxjs/operators';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-metadata-searcher',
|
||||
@@ -27,7 +26,7 @@ import {ActivatedRoute, Router} from '@angular/router';
|
||||
})
|
||||
export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
form: FormGroup;
|
||||
providers = Object.values(MetadataProvider);
|
||||
providers: string[] = [];
|
||||
allFetchedMetadata: BookMetadata[] = [];
|
||||
selectedFetchedMetadata!: BookMetadata | null;
|
||||
bookId!: number;
|
||||
@@ -65,7 +64,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
this.selectedFetchedMetadata = null;
|
||||
this.allFetchedMetadata = [];
|
||||
this.form.patchValue({
|
||||
provider: Object.values(MetadataProvider),
|
||||
provider: this.providers,
|
||||
title: '',
|
||||
author: '',
|
||||
});
|
||||
@@ -75,6 +74,13 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
filter(([book, settings]) => !!book && !!settings),
|
||||
distinctUntilChanged(([prevBook], [currBook]) => prevBook?.id === currBook?.id)
|
||||
).subscribe(([book, settings]) => {
|
||||
|
||||
console.log(settings!.metadataProviderSettings)
|
||||
|
||||
this.providers = Object.entries(settings!.metadataProviderSettings)
|
||||
.filter(([key, value]) => value.enabled)
|
||||
.map(([key]) => key.charAt(0).toUpperCase() + key.slice(1));
|
||||
|
||||
const autoBookSearchEnabled = settings!.autoBookSearch ?? false;
|
||||
|
||||
if (book) {
|
||||
@@ -83,7 +89,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
this.bookId = book.id;
|
||||
|
||||
this.form.patchValue({
|
||||
provider: Object.values(MetadataProvider),
|
||||
provider: this.providers,
|
||||
title: book.metadata?.title || null,
|
||||
author: book.metadata?.authors?.length ? book.metadata.authors[0] : ''
|
||||
});
|
||||
@@ -111,9 +117,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
|
||||
onSubmit(): void {
|
||||
if (this.form.valid) {
|
||||
const providerKeys = Object.keys(MetadataProvider).filter(key =>
|
||||
(this.form.get('provider')?.value as string[]).includes(MetadataProvider[key as keyof typeof MetadataProvider])
|
||||
);
|
||||
const providerKeys = this.form.get('provider')?.value;
|
||||
if (!providerKeys) {
|
||||
return;
|
||||
}
|
||||
@@ -155,6 +159,8 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
return `<a href="https://www.goodreads.com/book/show/${metadata.providerBookId}" target="_blank">Goodreads</a>`;
|
||||
case "Google":
|
||||
return `<a href="https://books.google.com/books?id=${metadata.providerBookId}" target="_blank">Google</a>`;
|
||||
case "Hardcover":
|
||||
return `<a href="https://hardcover.app/books/${metadata.providerBookId}" target="_blank">Hardcover</a>`;
|
||||
default:
|
||||
throw new Error(`Unsupported provider: ${metadata.provider}`);
|
||||
}
|
||||
|
||||
+24
-20
@@ -41,28 +41,32 @@
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 pt-2">
|
||||
<ng-container *ngIf="metadata.amazonRating || metadata.goodreadsRating; else legacyRating">
|
||||
<p *ngIf="metadata.amazonRating" class="font-semibold">Amazon: {{ metadata.amazonRating }}</p>
|
||||
<p-rating
|
||||
*ngIf="metadata.amazonRating"
|
||||
[(ngModel)]="metadata.amazonRating"
|
||||
readonly
|
||||
stars="5"
|
||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.amazonRating)">
|
||||
</p-rating>
|
||||
<p *ngIf="metadata.amazonRating" class="font-semibold"> ({{ metadata.amazonReviewCount | number:'1.0-0' }})</p>
|
||||
<ng-container *ngIf="metadata.amazonRating || metadata.goodreadsRating || metadata.hardcoverRating; else legacyRating">
|
||||
<ng-container *ngIf="metadata.amazonRating">
|
||||
<p class="font-semibold">Amazon: {{ metadata.amazonRating }}</p>
|
||||
<p-rating [ngModel]="metadata.amazonRating" readonly stars="5"
|
||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.amazonRating)">
|
||||
</p-rating>
|
||||
<p class="font-semibold">({{ metadata.amazonReviewCount | number:'1.0-0' }})</p>
|
||||
<span *ngIf="metadata.goodreadsRating || metadata.hardcoverRating">|</span>
|
||||
</ng-container>
|
||||
|
||||
<p *ngIf="metadata.amazonRating && metadata.goodreadsRating">|</p>
|
||||
<ng-container *ngIf="metadata.goodreadsRating">
|
||||
<p class="font-semibold">Goodreads: {{ metadata.goodreadsRating }}</p>
|
||||
<p-rating [ngModel]="metadata.goodreadsRating" readonly stars="5"
|
||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.goodreadsRating)">
|
||||
</p-rating>
|
||||
<p class="font-semibold">({{ metadata.goodreadsReviewCount | number:'1.0-0' }})</p>
|
||||
<span *ngIf="metadata.hardcoverRating">|</span>
|
||||
</ng-container>
|
||||
|
||||
<p *ngIf="metadata.goodreadsRating" class="font-semibold">Goodreads: {{ metadata.goodreadsRating }}</p>
|
||||
<p-rating
|
||||
*ngIf="metadata.goodreadsRating"
|
||||
[(ngModel)]="metadata.goodreadsRating"
|
||||
readonly
|
||||
stars="5"
|
||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.goodreadsRating)">
|
||||
</p-rating>
|
||||
<p *ngIf="metadata.goodreadsRating" class="font-semibold"> ({{ metadata.goodreadsReviewCount | number:'1.0-0' }})</p>
|
||||
<ng-container *ngIf="metadata.hardcoverRating">
|
||||
<p class="font-semibold">Hardcover: {{ metadata.hardcoverRating }}</p>
|
||||
<p-rating [ngModel]="metadata.hardcoverRating" readonly stars="5"
|
||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.hardcoverRating)">
|
||||
</p-rating>
|
||||
<p class="font-semibold">({{ metadata.hardcoverReviewCount | number:'1.0-0' }})</p>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
||||
<ng-template #legacyRating>
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ export class MetadataAdvancedFetchOptionsComponent implements OnChanges {
|
||||
|
||||
@Output() metadataOptionsSubmitted: EventEmitter<MetadataRefreshOptions> = new EventEmitter<MetadataRefreshOptions>();
|
||||
fields: (keyof FieldOptions)[] = ['title', 'description', 'authors', 'categories', 'cover'];
|
||||
providers: string[] = ['Amazon', 'Google', 'GoodReads'];
|
||||
providers: string[] = ['Amazon', 'Google', 'GoodReads', 'Hardcover'];
|
||||
refreshCovers: boolean = false;
|
||||
mergeCategories: boolean = false;
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
export enum MetadataProvider {
|
||||
Amazon = "Amazon",
|
||||
Google = "Google",
|
||||
GoodReads = "GoodReads"
|
||||
}
|
||||
@@ -53,6 +53,8 @@ export interface BookMetadata {
|
||||
amazonReviewCount?: number | null;
|
||||
goodreadsRating?: number | null;
|
||||
goodreadsReviewCount?: number | null;
|
||||
hardcoverRating?: number | null;
|
||||
hardcoverReviewCount?: number | null;
|
||||
coverUpdatedOn?: string;
|
||||
authors: string[];
|
||||
categories: string[];
|
||||
@@ -80,6 +82,8 @@ export interface BookMetadata {
|
||||
amazonReviewCountLocked?: boolean;
|
||||
goodreadsRatingLocked?: boolean;
|
||||
goodreadsReviewCountLocked?: boolean;
|
||||
hardcoverRatingLocked?: boolean;
|
||||
hardcoverReviewCountLocked?: boolean;
|
||||
coverUpdatedOnLocked?: boolean;
|
||||
authorsLocked?: boolean;
|
||||
categoriesLocked?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user