mirror of
https://github.com/simon-ding/polaris.git
synced 2026-02-06 15:10:49 +08:00
fix size limiter
This commit is contained in:
@@ -41,6 +41,6 @@ func (Media) Edges() []ent.Edge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type MediaLimiter struct {
|
type MediaLimiter struct {
|
||||||
SizeMin int `json:"size_min"`
|
SizeMin int `json:"size_min"` //in MB
|
||||||
SizeMax int `json:"size_max"`
|
SizeMax int `json:"size_max"` //in MB
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,11 +57,11 @@ func SearchTvSeries(db1 *db.Client, seriesId, seasonNum int, episodes []int, che
|
|||||||
}
|
}
|
||||||
|
|
||||||
if checkFileSize {
|
if checkFileSize {
|
||||||
if series.Limiter.SizeMin > 0 && r.Size < series.Limiter.SizeMin {
|
if series.Limiter.SizeMin > 0 && r.Size < series.Limiter.SizeMin*1000*1000 {
|
||||||
//min size not satified
|
//min size not satified
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if series.Limiter.SizeMax > 0 && r.Size > series.Limiter.SizeMax {
|
if series.Limiter.SizeMax > 0 && r.Size > series.Limiter.SizeMax*1000*1000 {
|
||||||
//max size not satified
|
//max size not satified
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user