mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
updating to use tpb cached torrent files
This commit is contained in:
@@ -63,15 +63,15 @@ function parseFile(file, parsedTorrentName) {
|
||||
}
|
||||
|
||||
async function decomposeAbsoluteEpisodes(files, torrent, imdbId) {
|
||||
if (files.every((file) => file.episodes.every((ep) => ep < 100))) {
|
||||
return; // nothing to decompose
|
||||
if (files.every((file) => !file.episodes || file.episodes.every((ep) => ep < 100))) {
|
||||
return files; // nothing to decompose
|
||||
}
|
||||
|
||||
const metadata = await getMetadata(imdbId, torrent.type || Type.MOVIE);
|
||||
// decompose if season is inside path, but individual files are concatenated ex. 101 (S01E01)
|
||||
files
|
||||
.filter(file => file.season && metadata.episodeCount[file.season] < 100)
|
||||
.filter(file => file.episodes.every(ep => ep / 100 === file.season))
|
||||
.filter(file => file.episodes && file.episodes.every(ep => ep / 100 === file.season))
|
||||
.forEach(file => file.episodes = file.episodes.map(ep => ep % 100));
|
||||
// decompose if no season info is available, but individual files are concatenated ex. 101 (S01E01)
|
||||
// based on total episodes count per season
|
||||
|
||||
Reference in New Issue
Block a user