From: Calin Crisan Date: Sat, 16 Nov 2013 19:07:07 +0000 (+0200) Subject: repetitive tasks scheduled at startup are now deferred X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=95fcc33697b0b9d4fa2839993c4c2f12493eb291;p=motioneye-debian repetitive tasks scheduled at startup are now deferred --- diff --git a/motioneye.py b/motioneye.py index fff516c..09e11c6 100755 --- a/motioneye.py +++ b/motioneye.py @@ -180,8 +180,9 @@ def _start_motion(): def _start_cleanup(): import mediafiles + ioloop = tornado.ioloop.IOLoop.instance() + def do_cleanup(): - ioloop = tornado.ioloop.IOLoop.instance() if ioloop._stopped: return @@ -195,14 +196,15 @@ def _start_cleanup(): ioloop.add_timeout(datetime.timedelta(seconds=settings.CLEANUP_INTERVAL), do_cleanup) - do_cleanup() + ioloop.add_timeout(datetime.timedelta(seconds=settings.CLEANUP_INTERVAL), do_cleanup) def _start_movie_thumbnailer(): import mediafiles + ioloop = tornado.ioloop.IOLoop.instance() + def do_next_movie_thumbail(): - ioloop = tornado.ioloop.IOLoop.instance() if ioloop._stopped: return @@ -214,8 +216,8 @@ def _start_movie_thumbnailer(): 'msg': unicode(e)}) ioloop.add_timeout(datetime.timedelta(seconds=settings.MJPG_CLIENT_TIMEOUT), do_next_movie_thumbail) - - do_next_movie_thumbail() + + ioloop.add_timeout(datetime.timedelta(seconds=settings.MJPG_CLIENT_TIMEOUT), do_next_movie_thumbail) if __name__ == '__main__': diff --git a/static/css/main.css b/static/css/main.css index 5b6fde4..e97d29f 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -347,6 +347,10 @@ tr.rpi { /* dialogs */ + +table.add-camera-dialog { + margin: auto; +} table.add-camera-dialog select, table.add-camera-dialog input[type=text], @@ -360,6 +364,8 @@ div.media-dialog { div.media-dialog-groups { text-align: center; + overflow: auto; + white-space: nowrap; } div.media-dialog-group-button { diff --git a/static/js/main.js b/static/js/main.js index 4088ae6..c47dcd4 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -852,7 +852,7 @@ function doUpdate() { runAlertDialog('motionEye was successfully updated!', function () { window.location.reload(true); }); - }, 2000); + }, 10000); } else { runAlertDialog('Update failed!', function () { @@ -1350,6 +1350,11 @@ function runMediaDialog(cameraId, mediaType) { var parts = path.split('/'); var keyParts = parts.splice(0, parts.length - 1); var key = keyParts.join('/'); + + if (key.indexOf('/') === 0) { + key = key.substring(1); + } + var list = (groups[key] = groups[key] || []); list.push({ @@ -1421,9 +1426,6 @@ function runMediaDialog(cameraId, mediaType) { mediaListDiv.html(''); -// var groupDiv = $('
' + (key || '(ungrouped)') + '
'); -// dialogDiv.append(groupDiv); - var entries = groups[key]; entries.forEach(function (entry) { mediaListDiv.append(entry.div);