Add "thumbnailUrlLastFetched" to thumbnail url (#607)

This commit is contained in:
schroda
2024-02-17 20:24:09 +01:00
committed by GitHub
parent e5ffbb462c
commit 02dc9ca736
3 changed files with 15 additions and 15 deletions

View File

@@ -99,8 +99,7 @@ export const actionToTranslationKey: {
export type MangaChapterCountInfo = { chapters: Pick<TManga['chapters'], 'totalCount'> };
export type MangaDownloadInfo = Pick<TManga, 'downloadCount'> & MangaChapterCountInfo;
export type MangaUnreadInfo = Pick<TManga, 'unreadCount'> & MangaChapterCountInfo;
export type MangaLastFetchedInfo = Pick<TManga, 'lastFetchedAt'>;
export type MangaThumbnailInfo = Pick<TManga, 'thumbnailUrl'>;
export type MangaThumbnailInfo = Pick<TManga, 'thumbnailUrl' | 'thumbnailUrlLastFetched'>;
export type MigrateMode = 'copy' | 'migrate';
@@ -173,9 +172,9 @@ export class Mangas {
return mangas.filter(Mangas.isPartiallyRead);
}
static getThumbnailUrl(manga: MangaLastFetchedInfo & Partial<MangaThumbnailInfo>): string {
static getThumbnailUrl(manga: Partial<MangaThumbnailInfo>): string {
const thumbnailUrl = manga.thumbnailUrl
? `${manga.thumbnailUrl}?fetchedAt=${manga.lastFetchedAt}`
? `${manga.thumbnailUrl}?fetchedAt=${manga.thumbnailUrlLastFetched}`
: 'nonExistingMangaUrl';
return requestManager.getValidImgUrlFor(thumbnailUrl);
}