Only update fast if a Sone is modified, downloading, or inserting.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 Oct 2010 05:43:00 +0000 (07:43 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 Oct 2010 05:43:00 +0000 (07:43 +0200)
All others get an update once a minute.

src/main/resources/static/javascript/sone.js

index 1d6f0f8..15788aa 100644 (file)
@@ -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);