From cde1451f9b4b0c30bcc662f86acaa4cfa561f05c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 10 Sep 2010 11:58:59 +0200 Subject: [PATCH] path cleanup, add volumes --- pandora/backend/models.py | 2 +- pandora/static/js/pandora.local.js | 50 +++++++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/pandora/backend/models.py b/pandora/backend/models.py index e6510b78b..6c7f158d4 100644 --- a/pandora/backend/models.py +++ b/pandora/backend/models.py @@ -250,7 +250,7 @@ class Movie(models.Model): def frame(self, position, width=128): stream = self.streams.filter(profile=settings.VIDEO_PROFILE+'.webm')[0] - path = os.path.join(settings.MEDIA_ROOT, 'frame', self.movieId, "%d"%width, "%s.jpg"%position) + path = os.path.join(settings.MEDIA_ROOT, movieid_path(self.movieId), 'frame', "%d"%width, "%s.jpg"%position) if not os.path.exists(path): extract.frame(stream.video.path, path, position, width) return path diff --git a/pandora/static/js/pandora.local.js b/pandora/static/js/pandora.local.js index 9bab40685..32d6eae72 100644 --- a/pandora/static/js/pandora.local.js +++ b/pandora/static/js/pandora.local.js @@ -1,5 +1,6 @@ if(typeof(app.afterLaunch) == "undefined") app.afterLaunch = []; + app.afterLaunch.push(function() { if (typeof(OxFF) == 'undefined') return; @@ -55,7 +56,6 @@ app.afterLaunch.push(function() { if(!cb) return null; return function(result) { - Ox.print("you called upload", result); var data = JSON.parse(result); cb(data) } @@ -81,16 +81,20 @@ app.afterLaunch.push(function() { } }, loadVolumes: function() { + var _this = this; Ox.print("load volumes"); var $section = new Ox.CollapsePanel({ id: 'volumes', size: 'small', title: 'Volumes' }); + app.$ui.sections.push($section); app.local.volumes(function(data) { Ox.print("got volumes", data); + var volumes = 0; $.each(data, function(name, info) { + volumes ++; Ox.print("add volume", name, info); var status = info.available?"online":"offline"; var $line = $('