[scraper] date handling

This commit is contained in:
TheBeastLT
2020-03-13 15:46:06 +01:00
parent 2b73b56106
commit 21338b3aee
4 changed files with 14 additions and 5 deletions

View File

@@ -122,7 +122,7 @@ function parseSeriesFile(file, parsedTorrentName) {
fileInfo.season = pathInfo.season;
}
// force episode to any found number if it was not parsed
if (!fileInfo.episodes) {
if (!fileInfo.episodes && !fileInfo.date) {
const epMatcher = fileInfo.title.match(/(?<!movie\W*|film\W*)(?:^|\W)(\d{1,4})(?:a|b|v\d)?(?:\W|$)(?!movie|film)/i);
fileInfo.episodes = epMatcher && [parseInt(epMatcher[1], 10)];
fileInfo.episode = fileInfo.episodes && fileInfo.episodes[0];