Skip to content

Commit

Permalink
feat(plaintext): add option to use Album & MatchRelease (#50)
Browse files Browse the repository at this point in the history
* option to use Album & MatchRelease for plaintext

* update README
  • Loading branch information
s0up4200 authored May 1, 2023
1 parent fe135bd commit b1d632a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,19 @@ Readarr will only use the `Match releases` field for now, so setting `matchRelea

You can drop alternate show titles from being added by setting `excludeAlternateTitles: true` for Sonarr in your config.

## Plaintext lists specific options

Plaintext lists can be anything, therefore you can optionally set `matchRelease: true` or `album: true` to use these fields in your autobrr filter. If not set, it will use the `Movies / Shows` field.

```yaml
lists:
- name: Personal list
type: plaintext
url: https://gist.githubusercontent.com/autobrr/somegist/raw
filters:
- 27 # change me
```

## Commands

Available commands.
Expand Down
1 change: 1 addition & 0 deletions internal/domain/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type ListConfig struct {
BasicAuth *BasicAuth `koanf:"basicAuth"`
Filters []int `koanf:"filters"`
MatchRelease bool `koanf:"matchRelease"`
Album bool `koanf:"album"`
Headers map[string]string `koanf:"headers"`
}

Expand Down
8 changes: 7 additions & 1 deletion internal/processor/plaintext.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ func (s Service) plaintext(ctx context.Context, cfg *domain.ListConfig, dryRun b
return nil
}

f := autobrr.UpdateFilter{Shows: strings.Join(filterTitles, ",")}
f := autobrr.UpdateFilter{Shows: joinedTitles}

if cfg.Album {
f = autobrr.UpdateFilter{Albums: joinedTitles}
} else if cfg.MatchRelease {
f = autobrr.UpdateFilter{MatchReleases: joinedTitles}
}

if !dryRun {
if err := brr.UpdateFilterByID(ctx, filterID, f); err != nil {
Expand Down

0 comments on commit b1d632a

Please sign in to comment.