From 6be344423c921ef7634805dfc1220f8a387e3daf Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Fri, 15 Dec 2023 13:18:47 +0200 Subject: [PATCH] fix selecting offcloud unrestricted link for multi dir torrents --- addon/moch/offcloud.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addon/moch/offcloud.js b/addon/moch/offcloud.js index f85cea9..3e14ebe 100644 --- a/addon/moch/offcloud.js +++ b/addon/moch/offcloud.js @@ -121,10 +121,9 @@ async function _createTorrent(OC, infoHash) { } async function _unrestrictLink(OC, infoHash, torrent, cachedEntryInfo, fileIndex) { - const targetFileName = decodeURIComponent(cachedEntryInfo); const files = await OC.cloud.explore(torrent.requestId) const targetFile = Number.isInteger(fileIndex) - ? files.find(file => file.includes(targetFileName)) + ? files.find(file => file.includes(`/${torrent.requestId}/${fileIndex}/`)) : files.find(file => isVideo(file)); if (!targetFile) {