-
Notifications
You must be signed in to change notification settings - Fork 274
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
Add ability to manually change episode quality. Fixes #4474 #4658
Conversation
medariox
commented
Jul 12, 2018
- 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
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.
Not a full review yet...
medusa/server/web/manage/handler.py
Outdated
@@ -297,7 +297,7 @@ def downloadSubtitleMissed(self, *args, **kwargs): | |||
to_download[(cur_indexer_id, cur_series_id)] = [str(x[b'season']) + 'x' + str(x[b'episode']) for x in all_eps_results] | |||
|
|||
for epResult in to_download[(cur_indexer_id, cur_series_id)]: | |||
season, episode = epResult.split('x') | |||
season, episode = epResult.lstrip('s').split('e') |
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 see a problem here, look at line 297, it's still using the SNxEP
format
<option selected value="">Change quality to:</option> | ||
<% qualities = sorted(Quality.qualityStrings.items(), key=operator.itemgetter(0)) %> | ||
% for quality, name in qualities: | ||
% if quality > 1: # Skip N/A (0) and Unknown (1) |
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 prefer:
% if quality not in (Quality.NA, Quality.UNKNOWN):
CHANGELOG.md
Outdated
@@ -3,6 +3,7 @@ | |||
**New Features** | |||
|
|||
- Hot-swap themes: No need to restart the Medusa after changing the theme ([#4271](https://github.com/pymedusa/Medusa/pull/4271)) | |||
- Added ability to manually change episode quality ([#4658](https://github.com/pymedusa/Medusa/pull/4658)) |
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 wouldn't call it a new feature...
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.
It was never possible to only change the quality of an episode... so it definitely is IMO.
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.
But we can also move it to improvements, it's the same for me.
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 feel like improvements would be a better description.
@@ -414,4 +424,19 @@ MEDUSA.home.displayShow = function() { // eslint-disable-line max-lines | |||
log.error(error.data); | |||
}); | |||
}); | |||
|
|||
function setQuality(quality, seriesSlug, episodes) { |
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.
Please use const setQuality = (quality, seriesSlug, episodes) => {
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.
Are you sure? That's a really ugly syntax IMO 😕
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.
How so? That's an arrow function.
The reason I wanted this change was the fact that functions get hoisted and you should avoid that if possible.
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.
It feels like that at first. But it gets better when your getting used to it
}); | ||
|
||
api.patch('series/' + seriesSlug + '/episodes', patchData) | ||
.then(response => { |
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
should be on the same line as the api.patch
.
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.
If I change it the XO lint won't pass.
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.
Try
api.patch('series/' + seriesSlug + '/episodes', patchData).then(response => {
log.info(response.data);
window.location.reload();
}).catch(error => {
log.error(error.data);
});
Strings can be checked |
I hope this won't cause more confusion. For example I changed from |
I think where moving to a situation where status and quality should be independent of one another. It gives more flexibility. I think that almost in all places we use the quality As an example the Do we really want to make all these decisions for our users? Like removing the quality when its changed to the status skipped? Users already voiced they want to have that flexibility. |
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.
Im not the best reviewer. But this looks good te me.
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 would have preferred the new code in showheader.mako
to use Vue's store but other than that it looks good. 👍