Ok so I decided to go through the code to understand why this problem happens. If you want the quickest possible fix that will take care of the specific problem that I encountered, then in the jimaku file at:
WebUI/src/features/anime/reader/services/jimaku.ts
In the last if chain in the filterEpisodeMatches function, check that the matches aren't empty before returning:
if (hasJapanese && japaneseMatches.length) {
return { matches: japaneseMatches, hasEpisodeTags: true }
}
if (hasSeason && seasonMatches.length) {
return { matches: seasonMatches, hasEpisodeTags: true }
}
if (hasGeneral && generalMatches.length) {
return { matches: generalMatches, hasEpisodeTags: true }
}
return { matches: [], hasEpisodeTags: false }
This fixes the problem, but it also made me curious why we're only choosing to return only one of the three categories of matches instead of just returning all the matches we get? This whole problem was caused because the function would find some atleast one file with japanese episode numbering, set hasJapanese to true making it only able to return japanese matches, then proceed to not find any Japanese episode numbers that match the actual target because the japanese episode numbers are the continuous kind not the per season kind. So it would return an empty array, making it fallback to filtering through all the jimaku files and finding the incorrect one.