mirror of
https://github.com/simon-ding/polaris.git
synced 2026-03-06 01:20:46 +08:00
feat: should match imdbid if present
This commit is contained in:
@@ -87,6 +87,7 @@ func (r *Response) ToResults(indexer *db.TorznabInfo) []Result {
|
||||
Seeders: mustAtoI(item.GetAttr("seeders")),
|
||||
Peers: mustAtoI(item.GetAttr("peers")),
|
||||
Category: mustAtoI(item.GetAttr("category")),
|
||||
ImdbId: item.GetAttr("imdbid"),
|
||||
DownloadVolumeFactor: tryParseFloat(item.GetAttr("downloadvolumefactor")),
|
||||
UploadVolumeFactor: tryParseFloat(item.GetAttr("uploadvolumefactor")),
|
||||
Source: indexer.Name,
|
||||
@@ -167,4 +168,5 @@ type Result struct {
|
||||
IndexerId int `json:"indexer_id"`
|
||||
Priority int `json:"priority"`
|
||||
IsPrivate bool `json:"is_private"`
|
||||
ImdbId string `json:"imdb_id"`
|
||||
}
|
||||
|
||||
@@ -67,6 +67,9 @@ func SearchTvSeries(db1 *db.Client, param *SearchParam) ([]torznab.Result, error
|
||||
if !torrentSizeOk(series, r.Size, param) {
|
||||
continue
|
||||
}
|
||||
if isImdbidNotMatch(series.ImdbID, r.ImdbId) { //imdb id not match
|
||||
continue
|
||||
}
|
||||
|
||||
filtered = append(filtered, r)
|
||||
}
|
||||
@@ -78,6 +81,15 @@ func SearchTvSeries(db1 *db.Client, param *SearchParam) ([]torznab.Result, error
|
||||
|
||||
}
|
||||
|
||||
func isImdbidNotMatch(id1, id2 string) bool {
|
||||
if id1 == "" || id2 == "" {
|
||||
return false
|
||||
}
|
||||
id1 = strings.TrimPrefix(id1, "tt")
|
||||
id2 = strings.TrimPrefix(id2, "tt")
|
||||
return id1 != id2
|
||||
}
|
||||
|
||||
func torrentSizeOk(detail *db.MediaDetails, torrentSize int, param *SearchParam) bool {
|
||||
if param.CheckFileSize {
|
||||
multiplier := 1 //大小倍数,正常为1,如果是季包则为季内集数
|
||||
@@ -154,6 +166,9 @@ func SearchMovie(db1 *db.Client, param *SearchParam) ([]torznab.Result, error) {
|
||||
if param.FilterQiangban && meta.IsQingban { //过滤枪版电影
|
||||
continue
|
||||
}
|
||||
if isImdbidNotMatch(movieDetail.ImdbID, r.ImdbId) { //imdb id not match
|
||||
continue
|
||||
}
|
||||
|
||||
ss := strings.Split(movieDetail.AirDate, "-")[0]
|
||||
year, _ := strconv.Atoi(ss)
|
||||
|
||||
Reference in New Issue
Block a user