fix: use audiobook thumbnail URL for audiobook entries in notebook (#2763)
This commit is contained in:
@@ -179,10 +179,13 @@ export class NotebookComponent implements OnInit, OnDestroy {
|
||||
const groupMap = new Map<number, BookGroup>();
|
||||
for (const entry of entries) {
|
||||
if (!groupMap.has(entry.bookId)) {
|
||||
const isAudiobook = entry.primaryBookType === 'AUDIOBOOK';
|
||||
groupMap.set(entry.bookId, {
|
||||
bookId: entry.bookId,
|
||||
bookTitle: entry.bookTitle,
|
||||
thumbnailUrl: this.urlHelper.getThumbnailUrl1(entry.bookId),
|
||||
thumbnailUrl: isAudiobook
|
||||
? this.urlHelper.getAudiobookThumbnailUrl(entry.bookId)
|
||||
: this.urlHelper.getDirectThumbnailUrl(entry.bookId),
|
||||
entries: [],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ export interface NotebookEntry {
|
||||
color?: string;
|
||||
style?: string;
|
||||
chapterTitle?: string;
|
||||
primaryBookType?: string;
|
||||
createdAt: string;
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
+1
-1
@@ -372,7 +372,7 @@ export class ReadingSessionTimelineComponent implements OnInit {
|
||||
}
|
||||
|
||||
public getCoverUrl(bookId: number): string {
|
||||
return this.urlHelperService.getThumbnailUrl1(bookId);
|
||||
return this.urlHelperService.getDirectThumbnailUrl(bookId);
|
||||
}
|
||||
|
||||
public getTooltipContent(session: TimelineSession): string {
|
||||
|
||||
@@ -42,7 +42,7 @@ export class UrlHelperService {
|
||||
return this.appendToken(url);
|
||||
}
|
||||
|
||||
getThumbnailUrl1(bookId: number, coverUpdatedOn?: string): string {
|
||||
getDirectThumbnailUrl(bookId: number, coverUpdatedOn?: string): string {
|
||||
let url = `${this.mediaBaseUrl}/book/${bookId}/thumbnail`;
|
||||
if (coverUpdatedOn) {
|
||||
url += `?${coverUpdatedOn}`;
|
||||
|
||||
Reference in New Issue
Block a user