mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feat(indexers): improve RED and OPS artist parsing (#629)
* feat(indexers): improve RED and OPS artist parsing * feat(indexers): deprecate lidarr red ops workaround * feat(indexers): change artist and album field check * seperator before tags and tags optional for red * fix: update rejection msg Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
This commit is contained in:
parent
12d05f0748
commit
08826db036
4 changed files with 6 additions and 13 deletions
|
@ -2,7 +2,6 @@ package action
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/autobrr/autobrr/internal/domain"
|
"github.com/autobrr/autobrr/internal/domain"
|
||||||
|
@ -53,12 +52,6 @@ func (s *service) lidarr(ctx context.Context, action *domain.Action, release dom
|
||||||
PublishDate: time.Now().Format(time.RFC3339),
|
PublishDate: time.Now().Format(time.RFC3339),
|
||||||
}
|
}
|
||||||
|
|
||||||
// special handling for RED and OPS because their torrent names contain to little info
|
|
||||||
// "Artist - Album" is not enough for Lidarr to make a decision. It needs year like "Artist - Album 2022"
|
|
||||||
if release.Indexer == "redacted" || release.Indexer == "ops" {
|
|
||||||
r.Title = fmt.Sprintf("%v (%d)", release.TorrentName, release.Year)
|
|
||||||
}
|
|
||||||
|
|
||||||
rejections, err := arr.Push(ctx, r)
|
rejections, err := arr.Push(ctx, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.log.Error().Err(err).Msgf("lidarr: failed to push release: %v", r)
|
s.log.Error().Err(err).Msgf("lidarr: failed to push release: %v", r)
|
||||||
|
|
|
@ -375,12 +375,12 @@ func (f Filter) CheckFilter(r *Release) ([]string, bool) {
|
||||||
r.addRejectionF("tags unwanted. got: %v want: %v", r.Tags, f.ExceptTags)
|
r.addRejectionF("tags unwanted. got: %v want: %v", r.Tags, f.ExceptTags)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(f.Artists) > 0 && !containsFuzzy(r.TorrentName, f.Artists) {
|
if len(f.Artists) > 0 && !contains(r.Artists, f.Artists) {
|
||||||
r.addRejectionF("artists not matching. got: %v want: %v", r.TorrentName, f.Artists)
|
r.addRejectionF("artists not matching. got: %v want: %v", r.Artists, f.Artists)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(f.Albums) > 0 && !containsFuzzy(r.TorrentName, f.Albums) {
|
if len(f.Albums) > 0 && !contains(r.Title, f.Albums) {
|
||||||
r.addRejectionF("albums not matching. got: %v want: %v", r.TorrentName, f.Albums)
|
r.addRejectionF("albums not matching. got: %v want: %v", r.Title, f.Albums)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perfect flac requires Cue, Log, Log Score 100, FLAC and 24bit Lossless
|
// Perfect flac requires Cue, Log, Log Score 100, FLAC and 24bit Lossless
|
||||||
|
|
|
@ -61,7 +61,7 @@ irc:
|
||||||
- "TORRENT: That Artist - Albuum [2002] [Single] - FLAC / Lossless / WEB - 2000s,house,uk.garage,garage.house - https://orpheus.network/torrents.php?id=000000 / https://orpheus.network/torrents.php?action=download&id=0000000"
|
- "TORRENT: That Artist - Albuum [2002] [Single] - FLAC / Lossless / WEB - 2000s,house,uk.garage,garage.house - https://orpheus.network/torrents.php?id=000000 / https://orpheus.network/torrents.php?action=download&id=0000000"
|
||||||
- "TORRENT: Something [2021] [Album] - FLAC / Lossless / CD - - https://orpheus.network/torrents.php?id=000000 / https://orpheus.network/torrents.php?action=download&id=0000000"
|
- "TORRENT: Something [2021] [Album] - FLAC / Lossless / CD - - https://orpheus.network/torrents.php?id=000000 / https://orpheus.network/torrents.php?action=download&id=0000000"
|
||||||
- "TORRENT: Artist 1 & Artist 2 - Best album (subtitle) [2004] [Album] - FLAC / Lossless / Log (100%) / Cue / CD - experimental,ambient,downtempo - https://orpheus.network/torrents.php?id=000000 / https://orpheus.network/torrents.php?action=download&id=0000000"
|
- "TORRENT: Artist 1 & Artist 2 - Best album (subtitle) [2004] [Album] - FLAC / Lossless / Log (100%) / Cue / CD - experimental,ambient,downtempo - https://orpheus.network/torrents.php?id=000000 / https://orpheus.network/torrents.php?action=download&id=0000000"
|
||||||
pattern: 'TORRENT: (.*) \[(.+?)\] \[(.+?)\] - (.*) - \s*(.*) - https?:\/\/.* \/ (https?:\/\/.+\/).+id=(\d+)'
|
pattern: 'TORRENT: (.* \[(.*?)\] \[(.*?)\] - (.*)) - \s*(.*) - https?:\/\/.* \/ (https?:\/\/.*\/).*id=(\d+)'
|
||||||
vars:
|
vars:
|
||||||
- torrentName
|
- torrentName
|
||||||
- year
|
- year
|
||||||
|
|
|
@ -85,7 +85,7 @@ irc:
|
||||||
- test:
|
- test:
|
||||||
- "Artist - Albumname [2008] [Single] - FLAC / Lossless / Log / 100% / Cue / CD - https://redacted.ch/torrents.php?id=0000000 / https://redacted.ch/torrents.php?action=download&id=0000000 - hip.hop,rhythm.and.blues,2000s"
|
- "Artist - Albumname [2008] [Single] - FLAC / Lossless / Log / 100% / Cue / CD - https://redacted.ch/torrents.php?id=0000000 / https://redacted.ch/torrents.php?action=download&id=0000000 - hip.hop,rhythm.and.blues,2000s"
|
||||||
- "A really long name here - Concertos 5 and 6, Suite No 2 [1991] [Album] - FLAC / Lossless / Log / 100% / Cue / CD - https://redacted.ch/torrents.php?id=0000000 / https://redacted.ch/torrents.php?action=download&id=0000000 - classical"
|
- "A really long name here - Concertos 5 and 6, Suite No 2 [1991] [Album] - FLAC / Lossless / Log / 100% / Cue / CD - https://redacted.ch/torrents.php?id=0000000 / https://redacted.ch/torrents.php?action=download&id=0000000 - classical"
|
||||||
pattern: '(.*) (?:\[(.*)\] \[(.*)\] - (.*))? .* \/ (https?\:\/\/.+\/).+id=(\d+) - (.+)'
|
pattern: '(.* (?:\[(.*)\] \[(.*)\] - (.*))?) - .* \/ (https?\:\/\/.+\/).+id=(\d+)[ -]*(.*)'
|
||||||
vars:
|
vars:
|
||||||
- torrentName
|
- torrentName
|
||||||
- year
|
- year
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue