Add support for using freeleech tokens if available

This commit is contained in:
Daniel Mason 2025-07-11 10:12:43 +12:00
parent 74f777340e
commit 1242c19883
Signed by: idanoo
GPG key ID: 387387CDBC02F132
21 changed files with 88 additions and 34 deletions

View file

@ -210,6 +210,7 @@ func (r *FilterRepo) FindByID(ctx context.Context, filterID int) (*domain.Filter
"f.scene",
"f.freeleech",
"f.freeleech_percent",
"f.freeleech_token",
"f.smart_episode",
"f.shows",
"f.seasons",
@ -438,6 +439,7 @@ func (r *FilterRepo) findByIndexerIdentifier(ctx context.Context, indexer string
"f.scene",
"f.freeleech",
"f.freeleech_percent",
"f.freeleech_token",
"f.smart_episode",
"f.shows",
"f.seasons",
@ -832,6 +834,7 @@ func (r *FilterRepo) Store(ctx context.Context, filter *domain.Filter) error {
"scene",
"freeleech",
"freeleech_percent",
"freeleech_token",
"smart_episode",
"shows",
"seasons",
@ -988,6 +991,7 @@ func (r *FilterRepo) Update(ctx context.Context, filter *domain.Filter) error {
Set("scene", filter.Scene).
Set("freeleech", filter.Freeleech).
Set("freeleech_percent", filter.FreeleechPercent).
Set("freeleech_token", filter.FreeleechToken).
Set("smart_episode", filter.SmartEpisode).
Set("shows", filter.Shows).
Set("seasons", filter.Seasons).
@ -1128,6 +1132,9 @@ func (r *FilterRepo) UpdatePartial(ctx context.Context, filter domain.FilterUpda
if filter.FreeleechPercent != nil {
q = q.Set("freeleech_percent", filter.FreeleechPercent)
}
if filter.FreeleechToken != nil {
q = q.Set("freeleech_token", filter.FreeleechToken)
}
if filter.SmartEpisode != nil {
q = q.Set("smart_episode", filter.SmartEpisode)
}