Skip to content

Commit

Permalink
feat: remove default internal size limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Nov 20, 2024
1 parent 6372c5c commit ea90e01
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions server/core/torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,8 @@ func imdbIDMatchExact(id1, id2 string) bool {
return id1 == id2
}

func torrentSizeOk(detail *db.MediaDetails, globalLimiter *db.MediaSizeLimiter, torrentSize int64, torrentEpisodeNum int, param *SearchParam) bool {
defaultMinSize := int64(80 * 1000 * 1000) //tv, 80M min
if detail.MediaType == media.MediaTypeMovie {
defaultMinSize = 200 * 1000 * 1000 // movie, 200M min
}

if detail.Limiter.SizeMin > 0 { //if size limiter set, use configured min size
defaultMinSize = detail.Limiter.SizeMin
}
func torrentSizeOk(detail *db.MediaDetails, globalLimiter *db.MediaSizeLimiter, torrentSize int64,
torrentEpisodeNum int, param *SearchParam) bool {

multiplier := 1 //大小倍数,正常为1,如果是季包则为季内集数
if detail.MediaType == media.MediaTypeTv {
Expand Down Expand Up @@ -166,7 +159,7 @@ func torrentSizeOk(detail *db.MediaDetails, globalLimiter *db.MediaSizeLimiter,
}
}
}
return torrentSize > defaultMinSize*int64(multiplier)
return true
}

func seasonEpisodeCount(detail *db.MediaDetails, seasonNum int) int {
Expand Down

0 comments on commit ea90e01

Please sign in to comment.