mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
adds manual reapply step to decompose episodes again
This commit is contained in:
@@ -35,7 +35,8 @@ module.exports.updateCurrentSeeders = function (torrent) {
|
||||
};
|
||||
|
||||
module.exports.torrentFiles = function (torrent) {
|
||||
return filesFromTorrentFile(torrent)
|
||||
return getFilesFromObject(torrent)
|
||||
.catch(() => filesFromTorrentFile(torrent))
|
||||
.catch(() => filesFromTorrentStream(torrent))
|
||||
.catch(() => filesFromCache(torrent.infoHash))
|
||||
.then((files) => filterVideos(files))
|
||||
@@ -43,6 +44,13 @@ module.exports.torrentFiles = function (torrent) {
|
||||
.then((files) => filterExtras(files));
|
||||
};
|
||||
|
||||
function getFilesFromObject(torrent) {
|
||||
if (torrent.files && torrent.files.length) {
|
||||
return Promise.resolve(torrent.files);
|
||||
}
|
||||
return Promise.reject("No files in the object");
|
||||
}
|
||||
|
||||
function filesFromCache(infoHash) {
|
||||
return retrieveTorrentFiles(infoHash)
|
||||
.then((files) => files.map((file) => ({
|
||||
|
||||
Reference in New Issue
Block a user