From c483e71bf1275c298979111ac244c2ff99794c20 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:55:33 +0100 Subject: [PATCH] Remove automatic manga update (#583) Since the server now has an automatic global update functionality, this is not needed anymore --- src/screens/Manga.tsx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/screens/Manga.tsx b/src/screens/Manga.tsx index bc1f5871..6f377c59 100644 --- a/src/screens/Manga.tsx +++ b/src/screens/Manga.tsx @@ -21,8 +21,6 @@ import { MangaToolbarMenu } from '@/components/manga/MangaToolbarMenu'; import { EmptyView } from '@/components/util/EmptyView'; import { LoadingPlaceholder } from '@/components/util/LoadingPlaceholder'; -const AUTOFETCH_AGE = 1000 * 60 * 60 * 24; // 24 hours - export const Manga: React.FC = () => { const { t } = useTranslation(); @@ -38,17 +36,9 @@ export const Manga: React.FC = () => { useSetDefaultBackTo('library'); useEffect(() => { - // Automatically fetch manga from source if data is older then 24 hours OR manga is not initialized yet - // Automatic fetch is done only once, to prevent issues when server does - // not update age for some reason (ie. error on source side) if (manga == null) return; - const isOutdated = - Date.now() - Number(manga.lastFetchedAt) * 1000 > AUTOFETCH_AGE || - Date.now() - Number(manga.chaptersLastFetchedAt) * 1000 > AUTOFETCH_AGE; - const refetchBecauseOutdated = manga.inLibrary && isOutdated; - - const doFetch = !autofetchedRef.current && (refetchBecauseOutdated || !manga.initialized); + const doFetch = !autofetchedRef.current && !manga.initialized; if (doFetch) { autofetchedRef.current = true; refresh();