diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 89beda2..d9b8b48 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -148,13 +148,18 @@ var ICEcoder = { if (!top.ICEcoder.indexing && !top.ICEcoder.loadingFile && top.ICEcoder.serverQueueItems.length === 0 && top.ICEcoder.openSeconds % 3 == 0) { top.ICEcoder.indexing = true; // Get new data - fetch('lib/indexer.php') + var timestampExtra = top.ICEcoder.indexData + ? "?timestamp="+top.ICEcoder.indexData.timestamps.indexed+"&csrf="+top.ICEcoder.csrf + : ""; + fetch('lib/indexer.php'+timestampExtra) .then(function(response) { // Convert to JSON return response.json(); }).then(function(data) { - top.ICEcoder.indexData = data; - top.ICEcoder.indexing = false; + if (data.timestamps.changed) { + top.ICEcoder.indexData = data; + } + top.ICEcoder.indexing = false; }); } },1000);