diff --git a/internal/database/filter.go b/internal/database/filter.go index fa74829..34bec5b 100644 --- a/internal/database/filter.go +++ b/internal/database/filter.go @@ -190,6 +190,9 @@ func (r *FilterRepo) FindByID(ctx context.Context, filterID int) (*domain.Filter "match_release_tags", "except_release_tags", "use_regex_release_tags", + "match_description", + "except_description", + "use_regex_description", "scene", "freeleech", "freeleech_percent", @@ -253,11 +256,11 @@ func (r *FilterRepo) FindByID(ctx context.Context, filterID int) (*domain.Filter } var f domain.Filter - var minSize, maxSize, maxDownloadsUnit, matchReleases, exceptReleases, matchReleaseGroups, exceptReleaseGroups, matchReleaseTags, exceptReleaseTags, freeleechPercent, shows, seasons, episodes, years, artists, albums, matchCategories, exceptCategories, matchUploaders, exceptUploaders, tags, exceptTags, tagsMatchLogic, exceptTagsMatchLogic, extScriptCmd, extScriptArgs, extWebhookHost, extWebhookData sql.NullString + var minSize, maxSize, maxDownloadsUnit, matchReleases, exceptReleases, matchReleaseGroups, exceptReleaseGroups, matchReleaseTags, exceptReleaseTags, matchDescription, exceptDescription, freeleechPercent, shows, seasons, episodes, years, artists, albums, matchCategories, exceptCategories, matchUploaders, exceptUploaders, tags, exceptTags, tagsMatchLogic, exceptTagsMatchLogic, extScriptCmd, extScriptArgs, extWebhookHost, extWebhookData sql.NullString var useRegex, scene, freeleech, hasLog, hasCue, perfectFlac, extScriptEnabled, extWebhookEnabled sql.NullBool var delay, maxDownloads, logScore, extWebhookStatus, extScriptStatus sql.NullInt32 - if err := row.Scan(&f.ID, &f.Enabled, &f.Name, &minSize, &maxSize, &delay, &f.Priority, &maxDownloads, &maxDownloadsUnit, &matchReleases, &exceptReleases, &useRegex, &matchReleaseGroups, &exceptReleaseGroups, &matchReleaseTags, &exceptReleaseTags, &f.UseRegexReleaseTags, &scene, &freeleech, &freeleechPercent, &f.SmartEpisode, &shows, &seasons, &episodes, pq.Array(&f.Resolutions), pq.Array(&f.Codecs), pq.Array(&f.Sources), pq.Array(&f.Containers), pq.Array(&f.MatchHDR), pq.Array(&f.ExceptHDR), pq.Array(&f.MatchOther), pq.Array(&f.ExceptOther), &years, &artists, &albums, pq.Array(&f.MatchReleaseTypes), pq.Array(&f.Formats), pq.Array(&f.Quality), pq.Array(&f.Media), &logScore, &hasLog, &hasCue, &perfectFlac, &matchCategories, &exceptCategories, &matchUploaders, &exceptUploaders, pq.Array(&f.MatchLanguage), pq.Array(&f.ExceptLanguage), &tags, &exceptTags, &tagsMatchLogic, &exceptTagsMatchLogic, pq.Array(&f.Origins), pq.Array(&f.ExceptOrigins), &extScriptEnabled, &extScriptCmd, &extScriptArgs, &extScriptStatus, &extWebhookEnabled, &extWebhookHost, &extWebhookData, &extWebhookStatus, &f.CreatedAt, &f.UpdatedAt); err != nil { + if err := row.Scan(&f.ID, &f.Enabled, &f.Name, &minSize, &maxSize, &delay, &f.Priority, &maxDownloads, &maxDownloadsUnit, &matchReleases, &exceptReleases, &useRegex, &matchReleaseGroups, &exceptReleaseGroups, &matchReleaseTags, &exceptReleaseTags, &f.UseRegexReleaseTags, &matchDescription, &exceptDescription, &f.UseRegexDescription, &scene, &freeleech, &freeleechPercent, &f.SmartEpisode, &shows, &seasons, &episodes, pq.Array(&f.Resolutions), pq.Array(&f.Codecs), pq.Array(&f.Sources), pq.Array(&f.Containers), pq.Array(&f.MatchHDR), pq.Array(&f.ExceptHDR), pq.Array(&f.MatchOther), pq.Array(&f.ExceptOther), &years, &artists, &albums, pq.Array(&f.MatchReleaseTypes), pq.Array(&f.Formats), pq.Array(&f.Quality), pq.Array(&f.Media), &logScore, &hasLog, &hasCue, &perfectFlac, &matchCategories, &exceptCategories, &matchUploaders, &exceptUploaders, pq.Array(&f.MatchLanguage), pq.Array(&f.ExceptLanguage), &tags, &exceptTags, &tagsMatchLogic, &exceptTagsMatchLogic, pq.Array(&f.Origins), pq.Array(&f.ExceptOrigins), &extScriptEnabled, &extScriptCmd, &extScriptArgs, &extScriptStatus, &extWebhookEnabled, &extWebhookHost, &extWebhookData, &extWebhookStatus, &f.CreatedAt, &f.UpdatedAt); err != nil { return nil, errors.Wrap(err, "error scanning row") } @@ -272,6 +275,8 @@ func (r *FilterRepo) FindByID(ctx context.Context, filterID int) (*domain.Filter f.ExceptReleaseGroups = exceptReleaseGroups.String f.MatchReleaseTags = matchReleaseTags.String f.ExceptReleaseTags = exceptReleaseTags.String + f.MatchDescription = matchDescription.String + f.ExceptDescription = exceptDescription.String f.FreeleechPercent = freeleechPercent.String f.Shows = shows.String f.Seasons = seasons.String @@ -333,6 +338,9 @@ func (r *FilterRepo) findByIndexerIdentifier(ctx context.Context, indexer string "f.match_release_tags", "f.except_release_tags", "f.use_regex_release_tags", + "f.match_description", + "f.except_description", + "f.use_regex_description", "f.scene", "f.freeleech", "f.freeleech_percent", @@ -406,11 +414,11 @@ func (r *FilterRepo) findByIndexerIdentifier(ctx context.Context, indexer string for rows.Next() { var f domain.Filter - var minSize, maxSize, maxDownloadsUnit, matchReleases, exceptReleases, matchReleaseGroups, exceptReleaseGroups, matchReleaseTags, exceptReleaseTags, freeleechPercent, shows, seasons, episodes, years, artists, albums, matchCategories, exceptCategories, matchUploaders, exceptUploaders, tags, exceptTags, tagsMatchLogic, exceptTagsMatchLogic, extScriptCmd, extScriptArgs, extWebhookHost, extWebhookData sql.NullString + var minSize, maxSize, maxDownloadsUnit, matchReleases, exceptReleases, matchReleaseGroups, exceptReleaseGroups, matchReleaseTags, exceptReleaseTags, matchDescription, exceptDescription, freeleechPercent, shows, seasons, episodes, years, artists, albums, matchCategories, exceptCategories, matchUploaders, exceptUploaders, tags, exceptTags, tagsMatchLogic, exceptTagsMatchLogic, extScriptCmd, extScriptArgs, extWebhookHost, extWebhookData sql.NullString var useRegex, scene, freeleech, hasLog, hasCue, perfectFlac, extScriptEnabled, extWebhookEnabled sql.NullBool var delay, maxDownloads, logScore, extWebhookStatus, extScriptStatus sql.NullInt32 - if err := rows.Scan(&f.ID, &f.Enabled, &f.Name, &minSize, &maxSize, &delay, &f.Priority, &maxDownloads, &maxDownloadsUnit, &matchReleases, &exceptReleases, &useRegex, &matchReleaseGroups, &exceptReleaseGroups, &matchReleaseTags, &exceptReleaseTags, &f.UseRegexReleaseTags, &scene, &freeleech, &freeleechPercent, &f.SmartEpisode, &shows, &seasons, &episodes, pq.Array(&f.Resolutions), pq.Array(&f.Codecs), pq.Array(&f.Sources), pq.Array(&f.Containers), pq.Array(&f.MatchHDR), pq.Array(&f.ExceptHDR), pq.Array(&f.MatchOther), pq.Array(&f.ExceptOther), &years, &artists, &albums, pq.Array(&f.MatchReleaseTypes), pq.Array(&f.Formats), pq.Array(&f.Quality), pq.Array(&f.Media), &logScore, &hasLog, &hasCue, &perfectFlac, &matchCategories, &exceptCategories, &matchUploaders, &exceptUploaders, pq.Array(&f.MatchLanguage), pq.Array(&f.ExceptLanguage), &tags, &exceptTags, &tagsMatchLogic, &exceptTagsMatchLogic, pq.Array(&f.Origins), pq.Array(&f.ExceptOrigins), &extScriptEnabled, &extScriptCmd, &extScriptArgs, &extScriptStatus, &extWebhookEnabled, &extWebhookHost, &extWebhookData, &extWebhookStatus, &f.CreatedAt, &f.UpdatedAt); err != nil { + if err := rows.Scan(&f.ID, &f.Enabled, &f.Name, &minSize, &maxSize, &delay, &f.Priority, &maxDownloads, &maxDownloadsUnit, &matchReleases, &exceptReleases, &useRegex, &matchReleaseGroups, &exceptReleaseGroups, &matchReleaseTags, &exceptReleaseTags, &f.UseRegexReleaseTags, &matchDescription, &exceptDescription, &f.UseRegexDescription, &scene, &freeleech, &freeleechPercent, &f.SmartEpisode, &shows, &seasons, &episodes, pq.Array(&f.Resolutions), pq.Array(&f.Codecs), pq.Array(&f.Sources), pq.Array(&f.Containers), pq.Array(&f.MatchHDR), pq.Array(&f.ExceptHDR), pq.Array(&f.MatchOther), pq.Array(&f.ExceptOther), &years, &artists, &albums, pq.Array(&f.MatchReleaseTypes), pq.Array(&f.Formats), pq.Array(&f.Quality), pq.Array(&f.Media), &logScore, &hasLog, &hasCue, &perfectFlac, &matchCategories, &exceptCategories, &matchUploaders, &exceptUploaders, pq.Array(&f.MatchLanguage), pq.Array(&f.ExceptLanguage), &tags, &exceptTags, &tagsMatchLogic, &exceptTagsMatchLogic, pq.Array(&f.Origins), pq.Array(&f.ExceptOrigins), &extScriptEnabled, &extScriptCmd, &extScriptArgs, &extScriptStatus, &extWebhookEnabled, &extWebhookHost, &extWebhookData, &extWebhookStatus, &f.CreatedAt, &f.UpdatedAt); err != nil { return nil, errors.Wrap(err, "error scanning row") } @@ -425,6 +433,8 @@ func (r *FilterRepo) findByIndexerIdentifier(ctx context.Context, indexer string f.ExceptReleaseGroups = exceptReleaseGroups.String f.MatchReleaseTags = matchReleaseTags.String f.ExceptReleaseTags = exceptReleaseTags.String + f.MatchDescription = matchDescription.String + f.ExceptDescription = exceptDescription.String f.FreeleechPercent = freeleechPercent.String f.Shows = shows.String f.Seasons = seasons.String @@ -484,6 +494,9 @@ func (r *FilterRepo) Store(ctx context.Context, filter domain.Filter) (*domain.F "match_release_tags", "except_release_tags", "use_regex_release_tags", + "match_description", + "except_description", + "use_regex_description", "scene", "freeleech", "freeleech_percent", @@ -548,6 +561,9 @@ func (r *FilterRepo) Store(ctx context.Context, filter domain.Filter) (*domain.F filter.MatchReleaseTags, filter.ExceptReleaseTags, filter.UseRegexReleaseTags, + filter.MatchDescription, + filter.ExceptDescription, + filter.UseRegexDescription, filter.Scene, filter.Freeleech, filter.FreeleechPercent, @@ -631,6 +647,9 @@ func (r *FilterRepo) Update(ctx context.Context, filter domain.Filter) (*domain. Set("match_release_tags", filter.MatchReleaseTags). Set("except_release_tags", filter.ExceptReleaseTags). Set("use_regex_release_tags", filter.UseRegexReleaseTags). + Set("match_description", filter.MatchDescription). + Set("except_description", filter.ExceptDescription). + Set("use_regex_description", filter.UseRegexDescription). Set("scene", filter.Scene). Set("freeleech", filter.Freeleech). Set("freeleech_percent", filter.FreeleechPercent). @@ -746,6 +765,15 @@ func (r *FilterRepo) UpdatePartial(ctx context.Context, filter domain.FilterUpda if filter.UseRegexReleaseTags != nil { q = q.Set("use_regex_release_tags", filter.UseRegexReleaseTags) } + if filter.MatchDescription != nil { + q = q.Set("match_description", filter.MatchDescription) + } + if filter.ExceptDescription != nil { + q = q.Set("except_description", filter.ExceptDescription) + } + if filter.UseRegexDescription != nil { + q = q.Set("use_regex_description", filter.UseRegexDescription) + } if filter.Scene != nil { q = q.Set("scene", filter.Scene) } diff --git a/internal/database/postgres_migrate.go b/internal/database/postgres_migrate.go index 0240bc8..633dbb9 100644 --- a/internal/database/postgres_migrate.go +++ b/internal/database/postgres_migrate.go @@ -83,6 +83,9 @@ CREATE TABLE filter match_release_tags TEXT, except_release_tags TEXT, use_regex_release_tags BOOLEAN DEFAULT FALSE, + match_description TEXT, + except_description TEXT, + use_regex_description BOOLEAN DEFAULT FALSE, scene BOOLEAN, freeleech BOOLEAN, freeleech_percent TEXT, @@ -680,4 +683,12 @@ ADD COLUMN download_url TEXT; ADD COLUMN priority INTEGER DEFAULT 0;`, `ALTER TABLE notification ADD COLUMN topic text;`, + `ALTER TABLE filter + ADD COLUMN match_description TEXT; + + ALTER TABLE filter + ADD COLUMN except_description TEXT; + + ALTER TABLE filter + ADD COLUMN use_regex_description BOOLEAN DEFAULT FALSE;`, } diff --git a/internal/database/sqlite_migrate.go b/internal/database/sqlite_migrate.go index be4b1b0..1fee991 100644 --- a/internal/database/sqlite_migrate.go +++ b/internal/database/sqlite_migrate.go @@ -83,6 +83,9 @@ CREATE TABLE filter match_release_tags TEXT, except_release_tags TEXT, use_regex_release_tags BOOLEAN DEFAULT FALSE, + match_description TEXT, + except_description TEXT, + use_regex_description BOOLEAN DEFAULT FALSE, scene BOOLEAN, freeleech BOOLEAN, freeleech_percent TEXT, @@ -1073,4 +1076,12 @@ ADD COLUMN download_url TEXT; ADD COLUMN priority INTEGER DEFAULT 0;`, `ALTER TABLE notification ADD COLUMN topic text;`, + `ALTER TABLE filter + ADD COLUMN match_description TEXT; + + ALTER TABLE filter + ADD COLUMN except_description TEXT; + + ALTER TABLE filter + ADD COLUMN use_regex_description BOOLEAN DEFAULT FALSE;`, } diff --git a/internal/domain/filter.go b/internal/domain/filter.go index d3d2f46..51192e5 100644 --- a/internal/domain/filter.go +++ b/internal/domain/filter.go @@ -124,6 +124,9 @@ type Filter struct { MatchReleaseTags string `json:"match_release_tags,omitempty"` ExceptReleaseTags string `json:"except_release_tags,omitempty"` UseRegexReleaseTags bool `json:"use_regex_release_tags,omitempty"` + MatchDescription string `json:"match_description,omitempty"` + ExceptDescription string `json:"except_description,omitempty"` + UseRegexDescription bool `json:"use_regex_description,omitempty"` ExternalScriptEnabled bool `json:"external_script_enabled,omitempty"` ExternalScriptCmd string `json:"external_script_cmd,omitempty"` ExternalScriptArgs string `json:"external_script_args,omitempty"` @@ -156,6 +159,9 @@ type FilterUpdate struct { MatchReleaseTags *string `json:"match_release_tags,omitempty"` ExceptReleaseTags *string `json:"except_release_tags,omitempty"` UseRegexReleaseTags *bool `json:"use_regex_release_tags,omitempty"` + MatchDescription *string `json:"match_description,omitempty"` + ExceptDescription *string `json:"except_description,omitempty"` + UseRegexDescription *bool `json:"use_regex_description,omitempty"` Scene *bool `json:"scene,omitempty"` Origins *[]string `json:"origins,omitempty"` ExceptOrigins *[]string `json:"except_origins,omitempty"` @@ -440,6 +446,26 @@ func (f Filter) CheckFilter(r *Release) ([]string, bool) { r.addRejectionF("log score. got: %v want: %v", r.LogScore, f.LogScore) } + // check description string + if f.UseRegexDescription { + if f.MatchDescription != "" && !matchRegex(r.Description, f.MatchDescription) { + r.addRejectionF("match description regex not matching. got: %v want: %v", r.Description, f.MatchDescription) + } + + if f.ExceptDescription != "" && matchRegex(r.Description, f.ExceptDescription) { + r.addRejectionF("except description regex: unwanted release. got: %v want: %v", r.Description, f.ExceptDescription) + } + + } else { + if f.MatchDescription != "" && !containsFuzzy(r.Description, f.MatchDescription) { + r.addRejectionF("match description not matching. got: %v want: %v", r.Description, f.MatchDescription) + } + + if f.ExceptDescription != "" && containsFuzzy(r.Description, f.ExceptDescription) { + r.addRejectionF("except description: unwanted release. got: %v want: %v", r.Description, f.ExceptDescription) + } + } + if len(r.Rejections) > 0 { return r.Rejections, false } diff --git a/internal/domain/release.go b/internal/domain/release.go index 1f5b63b..912d141 100644 --- a/internal/domain/release.go +++ b/internal/domain/release.go @@ -58,6 +58,7 @@ type Release struct { TorrentName string `json:"torrent_name"` // full release name Size uint64 `json:"size"` Title string `json:"title"` // Parsed title + Description string `json:"-"` Category string `json:"category"` Categories []string `json:"categories,omitempty"` Season int `json:"season"` diff --git a/internal/feed/rss.go b/internal/feed/rss.go index f9e0ae4..37bdcf4 100644 --- a/internal/feed/rss.go +++ b/internal/feed/rss.go @@ -193,6 +193,10 @@ func (j *RSSJob) processItem(item *gofeed.Item) *domain.Release { rls.Bonus = []string{"Freeleech"} } + if item.Description != "" { + rls.Description = item.Description + } + // add cookie to release for download if needed if j.Feed.Cookie != "" { rls.RawCookie = j.Feed.Cookie diff --git a/internal/feed/rss_test.go b/internal/feed/rss_test.go index e408f24..76ebf1d 100644 --- a/internal/feed/rss_test.go +++ b/internal/feed/rss_test.go @@ -67,7 +67,7 @@ func TestRSSJob_processItem(t *testing.T) { Link: "/details.php?id=00000&hit=1", GUID: "Some.Release.Title.2022.09.22.720p.WEB.h264-GROUP", }}, - want: &domain.Release{ID: 0, FilterStatus: "PENDING", Rejections: []string{}, Indexer: "mock-feed", FilterName: "", Protocol: "torrent", Implementation: "RSS", Timestamp: now, GroupID: "", TorrentID: "", TorrentURL: "https://fake-feed.com/details.php?id=00000&hit=1", TorrentTmpFile: "", TorrentDataRawBytes: []uint8(nil), TorrentHash: "", TorrentName: "Some.Release.Title.2022.09.22.720p.WEB.h264-GROUP", Size: 0x0, Title: "Some Release Title", Category: "", Season: 0, Episode: 0, Year: 2022, Resolution: "720p", Source: "WEB", Codec: []string{"H.264"}, Container: "", HDR: []string(nil), Audio: []string(nil), AudioChannels: "", Group: "GROUP", Region: "", Language: nil, Proper: false, Repack: false, Website: "", Artists: "", Type: "", LogScore: 0, Origin: "", Tags: []string{}, ReleaseTags: "", Freeleech: false, FreeleechPercent: 0, Bonus: []string(nil), Uploader: "", PreTime: "", Other: []string(nil), RawCookie: "", AdditionalSizeCheckRequired: false, FilterID: 0, Filter: (*domain.Filter)(nil), ActionStatus: []domain.ReleaseActionStatus(nil)}, + want: &domain.Release{ID: 0, FilterStatus: "PENDING", Rejections: []string{}, Indexer: "mock-feed", FilterName: "", Protocol: "torrent", Implementation: "RSS", Timestamp: now, GroupID: "", TorrentID: "", TorrentURL: "https://fake-feed.com/details.php?id=00000&hit=1", TorrentTmpFile: "", TorrentDataRawBytes: []uint8(nil), TorrentHash: "", TorrentName: "Some.Release.Title.2022.09.22.720p.WEB.h264-GROUP", Size: 0x0, Title: "Some Release Title", Description: "Category: Example\n Size: 1.49 GB\n Status: 27 seeders and 1 leechers\n Speed: 772.16 kB/s\n Added: 2022-09-29 16:06:08\n", Category: "", Season: 0, Episode: 0, Year: 2022, Resolution: "720p", Source: "WEB", Codec: []string{"H.264"}, Container: "", HDR: []string(nil), Audio: []string(nil), AudioChannels: "", Group: "GROUP", Region: "", Language: nil, Proper: false, Repack: false, Website: "", Artists: "", Type: "", LogScore: 0, Origin: "", Tags: []string{}, ReleaseTags: "", Freeleech: false, FreeleechPercent: 0, Bonus: []string(nil), Uploader: "", PreTime: "", Other: []string(nil), RawCookie: "", AdditionalSizeCheckRequired: false, FilterID: 0, Filter: (*domain.Filter)(nil), ActionStatus: []domain.ReleaseActionStatus(nil)}, }, { name: "with_baseurl", @@ -96,7 +96,7 @@ func TestRSSJob_processItem(t *testing.T) { Link: "https://fake-feed.com/details.php?id=00000&hit=1", GUID: "Some.Release.Title.2022.09.22.720p.WEB.h264-GROUP", }}, - want: &domain.Release{ID: 0, FilterStatus: "PENDING", Rejections: []string{}, Indexer: "mock-feed", FilterName: "", Protocol: "torrent", Implementation: "RSS", Timestamp: now, GroupID: "", TorrentID: "", TorrentURL: "https://fake-feed.com/details.php?id=00000&hit=1", TorrentTmpFile: "", TorrentDataRawBytes: []uint8(nil), TorrentHash: "", TorrentName: "Some.Release.Title.2022.09.22.720p.WEB.h264-GROUP", Size: 0x0, Title: "Some Release Title", Category: "", Season: 0, Episode: 0, Year: 2022, Resolution: "720p", Source: "WEB", Codec: []string{"H.264"}, Container: "", HDR: []string(nil), Audio: []string(nil), AudioChannels: "", Group: "GROUP", Region: "", Language: nil, Proper: false, Repack: false, Website: "", Artists: "", Type: "", LogScore: 0, Origin: "", Tags: []string{}, ReleaseTags: "", Freeleech: false, FreeleechPercent: 0, Bonus: []string(nil), Uploader: "", PreTime: "", Other: []string(nil), RawCookie: "", AdditionalSizeCheckRequired: false, FilterID: 0, Filter: (*domain.Filter)(nil), ActionStatus: []domain.ReleaseActionStatus(nil)}, + want: &domain.Release{ID: 0, FilterStatus: "PENDING", Rejections: []string{}, Indexer: "mock-feed", FilterName: "", Protocol: "torrent", Implementation: "RSS", Timestamp: now, GroupID: "", TorrentID: "", TorrentURL: "https://fake-feed.com/details.php?id=00000&hit=1", TorrentTmpFile: "", TorrentDataRawBytes: []uint8(nil), TorrentHash: "", TorrentName: "Some.Release.Title.2022.09.22.720p.WEB.h264-GROUP", Size: 0x0, Title: "Some Release Title", Description: "Category: Example\n Size: 1.49 GB\n Status: 27 seeders and 1 leechers\n Speed: 772.16 kB/s\n Added: 2022-09-29 16:06:08\n", Category: "", Season: 0, Episode: 0, Year: 2022, Resolution: "720p", Source: "WEB", Codec: []string{"H.264"}, Container: "", HDR: []string(nil), Audio: []string(nil), AudioChannels: "", Group: "GROUP", Region: "", Language: nil, Proper: false, Repack: false, Website: "", Artists: "", Type: "", LogScore: 0, Origin: "", Tags: []string{}, ReleaseTags: "", Freeleech: false, FreeleechPercent: 0, Bonus: []string(nil), Uploader: "", PreTime: "", Other: []string(nil), RawCookie: "", AdditionalSizeCheckRequired: false, FilterID: 0, Filter: (*domain.Filter)(nil), ActionStatus: []domain.ReleaseActionStatus(nil)}, }, { name: "time_parse", @@ -126,7 +126,7 @@ func TestRSSJob_processItem(t *testing.T) { GUID: "Some.Release.Title.2022.09.22.720p.WEB.h264-GROUP", //PublishedParsed: &nowMinusTime, }}, - want: &domain.Release{ID: 0, FilterStatus: "PENDING", Rejections: []string{}, Indexer: "mock-feed", FilterName: "", Protocol: "torrent", Implementation: "RSS", Timestamp: now, GroupID: "", TorrentID: "", TorrentURL: "https://fake-feed.com/details.php?id=00000&hit=1", TorrentTmpFile: "", TorrentDataRawBytes: []uint8(nil), TorrentHash: "", TorrentName: "Some.Release.Title.2022.09.22.720p.WEB.h264-GROUP", Size: 0x0, Title: "Some Release Title", Category: "", Season: 0, Episode: 0, Year: 2022, Resolution: "720p", Source: "WEB", Codec: []string{"H.264"}, Container: "", HDR: []string(nil), Audio: []string(nil), AudioChannels: "", Group: "GROUP", Region: "", Language: nil, Proper: false, Repack: false, Website: "", Artists: "", Type: "", LogScore: 0, Origin: "", Tags: []string{}, ReleaseTags: "", Freeleech: false, FreeleechPercent: 0, Bonus: []string(nil), Uploader: "", PreTime: "", Other: []string(nil), RawCookie: "", AdditionalSizeCheckRequired: false, FilterID: 0, Filter: (*domain.Filter)(nil), ActionStatus: []domain.ReleaseActionStatus(nil)}, + want: &domain.Release{ID: 0, FilterStatus: "PENDING", Rejections: []string{}, Indexer: "mock-feed", FilterName: "", Protocol: "torrent", Implementation: "RSS", Timestamp: now, GroupID: "", TorrentID: "", TorrentURL: "https://fake-feed.com/details.php?id=00000&hit=1", TorrentTmpFile: "", TorrentDataRawBytes: []uint8(nil), TorrentHash: "", TorrentName: "Some.Release.Title.2022.09.22.720p.WEB.h264-GROUP", Size: 0x0, Title: "Some Release Title", Description: "Category: Example\n Size: 1.49 GB\n Status: 27 seeders and 1 leechers\n Speed: 772.16 kB/s\n Added: 2022-09-29 16:06:08\n", Category: "", Season: 0, Episode: 0, Year: 2022, Resolution: "720p", Source: "WEB", Codec: []string{"H.264"}, Container: "", HDR: []string(nil), Audio: []string(nil), AudioChannels: "", Group: "GROUP", Region: "", Language: nil, Proper: false, Repack: false, Website: "", Artists: "", Type: "", LogScore: 0, Origin: "", Tags: []string{}, ReleaseTags: "", Freeleech: false, FreeleechPercent: 0, Bonus: []string(nil), Uploader: "", PreTime: "", Other: []string(nil), RawCookie: "", AdditionalSizeCheckRequired: false, FilterID: 0, Filter: (*domain.Filter)(nil), ActionStatus: []domain.ReleaseActionStatus(nil)}, }, { name: "time_parse", diff --git a/web/src/screens/filters/details.tsx b/web/src/screens/filters/details.tsx index ea584e6..547f771 100644 --- a/web/src/screens/filters/details.tsx +++ b/web/src/screens/filters/details.tsx @@ -352,6 +352,9 @@ export default function FilterDetails() { match_release_tags: filter.match_release_tags, except_release_tags: filter.except_release_tags, use_regex_release_tags: filter.use_regex_release_tags, + match_description: filter.match_description, + except_description: filter.except_description, + use_regex_description: filter.use_regex_description, match_categories: filter.match_categories, except_categories: filter.except_categories, tags: filter.tags, @@ -638,6 +641,17 @@ export function Advanced({ values }: AdvancedProps) { + + {/*
*/} +

This field has full regex support (Golang flavour).

https://autobrr.com/filters#advanced

Remember to tick Use Regex below if using more than * and ?.

} /> +

This field has full regex support (Golang flavour).

https://autobrr.com/filters#advanced

Remember to tick Use Regex below if using more than * and ?.

} /> + {/**/} + +
+ +
+
+

Freeleech may be announced as a binary true/false value or as a percentage, depending on the indexer. Use either or both, depending on the indexers you use.


See who uses what in the documentation: https://autobrr.com/filters/freeleech

} /> diff --git a/web/src/types/Filter.d.ts b/web/src/types/Filter.d.ts index 84b6c6b..1a1ce08 100644 --- a/web/src/types/Filter.d.ts +++ b/web/src/types/Filter.d.ts @@ -23,6 +23,9 @@ interface Filter { match_release_tags: string; except_release_tags: string; use_regex_release_tags: boolean; + match_description: string; + except_description: string; + use_regex_description: boolean; scene: boolean; origins: string[]; except_origins: string[];