-
Notifications
You must be signed in to change notification settings - Fork 277
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
Conversation
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.
medusa/providers/torrent/rss/nyaa.py
Outdated
search_string = { | ||
'Season': [] | ||
} | ||
season_search_keywords = ('batch', 'complete', 'season') |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
…x-show-season-packs-manual-search
* Got broken in a few commits back.
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( |
There was a problem hiding this comment.
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]) |
There was a problem hiding this comment.
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.
Season packs can be stored in two ways..
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.