Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonarr/Radarr Import using script #1674

Open
tomislav opened this issue Sep 14, 2023 · 8 comments
Open

Sonarr/Radarr Import using script #1674

tomislav opened this issue Sep 14, 2023 · 8 comments

Comments

@tomislav
Copy link

Sonarr and Radarr now support custom scripts for importing (i.e.. pre-import scripts) Sonarr/Sonarr#5538

All the environmental variables seem the same as OnDownload, and the script should just return exit code 3 after transcoding and they will handle the import.

@mdhiggins
Copy link
Owner

Shouldn't need any script adjustment then, there was never any specific discrimination between the various calls just the presence of the appropriate environment variables. Are you seeing issues?

@tomislav
Copy link
Author

Looking at postSonnar.py the script checks if sonarr_eventtype is Download, and this is not passed by this pre-import. It will probably need a separate script with proper exit codes too.

@mdhiggins
Copy link
Owner

Yeah reading over this it will need its own script I think, a preSonarr.py if you will though I can probably reuse a good portion of postSonarr

@mdhiggins
Copy link
Owner

Sonarr/Sonarr#5956

Looks like until these features are implemented this new import script probably won't be useful for SMA purposes but I'll keep an eye out for it

@JeWe37
Copy link

JeWe37 commented Sep 15, 2023

Note: I can recommend that you do make some changes to your scripts and remux and transcode from the downloads folder directly to the library folder, as it saves an additional unnecessary copy and thus speeds things up a fair bit(especially for pure remuxing). I can also recommend always requesting a rename, as you don't know whether people might be using say the audio or video codec in their naming scheme. Deferring is not really intended to change the file before it is imported. If you defer to Sonarr no changes should have been made. Good to see some potential usages by people other than me though.

@mdhiggins
Copy link
Owner

Yeah I was mostly referring to these two features

Custom import scripts that generate additional extra files to be imported.
Custom import scripts that remux the original media file to a different container, such that its extension must change

Both of things can and often do happen for SMA processed media, changing containers and ripping or downloading additional subtitles are common so as I understand it that would needed to be supported before adopting the feature

Currently doing things in the download folder is handled by post downloader scripts executed by the downloader before notifying Sonarr/Radarr since they haven't supported this historically, but once this matures it would be nice to offer a script for it

@tomislav
Copy link
Author

Sonarr/Sonarr#5956 is now merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants