diff --git a/shows/collector.go b/shows/collector.go index b65434a..1566d37 100644 --- a/shows/collector.go +++ b/shows/collector.go @@ -357,13 +357,13 @@ func (c *Collector) scanShowsFile(d *Dir) (map[string]*File, error) { for i, item := range movieFiles { item.Episode = i + 1 item.SeasonEpisode = fmt.Sprintf("s%02de%02d", item.Season, item.Episode) - utils.Logger.DebugF("scanShowsFile partMode=%d, correct episode to %d", d.PartMode, item.Episode, item.OriginTitle) + utils.Logger.DebugF("scanShowsFile partMode=%d, correct episode to %d", d.PartMode, item.Episode) } } else if d.PartMode > 1 { for _, item := range movieFiles { item.Episode = (item.Episode-1)*d.PartMode + item.Part item.SeasonEpisode = fmt.Sprintf("s%02de%02d", item.Season, item.Episode) - utils.Logger.DebugF("scanShowsFile partMode=%d, correct episode to %d", d.PartMode, item.Episode, item.OriginTitle) + utils.Logger.DebugF("scanShowsFile partMode=%d, correct episode to %d", d.PartMode, item.Episode) } } @@ -387,10 +387,13 @@ func (c *Collector) parseShowsFile(dir *Dir, file fs.FileInfo) *File { return nil } + fileName = strings.Replace(fileName, "."+suffix, "", 1) + fileName = utils.FilterOptionals(fileName) fileName = utils.ReplaceChsNumber(fileName) + fileName = utils.EpisodeCorrecting(fileName) // 提取季和集 - snum, enum := utils.MatchEpisode(fileName) + snum, enum := utils.MatchEpisode(fileName + "." + suffix) if dir.Season > 0 { snum = dir.Season } diff --git a/utils/video_test.go b/utils/video_test.go index 916b4f5..5510a07 100644 --- a/utils/video_test.go +++ b/utils/video_test.go @@ -21,6 +21,7 @@ func TestMatchEpisode(t *testing.T) { "Gannibal.Season01.EP02.2022.mp4": {1, 2}, "转生成自动贩卖机02全片简中.mp4": {1, 2}, "地球脉动.第3季.Planet.Earth.S03E02.2023.2160p.WEB-DL.H265.10bit.DDP2.0.2Audio-OurTV.mp4": {3, 2}, + "E01.mkv": {1, 1}, } for name, cse := range cases { s, e := MatchEpisode(name)