Feature: Add Comicvine to metadata providers. (#804)

* added comcivine
* updated comicvine schema
* added comic vine support
* changed SQL changes
* fixed init provider bug
* updated changes for Flyway migration.

---------

Co-authored-by: Aditya Chandel <8075870+adityachandelgit@users.noreply.github.com>
This commit is contained in:
Rprasad2400
2025-08-06 11:29:12 -06:00
committed by GitHub
co-authored by Aditya Chandel
parent e027225775
commit 46f86deb24
40 changed files with 610 additions and 7 deletions
@@ -355,6 +355,18 @@
}
</div>
</div>
<div class="flex flex-col gap-1 w-1/6">
<label for="comicvineId">Comicvine ID</label>
<div class="flex justify-between items-center gap-2">
<input pInputText id="comicvineId" formControlName="comicvineId" class="w-full"/>
@if (!book.metadata!['comicvineIdLocked']) {
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('comicvineId')" severity="success"></p-button>
}
@if (book.metadata!['comicvineIdLocked']) {
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('comicvineId')" severity="warn"></p-button>
}
</div>
</div>
</div>
</div>
</div>
@@ -97,6 +97,7 @@ export class MetadataEditorComponent implements OnInit {
amazonRating: new FormControl(''),
amazonReviewCount: new FormControl(''),
goodreadsId: new FormControl(''),
comicvineId: new FormControl(''),
goodreadsRating: new FormControl(''),
goodreadsReviewCount: new FormControl(''),
hardcoverId: new FormControl(''),
@@ -123,6 +124,7 @@ export class MetadataEditorComponent implements OnInit {
amazonRatingLocked: new FormControl(false),
amazonReviewCountLocked: new FormControl(false),
goodreadsIdLocked: new FormControl(''),
comicvineIdLocked: new FormControl(false),
goodreadsRatingLocked: new FormControl(false),
goodreadsReviewCountLocked: new FormControl(false),
hardcoverIdLocked: new FormControl(false),
@@ -189,6 +191,7 @@ export class MetadataEditorComponent implements OnInit {
amazonRating: metadata.amazonRating ?? null,
amazonReviewCount: metadata.amazonReviewCount ?? null,
goodreadsId: metadata.goodreadsId ?? null,
comicvineId: metadata.comicvineId ?? null,
goodreadsRating: metadata.goodreadsRating ?? null,
goodreadsReviewCount: metadata.goodreadsReviewCount ?? null,
hardcoverId: metadata.hardcoverId ?? null,
@@ -214,6 +217,7 @@ export class MetadataEditorComponent implements OnInit {
amazonRatingLocked: metadata.amazonRatingLocked ?? false,
amazonReviewCountLocked: metadata.amazonReviewCountLocked ?? false,
goodreadsIdLocked: metadata.goodreadsIdLocked ?? false,
comicvineIdLocked: metadata.comicvineIdLocked ?? false,
goodreadsRatingLocked: metadata.goodreadsRatingLocked ?? false,
goodreadsReviewCountLocked: metadata.goodreadsReviewCountLocked ?? false,
hardcoverIdLocked: metadata.hardcoverIdLocked ?? false,
@@ -241,6 +245,7 @@ export class MetadataEditorComponent implements OnInit {
{key: 'amazonRatingLocked', control: 'amazonRating'},
{key: 'personalRatingLocked', control: 'personalRating'},
{key: 'goodreadsIdLocked', control: 'goodreadsId'},
{key: 'comicvineIdLocked', control: 'comicvineId'},
{key: 'goodreadsReviewCountLocked', control: 'goodreadsReviewCount'},
{key: 'goodreadsRatingLocked', control: 'goodreadsRating'},
{key: 'hardcoverIdLocked', control: 'hardcoverId'},
@@ -352,6 +357,7 @@ export class MetadataEditorComponent implements OnInit {
amazonRating: form.get('amazonRating')?.value,
amazonReviewCount: form.get('amazonReviewCount')?.value,
goodreadsId: form.get('goodreadsId')?.value,
comicvineId: form.get('comicvineId')?.value,
goodreadsRating: form.get('goodreadsRating')?.value,
goodreadsReviewCount: form.get('goodreadsReviewCount')?.value,
hardcoverId: form.get('hardcoverId')?.value,
@@ -380,6 +386,7 @@ export class MetadataEditorComponent implements OnInit {
personalRatingLocked: form.get('personalRatingLocked')?.value,
amazonReviewCountLocked: form.get('amazonReviewCountLocked')?.value,
goodreadsIdLocked: form.get('goodreadsIdLocked')?.value,
comicvineIdLocked: form.get('comicvineIdLocked')?.value,
goodreadsRatingLocked: form.get('goodreadsRatingLocked')?.value,
goodreadsReviewCountLocked: form.get('goodreadsReviewCountLocked')?.value,
hardcoverIdLocked: form.get('hardcoverIdLocked')?.value,
@@ -423,6 +430,7 @@ export class MetadataEditorComponent implements OnInit {
amazonRating: wasCleared('personalRating'),
amazonReviewCount: wasCleared('amazonReviewCount'),
goodreadsId: wasCleared('goodreadsId'),
comicvineId: wasCleared('comicvineId'),
goodreadsRating: wasCleared('goodreadsRating'),
goodreadsReviewCount: wasCleared('goodreadsReviewCount'),
hardcoverId: wasCleared('hardcoverId'),
@@ -62,6 +62,7 @@ export class MetadataPickerComponent implements OnInit {
{label: 'Amz Reviews', controlName: 'amazonReviewCount', lockedKey: 'amazonReviewCountLocked', fetchedKey: 'amazonReviewCount'},
{label: 'Amz Rating', controlName: 'amazonRating', lockedKey: 'amazonRatingLocked', fetchedKey: 'amazonRating'},
{label: 'GR ID', controlName: 'goodreadsId', lockedKey: 'goodreadsIdLocked', fetchedKey: 'goodreadsId'},
{label: 'CV ID', controlName: 'comicvineId', lockedKey: 'comicvineIdLocked', fetchedKey: 'comicvineId'},
{label: 'GR Reviews', controlName: 'goodreadsReviewCount', lockedKey: 'goodreadsReviewCountLocked', fetchedKey: 'goodreadsReviewCount'},
{label: 'GR Rating', controlName: 'goodreadsRating', lockedKey: 'goodreadsRatingLocked', fetchedKey: 'goodreadsRating'},
{label: 'HC ID', controlName: 'hardcoverId', lockedKey: 'hardcoverIdLocked', fetchedKey: 'hardcoverId'},
@@ -105,6 +106,7 @@ export class MetadataPickerComponent implements OnInit {
amazonRating: new FormControl(''),
amazonReviewCount: new FormControl(''),
goodreadsId: new FormControl(''),
comicvineId: new FormControl(''),
goodreadsRating: new FormControl(''),
goodreadsReviewCount: new FormControl(''),
hardcoverId: new FormControl(''),
@@ -132,6 +134,7 @@ export class MetadataPickerComponent implements OnInit {
amazonRatingLocked: new FormControl(false),
amazonReviewCountLocked: new FormControl(false),
goodreadsIdLocked: new FormControl(false),
comicvineIdLocked: new FormControl(false),
goodreadsRatingLocked: new FormControl(false),
goodreadsReviewCountLocked: new FormControl(false),
hardcoverIdLocked: new FormControl(false),
@@ -180,6 +183,7 @@ export class MetadataPickerComponent implements OnInit {
amazonRating: metadata.amazonRating || null,
amazonReviewCount: metadata.amazonReviewCount || null,
goodreadsId: metadata.goodreadsId || null,
comicvineId: metadata.comicvineId || null,
goodreadsRating: metadata.goodreadsRating || null,
goodreadsReviewCount: metadata.goodreadsReviewCount || null,
hardcoverId: metadata.hardcoverId || null,
@@ -207,6 +211,7 @@ export class MetadataPickerComponent implements OnInit {
amazonRatingLocked: metadata.amazonRatingLocked || false,
amazonReviewCountLocked: metadata.amazonReviewCountLocked || false,
goodreadsIdLocked: metadata.goodreadsIdLocked || false,
comicvineIdLocked: metadata.comicvineIdLocked || false,
goodreadsRatingLocked: metadata.goodreadsRatingLocked || false,
goodreadsReviewCountLocked: metadata.goodreadsReviewCountLocked || false,
hardcoverIdLocked: metadata.hardcoverIdLocked || false,
@@ -287,6 +292,7 @@ export class MetadataPickerComponent implements OnInit {
amazonRating: this.metadataForm.get('amazonRating')?.value || this.copiedFields['amazonRating'] ? this.getNumberOrCopied('amazonRating') : null,
amazonReviewCount: this.metadataForm.get('amazonReviewCount')?.value || this.copiedFields['amazonReviewCount'] ? this.getNumberOrCopied('amazonReviewCount') : null,
goodreadsId: this.metadataForm.get('goodreadsId')?.value || this.copiedFields['goodreadsId'] ? this.getValueOrCopied('goodreadsId') : '',
comicvineId: this.metadataForm.get('comicvineId')?.value || this.copiedFields['comicvineId'] ? this.getValueOrCopied('comicvineId') : '',
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,
hardcoverId: this.metadataForm.get('hardcoverId')?.value || this.copiedFields['hardcoverId'] ? this.getValueOrCopied('hardcoverId') : '',
@@ -314,6 +320,7 @@ export class MetadataPickerComponent implements OnInit {
amazonRatingLocked: this.metadataForm.get('amazonRatingLocked')?.value,
amazonReviewCountLocked: this.metadataForm.get('amazonReviewCountLocked')?.value,
goodreadsIdLocked: this.metadataForm.get('goodreadsIdLocked')?.value,
comicvineIdLocked: this.metadataForm.get('comicvineIdLocked')?.value,
goodreadsRatingLocked: this.metadataForm.get('goodreadsRatingLocked')?.value,
goodreadsReviewCountLocked: this.metadataForm.get('goodreadsReviewCountLocked')?.value,
hardcoverIdLocked: this.metadataForm.get('hardcoverIdLocked')?.value,
@@ -353,6 +360,7 @@ export class MetadataPickerComponent implements OnInit {
amazonRating: current.amazonRating === null && original.amazonRating !== null,
amazonReviewCount: current.amazonReviewCount === null && original.amazonReviewCount !== null,
goodreadsId: !current.goodreadsId && !!original.goodreadsId,
comicvineId: !current.comicvineId && !!original.comicvineId,
goodreadsRating: current.goodreadsRating === null && original.goodreadsRating !== null,
goodreadsReviewCount: current.goodreadsReviewCount === null && original.goodreadsReviewCount !== null,
hardcoverId: !current.hardcoverId && !!original.hardcoverId,
@@ -183,7 +183,14 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
} else if (metadata.hardcoverId) {
return `<a href="https://hardcover.app/books/${metadata.hardcoverId}" target="_blank">Hardcover</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>`;
}
const name = metadata.seriesName;
return `<a href="https://comicvine.gamespot.com/volume/${metadata.comicvineId}" target="_blank">Comicvine</a>`;
}
throw new Error("No provider ID found in metadata.");
}
}
@@ -181,9 +181,25 @@
/>
</a>
}
@if (book?.metadata?.comicvineId) {
<a
class="flex items-center gap-1"
[href]="'https://comicvine.gamespot.com/' + book.metadata!.comicvineId"
target="_blank"
rel="noopener noreferrer"
>
<img
src="https://www.comicvine.com/favicon.ico"
alt="Comic Vine"
class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg"
/>
</a>
}
</div>
</div>
@if (book?.metadata?.categories?.length) {
<div class="overflow-x-auto scrollbar-hide max-w-7xl pt-2 md:pt-0">
<div class="flex gap-2 w-max max-w-[1150px]">