Giter Club home page Giter Club logo

animego's Issues

[功能] 增加更准确的季度匹配(bgm和tmdb的季度无法匹配的情况)

需要在parseAnimeSeason中增加
当 min > constant.ThemoviedbMatchSeasonDays
无法匹配到季度的情况下
去读取bgm的前传信息来再次判断是否有匹配season 循环到读取到有范围内匹配的季度 或者 一直读到第一季也无法匹配跳出。

	seasonInfo = resp.Seasons[0]
	min := 36500
	for _, r := range resp.Seasons {
		if r.Season == 0 || r.EpName == "Specials" {
			continue
		}
		// TODO: 待优化,通过比较此季度番剧的初放送日期,筛选差值最小的季
		if s := StrTimeSubAbs(r.AirDate, airDate); s < min {
			min = s
			seasonInfo = r
		}
	}
	if min > constant.ThemoviedbMatchSeasonDays {
		err = errors.WithStack(&exceptions.ErrThemoviedbMatchSeason{Message: "此番剧可能未开播"})
		log.DebugErr(err)
		return nil, err
	}

增加配置选项


TMDBFailSkip bool `yaml:"tmdb_fail_skip" json:"tmdb_fail_skip" attr:"跳过当前项" comment:"tmdb解析季度失败时,跳过当前项。优先级4"`
TMDBFailBacktrace bool `yaml:"tmdb_fail_backtrace" json:"tmdb_fail_backtrace" attr:"季度回溯匹配" comment:"tmdb解析季度失败时,季度逐个回溯匹配直到有匹配选项。优先级3"`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.