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:
co-authored by
Aditya Chandel
parent
e027225775
commit
46f86deb24
+27
@@ -52,6 +52,7 @@
|
||||
<p-checkbox [(ngModel)]="googleEnabled" [binary]="true"></p-checkbox>
|
||||
<label class="font-medium">Google</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class="flex items-center gap-4">
|
||||
@@ -72,7 +73,33 @@
|
||||
[(ngModel)]="hardcoverToken"
|
||||
(ngModelChange)="onTokenChange($event)" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class="flex items-center gap-4">
|
||||
<p-checkbox
|
||||
[binary]="true"
|
||||
[(ngModel)]="comicvineEnabled"
|
||||
[disabled]="!comicvineToken">
|
||||
</p-checkbox>
|
||||
<label class="font-medium">Comic Vine</label>
|
||||
</div>
|
||||
<div class="flex flex-col gap-2 pl-9 pt-1">
|
||||
<label class="font-medium text-sm">API Token</label>
|
||||
<input
|
||||
type="text"
|
||||
pInputText
|
||||
placeholder="Enter Comic Vine API token"
|
||||
class="w-full max-w-3xl"
|
||||
[(ngModel)]="comicvineToken"
|
||||
(ngModelChange)="onComicTokenChange($event)" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="flex justify-start px-4">
|
||||
|
||||
+17
@@ -58,6 +58,8 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
||||
amazonEnabled: boolean = false;
|
||||
goodreadsEnabled: boolean = false;
|
||||
googleEnabled: boolean = false;
|
||||
comicvineEnabled: boolean = false;
|
||||
comicvineToken: string = '';
|
||||
|
||||
private appSettingsService = inject(AppSettingsService);
|
||||
private messageService = inject(MessageService);
|
||||
@@ -79,6 +81,8 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
||||
this.googleEnabled = metadataProviderSettings?.google?.enabled ?? false;
|
||||
this.hardcoverToken = metadataProviderSettings?.hardcover?.apiKey ?? '';
|
||||
this.hardcoverEnabled = metadataProviderSettings?.hardcover?.enabled ?? false;
|
||||
this.comicvineEnabled = metadataProviderSettings?.comicvine?.enabled ?? false;
|
||||
this.comicvineToken = metadataProviderSettings?.comicvine?.apiKey ?? '';
|
||||
});
|
||||
}
|
||||
|
||||
@@ -89,6 +93,13 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
onComicTokenChange(newToken: string): void {
|
||||
this.comicvineToken = newToken;
|
||||
if (!newToken.trim()) {
|
||||
this.comicvineEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
saveSettings(): void {
|
||||
const payload = [
|
||||
{
|
||||
@@ -99,6 +110,12 @@ export class MetadataProviderSettingsComponent implements OnInit {
|
||||
cookie: this.amazonCookie,
|
||||
domain: this.selectedAmazonDomain
|
||||
},
|
||||
|
||||
comicvine: {
|
||||
enabled: this.comicvineEnabled,
|
||||
apiKey: this.comicvineToken.trim()
|
||||
},
|
||||
|
||||
goodReads: {enabled: this.goodreadsEnabled},
|
||||
google: {enabled: this.googleEnabled},
|
||||
hardcover: {
|
||||
|
||||
Reference in New Issue
Block a user