-
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
Add ability to manually change episode quality. Fixes #4474 #4658
Changes from 15 commits
1a53d36
d3a4248
f0fdb13
343fdd0
18aa7da
a5932a0
1f11e1c
0b6715e
d52b44e
334e3fc
a2433b7
8df89ca
c95d37a
f8c2126
5caaa66
140b76e
48bedcb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,9 @@ MEDUSA.home.displayShow = function() { // eslint-disable-line max-lines | |
|
||
$('#changeStatus').on('click', () => { | ||
const epArr = []; | ||
const status = $('#statusSelect').val(); | ||
const quality = $('#qualitySelect').val(); | ||
const seriesSlug = $('#series-slug').val(); | ||
|
||
$('.epCheck').each(function() { | ||
if (this.checked === true) { | ||
|
@@ -69,21 +72,28 @@ MEDUSA.home.displayShow = function() { // eslint-disable-line max-lines | |
return false; | ||
} | ||
|
||
window.location.href = $('base').attr('href') + 'home/setStatus?' + | ||
'indexername=' + $('#indexer-name').attr('value') + | ||
'&seriesid=' + $('#series-id').attr('value') + | ||
'&eps=' + epArr.join('|') + | ||
'&status=' + $('#statusSelect').val(); | ||
if (quality !== '') { | ||
setQuality(quality, seriesSlug, epArr); | ||
} | ||
|
||
if (status !== '') { | ||
window.location.href = $('base').attr('href') + 'home/setStatus?' + | ||
'indexername=' + $('#indexer-name').attr('value') + | ||
'&seriesid=' + $('#series-id').attr('value') + | ||
'&eps=' + epArr.join('|') + | ||
'&status=' + status; | ||
} | ||
}); | ||
|
||
$('.seasonCheck').on('click', function() { | ||
const seasCheck = this; | ||
const seasNo = $(seasCheck).attr('id'); | ||
|
||
$('#collapseSeason-' + seasNo).collapse('show'); | ||
const seasonIdentifier = 's' + seasNo; | ||
$('.epCheck:visible').each(function() { | ||
const epParts = $(this).attr('id').split('x'); | ||
if (epParts[0] === seasNo) { | ||
const epParts = $(this).attr('id').split('e'); | ||
if (epParts[0] === seasonIdentifier) { | ||
this.checked = seasCheck.checked; | ||
} | ||
}); | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Please use There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 |
||
const patchData = {}; | ||
episodes.forEach(episode => { | ||
patchData[episode] = { quality: parseInt(quality, 10) }; | ||
}); | ||
|
||
api.patch('series/' + seriesSlug + '/episodes', patchData) | ||
.then(response => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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);
}); |
||
log.info(response.data); | ||
window.location.reload(); | ||
}).catch(error => { | ||
log.error(error.data); | ||
}); | ||
} | ||
}; |
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