From d9999feb61116d533b5f1df0839580d722bf0156 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 16 Nov 2013 23:33:14 +0200 Subject: [PATCH] preview fixes --- src/mediafiles.py | 4 ++-- static/js/main.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mediafiles.py b/src/mediafiles.py index 32bfc86..c262f68 100644 --- a/src/mediafiles.py +++ b/src/mediafiles.py @@ -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} diff --git a/static/js/main.js b/static/js/main.js index 9dde017..b0c68d5 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -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 = $('
'); -- 2.39.5