TheCaptain989 / radarr-striptracks

A Docker Mod to Radarr/Sonarr to automatically strip out unwanted audio and subtitle tracks
https://hub.docker.com/r/thecaptain989/radarr-striptracks
GNU General Public License v3.0
20 stars 1 forks source link

Filename format renaming #50

Closed volschin closed 11 months ago

volschin commented 11 months ago

Having Renaming of the files enabled often there is changing something and a new rename needs to be done after striptracks. It would be cool, if at the end of processing the rename function of sonarr or radarr could be called.

TheCaptain989 commented 11 months ago

Could you give an example of the issue? I'm not sure I understand.

volschin commented 11 months ago

This is my standard movie format from media management of radarr {Movie CleanTitle} {(Release Year)} [imdbid-{ImdbId}] - {Edition Tags }{[Custom Formats]}{[Quality Full]}{[MediaInfo 3D]}{[MediaInfo VideoDynamicRangeType]}{[Mediainfo AudioCodec}{ Mediainfo AudioChannels}]{MediaInfo AudioLanguages}[{Mediainfo VideoCodec}]{-Release Group}

If I now remove unwanted Audio languages the information will often change. At the moment it will remain with the information before running striptracks, but it would be better it would be updated.

TheCaptain989 commented 11 months ago

Okay, I see. Let me think on that and do some experimenting.

volschin commented 11 months ago

Not sure if it is the right one, but the radarr API has a rename call [https://radarr.video/docs/api/#/RenameMovie/get_api_v3_rename]rename

TheCaptain989 commented 11 months ago

I figured out how to do this and testing has gone well. I'll probably push a development build with this feature in the next few days.

TheCaptain989 commented 11 months ago

I've run into a roadblock. I was trying to be fancy and get rid of the Rescan that my script calls at the end of the remux and use the native ManualImport API to load the new movie file directly into Radarr. This has a lot of benefits because it is both faster and allowed me to clean up a lot of complex if/then trees and confusing logic in my code design. This would necessarily have to happen before the rename API call (e.g. Radarr has to know about the movie first).

An issue arises with this method, though, because Radarr is apparently locked at one import job at a time. Because my script is already running as part of an import job, if it creates another job, that just goes into a queue and doesn't start executing until my script ends. My script can't end before it calls the rename API, and that can't be called until the import finishes. Grrrrrr.

I think I may be stuck with my original Rescan call. Oh, well. Back to to the drawing board.
volschin commented 11 months ago

Wow, hadn‘t thought this is that complex.

TheCaptain989 commented 11 months ago

Wow, hadn‘t thought this is that complex.

No worries.

I just created a new branch and uploaded the new script.

I'm still testing myself, but if you are brave, you can pull this new version by setting your DOCKER_MODS variable to thecaptain989/radarr-striptracks:latest. Testing feedback would be welcomed.

The new version addressed this issue and has a lot of changes under the hood.

volschin commented 11 months ago

Seem to work fine. A little bit irritating was, that now after „Movie Downloaded“ the last message via pushover for a film is „Movie File Deleted“. But in the history other order is shown with the rename icon last. So really fully automated now. Thank you very much.

TheCaptain989 commented 11 months ago

Seem to work fine. A little bit irritating was, that now after „Movie Downloaded“ the last message via pushover for a film is „Movie File Deleted“. But in the history other order is shown with the rename icon last.

Yeah, my hope was that I could call the ManualImport API and that would show up in the history, but as I said it seems like Radarr/Sonarr only allow one import task to run at a time.

Please let me know how it goes. I'd love to see some log files from the striptracks.txt log file if you're willing to share.