mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
feat(filters): support daily shows (#1462)
* feat(database): Add month, day columns to release table * feat(database): Add month, day columns to postgres release table * feat(filters): support daily show format * feat(filters): check smart episode daily * fix(tests): rss * feat(filters): add daily shows elements to form * enhancement(web): minimize html in MoviesAndTV tab * feat(filters): smart episode check proper and repack * feat(filters): smart episode do not allow multiple latest * feat(filters): smart episode check group with repack * feat(filters): smart episode allow multiple current releases --------- Co-authored-by: s0up4200 <soup@r4tio.dev> Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com> Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
This commit is contained in:
parent
2a3dcfbf05
commit
4fceccd611
15 changed files with 270 additions and 56 deletions
|
@ -62,6 +62,22 @@ const (
|
|||
FilterMaxDownloadsEver FilterMaxDownloadsUnit = "EVER"
|
||||
)
|
||||
|
||||
type SmartEpisodeParams struct {
|
||||
Title string
|
||||
Season int
|
||||
Episode int
|
||||
Year int
|
||||
Month int
|
||||
Day int
|
||||
Repack bool
|
||||
Proper bool
|
||||
Group string
|
||||
}
|
||||
|
||||
func (p *SmartEpisodeParams) IsDailyEpisode() bool {
|
||||
return p.Year != 0 && p.Month != 0 && p.Day != 0
|
||||
}
|
||||
|
||||
type FilterQueryParams struct {
|
||||
Sort map[string]string
|
||||
Filters struct {
|
||||
|
@ -106,6 +122,8 @@ type Filter struct {
|
|||
MatchOther []string `json:"match_other,omitempty"`
|
||||
ExceptOther []string `json:"except_other,omitempty"`
|
||||
Years string `json:"years,omitempty"`
|
||||
Months string `json:"months,omitempty"`
|
||||
Days string `json:"days,omitempty"`
|
||||
Artists string `json:"artists,omitempty"`
|
||||
Albums string `json:"albums,omitempty"`
|
||||
MatchReleaseTypes []string `json:"match_release_types,omitempty"` // Album,Single,EP
|
||||
|
@ -215,6 +233,8 @@ type FilterUpdate struct {
|
|||
MatchOther *[]string `json:"match_other,omitempty"`
|
||||
ExceptOther *[]string `json:"except_other,omitempty"`
|
||||
Years *string `json:"years,omitempty"`
|
||||
Months *string `json:"months,omitempty"`
|
||||
Days *string `json:"days,omitempty"`
|
||||
Artists *string `json:"artists,omitempty"`
|
||||
Albums *string `json:"albums,omitempty"`
|
||||
MatchReleaseTypes *[]string `json:"match_release_types,omitempty"` // Album,Single,EP
|
||||
|
@ -309,6 +329,8 @@ func (f *Filter) Sanitize() error {
|
|||
}
|
||||
|
||||
f.Years = sanitize.FilterString(f.Years)
|
||||
f.Months = sanitize.FilterString(f.Months)
|
||||
f.Days = sanitize.FilterString(f.Days)
|
||||
|
||||
f.Artists = sanitize.FilterString(f.Artists)
|
||||
f.Albums = sanitize.FilterString(f.Albums)
|
||||
|
@ -460,6 +482,14 @@ func (f *Filter) CheckFilter(r *Release) ([]string, bool) {
|
|||
f.addRejectionF("year not matching. got: %d want: %v", r.Year, f.Years)
|
||||
}
|
||||
|
||||
if f.Months != "" && !containsIntStrings(r.Month, f.Months) {
|
||||
f.addRejectionF("month not matching. got: %d want: %v", r.Month, f.Months)
|
||||
}
|
||||
|
||||
if f.Days != "" && !containsIntStrings(r.Day, f.Days) {
|
||||
f.addRejectionF("day not matching. got: %d want: %v", r.Day, f.Days)
|
||||
}
|
||||
|
||||
if f.MatchCategories != "" {
|
||||
var categories []string
|
||||
categories = append(categories, r.Categories...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue