From 09eba68e41589072336024fc057ddcf08b451e09 Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Thu, 27 Feb 2014 01:35:32 +0100 Subject: [PATCH] Display the full download.relpath as name. --- js/ctrls/download.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/ctrls/download.js b/js/ctrls/download.js index 5f201e2..78c7e41 100644 --- a/js/ctrls/download.js +++ b/js/ctrls/download.js @@ -283,7 +283,6 @@ function( var dlName; var files = d.files; if (files) { - dlName = files[0].path || d.files[0].uris[0].uri; var cfiles = ctx.files; for (var i = 0; i < files.length; ++i) { var cfile = cfiles[i] || (cfiles[i] = {}); @@ -302,6 +301,9 @@ function( } } cfiles.length = files.length; + if (cfiles.length) { + dlName = cfiles[0].relpath; + } } else { delete ctx.files; @@ -316,7 +318,7 @@ function( delete ctx.bittorrent; } - ctx.name = btName || utils.getFileName(dlName) || dlName || "Unknown"; + ctx.name = btName || dlName || "Unknown"; // collapse the download details initially if (ctx.collapsed === undefined) {