Skip to content

Commit

Permalink
generic getDownloadDir() call for all torrentClient support #546
Browse files Browse the repository at this point in the history
currently Transmission and uTorrent, others to follow as discovered.
  • Loading branch information
garfield69 committed Jul 6, 2016
1 parent 21f2bc6 commit 2122353
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/controllers/sidepanel/TorrentDetailsCtrl.js
Expand Up @@ -28,7 +28,7 @@ DuckieTV.controller('TorrentDetailsCtrl', ["DuckieTorrent", "torrent", "$scope",
file.isMovie = file.name.substring(file.name.length - 3).match(/mp4|avi|mkv|mpeg|mpg|flv/g);
if (file.isMovie) {
file.searchFileName = file.name.indexOf('/') > -1 ? file.name.split('/').pop().split(' ').pop() : file.name;
file.path = torrent.downloadDir || '';
file.path = self.torrent.getDownloadDir();
}
return file;
});
Expand Down
3 changes: 3 additions & 0 deletions js/services/TorrentClients/Transmission.js
Expand Up @@ -57,6 +57,9 @@ TransmissionData.extends(TorrentData, {
return new Promise(function(resolve) {
resolve(self.files);
});
},
getDownloadDir: function() {
return this.downloadDir;
}
});

Expand Down
3 changes: 3 additions & 0 deletions js/services/TorrentClients/uTorrent.js
Expand Up @@ -590,6 +590,9 @@ DuckieTorrent
resolve(files);
});
},
getDownloadDir: function() {
return $parse('properties.all.directory')(this);
},
/**
* The torrent is started if the status is uneven.
*/
Expand Down

0 comments on commit 2122353

Please sign in to comment.