Open
Conversation
Owner
|
Thanks for this! Rather than making an exception for lidarr you could pass in the application and make a decision based on that? It kind of looks strange to have a Boolean in a function signature to change it's behavior. |
|
Love seeing this project get worked on! 💪 |
Author
|
@wouterdebie you are right, it wasn't great. I took a stab into moving the code in the services::arr file into a struct, so now we have an enum for the type of app (lidarr, sonarr, etc) and can have different behaviour based on that. Not sure if I went too far - let me know in case I still think we can avoid checking lidarr for video files and the other three (sonarr, radarr, whisparr) if audio, but I can open another pull for that. |
Essentially, audio files are handled by lidarr, but not by the rest of the supporter *arr (Sonarr, Radarr, Whisparr) So this adds a MediaType enum for app to skip checking file types not handled by them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for lidarr. It has been working for me well in the past few days.
main difference is that the API endpoint for history is slightly different (URL and returned json) and add support for AUDIO file type.
is_imported might get a slight improvement if to add the service only for audios, instead of checking all services (lidarr, sonarr, radarr, whisparr) for each file. But I tried to make the least amount of changes.