Skip to content

Commit

Permalink
Fix episode search when E000 format is used. #22
Browse files Browse the repository at this point in the history
  • Loading branch information
arvida42 committed Aug 26, 2024
1 parent ab5a47b commit 03645b1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/lib/jackettio.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ function priotizeItems(allItems, priotizeItems, max){
}

function searchEpisodeFile(files, season, episode){
return files.find(file => file.name.includes(`S${numberPad(season)}E${numberPad(episode)}`))
|| files.find(file => file.name.includes(`${season}${numberPad(episode)}`))
|| files.find(file => file.name.includes(`${numberPad(episode)}`))
|| false;
for(let padCount = 3; padCount >= 2; padCount--){
let episodeFile = files.find(file => file.name.includes(`S${numberPad(season, padCount)}E${numberPad(episode, padCount)}`))
|| files.find(file => file.name.includes(`${season}${numberPad(episode, padCount)}`))
|| files.find(file => file.name.includes(`${numberPad(episode, padCount)}`))
|| false;
if(episodeFile)return episodeFile;
}
}

async function getTorrents(userConfig, metaInfos, debridInstance){
Expand Down

0 comments on commit 03645b1

Please sign in to comment.