fix playing TB cloud files due to link cacheing, close #328
Some checks failed
Deploy Addon / build (SSH_HOST_2, SSH_KEY_2) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_3, SSH_KEY_3) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_4, SSH_KEY_4) (push) Has been cancelled

This commit is contained in:
TheBeastLT 2024-12-25 08:39:09 +02:00
parent 0401828b2d
commit e3f1855a97

View file

@ -62,7 +62,7 @@ export async function getItemMeta(itemId, apiKey) {
id: `${KEY}:${itemId}:${file.id}`,
title: file.name,
released: new Date(createDate.getTime() - index).toISOString(),
streams: [{ url: `${apiKey}/null/${itemId}-${file.id}/null` }]
streams: [{ url: `${apiKey}/${itemId}-${file.id}/null/null` }]
}))
}
}
@ -88,8 +88,8 @@ export async function resolve({ ip, apiKey, infoHash, cachedEntryInfo, fileIndex
}
async function _resolve(apiKey, infoHash, cachedEntryInfo, fileIndex, ip) {
if (infoHash === 'null') {
const [type, rootId, fileId] = cachedEntryInfo.split('-');
if (infoHash?.includes('-')) {
const [type, rootId, fileId] = infoHash.split('-');
return getDownloadLink(apiKey, type, rootId, fileId, ip);
}
const torrent = await _createOrFindTorrent(apiKey, infoHash);