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

Notify Sonarr doesn't wait for scan to complete #1152

Open
dgibbs64 opened this issue Jan 25, 2025 · 4 comments
Open

Notify Sonarr doesn't wait for scan to complete #1152

dgibbs64 opened this issue Jan 25, 2025 · 4 comments

Comments

@dgibbs64
Copy link

Please put plugin requests/bugs at: https://github.com/HaveAGitGat/Tdarr_Plugins

Describe the bug
Notifying Sonarr triggers a rescan of a TV series. However, large series can take up to 1 minute to complete. This causes the "Apply Sonarr naming policy" to not rename the file if Sonarr is still scanning the series. The current solution is to add a 1 min delay between notify and rename which adds delay

To Reproduce
Test against tv series with a lot of episodes to cause delay in scanning the series

Expected behavior
Ideally, Notify Sonarr should wait for the scan to complete before moving on. However, this depends upon if the API can support it

@dennix85
Copy link

i believe that is how it is supposed to work, you add the wait block to it for the time needed in your specific situation, as not every instance/server has the same speed :)

alternatively if you have codec names in your file names, you can use a rename based on codec plugin,
that will change the file name of the file, then u can use the replace the original file plugin,
afterwards use the notify sonarr/ radarr plugin, instead of the renaming plugin, that should do it too.
will cause a scan too in your sonarr/radarr instance
thats how i use tdarr + sonarr/radarr no issues so far..

@dgibbs64
Copy link
Author

The problem is I had to add a wait block of 60 seconds per file. This adds up to a lot of delay and is essentially guess work as a series with few episodes completes in a few seconds and one with hundreds of episodes can take around 1-minute. It makes sense for the notify task to confirm the re-scan has finished, as the wait time is highly variable.

There is a plugin/option to rename from h264 to h265 but if anything else changes such as audio codec then the Sonarr rename still needs to happen. It is a lot easier to get sonarr to rename to its preferred way.

Not only that, the docs state to:

  1. send a notify
  2. do the sonarr rename
  3. send a notify

Following the docs in this way will cause the rename to not happen most of the time.
https://docs.tdarr.io/docs/plugins/flow-plugins/index/tools/Apply%20Radarr%20or%20Sonarr%20naming%20policy

If the rename fails to happen I have to manually trigger it in Sonarr then causes the files to be re added to the Tdarr queue which the wastes more time.

@dennix85
Copy link

I see your point, i have no further solution for you, maybe someone else has,
in the meanwhile the plugin used in my case, if you want to take a look at it:

Tdarr_Plugin_scha_rename_based_on_codec_schadi

well i have no issue audio or video, if i don't need video transcode but audio only, it does the job.
it is not a solution to the problem, just an alternative.

@supersnellehenk
Copy link

I suppose this isn't a very trivial feature to add, I'll see if I can make some time. I think what needs to happen is fetch the ID from the command sent, then monitor its progress using this endpoint: https://radarr.video/docs/api/#/Command/get_api_v3_command__id_.

Radarr & Sonarr essentially use the same API spec.

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

No branches or pull requests

3 participants