Remove automatic manga update (#583)

Since the server now has an automatic global update functionality, this is not needed anymore
This commit is contained in:
schroda
2024-01-29 20:55:33 +01:00
committed by GitHub
parent d6468bca57
commit c483e71bf1

View File

@@ -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();