fix cover not persisting after metadata search copy for physical books and audible audiobooks (#3003)

This commit is contained in:
ACX
2026-02-25 17:20:06 -07:00
committed by GitHub
parent 1b26e125ed
commit 07c6edf86b
@@ -462,7 +462,7 @@ export class MetadataPickerComponent implements OnInit {
}
}
flags['cover'] = !current.thumbnailUrl && !!original.thumbnailUrl;
flags['cover'] = this.copiedFields['thumbnailUrl'] === false && !current.thumbnailUrl && !!original.thumbnailUrl;
// Handle audiobook metadata clear flags (now at top-level of BookMetadata)
for (const field of AUDIOBOOK_METADATA_FIELDS) {
@@ -502,7 +502,10 @@ export class MetadataPickerComponent implements OnInit {
}
getThumbnail(): string | null {
// For Audible provider, cover is handled separately via uploadAudiobookCoverFromUrl
if (this.copiedFields['thumbnailUrl']) {
return (this.fetchedMetadata['thumbnailUrl' as keyof BookMetadata] as string) || null;
}
// For Audible provider, audiobook cover is handled separately via uploadAudiobookCoverFromUrl
if (this.isAudibleProvider()) {
return null;
}
@@ -510,9 +513,6 @@ export class MetadataPickerComponent implements OnInit {
if (thumbnailUrl?.includes('api/v1')) {
return null;
}
if (this.copiedFields['thumbnailUrl']) {
return (this.fetchedMetadata['thumbnailUrl' as keyof BookMetadata] as string) || null;
}
return null;
}
@@ -640,6 +640,7 @@ export class MetadataPickerComponent implements OnInit {
// For audiobook cover from Audible, use the thumbnailUrl from fetched metadata
if (field === 'audiobookThumbnailUrl') {
this.metadataForm.get('audiobookThumbnailUrl')?.setValue(this.fetchedMetadata.thumbnailUrl);
this.copiedFields['audiobookThumbnailUrl'] = true;
this.highlightCopiedInput(field);
return;
}