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

Manual snatch gives key error, when results are found but not for the searched ep no. #213

Closed
p0psicles opened this issue Mar 25, 2016 · 2 comments

Comments

@p0psicles
Copy link
Contributor

Before submitting your issue:

Enable debug logging in SickRage settings, reproduce the error (be sure to disable after the bug is fixed)

Branch/Commit: develop/dd1d8396ea4d333016610a04e8e19ab36d2d3026
OS: Windows 7
What you did: Manual snatch Searched for and "old" show, (law of ueki)
What happened: No results found and the provided exception
What you expected: At least no exception, but preferably search results if there are any.
Logs:

AA
AAKeyError: 4
AA    results = curProvider.cache.update_cache_manual_search(searchResults[searched_episode.episode])
AA  File "/home/home/SickRage/sickbeard/search.py", line 583, in searchProviders
AA    searchResult = search.searchProviders(self.show, [self.segment], True, self.downCurQuality, self.manual_snatch)
AA  File "/home/home/SickRage/sickbeard/search_queue.py", line 199, in run

After some analysis I noticed this is happening when your search for a show that gives back results, but not exactly for the episode your are looking for.

In case of the show law of ueki, it returned the season pack. That has an episode value of -1. As i searched for episode 51, it trowed the exception.

My proposal is to check if the searched for ep is in the list of search results + -1 (for season packs). For example searching for ep 51, would now match it against the list [51]. I'm going to manually add -1 to it. Making it match against [51, -1].

check topic fix-manual-snatch-keynotfound (#214) for an intermediate fix.
I'm curious to hear everyone opinions. And let's test some more. There are probably other use cases that we need to finetune.

Result:
image

@p0psicles
Copy link
Contributor Author

I stand corrected -1, doesn't mean it's a season pack.
It's more like a dump for when the episode could not be determined. It's happening for season packs and anime's with absolute episode numbering.

@p0psicles
Copy link
Contributor Author

Fixed in dev

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

2 participants