feat: comic metadata picker, lazy-load providers, and UI improvements (#2679)
* feat: add comic metadata support to metadata picker and fix Comicvine parser * feat: lazy-load Comicvine issue details on selection * feat: lazy-load detail metadata for Amazon, GoodReads, and Audible parsers * fix: prevent spurious comic_metadata row creation for non-comic books * fix: extract rich previews from Audible search and reorder picker sections * feat: redesign metadata editor layout with collapsible sections and boolean selects * fix: implement per-field comic metadata locks replacing grouped locks * feat: add comic metadata filters and fix visibleFilters backend support * fix: use human-readable role labels in comic creator filter * fix: auto-populate comic metadata from ComicVine during metadata fetch * refactor: clean up ComicvineBookParser remove duplication and comments * fix: use ComicMetadata webLink for ComicVine favicon URL * fix: cache library options to prevent Set All dropdowns from resetting * fix: stream book content from disk instead of loading entire file into memory * fix: increase max visible filters from 15 to 20 * feat: replace filter multiselect with drag-and-drop reorderable list * fix: use audiobook-specific cover paths and cache busting for audiobook thumbnail updates * chore: enforce mandatory screenshots and stricter testing requirements in PR template * fix: update BookServiceTest to match Resource return type after streaming change --------- Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@
|
||||
[text]="true"
|
||||
severity="secondary"
|
||||
(click)="ref?.close()"
|
||||
styleClass="close-button">
|
||||
class="close-button">
|
||||
</p-button>
|
||||
</div>
|
||||
}
|
||||
|
||||
+418
-288
@@ -161,6 +161,7 @@
|
||||
<p-button pTooltip="Unlock Cover" tooltipPosition="top" size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('audiobookCover')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
`
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -305,7 +306,7 @@
|
||||
</div>
|
||||
|
||||
<div class="field-row">
|
||||
<div class="field-group full-width">
|
||||
<div class="field-group half-width">
|
||||
<label for="moods">Moods</label>
|
||||
<div class="field-with-lock">
|
||||
<div class="autocomplete-wrapper">
|
||||
@@ -329,9 +330,7 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-row">
|
||||
<div class="field-group full-width">
|
||||
<div class="field-group half-width">
|
||||
<label for="tags">Tags</label>
|
||||
<div class="field-with-lock">
|
||||
<div class="autocomplete-wrapper">
|
||||
@@ -406,20 +405,45 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-group small-field">
|
||||
<label for="pageCount">Pages</label>
|
||||
<label>Public Reviews</label>
|
||||
<div class="field-with-lock">
|
||||
<input pInputText id="pageCount" formControlName="pageCount"/>
|
||||
@if (!book.metadata!['pageCountLocked']) {
|
||||
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('pageCount')" severity="success"></p-button>
|
||||
<input pSize="small" pInputText [disabled]="true" value="No Value"/>
|
||||
@if (!book.metadata!['reviewsLocked']) {
|
||||
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('reviews')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['pageCountLocked']) {
|
||||
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('pageCount')" severity="warn"></p-button>
|
||||
@if (book.metadata!['reviewsLocked']) {
|
||||
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('reviews')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-row">
|
||||
<div class="field-group small-field">
|
||||
<label for="isbn10">ISBN 10</label>
|
||||
<div class="field-with-lock">
|
||||
<input pInputText id="isbn10" formControlName="isbn10"/>
|
||||
@if (!book.metadata!['isbn10Locked']) {
|
||||
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('isbn10')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['isbn10Locked']) {
|
||||
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn10')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group small-field">
|
||||
<label for="isbn13">ISBN 13</label>
|
||||
<div class="field-with-lock">
|
||||
<input pInputText id="isbn13" formControlName="isbn13"/>
|
||||
@if (!book.metadata!['isbn13Locked']) {
|
||||
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('isbn13')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['isbn13Locked']) {
|
||||
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn13')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group small-field">
|
||||
<label for="ageRating">Age Rating</label>
|
||||
<div class="field-with-lock">
|
||||
@@ -441,7 +465,6 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-group small-field">
|
||||
<label for="contentRating">Content Rating</label>
|
||||
<div class="field-with-lock">
|
||||
@@ -463,309 +486,416 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-group small-field">
|
||||
<label for="pageCount">Pages</label>
|
||||
<div class="field-with-lock">
|
||||
<input pInputText id="pageCount" formControlName="pageCount"/>
|
||||
@if (!book.metadata!['pageCountLocked']) {
|
||||
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('pageCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['pageCountLocked']) {
|
||||
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('pageCount')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-row metadata-ids-row">
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="reviews">Public Reviews</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText [disabled]="true" value="No Value"/>
|
||||
@if (!book.metadata!['reviewsLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('reviews')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['reviewsLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('reviews')" severity="warn"></p-button>
|
||||
}
|
||||
<!-- Audiobook Metadata Section -->
|
||||
@if (isAudiobook(book)) {
|
||||
<div class="collapsible-section" [class.expanded]="audiobookSectionExpanded">
|
||||
<div class="collapsible-header" (click)="audiobookSectionExpanded = !audiobookSectionExpanded">
|
||||
<i class="pi pi-headphones"></i>
|
||||
<span>Audiobook Details</span>
|
||||
<i [class]="audiobookSectionExpanded ? 'pi pi-chevron-up' : 'pi pi-chevron-down'" class="section-toggle"></i>
|
||||
</div>
|
||||
@if (audiobookSectionExpanded) {
|
||||
<div class="collapsible-content">
|
||||
<div class="field-row metadata-ids-row">
|
||||
@for (field of audiobookMetadataFields; track field) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label>{{ field.label }}</label>
|
||||
<div class="field-with-lock">
|
||||
@if (field.type === 'boolean') {
|
||||
<p-select [formControlName]="field.controlName" [options]="booleanOptions" optionLabel="label" optionValue="value" appendTo="body"></p-select>
|
||||
} @else {
|
||||
<input pInputText [formControlName]="field.controlName"/>
|
||||
}
|
||||
@if (!metadataForm.get(field.lockedKey)?.value) {
|
||||
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
||||
}
|
||||
@if (metadataForm.get(field.lockedKey)?.value) {
|
||||
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="isbn10">ISBN 10</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="isbn10" formControlName="isbn10"/>
|
||||
@if (!book.metadata!['isbn10Locked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('isbn10')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['isbn10Locked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn10')" severity="warn"></p-button>
|
||||
}
|
||||
}
|
||||
|
||||
<!-- Comic Book Metadata Section -->
|
||||
@if (isCBX(book)) {
|
||||
<div class="collapsible-section" [class.expanded]="comicSectionExpanded">
|
||||
<div class="collapsible-header" (click)="comicSectionExpanded = !comicSectionExpanded">
|
||||
<i class="pi pi-bolt"></i>
|
||||
<span>Comic Book Details</span>
|
||||
<i [class]="comicSectionExpanded ? 'pi pi-chevron-up' : 'pi pi-chevron-down'" class="section-toggle"></i>
|
||||
</div>
|
||||
@if (comicSectionExpanded) {
|
||||
<div class="collapsible-content">
|
||||
<!-- Text/number/boolean fields in grid -->
|
||||
<div class="comic-text-grid">
|
||||
@for (field of comicTextFields; track field) {
|
||||
<div class="field-group">
|
||||
<label>{{ field.label }}</label>
|
||||
<div class="field-with-lock">
|
||||
@if (field.type === 'boolean') {
|
||||
<p-select [formControlName]="field.controlName" [options]="booleanOptions" optionLabel="label" optionValue="value" size="small" appendTo="body"></p-select>
|
||||
} @else {
|
||||
<input pSize="small" pInputText [formControlName]="field.controlName"/>
|
||||
}
|
||||
@if (!metadataForm.get(field.lockedKey)?.value) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
||||
}
|
||||
@if (metadataForm.get(field.lockedKey)?.value) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- Array fields (creators, characters, teams, locations) -->
|
||||
<div class="comic-array-grid">
|
||||
@for (field of comicArrayFields; track field) {
|
||||
<div class="field-group">
|
||||
<label>{{ field.label }}</label>
|
||||
<div class="field-with-lock">
|
||||
<div class="autocomplete-wrapper">
|
||||
<p-autoComplete
|
||||
[formControlName]="field.controlName"
|
||||
[multiple]="true"
|
||||
[dropdown]="false"
|
||||
[suggestions]="[]"
|
||||
[forceSelection]="false"
|
||||
[showClear]="true"
|
||||
(onKeyUp)="onAutoCompleteKeyUp(field.controlName, $event)"
|
||||
(onSelect)="onAutoCompleteSelect(field.controlName, $event)">
|
||||
</p-autoComplete>
|
||||
</div>
|
||||
@if (!metadataForm.get(field.lockedKey)?.value) {
|
||||
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
||||
}
|
||||
@if (metadataForm.get(field.lockedKey)?.value) {
|
||||
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- Textarea fields (notes) -->
|
||||
@for (field of comicTextareaFields; track field) {
|
||||
<div class="field-row comic-array-row">
|
||||
<div class="field-group full-width">
|
||||
<label>{{ field.label }}</label>
|
||||
<div class="field-with-lock description-with-lock">
|
||||
<textarea pTextarea [formControlName]="field.controlName" rows="4"></textarea>
|
||||
@if (!metadataForm.get(field.lockedKey)?.value) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
||||
}
|
||||
@if (metadataForm.get(field.lockedKey)?.value) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="isbn13">ISBN 13</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="isbn13" formControlName="isbn13"/>
|
||||
@if (!book.metadata!['isbn13Locked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('isbn13')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['isbn13Locked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn13')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Provider Metadata Section (collapsible) -->
|
||||
<div class="collapsible-section" [class.expanded]="providerSectionExpanded">
|
||||
<div class="collapsible-header" (click)="providerSectionExpanded = !providerSectionExpanded">
|
||||
<i class="pi pi-database"></i>
|
||||
<span>Provider Metadata</span>
|
||||
<i [class]="providerSectionExpanded ? 'pi pi-chevron-up' : 'pi pi-chevron-down'" class="section-toggle"></i>
|
||||
</div>
|
||||
@if (isFieldVisible('asin')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="asin">Amazon ASIN</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="asin" formControlName="asin"/>
|
||||
@if (!book.metadata!['asinLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('asin')" severity="success"></p-button>
|
||||
@if (providerSectionExpanded) {
|
||||
<div class="collapsible-content">
|
||||
<div class="field-row metadata-ids-row">
|
||||
@if (isFieldVisible('asin')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="asin">Amazon ASIN</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="asin" formControlName="asin"/>
|
||||
@if (!book.metadata!['asinLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('asin')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['asinLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('asin')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (book.metadata!['asinLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('asin')" severity="warn"></p-button>
|
||||
@if (isFieldVisible('amazonRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="amazonRating">Amazon ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="amazonRating" formControlName="amazonRating"/>
|
||||
@if (!book.metadata!['amazonRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['amazonRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('amazonRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="amazonRating">Amazon ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="amazonRating" formControlName="amazonRating"/>
|
||||
@if (!book.metadata!['amazonRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="success"></p-button>
|
||||
@if (isFieldVisible('amazonReviewCount')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="amazonRatingCount">Amazon #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="amazonRatingCount" formControlName="amazonReviewCount"/>
|
||||
@if (!book.metadata!['amazonReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['amazonReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (book.metadata!['amazonRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="warn"></p-button>
|
||||
@if (isFieldVisible('googleId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="googleId">Google Books ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="googleId" formControlName="googleId"/>
|
||||
@if (!book.metadata!['googleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('googleId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['googleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('googleId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('amazonReviewCount')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="amazonRatingCount">Amazon #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="amazonRatingCount" formControlName="amazonReviewCount"/>
|
||||
@if (!book.metadata!['amazonReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="success"></p-button>
|
||||
@if (isFieldVisible('goodreadsId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsId">Goodreads ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsId" formControlName="goodreadsId"/>
|
||||
@if (!book.metadata!['goodreadsIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['goodreadsIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (book.metadata!['amazonReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="warn"></p-button>
|
||||
@if (isFieldVisible('goodreadsRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsRating">Goodreads ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsRating" formControlName="goodreadsRating"/>
|
||||
@if (!book.metadata!['goodreadsRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['goodreadsRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('googleId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="googleId">Google Books ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="googleId" formControlName="googleId"/>
|
||||
@if (!book.metadata!['googleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('googleId')" severity="success"></p-button>
|
||||
@if (isFieldVisible('goodreadsReviewCount')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsReviewCount">Goodreads #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount"/>
|
||||
@if (!book.metadata!['goodreadsReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['goodreadsReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (book.metadata!['googleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('googleId')" severity="warn"></p-button>
|
||||
@if (isFieldVisible('hardcoverId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverId">Hardcover ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverId" formControlName="hardcoverId"/>
|
||||
@if (!book.metadata!['hardcoverIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('goodreadsId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsId">Goodreads ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsId" formControlName="goodreadsId"/>
|
||||
@if (!book.metadata!['goodreadsIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="success"></p-button>
|
||||
@if (isFieldVisible('hardcoverBookId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverBookId">Hardcover Book ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverBookId" formControlName="hardcoverBookId"/>
|
||||
@if (!book.metadata!['hardcoverBookIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverBookId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverBookIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverBookId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (book.metadata!['goodreadsIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="warn"></p-button>
|
||||
@if (isFieldVisible('hardcoverRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverRating">Hardcover ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverRating" formControlName="hardcoverRating"/>
|
||||
@if (!book.metadata!['hardcoverRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('goodreadsRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsRating">Goodreads ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsRating" formControlName="goodreadsRating"/>
|
||||
@if (!book.metadata!['goodreadsRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="success"></p-button>
|
||||
@if (isFieldVisible('hardcoverReviewCount')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverReviewCount">Hardcover #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount"/>
|
||||
@if (!book.metadata!['hardcoverReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (book.metadata!['goodreadsRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="warn"></p-button>
|
||||
@if (isFieldVisible('lubimyczytacId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="lubimyczytacId">Lubimyczytac ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="lubimyczytacId" formControlName="lubimyczytacId"/>
|
||||
@if (!book.metadata!['lubimyczytacIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('lubimyczytacId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['lubimyczytacIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('lubimyczytacId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('goodreadsReviewCount')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="goodreadsReviewCount">Goodreads #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount"/>
|
||||
@if (!book.metadata!['goodreadsReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="success"></p-button>
|
||||
@if (isFieldVisible('lubimyczytacRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="lubimyczytacRating">Lubimyczytac ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="lubimyczytacRating" formControlName="lubimyczytacRating"/>
|
||||
@if (!book.metadata!['lubimyczytacRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('lubimyczytacRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['lubimyczytacRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('lubimyczytacRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (book.metadata!['goodreadsReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="warn"></p-button>
|
||||
@if (isFieldVisible('comicvineId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="comicvineId">Comicvine ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="comicvineId" formControlName="comicvineId"/>
|
||||
@if (!book.metadata!['comicvineIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('comicvineId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['comicvineIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('comicvineId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('hardcoverId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverId">Hardcover ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverId" formControlName="hardcoverId"/>
|
||||
@if (!book.metadata!['hardcoverIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="success"></p-button>
|
||||
@if (isFieldVisible('ranobedbId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="ranobedbId">Ranobedb ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="ranobedbId" formControlName="ranobedbId"/>
|
||||
@if (!book.metadata!['ranobedbIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('ranobedbId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['ranobedbIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('ranobedbId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (book.metadata!['hardcoverIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="warn"></p-button>
|
||||
@if (isFieldVisible('ranobedbRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="ranobedbRating">Ranobedb ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="ranobedbRating" formControlName="ranobedbRating"/>
|
||||
@if (!book.metadata!['ranobedbRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('ranobedbRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['ranobedbRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('ranobedbRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('hardcoverBookId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverBookId">Hardcover Book ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverBookId" formControlName="hardcoverBookId"/>
|
||||
@if (!book.metadata!['hardcoverBookIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverBookId')" severity="success"></p-button>
|
||||
@if (isFieldVisible('audibleId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="audibleId">Audible ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="audibleId" formControlName="audibleId"/>
|
||||
@if (!book.metadata!['audibleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('audibleId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['audibleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('audibleId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (book.metadata!['hardcoverBookIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverBookId')" severity="warn"></p-button>
|
||||
@if (isFieldVisible('audibleRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="audibleRating">Audible ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="audibleRating" formControlName="audibleRating"/>
|
||||
@if (!book.metadata!['audibleRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('audibleRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['audibleRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('audibleRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('hardcoverRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverRating">Hardcover ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverRating" formControlName="hardcoverRating"/>
|
||||
@if (!book.metadata!['hardcoverRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('hardcoverReviewCount')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="hardcoverReviewCount">Hardcover #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount"/>
|
||||
@if (!book.metadata!['hardcoverReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['hardcoverReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('lubimyczytacId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="lubimyczytacId">Lubimyczytac ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="lubimyczytacId" formControlName="lubimyczytacId"/>
|
||||
@if (!book.metadata!['lubimyczytacIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('lubimyczytacId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['lubimyczytacIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('lubimyczytacId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('lubimyczytacRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="lubimyczytacRating">Lubimyczytac ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="lubimyczytacRating" formControlName="lubimyczytacRating"/>
|
||||
@if (!book.metadata!['lubimyczytacRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('lubimyczytacRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['lubimyczytacRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('lubimyczytacRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('comicvineId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="comicvineId">Comicvine ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="comicvineId" formControlName="comicvineId"/>
|
||||
@if (!book.metadata!['comicvineIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('comicvineId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['comicvineIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('comicvineId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('ranobedbId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="ranobedbId">Ranobedb ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="ranobedbId" formControlName="ranobedbId"/>
|
||||
@if (!book.metadata!['ranobedbIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('ranobedbId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['ranobedbIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('ranobedbId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('ranobedbRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="ranobedbRating">Ranobedb ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="ranobedbRating" formControlName="ranobedbRating"/>
|
||||
@if (!book.metadata!['ranobedbRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('ranobedbRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['ranobedbRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('ranobedbRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('audibleId')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="audibleId">Audible ID</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="audibleId" formControlName="audibleId"/>
|
||||
@if (!book.metadata!['audibleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('audibleId')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['audibleIdLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('audibleId')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('audibleRating')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="audibleRating">Audible ★</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="audibleRating" formControlName="audibleRating"/>
|
||||
@if (!book.metadata!['audibleRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('audibleRating')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['audibleRatingLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('audibleRating')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (isFieldVisible('audibleReviewCount')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="audibleReviewCount">Audible #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="audibleReviewCount" formControlName="audibleReviewCount"/>
|
||||
@if (!book.metadata!['audibleReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('audibleReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['audibleReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('audibleReviewCount')" severity="warn"></p-button>
|
||||
@if (isFieldVisible('audibleReviewCount')) {
|
||||
<div class="field-group metadata-id-field">
|
||||
<label for="audibleReviewCount">Audible #</label>
|
||||
<div class="field-with-lock">
|
||||
<input pSize="small" pInputText id="audibleReviewCount" formControlName="audibleReviewCount"/>
|
||||
@if (!book.metadata!['audibleReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('audibleReviewCount')" severity="success"></p-button>
|
||||
}
|
||||
@if (book.metadata!['audibleReviewCountLocked']) {
|
||||
<p-button size="small" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('audibleReviewCount')" severity="warn"></p-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+86
-5
@@ -239,7 +239,7 @@ label {
|
||||
|
||||
.language-field {
|
||||
@media (min-width: 768px) {
|
||||
width: 9rem;
|
||||
width: 11rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,21 +271,31 @@ label {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.half-width {
|
||||
width: 100%;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.series-name-field {
|
||||
@media (min-width: 768px) {
|
||||
flex-basis: 75%;
|
||||
flex: 4.75;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.small-field {
|
||||
@media (min-width: 768px) {
|
||||
width: 9rem;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.metadata-ids-row {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
||||
gap: 1rem;
|
||||
width: 100%;
|
||||
|
||||
@@ -300,6 +310,76 @@ label {
|
||||
}
|
||||
}
|
||||
|
||||
.collapsible-section {
|
||||
margin-top: 1rem;
|
||||
width: 100%;
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 0.75rem;
|
||||
|
||||
.collapsible-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.75rem 1rem;
|
||||
min-height: 2.5rem;
|
||||
background: var(--surface-ground);
|
||||
border-radius: 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-color);
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
transition: background 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background: var(--surface-hover);
|
||||
}
|
||||
|
||||
i:first-child {
|
||||
font-size: 0.9rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.section-toggle {
|
||||
margin-left: auto;
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-secondary-color);
|
||||
}
|
||||
}
|
||||
|
||||
&.expanded .collapsible-header {
|
||||
border-radius: 0.75rem 0.75rem 0 0;
|
||||
}
|
||||
|
||||
.collapsible-content {
|
||||
padding: 0.75rem;
|
||||
border-top: 1px solid var(--border-color);
|
||||
}
|
||||
}
|
||||
|
||||
.comic-text-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
|
||||
@media (max-width: 767px) {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
.comic-array-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
|
||||
@media (max-width: 767px) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.description-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -335,7 +415,8 @@ label {
|
||||
|
||||
input,
|
||||
p-autocomplete,
|
||||
p-datepicker {
|
||||
p-datepicker,
|
||||
p-select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
+120
-1
@@ -6,8 +6,9 @@ import {FormControl, FormGroup, FormsModule, ReactiveFormsModule,} from "@angula
|
||||
import {Observable, sample} from "rxjs";
|
||||
import {AsyncPipe} from "@angular/common";
|
||||
import {MessageService} from "primeng/api";
|
||||
import {Book, BookMetadata, MetadataClearFlags, MetadataUpdateWrapper,} from "../../../../book/model/book.model";
|
||||
import {Book, BookMetadata, ComicMetadata, MetadataClearFlags, MetadataUpdateWrapper,} from "../../../../book/model/book.model";
|
||||
import {UrlHelperService} from "../../../../../shared/service/url-helper.service";
|
||||
import {ALL_COMIC_METADATA_FIELDS, AUDIOBOOK_METADATA_FIELDS, COMIC_FORM_TO_MODEL_LOCK, COMIC_TEXT_METADATA_FIELDS, COMIC_ARRAY_METADATA_FIELDS, COMIC_TEXTAREA_METADATA_FIELDS, MetadataFieldConfig} from '../../../../../shared/metadata';
|
||||
import {FileUpload, FileUploadErrorEvent, FileUploadEvent,} from "primeng/fileupload";
|
||||
import {HttpResponse} from "@angular/common/http";
|
||||
import {BookService} from "../../../../book/service/book.service";
|
||||
@@ -106,6 +107,20 @@ export class MetadataEditorComponent implements OnInit {
|
||||
|
||||
contentRatingOptions: {label: string, value: string}[] = [];
|
||||
ageRatingOptions: {label: string, value: number}[] = [];
|
||||
booleanOptions: {label: string, value: boolean | null}[] = [
|
||||
{label: 'Unknown', value: null},
|
||||
{label: 'Yes', value: true},
|
||||
{label: 'No', value: false},
|
||||
];
|
||||
|
||||
comicSectionExpanded = true;
|
||||
audiobookSectionExpanded = true;
|
||||
providerSectionExpanded = true;
|
||||
|
||||
comicTextFields = COMIC_TEXT_METADATA_FIELDS;
|
||||
comicArrayFields = COMIC_ARRAY_METADATA_FIELDS;
|
||||
comicTextareaFields = COMIC_TEXTAREA_METADATA_FIELDS;
|
||||
audiobookMetadataFields = AUDIOBOOK_METADATA_FIELDS;
|
||||
|
||||
providerSpecificFields: MetadataProviderSpecificFields = {
|
||||
asin: true,
|
||||
@@ -274,6 +289,20 @@ export class MetadataEditorComponent implements OnInit {
|
||||
{label: '18+', value: 18},
|
||||
{label: '21+', value: 21}
|
||||
];
|
||||
|
||||
// Add audiobook metadata form controls
|
||||
for (const field of AUDIOBOOK_METADATA_FIELDS) {
|
||||
const defaultValue = field.type === 'boolean' ? null : '';
|
||||
this.metadataForm.addControl(field.controlName, new FormControl(defaultValue));
|
||||
this.metadataForm.addControl(field.lockedKey, new FormControl(false));
|
||||
}
|
||||
|
||||
// Add comic metadata form controls
|
||||
for (const field of ALL_COMIC_METADATA_FIELDS) {
|
||||
const defaultValue = field.type === 'array' ? [] : (field.type === 'number' || field.type === 'boolean') ? null : '';
|
||||
this.metadataForm.addControl(field.controlName, new FormControl(defaultValue));
|
||||
this.metadataForm.addControl(field.lockedKey, new FormControl(false));
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -434,6 +463,33 @@ export class MetadataEditorComponent implements OnInit {
|
||||
contentRatingLocked: metadata.contentRatingLocked ?? false,
|
||||
});
|
||||
|
||||
// Patch audiobook metadata
|
||||
const audiobookPatch: Record<string, unknown> = {};
|
||||
for (const field of AUDIOBOOK_METADATA_FIELDS) {
|
||||
const key = field.controlName as keyof BookMetadata;
|
||||
const lockedKey = field.lockedKey as keyof BookMetadata;
|
||||
audiobookPatch[field.controlName] = metadata[key] ?? (field.type === 'boolean' ? null : '');
|
||||
audiobookPatch[field.lockedKey] = metadata[lockedKey] ?? false;
|
||||
}
|
||||
this.metadataForm.patchValue(audiobookPatch);
|
||||
|
||||
// Patch comic metadata
|
||||
const comicMeta = metadata.comicMetadata;
|
||||
const comicPatch: Record<string, unknown> = {};
|
||||
for (const field of ALL_COMIC_METADATA_FIELDS) {
|
||||
const value = comicMeta?.[field.fetchedKey as keyof ComicMetadata];
|
||||
if (field.type === 'array') {
|
||||
comicPatch[field.controlName] = [...(value as string[] ?? [])].sort();
|
||||
} else if (field.type === 'boolean' || field.type === 'number') {
|
||||
comicPatch[field.controlName] = value ?? null;
|
||||
} else {
|
||||
comicPatch[field.controlName] = value ?? '';
|
||||
}
|
||||
const modelLockKey = COMIC_FORM_TO_MODEL_LOCK[field.lockedKey];
|
||||
comicPatch[field.lockedKey] = comicMeta?.[modelLockKey as keyof ComicMetadata] ?? false;
|
||||
}
|
||||
this.metadataForm.patchValue(comicPatch);
|
||||
|
||||
const lockableFields: { key: keyof BookMetadata; control: string }[] = [
|
||||
{key: "titleLocked", control: "title"},
|
||||
{key: "subtitleLocked", control: "subtitle"},
|
||||
@@ -485,6 +541,24 @@ export class MetadataEditorComponent implements OnInit {
|
||||
isLocked ? formControl.disable() : formControl.enable();
|
||||
}
|
||||
}
|
||||
|
||||
// Apply audiobook lock states
|
||||
for (const field of AUDIOBOOK_METADATA_FIELDS) {
|
||||
const isLocked = this.metadataForm.get(field.lockedKey)?.value === true;
|
||||
const formControl = this.metadataForm.get(field.controlName);
|
||||
if (formControl) {
|
||||
isLocked ? formControl.disable() : formControl.enable();
|
||||
}
|
||||
}
|
||||
|
||||
// Apply comic lock states
|
||||
for (const field of ALL_COMIC_METADATA_FIELDS) {
|
||||
const isLocked = this.metadataForm.get(field.lockedKey)?.value === true;
|
||||
const formControl = this.metadataForm.get(field.controlName);
|
||||
if (formControl) {
|
||||
isLocked ? formControl.disable() : formControl.enable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onAutoCompleteSelect(fieldName: string, event: AutoCompleteSelectEvent) {
|
||||
@@ -628,6 +702,12 @@ export class MetadataEditorComponent implements OnInit {
|
||||
thumbnailUrl: form.get("thumbnailUrl")?.value,
|
||||
audiobookCover: form.get("audiobookCover")?.value,
|
||||
|
||||
// Audiobook metadata
|
||||
narrator: form.get("narrator")?.value,
|
||||
abridged: form.get("abridged")?.value,
|
||||
narratorLocked: form.get("narratorLocked")?.value,
|
||||
abridgedLocked: form.get("abridgedLocked")?.value,
|
||||
|
||||
// Locks
|
||||
titleLocked: form.get("titleLocked")?.value,
|
||||
subtitleLocked: form.get("subtitleLocked")?.value,
|
||||
@@ -677,6 +757,35 @@ export class MetadataEditorComponent implements OnInit {
|
||||
}),
|
||||
};
|
||||
|
||||
// Build comic metadata from form controls
|
||||
const comicMetadata: Record<string, unknown> = {};
|
||||
for (const field of ALL_COMIC_METADATA_FIELDS) {
|
||||
const value = form.get(field.controlName)?.value;
|
||||
if (field.type === 'array') {
|
||||
comicMetadata[field.fetchedKey] = Array.isArray(value) ? value : [];
|
||||
} else if (field.type === 'number') {
|
||||
comicMetadata[field.fetchedKey] = value !== '' && value !== null ? Number(value) : null;
|
||||
} else if (field.type === 'boolean') {
|
||||
comicMetadata[field.fetchedKey] = value ?? null;
|
||||
} else {
|
||||
comicMetadata[field.fetchedKey] = value ?? '';
|
||||
}
|
||||
}
|
||||
// Consolidate comic lock states to model lock keys
|
||||
const lockGroups: Record<string, boolean> = {};
|
||||
for (const [formKey, modelKey] of Object.entries(COMIC_FORM_TO_MODEL_LOCK)) {
|
||||
const value = form.get(formKey)?.value ?? false;
|
||||
if (value) {
|
||||
lockGroups[modelKey] = true;
|
||||
} else if (!(modelKey in lockGroups)) {
|
||||
lockGroups[modelKey] = false;
|
||||
}
|
||||
}
|
||||
for (const [modelKey, value] of Object.entries(lockGroups)) {
|
||||
comicMetadata[modelKey] = value;
|
||||
}
|
||||
metadata.comicMetadata = comicMetadata as ComicMetadata;
|
||||
|
||||
const original = this.originalMetadata;
|
||||
|
||||
const wasCleared = (key: keyof BookMetadata): boolean => {
|
||||
@@ -725,6 +834,8 @@ export class MetadataEditorComponent implements OnInit {
|
||||
seriesName: wasCleared("seriesName"),
|
||||
seriesNumber: wasCleared("seriesNumber"),
|
||||
seriesTotal: wasCleared("seriesTotal"),
|
||||
narrator: wasCleared("narrator"),
|
||||
abridged: wasCleared("abridged"),
|
||||
audiobookCover: wasCleared("audiobookCover"),
|
||||
cover: false,
|
||||
ageRating: wasCleared("ageRating"),
|
||||
@@ -1051,6 +1162,14 @@ export class MetadataEditorComponent implements OnInit {
|
||||
return this.bookService.supportsDualCovers(book);
|
||||
}
|
||||
|
||||
isCBX(book: Book): boolean {
|
||||
return book.primaryFile?.bookType === 'CBX';
|
||||
}
|
||||
|
||||
isAudiobook(book: Book): boolean {
|
||||
return book.primaryFile?.bookType === 'AUDIOBOOK';
|
||||
}
|
||||
|
||||
getUploadAudiobookCoverUrl(): string {
|
||||
return this.bookService.getUploadAudiobookCoverUrl(this.currentBookId);
|
||||
}
|
||||
|
||||
+209
-35
@@ -1,6 +1,13 @@
|
||||
@if (book$ | async; as book) {
|
||||
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="metadata-picker">
|
||||
<div class="dialog-body">
|
||||
@if (detailLoading) {
|
||||
<div class="detail-loading-banner">
|
||||
<i class="pi pi-spin pi-spinner"></i>
|
||||
<span>Loading complete metadata...</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Column Headers (Desktop) -->
|
||||
<div class="column-headers desktop-only">
|
||||
<div class="column-label current">
|
||||
@@ -434,51 +441,170 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Provider Metadata Section -->
|
||||
@if (metadataProviderFields.length > 0) {
|
||||
<!-- Comic Book Details Section -->
|
||||
@if (shouldShowComicSection()) {
|
||||
<section class="form-section">
|
||||
<div class="section-header">
|
||||
<i class="pi pi-cloud"></i>
|
||||
<span>Provider Metadata</span>
|
||||
<div class="section-header collapsible-header" (click)="comicSectionExpanded = !comicSectionExpanded">
|
||||
<i class="pi pi-bolt"></i>
|
||||
<span>Comic Book Details</span>
|
||||
@if (!hasAnyFetchedComicData() && !hasAnyCurrentComicData()) {
|
||||
<span class="section-empty-badge">none present</span>
|
||||
}
|
||||
<i [class]="comicSectionExpanded ? 'pi pi-chevron-up' : 'pi pi-chevron-down'" class="section-toggle"></i>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
@for (field of metadataProviderFields; track field) {
|
||||
<div class="field-row">
|
||||
<label class="field-label">{{ field.label }}</label>
|
||||
<div class="field-content">
|
||||
<div class="field-side current">
|
||||
@if (comicSectionExpanded) {
|
||||
<div class="section-content">
|
||||
<!-- Comic text/number/boolean fields -->
|
||||
@for (field of comicTextFields; track field) {
|
||||
<div class="field-row">
|
||||
<label class="field-label">{{ field.label }}</label>
|
||||
<div class="field-content">
|
||||
<div class="field-side current">
|
||||
<button
|
||||
type="button"
|
||||
class="lock-btn"
|
||||
[class.locked]="metadataForm.get(field.lockedKey)?.value"
|
||||
(click)="toggleLock(field.controlName)"
|
||||
>
|
||||
<i [class]="metadataForm.get(field.lockedKey)?.value ? 'pi pi-lock' : 'pi pi-lock-open'"></i>
|
||||
</button>
|
||||
@if (field.type === 'boolean') {
|
||||
<p-checkbox
|
||||
formControlName="{{field.controlName}}"
|
||||
[binary]="true"
|
||||
class="field-checkbox"
|
||||
/>
|
||||
} @else {
|
||||
<input pInputText formControlName="{{field.controlName}}" class="field-input"/>
|
||||
}
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="lock-btn"
|
||||
[class.locked]="metadataForm.get(field.lockedKey)?.value"
|
||||
(click)="toggleLock(field.controlName)"
|
||||
class="transfer-btn"
|
||||
[class.saved]="isValueSaved(field.controlName)"
|
||||
[class.copied]="isValueCopied(field.controlName) && !hoveredFields[field.controlName]"
|
||||
[class.reset]="isValueCopied(field.controlName) && hoveredFields[field.controlName]"
|
||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||
(mouseenter)="onMouseEnter(field.controlName)"
|
||||
(mouseleave)="onMouseLeave(field.controlName)"
|
||||
>
|
||||
<i [class]="metadataForm.get(field.lockedKey)?.value ? 'pi pi-lock' : 'pi pi-lock-open'"></i>
|
||||
<i [class]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"></i>
|
||||
</button>
|
||||
<input pInputText formControlName="{{field.controlName}}" class="field-input"/>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="transfer-btn"
|
||||
[class.saved]="isValueSaved(field.controlName)"
|
||||
[class.copied]="isValueCopied(field.controlName) && !hoveredFields[field.controlName]"
|
||||
[class.reset]="isValueCopied(field.controlName) && hoveredFields[field.controlName]"
|
||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||
(mouseenter)="onMouseEnter(field.controlName)"
|
||||
(mouseleave)="onMouseLeave(field.controlName)"
|
||||
>
|
||||
<i [class]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"></i>
|
||||
</button>
|
||||
|
||||
<div class="field-side fetched">
|
||||
<input pInputText [value]="fetchedMetadata[field.fetchedKey] ?? ''" class="field-input" readonly/>
|
||||
<div class="field-side fetched">
|
||||
@if (field.type === 'boolean') {
|
||||
<p-checkbox
|
||||
[ngModel]="getFetchedComicValue(field.fetchedKey)"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
[binary]="true"
|
||||
[disabled]="true"
|
||||
class="field-checkbox"
|
||||
/>
|
||||
} @else {
|
||||
<input pInputText [value]="getFetchedComicValue(field.fetchedKey) ?? ''" class="field-input" readonly/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Comic array fields (creators, characters, teams, locations) -->
|
||||
@for (field of comicArrayFields; track field) {
|
||||
<div class="field-row">
|
||||
<label class="field-label">{{ field.label }}</label>
|
||||
<div class="field-content">
|
||||
<div class="field-side current">
|
||||
<button
|
||||
type="button"
|
||||
class="lock-btn"
|
||||
[class.locked]="metadataForm.get(field.lockedKey)?.value"
|
||||
(click)="toggleLock(field.controlName)"
|
||||
>
|
||||
<i [class]="metadataForm.get(field.lockedKey)?.value ? 'pi pi-lock' : 'pi pi-lock-open'"></i>
|
||||
</button>
|
||||
<p-autoComplete
|
||||
class="chips-input"
|
||||
formControlName="{{field.controlName}}"
|
||||
[multiple]="true"
|
||||
[dropdown]="false"
|
||||
[forceSelection]="false"
|
||||
[showClear]="true"
|
||||
[suggestions]="getFiltered(field.controlName)"
|
||||
(completeMethod)="filterItems($event, field.controlName)"
|
||||
(onKeyUp)="onAutoCompleteKeyUp(field.controlName, $event)"
|
||||
(onSelect)="onAutoCompleteSelect(field.controlName, $event)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="transfer-btn"
|
||||
[class.saved]="isValueSaved(field.controlName)"
|
||||
[class.copied]="isValueCopied(field.controlName) && !hoveredFields[field.controlName]"
|
||||
[class.reset]="isValueCopied(field.controlName) && hoveredFields[field.controlName]"
|
||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||
(mouseenter)="onMouseEnter(field.controlName)"
|
||||
(mouseleave)="onMouseLeave(field.controlName)"
|
||||
>
|
||||
<i [class]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"></i>
|
||||
</button>
|
||||
|
||||
<div class="field-side fetched">
|
||||
<p-autoComplete
|
||||
[ngModel]="getFetchedComicValue(field.fetchedKey) ?? []"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
[disabled]="true"
|
||||
[multiple]="true"
|
||||
[typeahead]="false"
|
||||
[dropdown]="false"
|
||||
[forceSelection]="false"
|
||||
class="chips-input readonly"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Comic textarea fields (notes) -->
|
||||
@for (field of comicTextareaFields; track field) {
|
||||
<div class="field-row textarea-row">
|
||||
<label class="field-label">{{ field.label }}</label>
|
||||
<div class="field-content">
|
||||
<div class="field-side current">
|
||||
<button
|
||||
type="button"
|
||||
class="lock-btn"
|
||||
[class.locked]="metadataForm.get(field.lockedKey)?.value"
|
||||
(click)="toggleLock(field.controlName)"
|
||||
>
|
||||
<i [class]="metadataForm.get(field.lockedKey)?.value ? 'pi pi-lock' : 'pi pi-lock-open'"></i>
|
||||
</button>
|
||||
<textarea pTextarea formControlName="{{field.controlName}}" class="field-textarea" rows="3"></textarea>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="transfer-btn"
|
||||
[class.saved]="isValueSaved(field.controlName)"
|
||||
[class.copied]="isValueCopied(field.controlName) && !hoveredFields[field.controlName]"
|
||||
[class.reset]="isValueCopied(field.controlName) && hoveredFields[field.controlName]"
|
||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||
(mouseenter)="onMouseEnter(field.controlName)"
|
||||
(mouseleave)="onMouseLeave(field.controlName)"
|
||||
>
|
||||
<i [class]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"></i>
|
||||
</button>
|
||||
|
||||
<div class="field-side fetched">
|
||||
<textarea pTextarea [value]="getFetchedComicValue(field.fetchedKey) ?? ''" class="field-textarea" rows="3" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
|
||||
@@ -547,6 +673,54 @@
|
||||
</div>
|
||||
</section>
|
||||
}
|
||||
|
||||
<!-- Provider Metadata Section -->
|
||||
@if (metadataProviderFields.length > 0) {
|
||||
<section class="form-section">
|
||||
<div class="section-header">
|
||||
<i class="pi pi-cloud"></i>
|
||||
<span>Provider Metadata</span>
|
||||
</div>
|
||||
|
||||
<div class="section-content">
|
||||
@for (field of metadataProviderFields; track field) {
|
||||
<div class="field-row">
|
||||
<label class="field-label">{{ field.label }}</label>
|
||||
<div class="field-content">
|
||||
<div class="field-side current">
|
||||
<button
|
||||
type="button"
|
||||
class="lock-btn"
|
||||
[class.locked]="metadataForm.get(field.lockedKey)?.value"
|
||||
(click)="toggleLock(field.controlName)"
|
||||
>
|
||||
<i [class]="metadataForm.get(field.lockedKey)?.value ? 'pi pi-lock' : 'pi pi-lock-open'"></i>
|
||||
</button>
|
||||
<input pInputText formControlName="{{field.controlName}}" class="field-input"/>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="transfer-btn"
|
||||
[class.saved]="isValueSaved(field.controlName)"
|
||||
[class.copied]="isValueCopied(field.controlName) && !hoveredFields[field.controlName]"
|
||||
[class.reset]="isValueCopied(field.controlName) && hoveredFields[field.controlName]"
|
||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||
(mouseenter)="onMouseEnter(field.controlName)"
|
||||
(mouseleave)="onMouseLeave(field.controlName)"
|
||||
>
|
||||
<i [class]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"></i>
|
||||
</button>
|
||||
|
||||
<div class="field-side fetched">
|
||||
<input pInputText [value]="fetchedMetadata[field.fetchedKey] ?? ''" class="field-input" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (!reviewMode) {
|
||||
|
||||
+49
@@ -25,6 +25,26 @@
|
||||
}
|
||||
|
||||
|
||||
// Detail loading banner
|
||||
.detail-loading-banner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.625rem 1rem;
|
||||
background: rgba(34, 197, 94, 0.1);
|
||||
border: 1px solid rgba(34, 197, 94, 0.3);
|
||||
border-radius: 8px;
|
||||
color: var(--p-green-400);
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
animation: fadeIn 0.3s ease-in;
|
||||
|
||||
i {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
// Body
|
||||
.dialog-body {
|
||||
flex: 1;
|
||||
@@ -128,6 +148,35 @@
|
||||
font-size: 0.9rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
&.collapsible-header {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
transition: color 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.section-toggle {
|
||||
margin-left: auto;
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-secondary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.section-empty-badge {
|
||||
font-size: 0.7rem;
|
||||
font-weight: 500;
|
||||
text-transform: none;
|
||||
letter-spacing: normal;
|
||||
color: var(--text-secondary-color);
|
||||
background: var(--surface-ground);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
padding: 0.125rem 0.5rem;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
.section-content {
|
||||
|
||||
+175
-2
@@ -1,5 +1,5 @@
|
||||
import {Component, DestroyRef, EventEmitter, inject, Input, OnInit, Output} from '@angular/core';
|
||||
import {Book, BookMetadata, MetadataClearFlags, MetadataUpdateWrapper} from '../../../../book/model/book.model';
|
||||
import {Book, BookMetadata, ComicMetadata, MetadataClearFlags, MetadataUpdateWrapper} from '../../../../book/model/book.model';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {Button} from 'primeng/button';
|
||||
import {FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
@@ -18,7 +18,7 @@ import {Checkbox} from 'primeng/checkbox';
|
||||
import {LazyLoadImageModule} from 'ng-lazyload-image';
|
||||
import {AppSettingsService} from '../../../../../shared/service/app-settings.service';
|
||||
import {MetadataProviderSpecificFields} from '../../../../../shared/model/app-settings.model';
|
||||
import {ALL_METADATA_FIELDS, AUDIOBOOK_METADATA_FIELDS, getArrayFields, getBookDetailsFields, getBottomFields, getProviderFields, getSeriesFields, getTextareaFields, getTopFields, MetadataFieldConfig, MetadataFormBuilder, MetadataUtilsService} from '../../../../../shared/metadata';
|
||||
import {ALL_COMIC_METADATA_FIELDS, ALL_METADATA_FIELDS, AUDIOBOOK_METADATA_FIELDS, COMIC_ARRAY_METADATA_FIELDS, COMIC_FORM_TO_MODEL_LOCK, COMIC_TEXT_METADATA_FIELDS, COMIC_TEXTAREA_METADATA_FIELDS, getArrayFields, getBookDetailsFields, getBottomFields, getProviderFields, getSeriesFields, getTextareaFields, getTopFields, MetadataFieldConfig, MetadataFormBuilder, MetadataUtilsService} from '../../../../../shared/metadata';
|
||||
|
||||
@Component({
|
||||
selector: 'app-metadata-picker',
|
||||
@@ -50,10 +50,15 @@ export class MetadataPickerComponent implements OnInit {
|
||||
metadataProviderFields: MetadataFieldConfig[] = [];
|
||||
metadataFieldsBottom: MetadataFieldConfig[] = [];
|
||||
audiobookMetadataFields: MetadataFieldConfig[] = [];
|
||||
comicTextFields: MetadataFieldConfig[] = [];
|
||||
comicArrayFields: MetadataFieldConfig[] = [];
|
||||
comicTextareaFields: MetadataFieldConfig[] = [];
|
||||
comicSectionExpanded = false;
|
||||
|
||||
@Input() reviewMode!: boolean;
|
||||
@Input() fetchedMetadata!: BookMetadata;
|
||||
@Input() book$!: Observable<Book | null>;
|
||||
@Input() detailLoading = false;
|
||||
@Output() goBack = new EventEmitter<boolean>();
|
||||
|
||||
currentBook: Book | null = null;
|
||||
@@ -93,6 +98,9 @@ export class MetadataPickerComponent implements OnInit {
|
||||
this.updateProviderFields();
|
||||
this.updateBottomFields();
|
||||
this.audiobookMetadataFields = AUDIOBOOK_METADATA_FIELDS;
|
||||
this.comicTextFields = COMIC_TEXT_METADATA_FIELDS;
|
||||
this.comicArrayFields = COMIC_ARRAY_METADATA_FIELDS;
|
||||
this.comicTextareaFields = COMIC_TEXTAREA_METADATA_FIELDS;
|
||||
}
|
||||
|
||||
private updateProviderFields(): void {
|
||||
@@ -209,8 +217,26 @@ export class MetadataPickerComponent implements OnInit {
|
||||
patchData[field.lockedKey] = topLevelLocked ?? false;
|
||||
}
|
||||
|
||||
// Handle comic book metadata fields (nested under comicMetadata)
|
||||
const comicMeta = metadata.comicMetadata;
|
||||
for (const field of ALL_COMIC_METADATA_FIELDS) {
|
||||
const value = comicMeta?.[field.fetchedKey as keyof ComicMetadata];
|
||||
if (field.type === 'array') {
|
||||
patchData[field.controlName] = [...(value as string[] ?? [])].sort();
|
||||
} else if (field.type === 'boolean') {
|
||||
patchData[field.controlName] = value ?? null;
|
||||
} else if (field.type === 'number') {
|
||||
patchData[field.controlName] = value ?? null;
|
||||
} else {
|
||||
patchData[field.controlName] = value ?? '';
|
||||
}
|
||||
const modelLockKey = COMIC_FORM_TO_MODEL_LOCK[field.lockedKey];
|
||||
patchData[field.lockedKey] = comicMeta?.[modelLockKey as keyof ComicMetadata] ?? false;
|
||||
}
|
||||
|
||||
this.metadataForm.patchValue(patchData);
|
||||
this.applyLockStates(metadata);
|
||||
this.comicSectionExpanded = this.hasAnyFetchedComicData() || this.hasAnyCurrentComicData();
|
||||
}
|
||||
|
||||
private applyLockStates(metadata: BookMetadata): void {
|
||||
@@ -222,6 +248,12 @@ export class MetadataPickerComponent implements OnInit {
|
||||
for (const field of AUDIOBOOK_METADATA_FIELDS) {
|
||||
lockedFields[field.lockedKey] = !!metadata[field.lockedKey as keyof BookMetadata];
|
||||
}
|
||||
// Handle comic book metadata lock states (nested under comicMetadata)
|
||||
const comicMeta = metadata.comicMetadata;
|
||||
for (const field of ALL_COMIC_METADATA_FIELDS) {
|
||||
const modelLockKey = COMIC_FORM_TO_MODEL_LOCK[field.lockedKey];
|
||||
lockedFields[field.lockedKey] = !!comicMeta?.[modelLockKey as keyof ComicMetadata];
|
||||
}
|
||||
this.formBuilder.applyLockStates(this.metadataForm, lockedFields);
|
||||
}
|
||||
|
||||
@@ -326,6 +358,35 @@ export class MetadataPickerComponent implements OnInit {
|
||||
metadata[field.lockedKey] = this.metadataForm.get(field.lockedKey)?.value ?? false;
|
||||
}
|
||||
|
||||
// Build comic metadata from form controls
|
||||
const comicMetadata: Record<string, unknown> = {};
|
||||
for (const field of ALL_COMIC_METADATA_FIELDS) {
|
||||
if (field.type === 'array') {
|
||||
comicMetadata[field.fetchedKey] = this.getArrayValue(field.controlName);
|
||||
} else if (field.type === 'number') {
|
||||
comicMetadata[field.fetchedKey] = this.getNumberValue(field.controlName);
|
||||
} else if (field.type === 'boolean') {
|
||||
comicMetadata[field.fetchedKey] = this.getBooleanValue(field.controlName);
|
||||
} else {
|
||||
comicMetadata[field.fetchedKey] = this.getStringValue(field.controlName);
|
||||
}
|
||||
}
|
||||
// Consolidate lock states back to model lock keys using the form-to-model mapping.
|
||||
// If ANY field in a group is locked, the backend group lock is set to true.
|
||||
const lockGroups: Record<string, boolean> = {};
|
||||
for (const [formKey, modelKey] of Object.entries(COMIC_FORM_TO_MODEL_LOCK)) {
|
||||
const value = this.metadataForm.get(formKey)?.value ?? false;
|
||||
if (value) {
|
||||
lockGroups[modelKey] = true;
|
||||
} else if (!(modelKey in lockGroups)) {
|
||||
lockGroups[modelKey] = false;
|
||||
}
|
||||
}
|
||||
for (const [modelKey, value] of Object.entries(lockGroups)) {
|
||||
comicMetadata[modelKey] = value;
|
||||
}
|
||||
metadata['comicMetadata'] = comicMetadata;
|
||||
|
||||
return metadata as BookMetadata;
|
||||
}
|
||||
|
||||
@@ -411,6 +472,27 @@ export class MetadataPickerComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle comic metadata clear flags
|
||||
const currComic = current.comicMetadata;
|
||||
const origComic = original.comicMetadata;
|
||||
if (origComic) {
|
||||
for (const field of ALL_COMIC_METADATA_FIELDS) {
|
||||
const key = field.fetchedKey as keyof ComicMetadata;
|
||||
const curr = currComic?.[key];
|
||||
const orig = origComic[key];
|
||||
|
||||
if (field.type === 'array') {
|
||||
flags[`comic_${key}`] = !(curr as string[])?.length && !!(orig as string[])?.length;
|
||||
} else if (field.type === 'boolean') {
|
||||
flags[`comic_${key}`] = curr === null && orig !== null;
|
||||
} else if (field.type === 'number') {
|
||||
flags[`comic_${key}`] = curr === null && orig !== null;
|
||||
} else {
|
||||
flags[`comic_${key}`] = !curr && !!orig;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return flags as MetadataClearFlags;
|
||||
}
|
||||
|
||||
@@ -478,6 +560,21 @@ export class MetadataPickerComponent implements OnInit {
|
||||
this.copiedFields,
|
||||
(field) => this.copyFetchedToCurrent(field)
|
||||
);
|
||||
// Also copy missing comic fields
|
||||
if (this.fetchedMetadata?.comicMetadata) {
|
||||
for (const field of ALL_COMIC_METADATA_FIELDS) {
|
||||
const isLocked = this.metadataForm.get(field.lockedKey)?.value;
|
||||
const currentValue = this.metadataForm.get(field.controlName)?.value;
|
||||
const fetchedValue = this.fetchedMetadata.comicMetadata[field.fetchedKey as keyof ComicMetadata];
|
||||
const isEmpty = Array.isArray(currentValue)
|
||||
? currentValue.length === 0
|
||||
: (currentValue === null || currentValue === undefined || currentValue === '');
|
||||
const hasFetchedValue = fetchedValue !== null && fetchedValue !== undefined && fetchedValue !== '';
|
||||
if (!isLocked && isEmpty && hasFetchedValue) {
|
||||
this.copyFetchedToCurrent(field.controlName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
copyAll(): void {
|
||||
@@ -486,9 +583,40 @@ export class MetadataPickerComponent implements OnInit {
|
||||
this.metadataForm,
|
||||
(field) => this.copyFetchedToCurrent(field)
|
||||
);
|
||||
// Also copy all comic fields
|
||||
if (this.fetchedMetadata?.comicMetadata) {
|
||||
for (const field of ALL_COMIC_METADATA_FIELDS) {
|
||||
const isLocked = this.metadataForm.get(field.lockedKey)?.value;
|
||||
const fetchedValue = this.fetchedMetadata.comicMetadata[field.fetchedKey as keyof ComicMetadata];
|
||||
if (!isLocked && fetchedValue != null && fetchedValue !== '') {
|
||||
this.copyFetchedToCurrent(field.controlName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
copyFetchedToCurrent(field: string): void {
|
||||
// Handle comic fields (nested under comicMetadata)
|
||||
const comicConfig = this.getComicFieldConfig(field);
|
||||
if (comicConfig) {
|
||||
const isLocked = this.metadataForm.get(comicConfig.lockedKey)?.value;
|
||||
if (isLocked) {
|
||||
this.messageService.add({
|
||||
severity: 'warn',
|
||||
summary: 'Action Blocked',
|
||||
detail: `${comicConfig.label} is locked and cannot be updated.`
|
||||
});
|
||||
return;
|
||||
}
|
||||
const value = this.fetchedMetadata?.comicMetadata?.[comicConfig.fetchedKey as keyof ComicMetadata];
|
||||
if (value !== null && value !== undefined && value !== '') {
|
||||
this.metadataForm.get(field)?.setValue(value);
|
||||
this.copiedFields[field] = true;
|
||||
this.highlightCopiedInput(field);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
let lockField = field;
|
||||
if (field === 'thumbnailUrl') {
|
||||
lockField = 'cover';
|
||||
@@ -552,6 +680,14 @@ export class MetadataPickerComponent implements OnInit {
|
||||
}
|
||||
|
||||
resetField(field: string): void {
|
||||
const comicConfig = this.getComicFieldConfig(field);
|
||||
if (comicConfig) {
|
||||
const value = this.originalMetadata?.comicMetadata?.[comicConfig.fetchedKey as keyof ComicMetadata];
|
||||
this.metadataForm.get(field)?.setValue(value ?? (comicConfig.type === 'array' ? [] : comicConfig.type === 'boolean' ? null : ''));
|
||||
this.copiedFields[field] = false;
|
||||
this.hoveredFields[field] = false;
|
||||
return;
|
||||
}
|
||||
this.metadataUtils.resetField(field, this.metadataForm, this.originalMetadata, this.copiedFields, this.hoveredFields);
|
||||
}
|
||||
|
||||
@@ -580,4 +716,41 @@ export class MetadataPickerComponent implements OnInit {
|
||||
supportsDualCovers(book: Book): boolean {
|
||||
return this.hasEbookFormat(book) && this.hasAudiobookFormat(book);
|
||||
}
|
||||
|
||||
// Comic metadata helpers
|
||||
hasAnyFetchedComicData(): boolean {
|
||||
const comic = this.fetchedMetadata?.comicMetadata;
|
||||
if (!comic) return false;
|
||||
return ALL_COMIC_METADATA_FIELDS.some(field => {
|
||||
const value = comic[field.fetchedKey as keyof ComicMetadata];
|
||||
if (value === null || value === undefined || value === '' || value === false) return false;
|
||||
if (Array.isArray(value) && value.length === 0) return false;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
hasAnyCurrentComicData(): boolean {
|
||||
const comic = this.currentBook?.metadata?.comicMetadata;
|
||||
if (!comic) return false;
|
||||
return ALL_COMIC_METADATA_FIELDS.some(field => {
|
||||
const value = comic[field.fetchedKey as keyof ComicMetadata];
|
||||
if (value === null || value === undefined || value === '' || value === false) return false;
|
||||
if (Array.isArray(value) && value.length === 0) return false;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
shouldShowComicSection(): boolean {
|
||||
return this.hasAnyFetchedComicData() || this.hasAnyCurrentComicData() ||
|
||||
this.currentBook?.primaryFile?.bookType === 'CBX' ||
|
||||
this.fetchedMetadata?.provider?.toLowerCase() === 'comicvine';
|
||||
}
|
||||
|
||||
getFetchedComicValue(fetchedKey: string): unknown {
|
||||
return this.fetchedMetadata?.comicMetadata?.[fetchedKey as keyof ComicMetadata];
|
||||
}
|
||||
|
||||
private getComicFieldConfig(controlName: string): MetadataFieldConfig | undefined {
|
||||
return ALL_COMIC_METADATA_FIELDS.find(f => f.controlName === controlName);
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -3,6 +3,7 @@
|
||||
<app-metadata-picker
|
||||
[fetchedMetadata]="selectedFetchedMetadata"
|
||||
[book$]="book$"
|
||||
[detailLoading]="detailLoading"
|
||||
(goBack)="onGoBack()">
|
||||
</app-metadata-picker>
|
||||
</div>
|
||||
|
||||
+63
-6
@@ -44,6 +44,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
@Input() book$!: Observable<Book | null>;
|
||||
|
||||
selectedFetchedMetadata$ = new BehaviorSubject<BookMetadata | null>(null);
|
||||
detailLoading = false;
|
||||
|
||||
private formBuilder = inject(FormBuilder);
|
||||
private bookMetadataService = inject(BookMetadataService);
|
||||
@@ -267,7 +268,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
if (metadata.comicvineId) return 'comicvine';
|
||||
if (metadata.ranobedbId) return 'ranobedb';
|
||||
if (metadata.audibleId) return 'audible';
|
||||
return null;
|
||||
return metadata.provider?.toLowerCase() || null;
|
||||
}
|
||||
|
||||
getProviderClass(metadata: BookMetadata): string {
|
||||
@@ -341,9 +342,64 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
|
||||
onBookClick(fetchedMetadata: BookMetadata) {
|
||||
this.selectedFetchedMetadata$.next(fetchedMetadata);
|
||||
|
||||
const enrichment = this.getDetailEnrichmentInfo(fetchedMetadata);
|
||||
|
||||
if (enrichment) {
|
||||
this.detailLoading = true;
|
||||
this.bookMetadataService.fetchMetadataDetail(enrichment.provider, enrichment.id)
|
||||
.pipe(takeUntil(this.cancelRequest$))
|
||||
.subscribe({
|
||||
next: (enriched) => {
|
||||
const current = this.selectedFetchedMetadata$.value;
|
||||
const currentId = current && this.getProviderItemId(current, enrichment.provider);
|
||||
if (currentId === enrichment.id) {
|
||||
this.selectedFetchedMetadata$.next(enriched);
|
||||
}
|
||||
this.detailLoading = false;
|
||||
},
|
||||
error: (err) => {
|
||||
console.error('Error fetching detailed metadata:', err);
|
||||
this.detailLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private getDetailEnrichmentInfo(metadata: BookMetadata): { provider: string; id: string } | null {
|
||||
if (metadata.comicvineId && (!metadata.comicMetadata
|
||||
|| (!metadata.comicMetadata.pencillers?.length
|
||||
&& !metadata.comicMetadata.inkers?.length
|
||||
&& !metadata.comicMetadata.colorists?.length
|
||||
&& !metadata.comicMetadata.letterers?.length
|
||||
&& !metadata.comicMetadata.editors?.length
|
||||
&& !metadata.comicMetadata.characters?.length))) {
|
||||
return {provider: 'Comicvine', id: metadata.comicvineId};
|
||||
}
|
||||
if (metadata.goodreadsId && !metadata.description) {
|
||||
return {provider: 'GoodReads', id: metadata.goodreadsId};
|
||||
}
|
||||
if (metadata.asin && !metadata.description) {
|
||||
return {provider: 'Amazon', id: metadata.asin};
|
||||
}
|
||||
if (metadata.audibleId && !metadata.description) {
|
||||
return {provider: 'Audible', id: metadata.audibleId};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private getProviderItemId(metadata: BookMetadata, provider: string): string | undefined {
|
||||
switch (provider) {
|
||||
case 'Comicvine': return metadata.comicvineId;
|
||||
case 'GoodReads': return metadata.goodreadsId;
|
||||
case 'Amazon': return metadata.asin;
|
||||
case 'Audible': return metadata.audibleId;
|
||||
default: return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
onGoBack() {
|
||||
this.detailLoading = false;
|
||||
this.selectedFetchedMetadata$.next(null);
|
||||
}
|
||||
|
||||
@@ -371,16 +427,17 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||
} else if (metadata['lubimyczytacId']) {
|
||||
return `<a href="https://lubimyczytac.pl/ksiazka/${metadata['lubimyczytacId']}/ksiazka" target="_blank">Lubimyczytac</a>`;
|
||||
} else if (metadata.comicvineId) {
|
||||
if (metadata.comicvineId.startsWith('4000')) {
|
||||
const name = metadata.seriesName ? metadata.seriesName.replace(/ /g, '-').toLowerCase() + "-" + metadata.seriesNumber : '';
|
||||
return `<a href="https://comicvine.gamespot.com/${name}/${metadata.comicvineId}" target="_blank">Comicvine</a>`;
|
||||
if (metadata.externalUrl) {
|
||||
return `<a href="${metadata.externalUrl}" target="_blank">Comicvine</a>`;
|
||||
}
|
||||
const name = metadata.seriesName;
|
||||
return `<a href="https://comicvine.gamespot.com/volume/${metadata.comicvineId}" target="_blank">Comicvine</a>`;
|
||||
return `<a href="https://comicvine.gamespot.com/4050-${metadata.comicvineId}/" target="_blank">Comicvine</a>`;
|
||||
} else if (metadata.ranobedbId) {
|
||||
return `<a href="https://ranobedb.org/book/${metadata.ranobedbId}" target="_blank">RanobeDB</a>`;
|
||||
} else if (metadata.audibleId) {
|
||||
return `<a href="https://www.audible.com/pd/${metadata.audibleId}" target="_blank">Audible</a>`;
|
||||
} else if (metadata.externalUrl) {
|
||||
const providerName = metadata.provider || 'Link';
|
||||
return `<a href="${metadata.externalUrl}" target="_blank">${providerName}</a>`;
|
||||
}
|
||||
throw new Error("No provider ID found in metadata.");
|
||||
}
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@
|
||||
width="200"
|
||||
appendTo="body"
|
||||
[preview]="true"
|
||||
styleClass="square-cover">
|
||||
class="square-cover">
|
||||
</p-image>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+2
-2
@@ -254,10 +254,10 @@
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (book?.metadata?.comicvineId) {
|
||||
@if (book?.metadata?.comicMetadata?.webLink) {
|
||||
<a
|
||||
class="rating-link"
|
||||
[href]="'https://comicvine.gamespot.com/' + book.metadata!.comicvineId"
|
||||
[href]="book.metadata!.comicMetadata!.webLink"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
<p-tag
|
||||
[value]="getSyncStatusLabel()"
|
||||
[severity]="getSyncStatusSeverity()"
|
||||
styleClass="sync-status-tag"
|
||||
class="sync-status-tag"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
[text]="true"
|
||||
severity="secondary"
|
||||
(click)="ref.close()"
|
||||
styleClass="close-button">
|
||||
class="close-button">
|
||||
</p-button>
|
||||
</div>
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
[text]="true"
|
||||
severity="secondary"
|
||||
(click)="dynamicDialogRef.close()"
|
||||
styleClass="close-button">
|
||||
class="close-button">
|
||||
</p-button>
|
||||
</div>
|
||||
|
||||
|
||||
+3
-3
@@ -162,7 +162,7 @@
|
||||
header="Merge/Split {{ currentMergeType | titlecase }}"
|
||||
[(visible)]="showMergeDialog"
|
||||
[modal]="true"
|
||||
styleClass="user-dialog"
|
||||
class="user-dialog"
|
||||
[style]="{width: '50rem'}">
|
||||
<div class="dialog-form">
|
||||
<p>You are merging/splitting {{ getSelectedItems(currentMergeType).length }} {{ currentMergeType }}:</p>
|
||||
@@ -238,7 +238,7 @@
|
||||
header="Rename/Split {{ currentMergeType | titlecase }}"
|
||||
[(visible)]="showRenameDialog"
|
||||
[modal]="true"
|
||||
styleClass="user-dialog"
|
||||
class="user-dialog"
|
||||
[style]="{width: '40rem'}">
|
||||
<div class="dialog-form">
|
||||
<p>You are renaming/splitting:</p>
|
||||
@@ -308,7 +308,7 @@
|
||||
header="Delete {{ currentMergeType | titlecase }}"
|
||||
[(visible)]="showDeleteDialog"
|
||||
[modal]="true"
|
||||
styleClass="user-dialog"
|
||||
class="user-dialog"
|
||||
[style]="{width: '40rem'}">
|
||||
<div class="dialog-form">
|
||||
<div class="warning-message">
|
||||
|
||||
+9
-9
@@ -36,28 +36,28 @@
|
||||
<p-select [options]="providersWithClear" [(ngModel)]="bulkP1"
|
||||
(ngModelChange)="setBulkProvider('p1', $event)"
|
||||
placeholder="Set all P1" appendTo="body"
|
||||
styleClass="select-full-width" size="small">
|
||||
class="select-full-width" size="small">
|
||||
</p-select>
|
||||
</td>
|
||||
<td class="table-cell">
|
||||
<p-select [options]="providersWithClear" [(ngModel)]="bulkP2"
|
||||
(ngModelChange)="setBulkProvider('p2', $event)"
|
||||
placeholder="Set all P2" appendTo="body"
|
||||
styleClass="select-full-width" size="small">
|
||||
class="select-full-width" size="small">
|
||||
</p-select>
|
||||
</td>
|
||||
<td class="table-cell">
|
||||
<p-select [options]="providersWithClear" [(ngModel)]="bulkP3"
|
||||
(ngModelChange)="setBulkProvider('p3', $event)"
|
||||
placeholder="Set all P3" appendTo="body"
|
||||
styleClass="select-full-width" size="small">
|
||||
class="select-full-width" size="small">
|
||||
</p-select>
|
||||
</td>
|
||||
<td class="table-cell">
|
||||
<p-select [options]="providersWithClear" [(ngModel)]="bulkP4"
|
||||
(ngModelChange)="setBulkProvider('p4', $event)"
|
||||
placeholder="Set all P4" appendTo="body"
|
||||
styleClass="select-full-width" size="small">
|
||||
class="select-full-width" size="small">
|
||||
</p-select>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -75,28 +75,28 @@
|
||||
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p1"
|
||||
[disabled]="!enabledFields[field]"
|
||||
placeholder="Unset" appendTo="body"
|
||||
styleClass="select-full-width" size="small">
|
||||
class="select-full-width" size="small">
|
||||
</p-select>
|
||||
</td>
|
||||
<td class="table-cell-sm">
|
||||
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p2"
|
||||
[disabled]="!enabledFields[field]"
|
||||
placeholder="Unset" appendTo="body"
|
||||
styleClass="select-full-width" size="small">
|
||||
class="select-full-width" size="small">
|
||||
</p-select>
|
||||
</td>
|
||||
<td class="table-cell-sm">
|
||||
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p3"
|
||||
[disabled]="!enabledFields[field]"
|
||||
placeholder="Unset" appendTo="body"
|
||||
styleClass="select-full-width" size="small">
|
||||
class="select-full-width" size="small">
|
||||
</p-select>
|
||||
</td>
|
||||
<td class="table-cell-sm">
|
||||
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p4"
|
||||
[disabled]="!enabledFields[field]"
|
||||
placeholder="Unset" appendTo="body"
|
||||
styleClass="select-full-width" size="small">
|
||||
class="select-full-width" size="small">
|
||||
</p-select>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -125,7 +125,7 @@
|
||||
<div class="option-item">
|
||||
<p pTooltip="Controls how fetched metadata replaces existing values. 'Replace Missing Only' only fills empty fields, 'Replace All Fields' overwrites existing values." tooltipPosition="top">Replace Mode:</p>
|
||||
<p-select [options]="replaceModeOptions" [(ngModel)]="replaceMode" optionLabel="label" optionValue="value"
|
||||
appendTo="body" size="small" styleClass="select-mode">
|
||||
appendTo="body" size="small" class="select-mode">
|
||||
</p-select>
|
||||
</div>
|
||||
<div class="option-item">
|
||||
|
||||
+9
-2
@@ -109,14 +109,21 @@
|
||||
.options-group {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 2.5rem;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 1rem 2.5rem;
|
||||
}
|
||||
|
||||
.option-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
gap: 0.5rem;
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
[text]="true"
|
||||
severity="secondary"
|
||||
(click)="close()"
|
||||
styleClass="close-button">
|
||||
class="close-button">
|
||||
</p-button>
|
||||
</div>
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
[text]="true"
|
||||
severity="secondary"
|
||||
(click)="ref.close()"
|
||||
styleClass="close-button">
|
||||
class="close-button">
|
||||
</p-button>
|
||||
</div>
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
[text]="true"
|
||||
severity="secondary"
|
||||
(click)="dialogRef.close()"
|
||||
styleClass="close-button">
|
||||
class="close-button">
|
||||
</p-button>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user