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

Check if the episode is a key of the searchResults before sending it #214

Merged
merged 1 commit into from
Mar 26, 2016

Conversation

p0psicles
Copy link
Contributor

Check if the episode is a key if the searchResults before sending it to cache.

  • Add the season pack's as a valid search result.

for searched_episode in searched_episode_list:
if searched_episode in [x for x, _ in searchResults.items()]:
results = curProvider.cache.update_cache_manual_search(searchResults[searched_episode])
if results is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just "if results:"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i'll change that

@p0psicles p0psicles changed the title Check if the episode is a key if the searchResults before sending it Check if the episode is a key of the searchResults before sending it Mar 25, 2016
@fernandog fernandog force-pushed the fix-manual-snatch-keynotfound branch 2 times, most recently from f081801 to d061607 Compare March 26, 2016 13:19
@OmgImAlexis
Copy link
Collaborator

Approved!

Approved with PullApprove

@@ -583,12 +583,12 @@ def searchProviders(show, episodes, manualSearch=False, downCurQuality=False, ma
searched_episode_list = [episode_obj.episode for episode_obj in episodes]
# Add the -1 to also match season pack results
searched_episode_list.append(-1)
episodes_search_result = [x for x, _ in searchResults.items()]
episodes_search_result = list(searchResults)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary, inefficient and increases memory usage

…to cache.

* Add the season pack's as a valid search result.
@p0psicles p0psicles force-pushed the fix-manual-snatch-keynotfound branch from d061607 to 08ee422 Compare March 26, 2016 18:38
@p0psicles p0psicles merged commit 564ce74 into develop Mar 26, 2016
@p0psicles p0psicles deleted the fix-manual-snatch-keynotfound branch March 26, 2016 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants