Skip to content

Commit

Permalink
Merge branch 'develop' into feature/apiv2-multithread
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkykh committed Aug 28, 2018
2 parents d181bd4 + 82366b3 commit 055c1cb
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 36 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- 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)
- Fixed testing email notification with TLS ([#4972](https://github.com/pymedusa/Medusa/pull/4972))

-----

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"ava": "0.25.0",
"codecov": "3.0.4",
"dredd": "5.1.11",
"execa": "0.11.0",
"execa": "1.0.0",
"nyc": "12.0.2",
"stylelint": "9.5.0",
"stylelint-config-standard": "18.2.0",
Expand Down
4 changes: 2 additions & 2 deletions themes-default/slim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"eslint-plugin-vue": "5.0.0-beta.3",
"esm": "3.0.80",
"file-loader": "2.0.0",
"filemanager-webpack-plugin": "2.0.1",
"glob": "7.1.2",
"filemanager-webpack-plugin": "2.0.2",
"glob": "7.1.3",
"gulp": "3.9.1",
"gulp-changed": "3.2.0",
"gulp-imagemin": "4.1.0",
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
36 changes: 29 additions & 7 deletions themes-default/slim/src/store/modules/shows.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Vue from 'vue';
import { ADD_SHOW } from '../mutation-types';

const state = {
Expand All @@ -6,19 +7,40 @@ const state = {

const mutations = {
[ADD_SHOW](state, show) {
const { shows } = state;
const showExists = shows.filter(({ id, indexer }) => id[indexer] === show.id[indexer]).length === 1;
if (showExists) {
state.shows[shows.indexOf(showExists)] = show;
} else {
const existingShow = state.shows.find(({ id, indexer }) => Number(show.id[show.indexer]) === Number(id[indexer]));

if (!existingShow) {
console.debug(`Adding ${show.title || show.indexer + String(show.id)} as it wasn't found in the shows array`, show);
state.shows.push(show);
return;
}

// Merge new show object over old one
// this allows detailed queries to update the record
// without the non-detailed removing the extra data
console.debug(`Found ${show.title || show.indexer + String(show.id)} in shows array attempting merge`);
const newShow = {
...existingShow,
...show
};

// Update state
Vue.set(state.shows, state.shows.indexOf(existingShow), newShow);
console.debug(`Merged ${newShow.title || newShow.indexer + String(newShow.id)}`, newShow);
}
};

const getters = {
getShowById: state => ({ id, indexer }) => state.shows.find(show => Number(show.id[indexer]) === Number(id)),
getShowByName: state => title => state.shows.find(show => show.title === title)
getShowByTitle: state => title => state.shows.find(show => show.title === title),
getSeason: state => ({ id, indexer, season }) => {
const show = state.shows.find(show => Number(show.id[indexer]) === Number(id));
return show && show.seasons ? show.seasons[season] : undefined;
},
getEpisode: state => ({ id, indexer, season, episode }) => {
const show = state.shows.find(show => Number(show.id[indexer]) === Number(id));
return show && show.seasons && show.seasons[season] ? show.seasons[season][episode] : undefined;
}
};

const actions = {
Expand All @@ -35,7 +57,7 @@ const actions = {
getShows(context, shows) {
const { commit, dispatch } = context;

// If no shows are provided get all of them
// If no shows are provided get the first 1000
if (!shows) {
const params = {
limit: 1000
Expand Down
2 changes: 1 addition & 1 deletion themes-default/slim/static/js/config/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ MEDUSA.config.notifications = function() { // eslint-disable-line max-lines
host = host.length > 0 ? host : null;
let port = $('#email_port').val();
port = port.length > 0 ? port : null;
const tls = $('#email_tls').attr('checked') === undefined ? 0 : 1;
const tls = $('#email_tls').is(':checked') ? 1 : 0;
let from = $('#email_from').val();
from = from.length > 0 ? from : 'root@localhost';
const user = $('#email_user').val().trim();
Expand Down
23 changes: 17 additions & 6 deletions themes-default/slim/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3469,9 +3469,9 @@ file-type@^6.1.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919"

[email protected].1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/filemanager-webpack-plugin/-/filemanager-webpack-plugin-2.0.1.tgz#b7027d55552eb80d0b327f2d56b5779138e4f5ec"
[email protected].2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/filemanager-webpack-plugin/-/filemanager-webpack-plugin-2.0.2.tgz#b5385dfe62c87e6708febf4a33aa935b26e639d8"
dependencies:
archiver "^2.1.1"
cpx "^1.5.0"
Expand Down Expand Up @@ -3876,9 +3876,9 @@ glob2base@^0.0.12:
dependencies:
find-index "^0.1.1"

[email protected].2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2:
version "7.1.2"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
[email protected].3:
version "7.1.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
Expand Down Expand Up @@ -3916,6 +3916,17 @@ glob@^6.0.1:
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2:
version "7.1.2"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@~3.1.21:
version "3.1.21"
resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd"
Expand Down
2 changes: 1 addition & 1 deletion themes/dark/assets/js/config/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ MEDUSA.config.notifications = function() { // eslint-disable-line max-lines
host = host.length > 0 ? host : null;
let port = $('#email_port').val();
port = port.length > 0 ? port : null;
const tls = $('#email_tls').attr('checked') === undefined ? 0 : 1;
const tls = $('#email_tls').is(':checked') ? 1 : 0;
let from = $('#email_from').val();
from = from.length > 0 ? from : 'root@localhost';
const user = $('#email_user').val().trim();
Expand Down
4 changes: 2 additions & 2 deletions themes/dark/assets/js/vendors.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion themes/light/assets/js/config/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ MEDUSA.config.notifications = function() { // eslint-disable-line max-lines
host = host.length > 0 ? host : null;
let port = $('#email_port').val();
port = port.length > 0 ? port : null;
const tls = $('#email_tls').attr('checked') === undefined ? 0 : 1;
const tls = $('#email_tls').is(':checked') ? 1 : 0;
let from = $('#email_from').val();
from = from.length > 0 ? from : 'root@localhost';
const user = $('#email_user').val().trim();
Expand Down
4 changes: 2 additions & 2 deletions themes/light/assets/js/vendors.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1865,9 +1865,9 @@ esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"

execa@0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-0.11.0.tgz#0b3c71daf9b9159c252a863cd981af1b4410d97a"
execa@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
dependencies:
cross-spawn "^6.0.0"
get-stream "^4.0.0"
Expand Down

0 comments on commit 055c1cb

Please sign in to comment.