From f409146eff70b92d7abf1561facbb0ee399cb573 Mon Sep 17 00:00:00 2001
From: Aleksandr Statciuk <github@oiya.xyz>
Date: Thu, 8 Sep 2022 20:40:31 +0300
Subject: [PATCH] Update update.js

---
 scripts/commands/database/update.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/commands/database/update.js b/scripts/commands/database/update.js
index da1f616b0..20925fad8 100644
--- a/scripts/commands/database/update.js
+++ b/scripts/commands/database/update.js
@@ -49,11 +49,13 @@ async function updateStreams(items = [], results = {}, origins = {}) {
     if (buffer[stream.get('url')]) {
       await db.streams.remove({ _id: stream.get('_id') })
       removed++
-    } else if (stream.changed) {
-      stream.set('updated_at', { updated_at: now })
-      await db.streams.update({ _id: stream.get('_id') }, stream.data())
+    } else {
       buffer[stream.get('url')] = true
-      updated++
+      if (stream.changed) {
+        stream.set('updated_at', { updated_at: now })
+        await db.streams.update({ _id: stream.get('_id') }, stream.data())
+        updated++
+      }
     }
   }