use api.addListItems instead of api.download, fixes #180

This commit is contained in:
j 2016-01-21 12:45:38 +05:30
parent 97fe8731b8
commit e9b6a51fff
2 changed files with 4 additions and 17 deletions

View file

@ -263,22 +263,6 @@ def findMetadata(data):
actions.register(findMetadata) 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): def cancelDownloads(data):
''' '''
takes { takes {

View file

@ -190,7 +190,10 @@ oml.ui.infoView = function(externalData, isMixed) {
click: function() { click: function() {
var _this = this; var _this = this;
this.options({disabled: true}); 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}); _this.options({disabled: false});
data.mediastate = 'transferring'; data.mediastate = 'transferring';
that.updateElement(data, $data); that.updateElement(data, $data);