mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(filters): OPS and RED split Artist and Album (#1398)
* fix(filters): OPS and RED parse and match Artist and Album * fix(filters): rls raw
This commit is contained in:
parent
1a23b69bcf
commit
51a7f71372
4 changed files with 21 additions and 7 deletions
|
@ -341,7 +341,7 @@ func TestIRCParserOrpheus_Parse(t *testing.T) {
|
|||
},
|
||||
},
|
||||
want: want{
|
||||
title: "Busta Rhymes - BEACH BALL (feat. BIA)",
|
||||
title: "BEACH BALL",
|
||||
release: "Busta Rhymes - BEACH BALL (feat. BIA) [2023] (WEB FLAC 24BIT Lossless)",
|
||||
},
|
||||
},
|
||||
|
@ -357,7 +357,7 @@ func TestIRCParserOrpheus_Parse(t *testing.T) {
|
|||
},
|
||||
},
|
||||
want: want{
|
||||
title: "Busta Rhymes - BEACH BALL (feat. BIA)",
|
||||
title: "BEACH BALL",
|
||||
release: "Busta Rhymes - BEACH BALL (feat. BIA) [2023] (CD FLAC Lossless)",
|
||||
},
|
||||
},
|
||||
|
|
|
@ -218,17 +218,20 @@ func (p IRCParserOrpheus) Parse(rls *Release, vars map[string]string) error {
|
|||
rls.Bitrate = tags.AudioBitrate
|
||||
rls.AudioFormat = tags.AudioFormat
|
||||
|
||||
// set log score
|
||||
// set log score even if it's not announced today
|
||||
rls.HasLog = tags.HasLog
|
||||
rls.LogScore = tags.LogScore
|
||||
rls.HasCue = tags.HasCue
|
||||
|
||||
// Construct new release name so we have full control. We remove category such as EP/Single/Album because EP is being mis-parsed.
|
||||
//torrentName = fmt.Sprintf("%s [%s] (%s)", title, year, strings.Join(audio, " "))
|
||||
torrentName = fmt.Sprintf("%s [%s] (%s)", title, year, strings.Join(audio, " "))
|
||||
|
||||
rls.ParseString(torrentName)
|
||||
rls.Title = title
|
||||
|
||||
// use parsed values from raw rls.Release struct
|
||||
raw := rls.Raw(torrentName)
|
||||
rls.Artists = raw.Artist
|
||||
rls.Title = raw.Title
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -267,7 +270,11 @@ func (p IRCParserRedacted) Parse(rls *Release, vars map[string]string) error {
|
|||
name := fmt.Sprintf("%s [%s] (%s)", title, year, strings.Join(audio, " "))
|
||||
|
||||
rls.ParseString(name)
|
||||
rls.Title = title
|
||||
|
||||
// use parsed values from raw rls.Release struct
|
||||
raw := rls.Raw(name)
|
||||
rls.Artists = raw.Artist
|
||||
rls.Title = raw.Title
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -105,6 +105,10 @@ type Release struct {
|
|||
ActionStatus []ReleaseActionStatus `json:"action_status"`
|
||||
}
|
||||
|
||||
func (r *Release) Raw(s string) rls.Release {
|
||||
return rls.ParseString(s)
|
||||
}
|
||||
|
||||
type ReleaseActionStatus struct {
|
||||
ID int64 `json:"id"`
|
||||
Status ReleasePushStatus `json:"status"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue