feat(metadata): initial implementation of Apple Books source (#1780)

This commit is contained in:
James Ward
2026-09-12 14:10:20 -04:00
committed by GitHub
parent 828806a4aa
commit 0660e1d6dc
70 changed files with 1132 additions and 51 deletions
@@ -155,15 +155,36 @@
<span class="setting-label">RanobeDB</span>
</div>
@if (ranobedbEnabled) {
<div class="setting-options">
<div class="config-field">
<div class="config-label-row">
<p-toggleswitch [(ngModel)]="ranobedbPreferRomaji"></p-toggleswitch>
<span class="config-label">{{ t('ranobedbPreferRomajiLabel') }}</span>
<div class="setting-options">
<div class="config-field">
<div class="config-label-row">
<p-toggleswitch [(ngModel)]="ranobedbPreferRomaji"></p-toggleswitch>
<span class="config-label">{{ t('ranobedbPreferRomajiLabel') }}</span>
</div>
<p class="config-description">{{ t('ranobedbPreferRomajiDesc') }}</p>
</div>
<p class="config-description">{{ t('ranobedbPreferRomajiDesc') }}</p>
</div>
}
</div>
<div class="setting-item">
<div class="setting-header">
<p-toggleswitch [(ngModel)]="appleBooksEnabled"></p-toggleswitch>
<span class="setting-label">Apple Books</span>
</div>
@if (appleBooksEnabled) {
<div class="setting-options">
<div class="config-field">
<span class="config-label">{{ t('region') }}</span>
<p-select
[options]="appleBooksCountries"
[(ngModel)]="selectedAppleBooksCountry"
[placeholder]="t('selectCountry')"
class="config-select">
</p-select>
</div>
</div>
}
</div>
</div>
@@ -82,6 +82,20 @@ export class MetadataProviderSettingsComponent {
{label: 'audible.in', value: 'in'}
];
appleBooksCountries = [
{label: 'US', value: 'US'},
{label: 'CA', value: 'CA'},
{label: 'GB', value: 'GB'},
{label: 'DE', value: 'DE'},
{label: 'FR', value: 'FR'},
{label: 'PL', value: 'PL'},
{label: 'JP', value: 'JP'},
{label: 'AU', value: 'AU'},
{label: 'IT', value: 'IT'},
{label: 'ES', value: 'ES'},
]
selectedAppleBooksCountry = 'US';
selectedAudibleDomain = 'com';
audibleEnabled: boolean = false;
@@ -98,6 +112,7 @@ export class MetadataProviderSettingsComponent {
ranobedbEnabled: boolean = false;
ranobedbPreferRomaji: boolean = false;
googleApiKey: string = '';
appleBooksEnabled: boolean = false;
private appSettingsService = inject(AppSettingsService);
private messageService = inject(MessageService);
@@ -130,6 +145,8 @@ export class MetadataProviderSettingsComponent {
this.ranobedbPreferRomaji = metadataProviderSettings?.ranobedb?.preferRomaji ?? false;
this.audibleEnabled = metadataProviderSettings?.audible?.enabled ?? false;
this.selectedAudibleDomain = metadataProviderSettings?.audible?.domain ?? 'com';
this.appleBooksEnabled = metadataProviderSettings?.appleBooks?.enabled ?? false;
this.selectedAppleBooksCountry = metadataProviderSettings?.appleBooks?.country ?? 'US';
}
onTokenChange(newToken: string): void {
@@ -180,7 +197,11 @@ export class MetadataProviderSettingsComponent {
audible: {
enabled: this.audibleEnabled,
domain: this.selectedAudibleDomain
}
},
appleBooks: {
enabled: this.appleBooksEnabled,
country: this.selectedAppleBooksCountry,
},
}
}
];