Preferred words adding all choices to file name; ignoring matches/no-matches

Sonarr version (exact version): 3.0.1.384
Mono version (if Sonarr is not running on Windows): 5.18.0.240
OS: Ubuntu 18
Description of issue:

This may be related to the latest update, but Sonarr is now adding all the preferred words into the file name.


Naming format:
{Series.CleanTitle}.S{season:00}E{episode:00}.{QUALITY.REAL}.{QUALITY.PROPER}.{Preferred.Words}.{Quality.Title}.{MediaInfo.VideoCodec}-{Release Group}

Preferred words:


source:
Talking.Dead.S08E12.Talking.Dead.on.Guardians.720p.HDTV.x264-CRiMSON

destination: Talking.Dead.S08E12.amzn.amazon.nf.netflix.ip.sky.hbo.cbs.stz.syfy.mtv.brav.hulu.ifc.tlc.vh1.anpl.crkl.vice.pbs.dcu.dsny.trvl.epix.amc.it.nlsub.720p.HDTV.x264-CRiMSON.mkv

expected:
Talking.Dead.S08E12.720p.HDTV.x264-CRiMSON.mkv since there was no match.

if there was a match, would expect:
Talking.Dead.S08E12.AMZN.720p.HDTV.x264-CRiMSON.mkv

Found the issue, it’ll be fixed in the next build.

Thanks! It looks like that problem is solved!

Just one minor issue left: the {Preferred Words} tag is now in all-lowercase. That was not the behavior before. In this instance, both the matched preferred word in the original filename, and the specified preferred word, were in caps (eg AMZN).

Preferred word:
AMZN

Source:
The.Middle.S08E23.1080p.AMZN.WEB-DL.DD5.1.H.264-TrollHD

Destination:
The.Middle.S08E23.amzn.1080p.WEB.h264-TrollHD.mkv

Expected:
The.Middle.S08E23.AMZN.1080p.WEB.h264-TrollHD.mkv

Also, somewhat related: I tested out the regex preferred word feature, and though it’s not sending the actual regex anymore, it is not sending the specified group only…

Naming format:
{Series.CleanTitle}.S{season:00}E{episode:00}.{QUALITY.REAL}.{QUALITY.PROPER}.{Preferred.Words}.{Quality.Title}.{MediaInfo.VideoCodec}-{Release Group}

Preferred word:
/\b(Amazon)\.?WEB\-DL\b/i

Source:
The.Middle.S08E20.1080p.Amazon.WEB-DL.DD.5.1.H.264-TrollHD

Destination:
The.Middle.S08E20.Amazon.WEB-DL.1080p.WEB.h264-TrollHD.mkv

Expected:
The.Middle.S08E20.Amazon.1080p.WEB.h264-TrollHD.mkv

* Looks like here the original letter case is being “honored”.

Ahh, we’re storing it as lower case for matching purposes, easy enough to fix.

It returns the entire matching string, you’ll need to match the suffix, but exclude it, \b(Amazon)(?=\.?WEB\-DL\b) will do that (this is the same way that Regex.Replace in most cases).

Awesome!

Tried both /\b(Amazon)(?=\.?WEB\-DL\b)/i and /\b(Amazon)(?=\.?WEB\-DL)\b/i and rename preview shows this:

- Season 08/The.Middle.S08E20.AMAZON.WEB-DL.1080p.WEB.h264-TrollHD.mkv
+ Season 08/The.Middle.S08E20.Amazon.amazon.1080p.WEB.h264-TrollHD.mkv

* although both regex terms look ok on regex101.com :stuck_out_tongue:

That much be matching something else, just that regex + that file name doesn’t double up amazon for me.

Yup! You were right! Forgot about a non regex preferred word with the same name, :man_facepalming:

So it looks like that is working…

- Season 08/The.Middle.S08E20.AMAZON.WEB-DL.1080p.WEB.h264-TrollHD.mkv
+ Season 08/The.Middle.S08E20.Amazon.1080p.WEB.h264-TrollHD.mkv

Thank you!

I guess the all lower case should have clued us in :grimacing:

Should be an update tonight/tomorrow with that fix for you, thanks for reporting these issues!

Yeah… :sweat_smile:

Awesome! Thank You, again!

Ok need help with regex again.

Source:
The.Purge.S01E08.PROPER.The.Giving.Time.Is.Here.1080p.AMZN.WEB-DL.DDP5.1.H.264-KiNGS.mkv

How can I extract just PROPER AMZN ?

TIA!

That’ll be tough because you can’t have an exclusion that accepts anything. Probably better to use one to score it and another to add the matching preferred words in.

Good idea! Thanks!

Hey Markus, any ETA on this? :grimacing: :pray:

This was fixed a couple days ago, 3.0.1.388+ should have it.

image

Duh! I thought it was just the “all words being added” issue fixed not the case one… and didnt test it out to see. But upgraded now and it’s working beautifully. Thank you !!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.