diff --git a/pandora/0xdb.jsonc b/pandora/0xdb.jsonc index c5b8ec3d..f37a0c65 100644 --- a/pandora/0xdb.jsonc +++ b/pandora/0xdb.jsonc @@ -31,6 +31,7 @@ "canEditPlaces": {"staff": true, "admin": true}, "canEditSitePages": {"staff": true, "admin": true}, "canEditUsers": {"admin": true}, + "canImportAnnotations": {"staff": true, "admin": true}, "canPlayClips": {"guest": 2, "member": 2, "friend": 4, "staff": 4, "admin": 4}, "canPlayVideo": {"guest": 1, "member": 1, "friend": 4, "staff": 4, "admin": 4}, "canSeeDebugMenu": {"staff": true, "admin": true}, diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index a5a64525..19c76372 100644 --- a/pandora/archive/extract.py +++ b/pandora/archive/extract.py @@ -241,7 +241,7 @@ def frame(videoFile, frame, position, height=128, redo=False): videoFile input frame output position as float in seconds - width of frame + height of frame redo boolean to extract file even if it exists ''' if exists(videoFile): diff --git a/pandora/item/models.py b/pandora/item/models.py index 939e3aa8..74ee69d8 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -850,7 +850,7 @@ class Item(models.Model): ''' Video related functions ''' - def frame(self, position, height=128): + def frame(self, position, height=None): offset = 0 streams = self.streams() for stream in streams: @@ -858,7 +858,10 @@ class Item(models.Model): offset += stream.duration else: position = position - offset - height = min(height, stream.resolution) + if not height: + height = stream.resolution + else: + height = min(height, stream.resolution) path = os.path.join(settings.MEDIA_ROOT, stream.path(), 'frames', "%dp"%height, "%s.jpg"%position) if not os.path.exists(path) and stream.video: diff --git a/pandora/padma.jsonc b/pandora/padma.jsonc index d430301c..c3a2622c 100644 --- a/pandora/padma.jsonc +++ b/pandora/padma.jsonc @@ -29,6 +29,7 @@ "canEditPlaces": {"staff": true, "admin": true}, "canEditSitePages": {"staff": true, "admin": true}, "canEditUsers": {"admin": true}, + "canImportAnnotations": {"staff": true, "admin": true}, "canPlayClips": {"guest": 1, "member": 1, "staff": 4, "admin": 4}, "canPlayVideo": {"guest": 1, "member": 1, "staff": 4, "admin": 4}, "canSeeDebugMenu": {"staff": true, "admin": true}, @@ -564,7 +565,7 @@ "itemFind": {"conditions": [], "operator": "&"}, "itemSort": [{"key": "position", "operator": "+"}], "itemView": "info", - "listColumns": ["title", "source", "project", "topics", "language", "duration"], + "listColumns": ["title", "source", "project", "topic", "language", "duration"], "listColumnWidth": {}, "listSelection": [], "listSort": [{"key": "title", "operator": "+"}], diff --git a/static/js/pandora/item.js b/static/js/pandora/item.js index 438de975..3facf4b0 100644 --- a/static/js/pandora/item.js +++ b/static/js/pandora/item.js @@ -3,7 +3,8 @@ pandora.ui.item = function() { - var that = Ox.Element(); + var that = Ox.Element(), + videoOptions; pandora.api.get({ id: pandora.user.ui.item, @@ -42,7 +43,7 @@ pandora.ui.item = function() { if (['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1) { // fixme: layers have value, subtitles has text? - var videoOptions = pandora.getVideoOptions(result.data); + videoOptions = pandora.getVideoOptions(result.data); } if (!result.data.rendered && [ @@ -240,6 +241,7 @@ pandora.ui.item = function() { cuts: result.data.cuts || [], duration: result.data.duration, enableDownload: pandora.site.capabilities.canDownloadVideo[pandora.user.level] >= result.data.rightslevel, + enableImport: pandora.site.capabilities.canImportAnnotations[pandora.user.level], enableSubtitles: pandora.user.ui.videoSubtitles, find: pandora.user.ui.itemFind, getFrameURL: function(position) { diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index 728bd2ee..2a5a120a 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -794,7 +794,7 @@ pandora.getVideoOptions = function(data) { pandora.site.video.resolutions.forEach(function(resolution) { options.video[resolution] = Ox.range(data.parts).map(function(i) { var part = (i + 1), - prefix = pandora.site.site.videoprefix.replace('PART', part); // fixme: '{part}' would be more consistent + prefix = pandora.site.site.videoprefix.replace('{part}', part); return prefix + '/' + (data.item || pandora.user.ui.item) + '/' + resolution + 'p' + part + '.' + pandora.user.videoFormat; });