fix failing rd retry when infohash not indexed
This commit is contained in:
parent
87648bbe50
commit
20187a1145
1 changed files with 4 additions and 4 deletions
|
|
@ -62,11 +62,11 @@ let ALL_RUSSIAN_TRACKERS = [];
|
|||
export async function getMagnetLink(infoHash) {
|
||||
const torrent = await getTorrent(infoHash).catch(() => ({ infoHash }));
|
||||
const torrentTrackers = torrent?.trackers?.split(',') || [];
|
||||
const animeTrackers = torrent.type === Type.ANIME ? ALL_ANIME_TRACKERS : [];
|
||||
const providerTrackers = RUSSIAN_PROVIDERS.includes(torrent.provider) && ALL_RUSSIAN_TRACKERS || [];
|
||||
const animeTrackers = torrent?.type === Type.ANIME ? ALL_ANIME_TRACKERS : [];
|
||||
const providerTrackers = RUSSIAN_PROVIDERS.includes(torrent?.provider) && ALL_RUSSIAN_TRACKERS || [];
|
||||
const trackers = unique([].concat(torrentTrackers).concat(animeTrackers).concat(providerTrackers));
|
||||
|
||||
return magnet.encode({ infoHash: infoHash, name: torrent.title, announce: trackers });
|
||||
return magnet.encode({ infoHash: infoHash, name: torrent?.title, announce: trackers });
|
||||
}
|
||||
|
||||
export async function initBestTrackers() {
|
||||
|
|
@ -112,4 +112,4 @@ export function enrichStreamSources(stream) {
|
|||
|
||||
function unique(array) {
|
||||
return Array.from(new Set(array));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue