Bimba.git

commit 32551106495dffe0af58d34173a5c3f0c242f2c5

Author: Adam Pioterek <adam.pioterek@protonmail.ch>

converter: upload only new

 converter/server/upload.php | 8 +++++++-


diff --git a/converter/server/upload.php b/converter/server/upload.php
index d95574fc8c3975c3a70054c8bab8f5cde9bee938..6b9e7e6b4bbbfcc9483f778ca956d5d2a0b31b81 100644
--- a/converter/server/upload.php
+++ b/converter/server/upload.php
@@ -37,7 +37,13 @@ foreach ($timetables as $id => $timetable) {
     $t = $timetable['t'];
     $sha = $timetable['sha'];
 
-    // todo if $id in $oldMetadata -> skip
+    $shallSkip = false;
+    foreach ($oldMetadata as $entry) {
+        if ($entry['id'] == $id)
+            $shallSkip = true;
+    }
+
+    if ($shallSkip) continue;
 
     $fp = fopen(dirname(__FILE__) . "/$id.db.gz", 'wb');
     $ch = curl_init($t);