Preferred Words and Manual Imports

Sonarr version (exact version): 3.0.1.482
Mono version (if Sonarr is not running on Windows): 5.18.1.0
OS: Ubuntu 18.04

Description of issue:

From my short bit of testing, it looks like the preferred words scoring for checking if a new download is an upgrade to an existing one uses EpisodeFiles.SceneName field. This seems problematic as manual imports do not seem to have a SceneName, so any manual imports will be constantly overwritten by any download with a preferred word score higher than 0.

Issue seems to be happening to me right now, as I have an automated process that adds new acquisitions to a queue to be transcoded, and then reimports them into Sonarr to overwrite the original. The new import loses its SceneName and then gets overwritten again by anything with a preferred word score. I have managed to prevent this issue on a single episode by manually editing the .db to add a scene name that would obtain a high pref score, and it no longer sees all download files as upgrades.

Can provide logs and better steps later if needed, I’m writing this on my phone right now as I was quickly testing on my lunch break.

How are you manually importing the file? Manual Import from Activity: Queue? Manual Import from Wanted: Missing or dropping the file in the series folder and rescanning?

The SceneName field is used to accurately calculate the score when comparing to a new release, which will account for any changes to preferred word scoring made since the file was imported.

If there isn’t a scene name it’s tricky because I can see some people wanting it to upgrade and others for it to not.

I was originally doing drop and rescan but I did do one attempt from Wanted>Manual Import that had the same issue.

Is there a way to format the filename so that it will be filled in as scene when rescanned/reimported?

I noticed that if I ended the new file name with “-Recode” it the DB marked the scene group as Recode so it looks like it is doing some sort of parsing on the imported files.

Edit:
I’ll provide more details in few hours when I get home. Another oddity was that after I changed the DB file directly, manual search still showed files as being upgrades to my file, then I did a rescan, manually searched again, and it was fixed. I need to look into that scenario more but ran out of time on my break. Not sure if it was just because I edited the DB file with Sonar still running or not.

Edit2:
Would it perhaps be easier for me in the short term to just write a postprocessing script to run on import that will hit the episodefile API and have it updated the scenename to my import filename (all my preferred words are in my file names). Haven’t played around with postprocessing scripts before, there is a way to run one on manual import/drop and rescan correct?

The logic for determining if a file is a scene name is here: https://github.com/Sonarr/Sonarr/blob/phantom-develop/src/NzbDrone.Core/Parser/SceneChecker.cs

Sonarr must be able to parse it and it relies on there being periods in the filename and no spaces (So typical Series.Title.S01E01.720p.HDTV.x264-ReleaseGroup style naming.

The source file name will be the most important information, but if the scene name isn’t known it will use the current file name (useful if you include preferred words in the file name).

You can’t update the scene name through the API.

Thanks for the starting point. ill browse the source deeper when I get a chance.

So are all manual imports ignored for word score? or just ones that don’t parse out to be scene?

Could see that being annoying since I tend to use manual imports for older series where I get it all in one torrents instead of individual episodes / seasons.

For a manual import nothing really matters, you can forcibly ignore any rejection. To the underlying import the determination of the scene name is the same regardless of the source.

Right but I mean after I do a manual import, it’ll continue looking for upgrades, and my manually imported file will always have a pref score of 0 if it’s not named according to scene, correct?

or does pref score comparing check against a different field if scene name is empty?

Quoting myself from above, scene name then filename if scene name isn’t available.

Doh! ok must have overlooked that. I think I know what my issue is then! the pref score is going down after the new file is imported and renamed… so it is then seeing upgrades.

Essentially, original file is +15, the transcoded file is still +15, but once sonarr renames it to my naming schema, it’s going down to +10 because a pref word is lost in rename. Should be fixable on my end easily enough. Thanks for the quick replies. Will test tonight and reaffirm that fixes it.

Edit:
Confirmed this to be working, had a +5 for x264 content, but was transcoding to x265, so it was losing that score. Added a new custom preferred word (since i dont want x265 as one) to the transcoded file name that will carry over during import to make up for the difference and everything’s working as intended now.

1 Like

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