From: Calin Crisan Date: Sun, 17 Nov 2013 16:30:39 +0000 (+0200) Subject: yet another media list fix X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=31e88bbd380503b05335e006e39c47faa7f4c943;p=motioneye-debian yet another media list fix --- diff --git a/src/handlers.py b/src/handlers.py index e41be6a..c77addd 100644 --- a/src/handlers.py +++ b/src/handlers.py @@ -599,6 +599,10 @@ class PictureHandler(BaseHandler): stat=self.get_argument('stat', None)) else: + if self.get_argument('prefix', None): + import time + time.sleep(2) + pictures = mediafiles.list_media(camera_config, media_type='picture', prefix=self.get_argument('prefix', None), stat=self.get_argument('stat', None)) diff --git a/static/js/main.js b/static/js/main.js index b4dd8ef..73a5fc6 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1427,11 +1427,11 @@ function runMediaDialog(cameraId, mediaType) { var mediaListByName = {}; var entries = groups[key]; - function addEntries() { - /* cleanup the media list */ - mediaListDiv.children('div.media-list-entry').detach(); - mediaListDiv.html(''); + /* cleanup the media list */ + mediaListDiv.children('div.media-list-entry').detach(); + mediaListDiv.html(''); + function addEntries() { /* add the entries to the media list */ entries.forEach(function (entry) { var entryDiv = entry.div; @@ -1444,7 +1444,7 @@ function runMediaDialog(cameraId, mediaType) { mediaListDiv.append(entryDiv); }); - + /* trigger a scroll event */ mediaListDiv.scroll(); } @@ -1459,6 +1459,8 @@ function runMediaDialog(cameraId, mediaType) { var url = '/' + mediaType + '/' + cameraId + '/list/?prefix=' + (key || 'ungrouped')+ '&stat=true'; ajax('GET', url, null, function (data) { + previewImg.remove(); + if (data == null || data.error) { hideModalDialog(); showErrorMessage(data && data.error);