From: Chocobozzz Date: Tue, 19 Mar 2019 10:14:48 +0000 (+0100) Subject: Only create refresh job if needed X-Git-Tag: v1.3.0-rc.1~129 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f58094b2577afbd26bb2e74768938bcdd9890c16;p=oweals%2Fpeertube.git Only create refresh job if needed --- diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts index 9ca0502a4..66d0abf35 100644 --- a/server/lib/activitypub/videos.ts +++ b/server/lib/activitypub/videos.ts @@ -180,8 +180,7 @@ async function getOrCreateVideoAndAccountAndChannel (options: { let videoFromDatabase = await fetchVideoByUrl(videoUrl, fetchType) if (videoFromDatabase) { - - if (allowRefresh === true) { + if (videoFromDatabase.isOutdated() && allowRefresh === true) { const refreshOptions = { video: videoFromDatabase, fetchedType: fetchType,