Use missing cover

This commit is contained in:
aditya.chandel
2025-01-23 14:20:51 -07:00
parent 0a7140e5aa
commit 7bb44641b1
4 changed files with 5 additions and 2 deletions
@@ -32,7 +32,7 @@
<div *ngIf="!loading" class="mt-8 flex-1 overflow-y-auto">
<div *ngFor="let metadata of allFetchedMetadata" class="book-item flex flex-col w-full">
<div class="flex w-full flex-row book-item-content" (click)="onBookClick(metadata)">
<img [src]="metadata.thumbnailUrl || 'assets/book-cover-metadata.png'" alt="Image" class="img-fixed-dimensions pr-2"/>
<img [src]="metadata.thumbnailUrl || 'assets/images/missing-cover.jpg'" alt="Image" class="img-fixed-dimensions pr-2"/>
<div class=" flex flex-col w-full m-2">
<div class="flex flex-row gap-4 justify-between">
<p class="font-bold">{{ truncateText(metadata['title'], 90) }}</p>
@@ -8,6 +8,9 @@ export class UrlHelperService {
private readonly baseUrl = API_CONFIG.BASE_URL;
getCoverUrl(bookId: number, coverUpdatedOn?: string): string {
return `${this.baseUrl}/api/v1/book/${bookId}/cover?${coverUpdatedOn || ''}`;
if (!coverUpdatedOn) {
return 'assets/images/missing-cover.jpg';
}
return `${this.baseUrl}/api/v1/book/${bookId}/cover?${coverUpdatedOn}`;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB