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 #4757: Error getting season scene exceptions on show page #4964

Merged
merged 2 commits into from
Aug 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Fixed excessive anidb udp calls when opening editShow ([#4822](https://github.com/pymedusa/Medusa/pull/4822))
- Fixed UI not loading using edge browser, when using a reverse proxy (without an alternative port) ([#4928](https://github.com/pymedusa/Medusa/pull/4928))
- Fixed episode lookup with conflicting show IDs ([#4933](https://github.com/pymedusa/Medusa/pull/4933))
- Fixed error getting season scene exceptions on show page [#4964](https://github.com/pymedusa/Medusa/pull/4964)

-----

Expand Down
33 changes: 23 additions & 10 deletions themes-default/slim/src/components/display-show.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { mapState, mapGetters } from 'vuex';
import { api } from '../api';
import { api, apiRoute } from '../api';
import AppLink from './app-link.vue';
import PlotInfo from './plot-info.vue';

Expand Down Expand Up @@ -58,7 +58,7 @@ export default {
setEpisodeSceneNumbering,
setAbsoluteSceneNumbering,
setInputValidInvalid,
setSeasonSceneException,
getSeasonSceneExceptions,
showHideRows
} = this;

Expand Down Expand Up @@ -286,14 +286,8 @@ export default {
});
attachImdbTooltip(); // eslint-disable-line no-undef

// @TODO: OMG: This is just a basic json, in future it should be based on the CRUD route.
// Get the season exceptions and the xem season mappings.
$.getJSON('home/getSeasonSceneExceptions', {
indexername: $('#indexer-name').val(),
seriesid: $('#series-id').val() // eslint-disable-line camelcase
}, data => {
setSeasonSceneException(data);
});
getSeasonSceneExceptions();

$(document.body).on('click', '.display-specials a', event => {
api.patch('config/main', {
Expand Down Expand Up @@ -430,9 +424,28 @@ export default {
});
return false;
},
// @TODO: OMG: This is just a basic json, in future it should be based on the CRUD route.
// Get the season exceptions and the xem season mappings.
getSeasonSceneExceptions() {
const indexerName = document.querySelector('#indexer-name').value;
const seriesId = document.querySelector('#series-id').value;
if (!indexerName || !seriesId) {
console.warn('Unable to get season scene exceptions: Unknown series identifier');
return;
}
const params = {
indexername: indexerName,
seriesid: seriesId
};
apiRoute.get('home/getSeasonSceneExceptions', { params }).then(response => {
this.setSeasonSceneExceptions(response.data);
}).catch(error => {
console.error('Error getting season scene exceptions', error);
});
},
// Set the season exception based on using the get_xem_numbering_for_show() for animes if available in data.xemNumbering,
// or else try to map using just the data.season_exceptions.
setSeasonSceneException(data) {
setSeasonSceneExceptions(data) {
$.each(data.seasonExceptions, (season, nameExceptions) => {
let foundInXem = false;
// Check if it is a season name exception, we don't handle the show name exceptions here
Expand Down
Loading