improve offcloud link resolving
This commit is contained in:
parent
9c92b2100f
commit
a83eef99da
1 changed files with 2 additions and 2 deletions
|
|
@ -136,8 +136,8 @@ async function _retryCreateTorrent(OC, infoHash, cachedEntryInfo, fileIndex) {
|
||||||
async function _unrestrictLink(OC, infoHash, torrent, cachedEntryInfo, fileIndex) {
|
async function _unrestrictLink(OC, infoHash, torrent, cachedEntryInfo, fileIndex) {
|
||||||
const targetFileName = decodeURIComponent(cachedEntryInfo);
|
const targetFileName = decodeURIComponent(cachedEntryInfo);
|
||||||
const files = await _getFileUrls(OC, torrent)
|
const files = await _getFileUrls(OC, torrent)
|
||||||
const targetFile = files.find(file => file.includes(`/${torrent.requestId}/${fileIndex}/`))
|
const targetFile = files.find(file => sameFilename(targetFileName, file.split('/').pop()))
|
||||||
|| files.find(file => sameFilename(targetFileName, file.split('/').pop()))
|
|| files.find(file => file.includes(`/${torrent.requestId}/${fileIndex}/`))
|
||||||
|| files.find(file => isVideo(file))
|
|| files.find(file => isVideo(file))
|
||||||
|| files.pop();
|
|| files.pop();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue