diff --git a/static/js/editor.js b/static/js/editor.js index e3c6666a..ad6b9c85 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -127,8 +127,8 @@ pandora.ui.editor = function(data) { pandora.$ui[dialog] && pandora.$ui[dialog].remove(); pandora.$ui[dialog] = pandora.ui[dialog](data).open(); }, - downloadvideo: function(data) { - document.location.href = pandora.getDownloadLink(ui.item); + downloadvideo: function() { + document.location.href = pandora.getDownloadLink(ui.item, data.rightslevel); }, downloadselection: function(data) { document.location.href = '/' + ui.item diff --git a/static/js/player.js b/static/js/player.js index b93c7e82..26b4c7f4 100644 --- a/static/js/player.js +++ b/static/js/player.js @@ -83,8 +83,8 @@ pandora.ui.player = function(data) { return clip.annotation || ui.item + '/' + clip['in'] + '-' + clip.out; }), 'clip'); }, - downloadvideo: function(data) { - document.location.href = pandora.getDownloadLink(ui.item); + downloadvideo: function() { + document.location.href = pandora.getDownloadLink(ui.item, data.rightslevel); }, find: function(data) { pandora.UI.set({itemFind: data.find}); diff --git a/static/js/utils.js b/static/js/utils.js index 68a3d204..1661077a 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -928,8 +928,14 @@ pandora.getClipVideos = function(clip, resolution) { }; }()); -pandora.getDownloadLink = function(item) { - return '/' + item + (pandora.site.video.torrent ? '/torrent/' : '/download/'); +pandora.getDownloadLink = function(item, rightslevel) { + console.log('pandora.getDownloadLink', item, rightslevel); + var torrent = pandora.site.video.torrent; + if (arguments.length == 2 && torrent && + pandora.site.capabilities.canSeeItem.guest < rightslevel) { + torrent = false; + } + return '/' + item + (torrent ? '/torrent/' : '/download/'); } pandora.getEditTooltip = function(title) {