Skip to content

Commit 6926543

Browse files
jeremcomackode
authored andcommitted
Fix comparison of local files issues on Windows (#76)
1 parent 2683460 commit 6926543

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

api/controllers/downloads-controller.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,9 @@ DownloadsController.prototype.getDownloading = function (manifestId, localFile)
380380
for (var link in items) {
381381
if (items.hasOwnProperty(link)) {
382382
let download = items[link];
383-
if (download.localUrl === localFile) {
383+
let downloadPath = path.normalize(download.localUrl);
384+
let local = path.normalize(localFile);
385+
if (downloadPath === local) {
384386
return download;
385387
}
386388
}
@@ -435,7 +437,9 @@ DownloadsController.prototype.performSeek = function (manifestId, localFile, cal
435437
}
436438

437439
let index = items.findIndex(function (download) {
438-
return (download.localUrl === localFile)
440+
let downloadPath = path.normalize(download.localUrl);
441+
let local = path.normalize(localFile);
442+
return (downloadPath === local)
439443
});
440444
if (index > -1) {
441445

0 commit comments

Comments
 (0)