fix: lidarr add more info to push (#133)

This commit is contained in:
Ludvig Lundgren 2022-02-09 21:38:45 +01:00 committed by GitHub
parent bcc9fad509
commit 6d68a5c3b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@ package action
import ( import (
"context" "context"
"fmt"
"time" "time"
"github.com/autobrr/autobrr/internal/domain" "github.com/autobrr/autobrr/internal/domain"
@ -52,6 +53,12 @@ func (s *service) lidarr(release domain.Release, action domain.Action) ([]string
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(r) rejections, err := arr.Push(r)
if err != nil { if err != nil {
log.Error().Stack().Err(err).Msgf("lidarr: failed to push release: %v", r) log.Error().Stack().Err(err).Msgf("lidarr: failed to push release: %v", r)