Skip to content

Commit 6ed991d

Browse files
committed
Fix dir filters for windows paths
Issue #98
1 parent 94a0b7c commit 6ed991d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/filters.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ function buildDirTree(paths: string[], expanded: string[]): Directory {
228228
paths.forEach((path) => {
229229
const parts = path.split("/");
230230
let dir = root;
231-
let currentPath = "/";
231+
let currentPath = "";
232232
for (const part of parts) {
233-
if (part === "") continue;
234233
currentPath = currentPath + part + "/";
234+
if (part === "") continue;
235235
if (!dir.subdirs.has(part)) {
236236
dir.subdirs.set(part, {
237237
name: part,

src/rpc/torrent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export async function processTorrent(t: TorrentBase, lookupIps: boolean, client:
110110

111111
return {
112112
...t,
113+
downloadDir: (t.downloadDir as string).replaceAll("\\", "/"),
113114
cachedError: getTorrentError(t),
114115
cachedTrackerStatus: getTrackerStatus(t),
115116
cachedMainTracker: getTorrentMainTracker(t),

0 commit comments

Comments
 (0)