Triggering files rescan

Hello,
I’ve been a long time user of sonarr.
I run it on a unraid server trough a docker container.
Today i finally upgraded to v3. Thank you for that; it all went smooth.
As my library is growing i’m in the process of reencoding all my video files to hevc.
I let unmanic library optimizer do this. I guess it will end up in about 2 or 3 months.
Unmanic reencode the file and replace the original. The reencoded file has the same filename; and it’s ok for me as it’s used for subs downloading.
I’d like to be able to trigger a files rescan in sonarr to update media info.
Is this something that could be easily doable ?

Not currently, there’s a little discussion about it here: https://github.com/Sonarr/Sonarr/issues/3366
Also somewhere on the forum someone also asked, and it boils down to removing the series (not deleting the files) and adding again, this will trigger mediainfo scanning.

I’ve been playing with the idea to let the encoder rename the file to something sonarr can parse, but is still different from the original filename. E.g. series.title.quality-ENCODED.mkv, where “-ENCODED” is the additional part and the rest is the filename as sonarr originally named it.
Then do an api call to sonarr to rescan the series (not sure if you can request to scan more granular), so it can “see” the original was deleted and there’s a new file in place.
Then another api call to sonarr, to rename the “new” files to the correct formatted name again.
Not super optimal, but I guess it can be done.

I haven’t tested this yet, I would assume sonarr can parse a filename like that and thinks “ENCODED” is the release group. I don’t really care about preserving the original information so I’m cool with that.

Sonarr won’t rescan a file if the name has not changed. You can use the API specifically the rescanSeries command to tell Sonarr to rescan a folder (similar to Refresh and Rescan in the UI, but skips the information refresh from TheTVDB).

As long as your filename contains season/episode, date or absolute episode number that matches TheTVDB you should be fine (and likely ENCODED would become the release group).

I’m confused. If i find a way to use the api, it will rescan the files even if the filename has not changed ? If so it’s not similar to refresh and scan.
For now when i manually click on refresh&scan it doesn’t rescan video files for size or codec.

I meant that to be a separate thought on how to tell programatically Sonarr to rescan if the filename had changed. If the filename has not changed Sonarr will not reprocess it regardless of how you tell it to rescan.

ok i get that.
So i have to have filenames changed.
It doesn’t suit me as i have subs which need to be renammed too and more important for some files i don’t have subs yet and sub search and match is quite often based on filename.
I think it would not be a problem for plex as the seen/not seen status is not based on the filename.

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