Only create refresh job if needed
authorChocobozzz <me@florianbigard.com>
Tue, 19 Mar 2019 10:14:48 +0000 (11:14 +0100)
committerChocobozzz <me@florianbigard.com>
Tue, 19 Mar 2019 10:14:48 +0000 (11:14 +0100)
server/lib/activitypub/videos.ts

index 9ca0502a406ec0cafcc4511dd187a25f85b78a10..66d0abf359ce35e97b4e2cc698cc3b969a78a5fb 100644 (file)
@@ -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,