name from path bug fixed
This commit is contained in:
parent
3cd22d932d
commit
37e6a48230
11
js/script.js
11
js/script.js
|
@ -425,15 +425,8 @@ function getTemplateCtx(data) {
|
||||||
percentage = percentage.toFixed(2);
|
percentage = percentage.toFixed(2);
|
||||||
if(!percentage) percentage = 0;
|
if(!percentage) percentage = 0;
|
||||||
var name;
|
var name;
|
||||||
if(data.files[0].path && data.dir) {
|
var seed = (data.files[0].path || data.files[0].uris[0].uri).split(/[/\\]/);
|
||||||
name = data.files[0].path.replace(/^.*[\\\/\]]/, '');
|
name = seed[seed.length - 1];
|
||||||
//name = data.files[0].path.replace(data.dir, '').substr(1);
|
|
||||||
//if(name.indexOf('/') !== -1)
|
|
||||||
//name = name.substring(0, name.indexOf('/'));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
name = data.files[0].uris[0].uri.replace(/^.*[\\\/]/, '');
|
|
||||||
}
|
|
||||||
|
|
||||||
var eta = changeTime((data.totalLength-data.completedLength)/data.downloadSpeed);
|
var eta = changeTime((data.totalLength-data.completedLength)/data.downloadSpeed);
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user