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

Fix the queries to show the cached season packs #3030

Merged
merged 8 commits into from
Dec 3, 2017

Conversation

p0psicles
Copy link
Contributor

@p0psicles p0psicles commented Aug 18, 2017

Season packs can be stored in two ways..

  1. With season 1 and episodes "empty" for ex: '||'
  2. With season 1 and episodes filled with all the episodes of the season. Like '|1|2|3|..'.

no. 2 was not yet visualized. But is with this change.

Second "feature" thats added to this pr, is adjust the season search strings for the provider Nyaa.
As only little anime season packs, are released with season x. I've adjusted it to search for season pack keywords.

  • PR is based on the DEVELOP branch
  • Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review
  • Read the contribution guide

Season packs can be stored in two ways..
1. With season 1 and episodes "empty" for ex: '||'
2. With season 1 and episodes filled with all the episodes of the season. Like '|1|2|3|..'.

#2 was not yet visualized. But is with this change.
search_string = {
'Season': []
}
season_search_keywords = ('batch', 'complete', 'season')
Copy link
Contributor Author

@p0psicles p0psicles Aug 18, 2017

Choose a reason for hiding this comment

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

I know it's a little offtopic regarding the PR. But I had to make this change before, I could fix the manual search cache query.

Maybe for season packs, we should go with using these keywords. Then we could store them like how we currently do for the 'PROPER' keywords. As providers often utilize there own keywords for season packs.

Another option is to only implement this for anime, as anime releases often don't follow scene.

@duramato thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Currently non anime doesn't need that as we don't support downloading complete releases, which are the complete show. Scene anime also follows normal "show's" numbering.

This could be usefull for foreign or non "standard" naming, like for example instead of Season 1 releases with Series 1 that exist.
So something like yoou propose would be usefull still for everything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then I suggest we add an attribute to the providers named season_pack_keywords (or something else). And if that attribute exists, we use the season_search_string creation, as shown in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Continuing this in: #3369.
I'll limit this PR to the db query changes.

else:
# If were not looking for all results, meaning don't do the filter on season + ep, add sql
if not int(show_all_results):
list_of_episodes = '{0}{1}'.format(' episodes LIKE ', ' AND episodes LIKE '.join(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the meat of this PR.
It essentially makes sure we query for a season pack when a season is passed and no episodes are passed. Which is the most often occurring situation. Or when all episodes for the season are passed. Like: |1|2|3|4|5|...etc|.

@@ -645,9 +645,9 @@ def _get_season_search_strings(self, episode):
episode_string = show_name + self.search_separator

if episode.series.air_by_date or episode.series.sports:
episode_string += str(episode.airdate).split('-')[0]
search_string['Season'].append(episode_string + str(episode.airdate).split('-')[0])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This I needed fix. Got broken few commits back. With the season search templates.

@medariox medariox merged commit 140be81 into develop Dec 3, 2017
@medariox medariox deleted the feature/fix-show-season-packs-manual-search branch December 3, 2017 20:44
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.

3 participants