]> www.vanbest.org Git - motioneye-debian/commitdiff
preview fixes
authorCalin Crisan <ccrisan@gmail.com>
Sat, 16 Nov 2013 21:33:14 +0000 (23:33 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 16 Nov 2013 21:33:14 +0000 (23:33 +0200)
src/mediafiles.py
static/js/main.js

index 32bfc86f95859e472337ee0a1582ca5e2b0755d3..c262f68e8223c8e3906fa522bb86969ba5da8bd5 100644 (file)
@@ -24,7 +24,6 @@ import subprocess
 from PIL import Image
 
 import config
-import utils
 
 
 _PICTURE_EXTS = ['.jpg']
@@ -90,7 +89,8 @@ def make_movie_preview(camera_config, full_path):
     framerate = camera_config['framerate']
     pre_capture = camera_config['pre_capture']
     offs = pre_capture / framerate
-    offs *= 2
+    offs = min(4, offs * 2)
+    
 
     cmd = 'ffmpeg -i "%(path)s" -f mjpeg -vframes 1 -ss %(offs)s -y %(path)s.thumb' % {
             'path': full_path, 'offs': offs}
index 9dde0175b7f86b125d8e8deffe8132a272cc7849..b0c68d5373c6302aa7ce46a629e95c58ef6411bf 100644 (file)
@@ -1380,7 +1380,7 @@ function runMediaDialog(cameraId, mediaType) {
         /* prepare the entries within each group */
         keys.forEach(function (key) {
             var entries = groups[key];
-            entries.sortKey(function (e) {return e.timestamp;});
+            entries.sortKey(function (e) {return e.timestamp || e.name;});
             
             entries.forEach(function (entry, pos) {
                 var entryDiv = $('<div class="media-list-entry"></div>');