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

Flow Plugin notify Radarr or Sonarr, more robust and new output for file not found #600

Merged

Conversation

Marnalas
Copy link
Contributor

@Marnalas Marnalas commented Feb 25, 2024

Hi there,

I added a new version of the flow plugin notifyRadarrOrSonarr for two reasons :

  • added a more robust way to find the file and a distinct output for when the file is not found ;
  • added more safeties to avoid exceptions being thrown.

Might fix #578 and fix this issue. It's hard to be sure but the logs looks like what I was running into before I applied the modifications.

@Marnalas
Copy link
Contributor Author

@HaveAGitGat My bad about the eslint warnings and errors. I fixed it.

@Marnalas Marnalas marked this pull request as draft March 26, 2024 22:17
@Marnalas
Copy link
Contributor Author

Changing this PR to draft as I intend to modify it regarding the issue detected in this post : HaveAGitGat/Tdarr#975
I think that the "parse" endpoint currently used in this flow plugin is a pretty inefficient way to query for the movieId. It uses the file name which, for a lot of people who follow the Plex/Jellyfin/Emby naming recommendations, is quite long and contains lots of special characters that are not friendly as an HTTP query parameter. I'm gonna look into proposing a modified version of the notify flow plugin using the "movieLookup" endpoints instead.

@Marnalas Marnalas marked this pull request as ready for review March 31, 2024 20:28
@Marnalas
Copy link
Contributor Author

Marnalas commented Mar 31, 2024

After some rework due to the issue HaveAGitGat/Tdarr#975, this plugin now tries to get the imdbId from the file's name + path and then use the lookup endpoints to get the movieId/serieId :

  • for radarr : /api/v3/movie/lookup?term=imdb:imdbId
  • for sonarr : /api/v3/series/lookup?term=imdb:imdbId

If there is no imdbId found or if these endpoints fail to return the movieId/serieId, then the parse endpoint is used as a fallback method.
I think the plugin is more reliable and less error prone this way.

I tested the new version thoroughly (thousands of files, series and movies) on my side. The tests I ran included files that didn't have an imdbId, or had an imdb that doesn't exist, for both movies and series. I also got confirmation from the issue's OP that the modifications solve his problem.

@Marnalas
Copy link
Contributor Author

@HaveAGitGat Hi, I see the checks are failing at "auto_compile_and_push" because of an error while executing a git command. I don't see more detail. Anything I can do on my side ?
(I'll ask this question on any of my PR that has this problem, feel free to answer only to one of them)

@HaveAGitGat
Copy link
Owner

Thanks, looks good.

@HaveAGitGat HaveAGitGat merged commit bbebce8 into HaveAGitGat:master May 8, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

Please finally fix notify flow NotifyRadarrOrSonarr Flow Plugin has Filename issue
2 participants