From 631afc50080c33a57d7a06b4f836af3a5ce70908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Rodr=C3=ADguez?= Date: Mon, 7 Dec 2015 11:53:57 -0500 Subject: [PATCH] Open .torrent files support --- README.md | 2 +- app.coffee | 8 +------- compiled/app.js | 9 +-------- compiled/index.html | 9 +++------ index.jade | 6 +++--- 5 files changed, 9 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 7f1c1ea..c4ff2da 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ### Features - [x] Informative GUI with easy sharing options - [x] Downloading from an info hash or magnet URI -- [ ] Downloading from a .torrent file (Coming Soon) +- [x] Downloading from a .torrent file (Coming Soon) - [x] Seeding files (Single file only for the moment) - [ ] Seeding CORS-enabled remote files (Coming Soon) - [x] Download/Upload speed per torrent diff --git a/app.coffee b/app.coffee index a4e0b2b..0c97153 100644 --- a/app.coffee +++ b/app.coffee @@ -83,13 +83,7 @@ app.controller 'bTorrentCtrl', ['$scope','$http','$log','$location', 'uiGridCons if file? dbg 'Adding ' + file.name $scope.client.processing = true - url = URL.createObjectURL file - $http.get(url).then((response) -> - dbg 'Success' + response.data - , (response) -> - dbg 'ERROR' - ) - $scope.client.add url, opts, $scope.onTorrent + $scope.client.add file, opts, $scope.onTorrent $scope.addMagnet = -> if $scope.torrentInput != '' diff --git a/compiled/app.js b/compiled/app.js index ec484cf..98e14da 100644 --- a/compiled/app.js +++ b/compiled/app.js @@ -122,17 +122,10 @@ } }; $scope.openTorrentFile = function(file) { - var url; if (file != null) { dbg('Adding ' + file.name); $scope.client.processing = true; - url = URL.createObjectURL(file); - $http.get(url).then(function(response) { - return dbg('Success' + response.data); - }, function(response) { - return dbg('ERROR'); - }); - return $scope.client.add(url, opts, $scope.onTorrent); + return $scope.client.add(file, opts, $scope.onTorrent); } }; $scope.addMagnet = function() { diff --git a/compiled/index.html b/compiled/index.html index f6ef107..3a66428 100644 --- a/compiled/index.html +++ b/compiled/index.html @@ -8,7 +8,7 @@ - + @@ -17,7 +17,7 @@
-

βTorrent v0.6.2

+

βTorrent v0.6.3

@@ -28,10 +28,7 @@
- +
diff --git a/index.jade b/index.jade index 1cfb240..4925c66 100644 --- a/index.jade +++ b/index.jade @@ -8,7 +8,7 @@ html(ng-app='bTorrent', lang='en') meta(name='keywords', content='βTorrent, btorrent, client, webtorrent, browser, torrent, stream, bittorrent') meta(name='author', content='Diego Rodríguez Baquero - DiegoRBaquero') meta(name='viewport', content='width=device-width, initial-scale=1') - script(src='https://cdn.jsdelivr.net/g/webtorrent@0.63.2,momentjs@2.10,angularjs@1.4,angular.ui-grid@3.0') + script(src='https://cdn.jsdelivr.net/g/webtorrent@0.63.3,momentjs@2.10,angularjs@1.4,angular.ui-grid@3.0') script(src='https://cdnjs.cloudflare.com/ajax/libs/danialfarid-angular-file-upload/10.1.8/ng-file-upload.min.js') link(rel='stylesheet', href='https://cdn.jsdelivr.net/g/normalize@3.0,skeleton@2.0') link(rel='stylesheet', href='https://cdn.jsdelivr.net/fontawesome/4.5/css/font-awesome.min.css') @@ -18,7 +18,7 @@ html(ng-app='bTorrent', lang='en') header h1 | βTorrent - span.version v0.6.2 + span.version v0.6.3 .container .row @@ -29,7 +29,7 @@ html(ng-app='bTorrent', lang='en') i.fa.fa-download | Download .three.columns - //button.button-primary(type='file', ngf-select='openTorrentFile($file)') + button.button-primary(type='file', ngf-select='openTorrentFile($file)') i.fa.fa-folder-open | Open torrent file .three.columns.u-pull-right