-
Notifications
You must be signed in to change notification settings - Fork 31
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
Upgradinatorr - Improved series searching #183
Upgradinatorr - Improved series searching #183
Conversation
Neat idea. When I get a moment. I'll look into this. |
|
…-searching + fix bug in season filtering
It's been a whirlwind weekend, I haven't had a chance to look this over, glad to see you found issues and fixed them. |
No problem! Take your time. It's a pretty difficult script to refactor once knowing it'll all work, as I'm using it I'm discovering issues/improvements. I believe there's an efficiency improvement that can be done, taking a look at that today I was wrong... Did realise I hadn't updated a docstring though |
So couple things to look into
All in all I like the implementation. Sorry I don't have time to fully read over the code 100% I skimmed through it while I'm sitting in my car at my kids evening events. I'm always up for code improvements and refactors that make the code make more sense as well as better documentation (I'm not a coder by trade and this is 100% self taught..) |
The default value for I'll update the sample config, wasn't really sure where to document this till now. Please don't be sorry! It's my first time contributing code to an open source, so it's quite fun and I have a bunch of time on my hands at the moment. |
Description
This PR refactors the searching logic within Upgradinatorr to allow for improved series searching, which reduces the number of potential hits upgradinatorr triggers. It does this by introducing a new config parameter for the sonarr instance called
season_monitored_threshold
. This threshold is then used to make a decision during media filteration, whereby if the percentage of episodes monitored within a season is less than the threshold, upgradinator will then mark the season as unmonitored, resulting in no search request being sent to sonarr for that season. The media processing has been updated to support these changes.Example
season_monitored_threshold
set to 0.92/8 = 25% of episodes within this season are monitored. Therefore, since 0.25 is less than our threshold of 0.9, upgradinator will not request a search.
Debug logs for the above example (has some improved logging missing from it): notifiarr log link
Reason
I don't want season packs to be grabbed when I have already started watching a season, which results in unnecessary download usage. Was curious about how searches are handled on sonarrs end of things and it seems like a pack could be grabbed despite episodes being unmonitored, so I looked into implementing a solution within upgradinatorr. Managed to get my desired results, whilst maintaining all existing functionality.
If you want to read more about the sonarr side of this, I asked in their support discord here.
Development
Thought I'd explain how I went about contributing to your repo. After cloning the fork, I setup radarr and sonarr on my local machine so I could test the upgradinatorr script with a small library with no indexers. Once I was sure about my implementation, I added it to my server and tested it on there with my main library with all my indexers. The implementation is working as expected and I'll continue to use the fork on my server, so I'll continue to test it myself.
Config I tested with:
Also one last note, I was really stumped as to what the best name of the new argument should be, I'm still not really happy with
season_monitored_threshold
. Feel free to make a request/suggestion on renaming it.