From d558ccfd06e05439b54fdf505ae8a4ef5c8b1bfa Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 6 Jul 2014 15:09:49 +0000 Subject: [PATCH] Allow setting custom time limit for video assets (to be able to swtich to livestreams for a limited time) --- server.py | 2 +- static/js/screenly-ose.coffee | 2 +- static/js/screenly-ose.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index b8423b45..c1cac74b 100644 --- a/server.py +++ b/server.py @@ -163,7 +163,7 @@ def prepare_asset(request): break f.write(chunk) - if "video" in asset['mimetype']: + if "video" in asset['mimetype'] and get('duration')=="-1": video_duration = get_video_duration(asset['uri']) if video_duration: asset['duration'] = int(video_duration.total_seconds()) diff --git a/static/js/screenly-ose.coffee b/static/js/screenly-ose.coffee index a8115da1..8e8c0f3e 100644 --- a/static/js/screenly-ose.coffee +++ b/static/js/screenly-ose.coffee @@ -95,7 +95,7 @@ API.View.EditAssetView = class EditAssetView extends Backbone.View (@$ '#modalLabel').text "Edit Asset" (@$ '.asset-location').hide(); (@$ '.asset-location.edit').show() - (@$ '.duration').toggle ((@model.get 'mimetype') != 'video') + (@$ '.duration').toggle (true) @clickTabNavUri() if (@model.get 'mimetype') == 'webpage' for field in @model.fields diff --git a/static/js/screenly-ose.js b/static/js/screenly-ose.js index 7df11ff1..860aaf18 100644 --- a/static/js/screenly-ose.js +++ b/static/js/screenly-ose.js @@ -214,7 +214,7 @@ (this.$('.asset-location')).hide(); (this.$('.asset-location.edit')).show(); } - (this.$('.duration')).toggle((this.model.get('mimetype')) !== 'video'); + (this.$('.duration')).toggle(true); if ((this.model.get('mimetype')) === 'webpage') { this.clickTabNavUri(); }