From fc2d9678eef8494c33cf2876a5eebadbd707877e Mon Sep 17 00:00:00 2001 From: MaysWind Date: Tue, 8 Oct 2019 21:55:22 +0800 Subject: [PATCH] remove query string from task name --- src/scripts/services/aria2TaskService.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/scripts/services/aria2TaskService.js b/src/scripts/services/aria2TaskService.js index 27de3be..5ca1030 100644 --- a/src/scripts/services/aria2TaskService.js +++ b/src/scripts/services/aria2TaskService.js @@ -20,7 +20,14 @@ return path; } - return path.substring(index + 1); + var fileNameAndQueryString = path.substring(index + 1); + var queryStringStartPos = fileNameAndQueryString.indexOf('?'); + + if (queryStringStartPos <= 0) { + return fileNameAndQueryString; + } + + return fileNameAndQueryString.substring(0, queryStringStartPos); }; var calculateDownloadRemainTime = function (remainBytes, downloadSpeed) {