From: David ‘Bombe’ Roden Date: Fri, 22 Oct 2010 05:43:00 +0000 (+0200) Subject: Only update fast if a Sone is modified, downloading, or inserting. X-Git-Tag: 0.1-RC1~99 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f83080fd6dcd9372a08085b9080315ab7b679f69;p=Sone.git Only update fast if a Sone is modified, downloading, or inserting. All others get an update once a minute. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 1d6f0f8..15788aa 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -95,10 +95,8 @@ function getSoneStatus(soneId) { updateSoneStatus(soneId, data.status, data.modified, data.lastUpdated); /* seconds! */ updateInterval = 60; - if (data.age < 600) { + if (data.modified || (data.status == "downloading") || (data.status == "inserting")) {} updateInterval = 5; - } else if (data.age < 86400) { - updateInterval = 30; } setTimeout(function() { getSoneStatus(soneId);