diff --git a/index.html b/index.html index 9d30c60..a30f28e 100755 --- a/index.html +++ b/index.html @@ -50,7 +50,6 @@ - @@ -508,7 +507,7 @@
  • Length  {{download.pieceLength | blength}}
  • diff --git a/js/ctrls/download.js b/js/ctrls/download.js index ee175ef..d7635a3 100644 --- a/js/ctrls/download.js +++ b/js/ctrls/download.js @@ -12,6 +12,10 @@ function( scope, rpc, utils, alerts, modals, fsettings, activeInclude, waitingExclude, window ) { + + var re_slashes = /\\/g; + var slash = "/"; + scope.active = [], scope.waiting = [], scope.stopped = []; scope.gstats = {}; @@ -192,9 +196,16 @@ function( if (files) { var cfiles = ctx["files"] || (ctx["files"] = []); for (var i = 0; i < files.length; ++i) { - var file = cfiles[i] || (cfiles[i] = {}); - file.path = files[i].path; - file.length = files[i].length; + var cfile = cfiles[i] || (cfiles[i] = {}); + var file = files[i]; + if (file.path !== cfile.path) { + cfile.path = file.path; + cfile.length = file.length; + cfile.relpath = file.path.replace(re_slashes, slash); + if (!cfile.relpath.startsWith("[")) { // METADATA + cfile.relpath = cfile.relpath.substr(ctx.dir.length + 1); + } + } } cfiles.length = files.length; } diff --git a/js/filters/path.js b/js/filters/path.js deleted file mode 100644 index d3ef1ea..0000000 --- a/js/filters/path.js +++ /dev/null @@ -1,8 +0,0 @@ -// returns the relative path from base -angular.module('webui.filters.path', []) -.filter('prelative', function() { - return function(path, base) { - return path.replace(/\\/g, '/') - .replace(base.replace(/\\/, '/'), '.'); - }; -}); diff --git a/js/init.js b/js/init.js index 3090551..25b44e0 100644 --- a/js/init.js +++ b/js/init.js @@ -3,7 +3,7 @@ var webui = angular.module('webui', [ 'webui.services.constants', 'webui.services.rpc', 'webui.services.modals', 'webui.services.alerts', 'webui.services.settings', 'webui.services.settings.filters', - 'webui.filters.bytes', 'webui.filters.path', + 'webui.filters.bytes', 'webui.directives.chunkbar', 'webui.directives.dgraph', 'webui.directives.fselect', 'webui.ctrls.download', 'webui.ctrls.nav', 'webui.ctrls.modal', 'webui.ctrls.alert', 'webui.ctrls.props',