From e9b6a51fffa61e1766f50770e4a621000ca5587e Mon Sep 17 00:00:00 2001 From: j Date: Thu, 21 Jan 2016 12:45:38 +0530 Subject: [PATCH] use api.addListItems instead of api.download, fixes #180 --- oml/item/api.py | 16 ---------------- static/js/infoView.js | 5 ++++- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/oml/item/api.py b/oml/item/api.py index a072335..aecb2d6 100644 --- a/oml/item/api.py +++ b/oml/item/api.py @@ -263,22 +263,6 @@ def findMetadata(data): actions.register(findMetadata) -def download(data): - ''' - takes { - id - } - ''' - response = {} - item = models.Item.get(data['id']) - if item: - item.queue_download() - item.update() - response = {'queued': data['id']} - return response -actions.register(download, cache=False) - - def cancelDownloads(data): ''' takes { diff --git a/static/js/infoView.js b/static/js/infoView.js index d845649..bff758c 100644 --- a/static/js/infoView.js +++ b/static/js/infoView.js @@ -190,7 +190,10 @@ oml.ui.infoView = function(externalData, isMixed) { click: function() { var _this = this; this.options({disabled: true}); - oml.api.download({id: ui.item}, function(result) { + oml.api.addListItems({ + items: [ui.item], + list: ':' + }, function(result) { _this.options({disabled: false}); data.mediastate = 'transferring'; that.updateElement(data, $data);