diff --git a/themes-default/slim/src/components/manual-post-process.vue b/themes-default/slim/src/components/manual-post-process.vue index c67b671d63..e2c8897804 100644 --- a/themes-default/slim/src/components/manual-post-process.vue +++ b/themes-default/slim/src/components/manual-post-process.vue @@ -2,14 +2,6 @@ export default { name: 'manual-post-process', template: '#manual-post-process-template', - metaInfo: { - title: 'Post Processing' - }, - data() { - return { - header: 'Post Processing' - }; - }, mounted() { $('#episodeDir').fileBrowser({ title: 'Select Unprocessed Episode Folder', diff --git a/themes-default/slim/src/components/snatch-selection.vue b/themes-default/slim/src/components/snatch-selection.vue index fa4e6e19af..f015bc9494 100644 --- a/themes-default/slim/src/components/snatch-selection.vue +++ b/themes-default/slim/src/components/snatch-selection.vue @@ -8,6 +8,18 @@ export default { components: { AppLink }, + metaInfo() { + if (!this.show || !this.show.title) { + return { + title: 'Medusa' + }; + } + const { title } = this.show; + return { + title, + titleTemplate: '%s | Medusa' + }; + }, computed: { ...mapState({ shows: state => state.shows.shows @@ -43,6 +55,11 @@ export default { return show; } }, + created() { + const { indexer, id, $store } = this; + // Needed for the title + $store.dispatch('getShow', { indexer, id }); + }, mounted() { window.addEventListener('load', () => { // Adjust the summary background position and size diff --git a/themes-default/slim/src/router.js b/themes-default/slim/src/router.js index d263651b4a..1fbcdd70f2 100644 --- a/themes-default/slim/src/router.js +++ b/themes-default/slim/src/router.js @@ -16,6 +16,29 @@ const homeRoutes = { }, { path: 'displayShow', name: 'displayShow' + }, { + path: 'snatchSelection', + name: 'snatchSelection' + }, { + path: 'testRename', + name: 'testRename', + meta: { + title: 'Preview Rename', + header: 'Preview Rename' + } + }, { + path: 'postprocess', + name: 'postprocess', + meta: { + title: 'Manual Post-Processing', + header: 'Manual Post-Processing' + } + }, { + path: 'status', + name: 'status', + meta: { + title: 'Status' + } }] }; diff --git a/themes-default/slim/views/home_postprocess.mako b/themes-default/slim/views/home_postprocess.mako index 7f39c7f967..72caa571f4 100644 --- a/themes-default/slim/views/home_postprocess.mako +++ b/themes-default/slim/views/home_postprocess.mako @@ -8,7 +8,7 @@
% if int(show.air_by_date) == 1 and app.NAMING_CUSTOM_ABD: diff --git a/themes/dark/assets/js/vendors.js b/themes/dark/assets/js/vendors.js index ff513fca81..0cbc6b6936 100644 --- a/themes/dark/assets/js/vendors.js +++ b/themes/dark/assets/js/vendors.js @@ -663,7 +663,7 @@ eval("\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nmodule.exports /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("/* WEBPACK VAR INJECTION */(function($) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = {\n name: 'manual-post-process',\n template: '#manual-post-process-template',\n metaInfo: {\n title: 'Post Processing'\n },\n data: function data() {\n return {\n header: 'Post Processing'\n };\n },\n mounted: function mounted() {\n $('#episodeDir').fileBrowser({\n title: 'Select Unprocessed Episode Folder',\n key: 'postprocessPath'\n });\n }\n};\nexports.default = _default;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/manual-post-process.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); +eval("/* WEBPACK VAR INJECTION */(function($) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = {\n name: 'manual-post-process',\n template: '#manual-post-process-template',\n mounted: function mounted() {\n $('#episodeDir').fileBrowser({\n title: 'Select Unprocessed Episode Folder',\n key: 'postprocessPath'\n });\n }\n};\nexports.default = _default;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/manual-post-process.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -747,7 +747,7 @@ eval("\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("/* WEBPACK VAR INJECTION */(function($) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n\nvar _appLink = _interopRequireDefault(__webpack_require__(/*! ./app-link.vue */ \"./src/components/app-link.vue\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _templateObject4() {\n var data = _taggedTemplateLiteral([\"Something went wrong in getthing the paramaters from dom. indexerName: \", \",\\n seriesId: \", \", season: \", \", episode: \", \"\"]);\n\n _templateObject4 = function _templateObject4() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject3() {\n var data = _taggedTemplateLiteral([\"\"]);\n\n _templateObject3 = function _templateObject3() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject2() {\n var data = _taggedTemplateLiteral([\"Something went wrong in getthing the paramaters from dom. indexerName: \", \",\\n seriesId: \", \", season: \", \", episode: \", \"\"]);\n\n _templateObject2 = function _templateObject2() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"\"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: 'snatchSelection',\n template: '#snatch-selection-template',\n components: {\n AppLink: _appLink.default\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n shows: function shows(state) {\n return state.shows.shows;\n }\n }), (0, _vuex.mapGetters)(['getShowById']), {\n indexer: function indexer() {\n return this.$route.query.indexername;\n },\n id: function id() {\n return this.$route.query.seriesid;\n },\n season: function season() {\n return this.$route.query.season;\n },\n episode: function episode() {\n return this.$route.query.episode;\n },\n show: function show() {\n var indexer = this.indexer,\n id = this.id,\n getShowById = this.getShowById,\n shows = this.shows,\n $store = this.$store;\n var defaults = $store.state.defaults;\n\n if (shows.length === 0 || !indexer || !id) {\n return defaults.show;\n }\n\n var show = getShowById({\n indexer: indexer,\n id: id\n });\n\n if (!show) {\n return defaults.show;\n }\n\n return show;\n }\n }),\n mounted: function mounted() {\n window.addEventListener('load', function () {\n // Adjust the summary background position and size\n window.dispatchEvent(new Event('resize'));\n });\n attachImdbTooltip(); // eslint-disable-line no-undef\n\n $(document.body).on('click', '.imdbPlot', function (event) {\n $(event.currentTarget).prev('span').toggle();\n\n if ($(event.currentTarget).html() === '..show less') {\n $(event.currentTarget).html('..show more');\n } else {\n $(event.currentTarget).html('..show less');\n }\n\n moveSummaryBackground();\n }); // Adjust the summary background position and size on page load and resize\n\n function moveSummaryBackground() {\n var height = $('#summary').height() + 10;\n var top = $('#summary').offset().top + 5;\n $('#summaryBackground').height(height);\n $('#summaryBackground').offset({\n top: top,\n left: 0\n });\n $('#summaryBackground').show();\n }\n\n $(window).resize(function () {\n moveSummaryBackground();\n });\n\n var updateSpinner = function updateSpinner(message, showSpinner) {\n // Get spinner object as needed\n var spinner = $('#searchNotification');\n\n if (showSpinner) {\n message = ' ' + message;\n }\n\n $(spinner).empty().append(message);\n }; // Check the previous status of the history table, for hidden or shown, through the data attribute\n // data-history-toggle-hidden\n\n\n function toggleHistoryTable() {\n // eslint-disable-line no-unused-vars\n // Get previous state which was saved on the wrapper\n var showOrHide = $('#wrapper').attr('data-history-toggle');\n $('#historydata').collapse(showOrHide);\n }\n\n $.fn.loadContainer = function (path, loadingTxt, errorTxt, callback) {\n updateSpinner(loadingTxt);\n $('#manualSearchMeta').load(path + ' #manualSearchMeta meta');\n $(this).load(path + ' #manualSearchTbody tr', function (response, status) {\n if (status === 'error') {\n updateSpinner(errorTxt, false);\n }\n\n if (typeof callback !== 'undefined') {\n callback();\n }\n });\n }; // Click event for the download button for snatching a result\n\n\n $(document.body).on('click', '.epManualSearch', function (event) {\n event.preventDefault();\n var link = event.currentTarget;\n $(link).children('img').prop('src', 'images/loading16.gif');\n $.getJSON(event.currentTarget.href, function (data) {\n if (data.result === 'success') {\n $(link).children('img').prop('src', 'images/save.png');\n } else {\n $(link).children('img').prop('src', 'images/no16.png');\n }\n });\n });\n\n $.fn.generateStars = function () {\n return this.each(function (index, element) {\n $(element).html($('').width($(element).text() * 12));\n });\n };\n\n function initTableSorter(table) {\n // Nasty hack to re-initialize tablesorter after refresh\n $(table).tablesorter({\n widgets: ['saveSort', 'stickyHeaders', 'columnSelector', 'filter'],\n widgetOptions: {\n filter_columnFilters: true,\n // eslint-disable-line camelcase\n filter_hideFilters: true,\n // eslint-disable-line camelcase\n filter_saveFilters: true,\n // eslint-disable-line camelcase\n columnSelector_saveColumns: true,\n // eslint-disable-line camelcase\n columnSelector_layout: '',\n // eslint-disable-line camelcase\n columnSelector_mediaquery: false,\n // eslint-disable-line camelcase\n columnSelector_cssChecked: 'checked' // eslint-disable-line camelcase\n\n },\n textExtraction: function () {\n return {\n // 2: Provider\n 2: function _(node) {\n return $(node).find('img').attr('title');\n },\n // 6: The size column needs an explicit field for the filtering on raw size.\n 6: function _(node) {\n return node.getAttribute('data-size');\n },\n // 9: Published date\n 9: function _(node) {\n return node.getAttribute('data-datetime');\n },\n // 10: Added date\n 10: function _(node) {\n return node.getAttribute('data-datetime');\n }\n };\n }(),\n headers: {\n 9: {\n sorter: 'realISODate'\n },\n // Published\n 10: {\n sorter: 'realISODate'\n },\n // Added\n 11: {\n sorter: false,\n parser: false // Snatch link\n\n }\n }\n });\n }\n\n $('.imdbstars').generateStars();\n\n function checkCacheUpdates(repeat) {\n var pollInterval = 5000;\n repeat = repeat || true;\n var indexerName = $('meta[data-last-prov-updates]').attr('data-indexer-name');\n var seriesId = $('meta[data-last-prov-updates]').attr('data-series-id');\n var season = $('meta[data-last-prov-updates]').attr('data-season');\n var episode = $('meta[data-last-prov-updates]').attr('data-episode');\n var data = $('meta[data-last-prov-updates]').data('last-prov-updates');\n var manualSearchType = $('meta[data-last-prov-updates]').attr('data-manual-search-type');\n var checkParams = [indexerName, seriesId, season, episode].every(function (checkIsTrue) {\n return checkIsTrue;\n });\n\n if (!checkParams) {\n console.log(\"\"(_templateObject2(), indexerName, seriesId, season, episode)(_templateObject()));\n return;\n }\n\n var urlParams = '?indexername=' + indexerName + '&seriesid=' + seriesId + '&season=' + season + '&episode=' + episode;\n\n if (manualSearchType === 'season') {\n urlParams += '&manual_search_type=' + manualSearchType;\n }\n\n if (!$.isNumeric(seriesId) || !$.isNumeric(season) || !$.isNumeric(episode)) {\n setTimeout(function () {\n checkCacheUpdates(true);\n }, 200);\n }\n\n $.ajax({\n url: 'home/manualSearchCheckCache' + urlParams,\n type: 'GET',\n data: data,\n contentType: 'application/json',\n error: function error() {\n // Repeat = false;\n console.log('Error occurred!!');\n $('.manualSearchButton').removeAttr('disabled');\n },\n complete: function complete() {\n if (repeat) {\n setTimeout(checkCacheUpdates, pollInterval);\n }\n },\n timeout: 15000 // Timeout after 15s\n\n }).done(function (data) {\n // @TODO: Combine the lower if statements\n if (data === '') {\n updateSpinner('Search finished', false);\n $('.manualSearchButton').removeAttr('disabled');\n repeat = false;\n }\n\n if (data.result === 'refresh') {\n window.location.reload();\n updateSpinner('Refreshed results...', true);\n }\n\n if (data.result === 'searching') {\n // Ep is searched, you will get a results any minute now\n pollInterval = 5000;\n $('.manualSearchButton').prop('disabled', true);\n updateSpinner('The episode is being searched, please wait......', true);\n }\n\n if (data.result === 'queued') {\n // Ep is queued, this might take some time to get results\n pollInterval = 7000;\n $('.manualSearchButton').prop('disabled', true);\n updateSpinner('The episode has been queued, because another search is taking place. please wait..', true);\n }\n\n if (data.result === 'finished') {\n // Ep search is finished\n updateSpinner('Search finished', false);\n $('.manualSearchButton').removeAttr('disabled');\n repeat = false;\n $('#srchresults').trigger('update', true);\n $('[datetime]').timeago();\n }\n\n if (data.result === 'error') {\n // Ep search is finished but with an error\n console.log('Probably tried to call manualSelectCheckCache, while page was being refreshed.');\n $('.manualSearchButton').removeAttr('disabled');\n repeat = true;\n }\n });\n }\n\n setTimeout(checkCacheUpdates, 2000); // Click event for the reload results and force search buttons\n\n $(document.body).on('click', '.manualSearchButton', function (event) {\n event.preventDefault();\n $('.manualSearchButton').prop('disabled', true);\n var indexerName = $('meta[data-last-prov-updates]').attr('data-indexer-name');\n var seriesId = $('meta[data-last-prov-updates]').attr('data-series-id');\n var season = $('meta[data-last-prov-updates]').attr('data-season');\n var episode = $('meta[data-last-prov-updates]').attr('data-episode');\n var manualSearchType = $('meta[data-last-prov-updates]').attr('data-manual-search-type');\n var forceSearch = $(event.currentTarget).attr('data-force-search');\n var checkParams = [indexerName, seriesId, season, episode].every(function (checkIsTrue) {\n return checkIsTrue;\n });\n\n if (!checkParams) {\n console.log(\"\"(_templateObject4(), indexerName, seriesId, season, episode)(_templateObject3()));\n return;\n }\n\n if ($.isNumeric(seriesId) && $.isNumeric(season) && $.isNumeric(episode)) {\n updateSpinner('Started a forced manual search...', true);\n $.getJSON('home/snatchSelection', {\n indexername: indexerName,\n seriesid: seriesId,\n season: season,\n episode: episode,\n manual_search_type: manualSearchType,\n // eslint-disable-line camelcase\n perform_search: forceSearch // eslint-disable-line camelcase\n\n }); // Force the search, but give the checkCacheUpdates the time to start up a search thread\n\n setTimeout(function () {\n checkCacheUpdates(true);\n }, 2000);\n }\n }); // Moved and rewritten this from displayShow. This changes the button when clicked for collapsing/expanding the\n // \"Show History\" button to show or hide the snatch/download/failed history for a manual searched episode or pack.\n\n $('#popover').popover({\n placement: 'bottom',\n html: true,\n // Required if content has HTML\n content: ''\n }).on('shown.bs.popover', function () {\n // Bootstrap popover event triggered when the popover opens\n $.tablesorter.columnSelector.attachTo($('#srchresults'), '#popover-target');\n });\n $('#btnReset').click(function () {\n $('#showTable').trigger('saveSortReset') // Clear saved sort\n .trigger('sortReset'); // Reset current table sort\n\n return false;\n });\n $(function () {\n initTableSorter('#srchresults');\n moveSummaryBackground();\n $('body').on('hide.bs.collapse', '.collapse.toggle', function () {\n $('#showhistory').text('Show History');\n $('#wrapper').prop('data-history-toggle', 'hide');\n });\n $('body').on('show.bs.collapse', '.collapse.toggle', function () {\n $('#showhistory').text('Hide History');\n $('#wrapper').prop('data-history-toggle', 'show');\n });\n });\n $(document.body).on('click', '.release-name-ellipses, .release-name-ellipses-toggled', function (event) {\n var target = $(event.currentTarget);\n\n if (target.hasClass('release-name-ellipses')) {\n target.switchClass('release-name-ellipses', 'release-name-ellipses-toggled', 100);\n } else {\n target.switchClass('release-name-ellipses-toggled', 'release-name-ellipses', 100);\n }\n });\n }\n};\nexports.default = _default;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/snatch-selection.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); +eval("/* WEBPACK VAR INJECTION */(function($) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n\nvar _appLink = _interopRequireDefault(__webpack_require__(/*! ./app-link.vue */ \"./src/components/app-link.vue\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _templateObject4() {\n var data = _taggedTemplateLiteral([\"Something went wrong in getthing the paramaters from dom. indexerName: \", \",\\n seriesId: \", \", season: \", \", episode: \", \"\"]);\n\n _templateObject4 = function _templateObject4() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject3() {\n var data = _taggedTemplateLiteral([\"\"]);\n\n _templateObject3 = function _templateObject3() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject2() {\n var data = _taggedTemplateLiteral([\"Something went wrong in getthing the paramaters from dom. indexerName: \", \",\\n seriesId: \", \", season: \", \", episode: \", \"\"]);\n\n _templateObject2 = function _templateObject2() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"\"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: 'snatchSelection',\n template: '#snatch-selection-template',\n components: {\n AppLink: _appLink.default\n },\n metaInfo: function metaInfo() {\n if (!this.show || !this.show.title) {\n return {\n title: 'Medusa'\n };\n }\n\n var title = this.show.title;\n return {\n title: title,\n titleTemplate: '%s | Medusa'\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n shows: function shows(state) {\n return state.shows.shows;\n }\n }), (0, _vuex.mapGetters)(['getShowById']), {\n indexer: function indexer() {\n return this.$route.query.indexername;\n },\n id: function id() {\n return this.$route.query.seriesid;\n },\n season: function season() {\n return this.$route.query.season;\n },\n episode: function episode() {\n return this.$route.query.episode;\n },\n show: function show() {\n var indexer = this.indexer,\n id = this.id,\n getShowById = this.getShowById,\n shows = this.shows,\n $store = this.$store;\n var defaults = $store.state.defaults;\n\n if (shows.length === 0 || !indexer || !id) {\n return defaults.show;\n }\n\n var show = getShowById({\n indexer: indexer,\n id: id\n });\n\n if (!show) {\n return defaults.show;\n }\n\n return show;\n }\n }),\n created: function created() {\n var indexer = this.indexer,\n id = this.id,\n $store = this.$store; // Needed for the title\n\n $store.dispatch('getShow', {\n indexer: indexer,\n id: id\n });\n },\n mounted: function mounted() {\n window.addEventListener('load', function () {\n // Adjust the summary background position and size\n window.dispatchEvent(new Event('resize'));\n });\n attachImdbTooltip(); // eslint-disable-line no-undef\n\n $(document.body).on('click', '.imdbPlot', function (event) {\n $(event.currentTarget).prev('span').toggle();\n\n if ($(event.currentTarget).html() === '..show less') {\n $(event.currentTarget).html('..show more');\n } else {\n $(event.currentTarget).html('..show less');\n }\n\n moveSummaryBackground();\n }); // Adjust the summary background position and size on page load and resize\n\n function moveSummaryBackground() {\n var height = $('#summary').height() + 10;\n var top = $('#summary').offset().top + 5;\n $('#summaryBackground').height(height);\n $('#summaryBackground').offset({\n top: top,\n left: 0\n });\n $('#summaryBackground').show();\n }\n\n $(window).resize(function () {\n moveSummaryBackground();\n });\n\n var updateSpinner = function updateSpinner(message, showSpinner) {\n // Get spinner object as needed\n var spinner = $('#searchNotification');\n\n if (showSpinner) {\n message = ' ' + message;\n }\n\n $(spinner).empty().append(message);\n }; // Check the previous status of the history table, for hidden or shown, through the data attribute\n // data-history-toggle-hidden\n\n\n function toggleHistoryTable() {\n // eslint-disable-line no-unused-vars\n // Get previous state which was saved on the wrapper\n var showOrHide = $('#wrapper').attr('data-history-toggle');\n $('#historydata').collapse(showOrHide);\n }\n\n $.fn.loadContainer = function (path, loadingTxt, errorTxt, callback) {\n updateSpinner(loadingTxt);\n $('#manualSearchMeta').load(path + ' #manualSearchMeta meta');\n $(this).load(path + ' #manualSearchTbody tr', function (response, status) {\n if (status === 'error') {\n updateSpinner(errorTxt, false);\n }\n\n if (typeof callback !== 'undefined') {\n callback();\n }\n });\n }; // Click event for the download button for snatching a result\n\n\n $(document.body).on('click', '.epManualSearch', function (event) {\n event.preventDefault();\n var link = event.currentTarget;\n $(link).children('img').prop('src', 'images/loading16.gif');\n $.getJSON(event.currentTarget.href, function (data) {\n if (data.result === 'success') {\n $(link).children('img').prop('src', 'images/save.png');\n } else {\n $(link).children('img').prop('src', 'images/no16.png');\n }\n });\n });\n\n $.fn.generateStars = function () {\n return this.each(function (index, element) {\n $(element).html($('').width($(element).text() * 12));\n });\n };\n\n function initTableSorter(table) {\n // Nasty hack to re-initialize tablesorter after refresh\n $(table).tablesorter({\n widgets: ['saveSort', 'stickyHeaders', 'columnSelector', 'filter'],\n widgetOptions: {\n filter_columnFilters: true,\n // eslint-disable-line camelcase\n filter_hideFilters: true,\n // eslint-disable-line camelcase\n filter_saveFilters: true,\n // eslint-disable-line camelcase\n columnSelector_saveColumns: true,\n // eslint-disable-line camelcase\n columnSelector_layout: '',\n // eslint-disable-line camelcase\n columnSelector_mediaquery: false,\n // eslint-disable-line camelcase\n columnSelector_cssChecked: 'checked' // eslint-disable-line camelcase\n\n },\n textExtraction: function () {\n return {\n // 2: Provider\n 2: function _(node) {\n return $(node).find('img').attr('title');\n },\n // 6: The size column needs an explicit field for the filtering on raw size.\n 6: function _(node) {\n return node.getAttribute('data-size');\n },\n // 9: Published date\n 9: function _(node) {\n return node.getAttribute('data-datetime');\n },\n // 10: Added date\n 10: function _(node) {\n return node.getAttribute('data-datetime');\n }\n };\n }(),\n headers: {\n 9: {\n sorter: 'realISODate'\n },\n // Published\n 10: {\n sorter: 'realISODate'\n },\n // Added\n 11: {\n sorter: false,\n parser: false // Snatch link\n\n }\n }\n });\n }\n\n $('.imdbstars').generateStars();\n\n function checkCacheUpdates(repeat) {\n var pollInterval = 5000;\n repeat = repeat || true;\n var indexerName = $('meta[data-last-prov-updates]').attr('data-indexer-name');\n var seriesId = $('meta[data-last-prov-updates]').attr('data-series-id');\n var season = $('meta[data-last-prov-updates]').attr('data-season');\n var episode = $('meta[data-last-prov-updates]').attr('data-episode');\n var data = $('meta[data-last-prov-updates]').data('last-prov-updates');\n var manualSearchType = $('meta[data-last-prov-updates]').attr('data-manual-search-type');\n var checkParams = [indexerName, seriesId, season, episode].every(function (checkIsTrue) {\n return checkIsTrue;\n });\n\n if (!checkParams) {\n console.log(\"\"(_templateObject2(), indexerName, seriesId, season, episode)(_templateObject()));\n return;\n }\n\n var urlParams = '?indexername=' + indexerName + '&seriesid=' + seriesId + '&season=' + season + '&episode=' + episode;\n\n if (manualSearchType === 'season') {\n urlParams += '&manual_search_type=' + manualSearchType;\n }\n\n if (!$.isNumeric(seriesId) || !$.isNumeric(season) || !$.isNumeric(episode)) {\n setTimeout(function () {\n checkCacheUpdates(true);\n }, 200);\n }\n\n $.ajax({\n url: 'home/manualSearchCheckCache' + urlParams,\n type: 'GET',\n data: data,\n contentType: 'application/json',\n error: function error() {\n // Repeat = false;\n console.log('Error occurred!!');\n $('.manualSearchButton').removeAttr('disabled');\n },\n complete: function complete() {\n if (repeat) {\n setTimeout(checkCacheUpdates, pollInterval);\n }\n },\n timeout: 15000 // Timeout after 15s\n\n }).done(function (data) {\n // @TODO: Combine the lower if statements\n if (data === '') {\n updateSpinner('Search finished', false);\n $('.manualSearchButton').removeAttr('disabled');\n repeat = false;\n }\n\n if (data.result === 'refresh') {\n window.location.reload();\n updateSpinner('Refreshed results...', true);\n }\n\n if (data.result === 'searching') {\n // Ep is searched, you will get a results any minute now\n pollInterval = 5000;\n $('.manualSearchButton').prop('disabled', true);\n updateSpinner('The episode is being searched, please wait......', true);\n }\n\n if (data.result === 'queued') {\n // Ep is queued, this might take some time to get results\n pollInterval = 7000;\n $('.manualSearchButton').prop('disabled', true);\n updateSpinner('The episode has been queued, because another search is taking place. please wait..', true);\n }\n\n if (data.result === 'finished') {\n // Ep search is finished\n updateSpinner('Search finished', false);\n $('.manualSearchButton').removeAttr('disabled');\n repeat = false;\n $('#srchresults').trigger('update', true);\n $('[datetime]').timeago();\n }\n\n if (data.result === 'error') {\n // Ep search is finished but with an error\n console.log('Probably tried to call manualSelectCheckCache, while page was being refreshed.');\n $('.manualSearchButton').removeAttr('disabled');\n repeat = true;\n }\n });\n }\n\n setTimeout(checkCacheUpdates, 2000); // Click event for the reload results and force search buttons\n\n $(document.body).on('click', '.manualSearchButton', function (event) {\n event.preventDefault();\n $('.manualSearchButton').prop('disabled', true);\n var indexerName = $('meta[data-last-prov-updates]').attr('data-indexer-name');\n var seriesId = $('meta[data-last-prov-updates]').attr('data-series-id');\n var season = $('meta[data-last-prov-updates]').attr('data-season');\n var episode = $('meta[data-last-prov-updates]').attr('data-episode');\n var manualSearchType = $('meta[data-last-prov-updates]').attr('data-manual-search-type');\n var forceSearch = $(event.currentTarget).attr('data-force-search');\n var checkParams = [indexerName, seriesId, season, episode].every(function (checkIsTrue) {\n return checkIsTrue;\n });\n\n if (!checkParams) {\n console.log(\"\"(_templateObject4(), indexerName, seriesId, season, episode)(_templateObject3()));\n return;\n }\n\n if ($.isNumeric(seriesId) && $.isNumeric(season) && $.isNumeric(episode)) {\n updateSpinner('Started a forced manual search...', true);\n $.getJSON('home/snatchSelection', {\n indexername: indexerName,\n seriesid: seriesId,\n season: season,\n episode: episode,\n manual_search_type: manualSearchType,\n // eslint-disable-line camelcase\n perform_search: forceSearch // eslint-disable-line camelcase\n\n }); // Force the search, but give the checkCacheUpdates the time to start up a search thread\n\n setTimeout(function () {\n checkCacheUpdates(true);\n }, 2000);\n }\n }); // Moved and rewritten this from displayShow. This changes the button when clicked for collapsing/expanding the\n // \"Show History\" button to show or hide the snatch/download/failed history for a manual searched episode or pack.\n\n $('#popover').popover({\n placement: 'bottom',\n html: true,\n // Required if content has HTML\n content: ''\n }).on('shown.bs.popover', function () {\n // Bootstrap popover event triggered when the popover opens\n $.tablesorter.columnSelector.attachTo($('#srchresults'), '#popover-target');\n });\n $('#btnReset').click(function () {\n $('#showTable').trigger('saveSortReset') // Clear saved sort\n .trigger('sortReset'); // Reset current table sort\n\n return false;\n });\n $(function () {\n initTableSorter('#srchresults');\n moveSummaryBackground();\n $('body').on('hide.bs.collapse', '.collapse.toggle', function () {\n $('#showhistory').text('Show History');\n $('#wrapper').prop('data-history-toggle', 'hide');\n });\n $('body').on('show.bs.collapse', '.collapse.toggle', function () {\n $('#showhistory').text('Hide History');\n $('#wrapper').prop('data-history-toggle', 'show');\n });\n });\n $(document.body).on('click', '.release-name-ellipses, .release-name-ellipses-toggled', function (event) {\n var target = $(event.currentTarget);\n\n if (target.hasClass('release-name-ellipses')) {\n target.switchClass('release-name-ellipses', 'release-name-ellipses-toggled', 100);\n } else {\n target.switchClass('release-name-ellipses-toggled', 'release-name-ellipses', 100);\n }\n });\n }\n};\nexports.default = _default;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/snatch-selection.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -3151,7 +3151,7 @@ eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack:///./src/ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _vueRouter = _interopRequireDefault(__webpack_require__(/*! vue-router */ \"./node_modules/vue-router/dist/vue-router.esm.js\"));\n\nvar _components = __webpack_require__(/*! ./components */ \"./src/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar homeRoutes = {\n path: '/home',\n children: [{\n path: '',\n name: 'home',\n meta: {\n title: 'Home',\n header: 'Show List'\n }\n }, {\n path: 'editShow',\n name: 'editShow'\n }, {\n path: 'displayShow',\n name: 'displayShow'\n }]\n};\nvar configRoutes = {\n path: '/config',\n component: {\n template: ''\n },\n children: [{\n path: '',\n name: 'config',\n meta: {\n title: 'Help & Info',\n header: 'Medusa Configuration'\n },\n component: _components.Config\n }, {\n path: 'anime',\n name: 'configAnime',\n meta: {\n title: 'Config - Anime',\n header: 'Anime'\n }\n }, {\n path: 'backuprestore',\n name: 'configBackupRestore',\n meta: {\n title: 'Config - Backup/Restore',\n header: 'Backup/Restore'\n }\n }, {\n path: 'general',\n name: 'configGeneral',\n meta: {\n title: 'Config - General',\n header: 'General Configuration'\n }\n }, {\n path: 'notifications',\n name: 'configNotifications',\n meta: {\n title: 'Config - Notifications',\n header: 'Notifications'\n }\n }, {\n path: 'postProcessing',\n name: 'configPostProcessing',\n meta: {\n title: 'Config - Post Processing',\n header: 'Post Processing'\n }\n }, {\n path: 'providers',\n name: 'configSearchProviders',\n meta: {\n title: 'Config - Providers',\n header: 'Search Providers'\n }\n }, {\n path: 'search',\n name: 'configSearchSettings',\n meta: {\n title: 'Config - Episode Search',\n header: 'Search Settings'\n }\n }, {\n path: 'subtitles',\n name: 'configSubtitles',\n meta: {\n title: 'Config - Subtitles',\n header: 'Subtitles'\n }\n }]\n};\nvar addShowRoutes = {\n path: '/addShows',\n component: {\n template: ' '\n },\n children: [{\n path: '',\n name: 'addShows',\n meta: {\n title: 'Add Shows',\n header: 'Add Shows'\n },\n component: _components.AddShows\n }, {\n path: 'addExistingShows',\n name: 'addExistingShows',\n meta: {\n title: 'Add Existing Shows',\n header: 'Add Existing Shows'\n }\n }, {\n path: 'newShow',\n name: 'addNewShow',\n meta: {\n title: 'Add New Show',\n header: 'Add New Show'\n }\n }]\n};\nvar loginRoute = {\n path: '/login',\n name: 'login',\n meta: {\n title: 'Login'\n },\n component: _components.Login\n};\nvar addRecommendedRoute = {\n path: '/addRecommended',\n name: 'addRecommended',\n meta: {\n title: 'Add Recommended Shows',\n header: 'Add Recommended Shows'\n },\n component: _components.AddRecommended\n};\nvar scheduleRoute = {\n path: '/schedule',\n name: 'schedule',\n meta: {\n title: 'Schedule',\n header: 'Schedule'\n }\n};\nvar historyRoute = {\n path: '/history',\n name: 'history',\n meta: {\n title: 'History',\n header: 'History'\n }\n};\nvar manageRoutes = {\n path: '/manage',\n component: {\n template: ' '\n },\n children: [{\n path: '',\n name: 'manage',\n meta: {\n title: 'Mass Update',\n header: 'Mass Update'\n }\n }, {\n path: 'backlogOverview',\n name: 'manageBacklogOverview',\n meta: {\n title: 'Backlog Overview',\n header: 'Backlog Overview'\n }\n }, {\n path: 'episodeStatuses',\n name: 'manageEpisodeOverview',\n meta: {\n title: 'Episode Overview',\n header: 'Episode Overview'\n }\n }, {\n path: 'failedDownloads',\n name: 'manageFailedDownloads',\n meta: {\n title: 'Failed Downloads',\n header: 'Failed Downlaods'\n }\n }, {\n path: 'manageSearches',\n name: 'manageManageSearches',\n meta: {\n title: 'Manage Searches',\n header: 'Manage Searches'\n }\n }, {\n path: 'massEdit',\n name: 'manageMassEdit',\n meta: {\n title: 'Mass Edit'\n }\n }, {\n path: 'subtitleMissed',\n name: 'manageSubtitleMissed',\n meta: {\n title: 'Missing Subtitles',\n header: 'Missing Subtitles'\n }\n }, {\n path: 'subtitleMissedPP',\n name: 'manageSubtitleMissedPP',\n meta: {\n title: 'Missing Subtitles in Post-Process folder',\n header: 'Missing Subtitles in Post-Process folder'\n }\n }]\n};\nvar notFoundRoutes = {\n path: '/not-found',\n name: 'not-found',\n meta: {\n title: '404',\n header: '404 - page not found'\n },\n component: _components.NotFound // @NOTE: Redirect can only be added once all routes are vue\n // }, {\n // path: '*',\n // redirect: '/not-found'\n\n};\nvar routes = [homeRoutes, configRoutes, addShowRoutes, loginRoute, addRecommendedRoute, scheduleRoute, historyRoute, manageRoutes, notFoundRoutes];\nvar router = new _vueRouter.default({\n base: document.body.getAttribute('web-root') + '/',\n mode: 'history',\n routes: routes\n});\nrouter.beforeEach(function (to, from, next) {\n var meta = to.meta;\n var title = meta.title; // If there's no title then it's not a .vue route\n // or it's handling its own title\n\n if (title) {\n document.title = \"\".concat(title, \" | Medusa\");\n } // Always call next otherwise the will be empty\n\n\n next();\n});\nvar _default = router;\nexports.default = _default;\n\n//# sourceURL=webpack:///./src/router.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _vueRouter = _interopRequireDefault(__webpack_require__(/*! vue-router */ \"./node_modules/vue-router/dist/vue-router.esm.js\"));\n\nvar _components = __webpack_require__(/*! ./components */ \"./src/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar homeRoutes = {\n path: '/home',\n children: [{\n path: '',\n name: 'home',\n meta: {\n title: 'Home',\n header: 'Show List'\n }\n }, {\n path: 'editShow',\n name: 'editShow'\n }, {\n path: 'displayShow',\n name: 'displayShow'\n }, {\n path: 'snatchSelection',\n name: 'snatchSelection'\n }, {\n path: 'testRename',\n name: 'testRename',\n meta: {\n title: 'Preview Rename',\n header: 'Preview Rename'\n }\n }, {\n path: 'postprocess',\n name: 'postprocess',\n meta: {\n title: 'Manual Post-Processing',\n header: 'Manual Post-Processing'\n }\n }, {\n path: 'status',\n name: 'status',\n meta: {\n title: 'Status'\n }\n }]\n};\nvar configRoutes = {\n path: '/config',\n component: {\n template: ' '\n },\n children: [{\n path: '',\n name: 'config',\n meta: {\n title: 'Help & Info',\n header: 'Medusa Configuration'\n },\n component: _components.Config\n }, {\n path: 'anime',\n name: 'configAnime',\n meta: {\n title: 'Config - Anime',\n header: 'Anime'\n }\n }, {\n path: 'backuprestore',\n name: 'configBackupRestore',\n meta: {\n title: 'Config - Backup/Restore',\n header: 'Backup/Restore'\n }\n }, {\n path: 'general',\n name: 'configGeneral',\n meta: {\n title: 'Config - General',\n header: 'General Configuration'\n }\n }, {\n path: 'notifications',\n name: 'configNotifications',\n meta: {\n title: 'Config - Notifications',\n header: 'Notifications'\n }\n }, {\n path: 'postProcessing',\n name: 'configPostProcessing',\n meta: {\n title: 'Config - Post Processing',\n header: 'Post Processing'\n }\n }, {\n path: 'providers',\n name: 'configSearchProviders',\n meta: {\n title: 'Config - Providers',\n header: 'Search Providers'\n }\n }, {\n path: 'search',\n name: 'configSearchSettings',\n meta: {\n title: 'Config - Episode Search',\n header: 'Search Settings'\n }\n }, {\n path: 'subtitles',\n name: 'configSubtitles',\n meta: {\n title: 'Config - Subtitles',\n header: 'Subtitles'\n }\n }]\n};\nvar addShowRoutes = {\n path: '/addShows',\n component: {\n template: ' '\n },\n children: [{\n path: '',\n name: 'addShows',\n meta: {\n title: 'Add Shows',\n header: 'Add Shows'\n },\n component: _components.AddShows\n }, {\n path: 'addExistingShows',\n name: 'addExistingShows',\n meta: {\n title: 'Add Existing Shows',\n header: 'Add Existing Shows'\n }\n }, {\n path: 'newShow',\n name: 'addNewShow',\n meta: {\n title: 'Add New Show',\n header: 'Add New Show'\n }\n }]\n};\nvar loginRoute = {\n path: '/login',\n name: 'login',\n meta: {\n title: 'Login'\n },\n component: _components.Login\n};\nvar addRecommendedRoute = {\n path: '/addRecommended',\n name: 'addRecommended',\n meta: {\n title: 'Add Recommended Shows',\n header: 'Add Recommended Shows'\n },\n component: _components.AddRecommended\n};\nvar scheduleRoute = {\n path: '/schedule',\n name: 'schedule',\n meta: {\n title: 'Schedule',\n header: 'Schedule'\n }\n};\nvar historyRoute = {\n path: '/history',\n name: 'history',\n meta: {\n title: 'History',\n header: 'History'\n }\n};\nvar manageRoutes = {\n path: '/manage',\n component: {\n template: ' '\n },\n children: [{\n path: '',\n name: 'manage',\n meta: {\n title: 'Mass Update',\n header: 'Mass Update'\n }\n }, {\n path: 'backlogOverview',\n name: 'manageBacklogOverview',\n meta: {\n title: 'Backlog Overview',\n header: 'Backlog Overview'\n }\n }, {\n path: 'episodeStatuses',\n name: 'manageEpisodeOverview',\n meta: {\n title: 'Episode Overview',\n header: 'Episode Overview'\n }\n }, {\n path: 'failedDownloads',\n name: 'manageFailedDownloads',\n meta: {\n title: 'Failed Downloads',\n header: 'Failed Downlaods'\n }\n }, {\n path: 'manageSearches',\n name: 'manageManageSearches',\n meta: {\n title: 'Manage Searches',\n header: 'Manage Searches'\n }\n }, {\n path: 'massEdit',\n name: 'manageMassEdit',\n meta: {\n title: 'Mass Edit'\n }\n }, {\n path: 'subtitleMissed',\n name: 'manageSubtitleMissed',\n meta: {\n title: 'Missing Subtitles',\n header: 'Missing Subtitles'\n }\n }, {\n path: 'subtitleMissedPP',\n name: 'manageSubtitleMissedPP',\n meta: {\n title: 'Missing Subtitles in Post-Process folder',\n header: 'Missing Subtitles in Post-Process folder'\n }\n }]\n};\nvar notFoundRoutes = {\n path: '/not-found',\n name: 'not-found',\n meta: {\n title: '404',\n header: '404 - page not found'\n },\n component: _components.NotFound // @NOTE: Redirect can only be added once all routes are vue\n // }, {\n // path: '*',\n // redirect: '/not-found'\n\n};\nvar routes = [homeRoutes, configRoutes, addShowRoutes, loginRoute, addRecommendedRoute, scheduleRoute, historyRoute, manageRoutes, notFoundRoutes];\nvar router = new _vueRouter.default({\n base: document.body.getAttribute('web-root') + '/',\n mode: 'history',\n routes: routes\n});\nrouter.beforeEach(function (to, from, next) {\n var meta = to.meta;\n var title = meta.title; // If there's no title then it's not a .vue route\n // or it's handling its own title\n\n if (title) {\n document.title = \"\".concat(title, \" | Medusa\");\n } // Always call next otherwise the will be empty\n\n\n next();\n});\nvar _default = router;\nexports.default = _default;\n\n//# sourceURL=webpack:///./src/router.js?"); /***/ }), diff --git a/themes/dark/templates/home_postprocess.mako b/themes/dark/templates/home_postprocess.mako index 7f39c7f967..72caa571f4 100644 --- a/themes/dark/templates/home_postprocess.mako +++ b/themes/dark/templates/home_postprocess.mako @@ -8,7 +8,7 @@ -{{header}}
+{{ $route.meta.header }}
@@ -112,6 +112,7 @@ window.app = {}; window.app = new Vue({ el: '#vue-wrap', store, + router, data() { return { // This loads manual-post-process.vue diff --git a/themes/dark/templates/testRename.mako b/themes/dark/templates/testRename.mako index 7d6b51410c..5822873ee9 100644 --- a/themes/dark/templates/testRename.mako +++ b/themes/dark/templates/testRename.mako @@ -12,63 +12,54 @@ <%block name="scripts"> %block> <%block name="content"> @@ -82,7 +73,7 @@ const startVue = () => { -{{header}}
+{{ $route.meta.header }}
Preview of the proposed name changes
% if int(show.air_by_date) == 1 and app.NAMING_CUSTOM_ABD: diff --git a/themes/light/assets/js/vendors.js b/themes/light/assets/js/vendors.js index ff513fca81..0cbc6b6936 100644 --- a/themes/light/assets/js/vendors.js +++ b/themes/light/assets/js/vendors.js @@ -663,7 +663,7 @@ eval("\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nmodule.exports /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("/* WEBPACK VAR INJECTION */(function($) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = {\n name: 'manual-post-process',\n template: '#manual-post-process-template',\n metaInfo: {\n title: 'Post Processing'\n },\n data: function data() {\n return {\n header: 'Post Processing'\n };\n },\n mounted: function mounted() {\n $('#episodeDir').fileBrowser({\n title: 'Select Unprocessed Episode Folder',\n key: 'postprocessPath'\n });\n }\n};\nexports.default = _default;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/manual-post-process.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); +eval("/* WEBPACK VAR INJECTION */(function($) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = {\n name: 'manual-post-process',\n template: '#manual-post-process-template',\n mounted: function mounted() {\n $('#episodeDir').fileBrowser({\n title: 'Select Unprocessed Episode Folder',\n key: 'postprocessPath'\n });\n }\n};\nexports.default = _default;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/manual-post-process.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -747,7 +747,7 @@ eval("\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("/* WEBPACK VAR INJECTION */(function($) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n\nvar _appLink = _interopRequireDefault(__webpack_require__(/*! ./app-link.vue */ \"./src/components/app-link.vue\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _templateObject4() {\n var data = _taggedTemplateLiteral([\"Something went wrong in getthing the paramaters from dom. indexerName: \", \",\\n seriesId: \", \", season: \", \", episode: \", \"\"]);\n\n _templateObject4 = function _templateObject4() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject3() {\n var data = _taggedTemplateLiteral([\"\"]);\n\n _templateObject3 = function _templateObject3() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject2() {\n var data = _taggedTemplateLiteral([\"Something went wrong in getthing the paramaters from dom. indexerName: \", \",\\n seriesId: \", \", season: \", \", episode: \", \"\"]);\n\n _templateObject2 = function _templateObject2() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"\"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: 'snatchSelection',\n template: '#snatch-selection-template',\n components: {\n AppLink: _appLink.default\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n shows: function shows(state) {\n return state.shows.shows;\n }\n }), (0, _vuex.mapGetters)(['getShowById']), {\n indexer: function indexer() {\n return this.$route.query.indexername;\n },\n id: function id() {\n return this.$route.query.seriesid;\n },\n season: function season() {\n return this.$route.query.season;\n },\n episode: function episode() {\n return this.$route.query.episode;\n },\n show: function show() {\n var indexer = this.indexer,\n id = this.id,\n getShowById = this.getShowById,\n shows = this.shows,\n $store = this.$store;\n var defaults = $store.state.defaults;\n\n if (shows.length === 0 || !indexer || !id) {\n return defaults.show;\n }\n\n var show = getShowById({\n indexer: indexer,\n id: id\n });\n\n if (!show) {\n return defaults.show;\n }\n\n return show;\n }\n }),\n mounted: function mounted() {\n window.addEventListener('load', function () {\n // Adjust the summary background position and size\n window.dispatchEvent(new Event('resize'));\n });\n attachImdbTooltip(); // eslint-disable-line no-undef\n\n $(document.body).on('click', '.imdbPlot', function (event) {\n $(event.currentTarget).prev('span').toggle();\n\n if ($(event.currentTarget).html() === '..show less') {\n $(event.currentTarget).html('..show more');\n } else {\n $(event.currentTarget).html('..show less');\n }\n\n moveSummaryBackground();\n }); // Adjust the summary background position and size on page load and resize\n\n function moveSummaryBackground() {\n var height = $('#summary').height() + 10;\n var top = $('#summary').offset().top + 5;\n $('#summaryBackground').height(height);\n $('#summaryBackground').offset({\n top: top,\n left: 0\n });\n $('#summaryBackground').show();\n }\n\n $(window).resize(function () {\n moveSummaryBackground();\n });\n\n var updateSpinner = function updateSpinner(message, showSpinner) {\n // Get spinner object as needed\n var spinner = $('#searchNotification');\n\n if (showSpinner) {\n message = ' ' + message;\n }\n\n $(spinner).empty().append(message);\n }; // Check the previous status of the history table, for hidden or shown, through the data attribute\n // data-history-toggle-hidden\n\n\n function toggleHistoryTable() {\n // eslint-disable-line no-unused-vars\n // Get previous state which was saved on the wrapper\n var showOrHide = $('#wrapper').attr('data-history-toggle');\n $('#historydata').collapse(showOrHide);\n }\n\n $.fn.loadContainer = function (path, loadingTxt, errorTxt, callback) {\n updateSpinner(loadingTxt);\n $('#manualSearchMeta').load(path + ' #manualSearchMeta meta');\n $(this).load(path + ' #manualSearchTbody tr', function (response, status) {\n if (status === 'error') {\n updateSpinner(errorTxt, false);\n }\n\n if (typeof callback !== 'undefined') {\n callback();\n }\n });\n }; // Click event for the download button for snatching a result\n\n\n $(document.body).on('click', '.epManualSearch', function (event) {\n event.preventDefault();\n var link = event.currentTarget;\n $(link).children('img').prop('src', 'images/loading16.gif');\n $.getJSON(event.currentTarget.href, function (data) {\n if (data.result === 'success') {\n $(link).children('img').prop('src', 'images/save.png');\n } else {\n $(link).children('img').prop('src', 'images/no16.png');\n }\n });\n });\n\n $.fn.generateStars = function () {\n return this.each(function (index, element) {\n $(element).html($('').width($(element).text() * 12));\n });\n };\n\n function initTableSorter(table) {\n // Nasty hack to re-initialize tablesorter after refresh\n $(table).tablesorter({\n widgets: ['saveSort', 'stickyHeaders', 'columnSelector', 'filter'],\n widgetOptions: {\n filter_columnFilters: true,\n // eslint-disable-line camelcase\n filter_hideFilters: true,\n // eslint-disable-line camelcase\n filter_saveFilters: true,\n // eslint-disable-line camelcase\n columnSelector_saveColumns: true,\n // eslint-disable-line camelcase\n columnSelector_layout: '',\n // eslint-disable-line camelcase\n columnSelector_mediaquery: false,\n // eslint-disable-line camelcase\n columnSelector_cssChecked: 'checked' // eslint-disable-line camelcase\n\n },\n textExtraction: function () {\n return {\n // 2: Provider\n 2: function _(node) {\n return $(node).find('img').attr('title');\n },\n // 6: The size column needs an explicit field for the filtering on raw size.\n 6: function _(node) {\n return node.getAttribute('data-size');\n },\n // 9: Published date\n 9: function _(node) {\n return node.getAttribute('data-datetime');\n },\n // 10: Added date\n 10: function _(node) {\n return node.getAttribute('data-datetime');\n }\n };\n }(),\n headers: {\n 9: {\n sorter: 'realISODate'\n },\n // Published\n 10: {\n sorter: 'realISODate'\n },\n // Added\n 11: {\n sorter: false,\n parser: false // Snatch link\n\n }\n }\n });\n }\n\n $('.imdbstars').generateStars();\n\n function checkCacheUpdates(repeat) {\n var pollInterval = 5000;\n repeat = repeat || true;\n var indexerName = $('meta[data-last-prov-updates]').attr('data-indexer-name');\n var seriesId = $('meta[data-last-prov-updates]').attr('data-series-id');\n var season = $('meta[data-last-prov-updates]').attr('data-season');\n var episode = $('meta[data-last-prov-updates]').attr('data-episode');\n var data = $('meta[data-last-prov-updates]').data('last-prov-updates');\n var manualSearchType = $('meta[data-last-prov-updates]').attr('data-manual-search-type');\n var checkParams = [indexerName, seriesId, season, episode].every(function (checkIsTrue) {\n return checkIsTrue;\n });\n\n if (!checkParams) {\n console.log(\"\"(_templateObject2(), indexerName, seriesId, season, episode)(_templateObject()));\n return;\n }\n\n var urlParams = '?indexername=' + indexerName + '&seriesid=' + seriesId + '&season=' + season + '&episode=' + episode;\n\n if (manualSearchType === 'season') {\n urlParams += '&manual_search_type=' + manualSearchType;\n }\n\n if (!$.isNumeric(seriesId) || !$.isNumeric(season) || !$.isNumeric(episode)) {\n setTimeout(function () {\n checkCacheUpdates(true);\n }, 200);\n }\n\n $.ajax({\n url: 'home/manualSearchCheckCache' + urlParams,\n type: 'GET',\n data: data,\n contentType: 'application/json',\n error: function error() {\n // Repeat = false;\n console.log('Error occurred!!');\n $('.manualSearchButton').removeAttr('disabled');\n },\n complete: function complete() {\n if (repeat) {\n setTimeout(checkCacheUpdates, pollInterval);\n }\n },\n timeout: 15000 // Timeout after 15s\n\n }).done(function (data) {\n // @TODO: Combine the lower if statements\n if (data === '') {\n updateSpinner('Search finished', false);\n $('.manualSearchButton').removeAttr('disabled');\n repeat = false;\n }\n\n if (data.result === 'refresh') {\n window.location.reload();\n updateSpinner('Refreshed results...', true);\n }\n\n if (data.result === 'searching') {\n // Ep is searched, you will get a results any minute now\n pollInterval = 5000;\n $('.manualSearchButton').prop('disabled', true);\n updateSpinner('The episode is being searched, please wait......', true);\n }\n\n if (data.result === 'queued') {\n // Ep is queued, this might take some time to get results\n pollInterval = 7000;\n $('.manualSearchButton').prop('disabled', true);\n updateSpinner('The episode has been queued, because another search is taking place. please wait..', true);\n }\n\n if (data.result === 'finished') {\n // Ep search is finished\n updateSpinner('Search finished', false);\n $('.manualSearchButton').removeAttr('disabled');\n repeat = false;\n $('#srchresults').trigger('update', true);\n $('[datetime]').timeago();\n }\n\n if (data.result === 'error') {\n // Ep search is finished but with an error\n console.log('Probably tried to call manualSelectCheckCache, while page was being refreshed.');\n $('.manualSearchButton').removeAttr('disabled');\n repeat = true;\n }\n });\n }\n\n setTimeout(checkCacheUpdates, 2000); // Click event for the reload results and force search buttons\n\n $(document.body).on('click', '.manualSearchButton', function (event) {\n event.preventDefault();\n $('.manualSearchButton').prop('disabled', true);\n var indexerName = $('meta[data-last-prov-updates]').attr('data-indexer-name');\n var seriesId = $('meta[data-last-prov-updates]').attr('data-series-id');\n var season = $('meta[data-last-prov-updates]').attr('data-season');\n var episode = $('meta[data-last-prov-updates]').attr('data-episode');\n var manualSearchType = $('meta[data-last-prov-updates]').attr('data-manual-search-type');\n var forceSearch = $(event.currentTarget).attr('data-force-search');\n var checkParams = [indexerName, seriesId, season, episode].every(function (checkIsTrue) {\n return checkIsTrue;\n });\n\n if (!checkParams) {\n console.log(\"\"(_templateObject4(), indexerName, seriesId, season, episode)(_templateObject3()));\n return;\n }\n\n if ($.isNumeric(seriesId) && $.isNumeric(season) && $.isNumeric(episode)) {\n updateSpinner('Started a forced manual search...', true);\n $.getJSON('home/snatchSelection', {\n indexername: indexerName,\n seriesid: seriesId,\n season: season,\n episode: episode,\n manual_search_type: manualSearchType,\n // eslint-disable-line camelcase\n perform_search: forceSearch // eslint-disable-line camelcase\n\n }); // Force the search, but give the checkCacheUpdates the time to start up a search thread\n\n setTimeout(function () {\n checkCacheUpdates(true);\n }, 2000);\n }\n }); // Moved and rewritten this from displayShow. This changes the button when clicked for collapsing/expanding the\n // \"Show History\" button to show or hide the snatch/download/failed history for a manual searched episode or pack.\n\n $('#popover').popover({\n placement: 'bottom',\n html: true,\n // Required if content has HTML\n content: ''\n }).on('shown.bs.popover', function () {\n // Bootstrap popover event triggered when the popover opens\n $.tablesorter.columnSelector.attachTo($('#srchresults'), '#popover-target');\n });\n $('#btnReset').click(function () {\n $('#showTable').trigger('saveSortReset') // Clear saved sort\n .trigger('sortReset'); // Reset current table sort\n\n return false;\n });\n $(function () {\n initTableSorter('#srchresults');\n moveSummaryBackground();\n $('body').on('hide.bs.collapse', '.collapse.toggle', function () {\n $('#showhistory').text('Show History');\n $('#wrapper').prop('data-history-toggle', 'hide');\n });\n $('body').on('show.bs.collapse', '.collapse.toggle', function () {\n $('#showhistory').text('Hide History');\n $('#wrapper').prop('data-history-toggle', 'show');\n });\n });\n $(document.body).on('click', '.release-name-ellipses, .release-name-ellipses-toggled', function (event) {\n var target = $(event.currentTarget);\n\n if (target.hasClass('release-name-ellipses')) {\n target.switchClass('release-name-ellipses', 'release-name-ellipses-toggled', 100);\n } else {\n target.switchClass('release-name-ellipses-toggled', 'release-name-ellipses', 100);\n }\n });\n }\n};\nexports.default = _default;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/snatch-selection.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); +eval("/* WEBPACK VAR INJECTION */(function($) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n\nvar _appLink = _interopRequireDefault(__webpack_require__(/*! ./app-link.vue */ \"./src/components/app-link.vue\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _templateObject4() {\n var data = _taggedTemplateLiteral([\"Something went wrong in getthing the paramaters from dom. indexerName: \", \",\\n seriesId: \", \", season: \", \", episode: \", \"\"]);\n\n _templateObject4 = function _templateObject4() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject3() {\n var data = _taggedTemplateLiteral([\"\"]);\n\n _templateObject3 = function _templateObject3() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject2() {\n var data = _taggedTemplateLiteral([\"Something went wrong in getthing the paramaters from dom. indexerName: \", \",\\n seriesId: \", \", season: \", \", episode: \", \"\"]);\n\n _templateObject2 = function _templateObject2() {\n return data;\n };\n\n return data;\n}\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"\"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: 'snatchSelection',\n template: '#snatch-selection-template',\n components: {\n AppLink: _appLink.default\n },\n metaInfo: function metaInfo() {\n if (!this.show || !this.show.title) {\n return {\n title: 'Medusa'\n };\n }\n\n var title = this.show.title;\n return {\n title: title,\n titleTemplate: '%s | Medusa'\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n shows: function shows(state) {\n return state.shows.shows;\n }\n }), (0, _vuex.mapGetters)(['getShowById']), {\n indexer: function indexer() {\n return this.$route.query.indexername;\n },\n id: function id() {\n return this.$route.query.seriesid;\n },\n season: function season() {\n return this.$route.query.season;\n },\n episode: function episode() {\n return this.$route.query.episode;\n },\n show: function show() {\n var indexer = this.indexer,\n id = this.id,\n getShowById = this.getShowById,\n shows = this.shows,\n $store = this.$store;\n var defaults = $store.state.defaults;\n\n if (shows.length === 0 || !indexer || !id) {\n return defaults.show;\n }\n\n var show = getShowById({\n indexer: indexer,\n id: id\n });\n\n if (!show) {\n return defaults.show;\n }\n\n return show;\n }\n }),\n created: function created() {\n var indexer = this.indexer,\n id = this.id,\n $store = this.$store; // Needed for the title\n\n $store.dispatch('getShow', {\n indexer: indexer,\n id: id\n });\n },\n mounted: function mounted() {\n window.addEventListener('load', function () {\n // Adjust the summary background position and size\n window.dispatchEvent(new Event('resize'));\n });\n attachImdbTooltip(); // eslint-disable-line no-undef\n\n $(document.body).on('click', '.imdbPlot', function (event) {\n $(event.currentTarget).prev('span').toggle();\n\n if ($(event.currentTarget).html() === '..show less') {\n $(event.currentTarget).html('..show more');\n } else {\n $(event.currentTarget).html('..show less');\n }\n\n moveSummaryBackground();\n }); // Adjust the summary background position and size on page load and resize\n\n function moveSummaryBackground() {\n var height = $('#summary').height() + 10;\n var top = $('#summary').offset().top + 5;\n $('#summaryBackground').height(height);\n $('#summaryBackground').offset({\n top: top,\n left: 0\n });\n $('#summaryBackground').show();\n }\n\n $(window).resize(function () {\n moveSummaryBackground();\n });\n\n var updateSpinner = function updateSpinner(message, showSpinner) {\n // Get spinner object as needed\n var spinner = $('#searchNotification');\n\n if (showSpinner) {\n message = ' ' + message;\n }\n\n $(spinner).empty().append(message);\n }; // Check the previous status of the history table, for hidden or shown, through the data attribute\n // data-history-toggle-hidden\n\n\n function toggleHistoryTable() {\n // eslint-disable-line no-unused-vars\n // Get previous state which was saved on the wrapper\n var showOrHide = $('#wrapper').attr('data-history-toggle');\n $('#historydata').collapse(showOrHide);\n }\n\n $.fn.loadContainer = function (path, loadingTxt, errorTxt, callback) {\n updateSpinner(loadingTxt);\n $('#manualSearchMeta').load(path + ' #manualSearchMeta meta');\n $(this).load(path + ' #manualSearchTbody tr', function (response, status) {\n if (status === 'error') {\n updateSpinner(errorTxt, false);\n }\n\n if (typeof callback !== 'undefined') {\n callback();\n }\n });\n }; // Click event for the download button for snatching a result\n\n\n $(document.body).on('click', '.epManualSearch', function (event) {\n event.preventDefault();\n var link = event.currentTarget;\n $(link).children('img').prop('src', 'images/loading16.gif');\n $.getJSON(event.currentTarget.href, function (data) {\n if (data.result === 'success') {\n $(link).children('img').prop('src', 'images/save.png');\n } else {\n $(link).children('img').prop('src', 'images/no16.png');\n }\n });\n });\n\n $.fn.generateStars = function () {\n return this.each(function (index, element) {\n $(element).html($('').width($(element).text() * 12));\n });\n };\n\n function initTableSorter(table) {\n // Nasty hack to re-initialize tablesorter after refresh\n $(table).tablesorter({\n widgets: ['saveSort', 'stickyHeaders', 'columnSelector', 'filter'],\n widgetOptions: {\n filter_columnFilters: true,\n // eslint-disable-line camelcase\n filter_hideFilters: true,\n // eslint-disable-line camelcase\n filter_saveFilters: true,\n // eslint-disable-line camelcase\n columnSelector_saveColumns: true,\n // eslint-disable-line camelcase\n columnSelector_layout: '',\n // eslint-disable-line camelcase\n columnSelector_mediaquery: false,\n // eslint-disable-line camelcase\n columnSelector_cssChecked: 'checked' // eslint-disable-line camelcase\n\n },\n textExtraction: function () {\n return {\n // 2: Provider\n 2: function _(node) {\n return $(node).find('img').attr('title');\n },\n // 6: The size column needs an explicit field for the filtering on raw size.\n 6: function _(node) {\n return node.getAttribute('data-size');\n },\n // 9: Published date\n 9: function _(node) {\n return node.getAttribute('data-datetime');\n },\n // 10: Added date\n 10: function _(node) {\n return node.getAttribute('data-datetime');\n }\n };\n }(),\n headers: {\n 9: {\n sorter: 'realISODate'\n },\n // Published\n 10: {\n sorter: 'realISODate'\n },\n // Added\n 11: {\n sorter: false,\n parser: false // Snatch link\n\n }\n }\n });\n }\n\n $('.imdbstars').generateStars();\n\n function checkCacheUpdates(repeat) {\n var pollInterval = 5000;\n repeat = repeat || true;\n var indexerName = $('meta[data-last-prov-updates]').attr('data-indexer-name');\n var seriesId = $('meta[data-last-prov-updates]').attr('data-series-id');\n var season = $('meta[data-last-prov-updates]').attr('data-season');\n var episode = $('meta[data-last-prov-updates]').attr('data-episode');\n var data = $('meta[data-last-prov-updates]').data('last-prov-updates');\n var manualSearchType = $('meta[data-last-prov-updates]').attr('data-manual-search-type');\n var checkParams = [indexerName, seriesId, season, episode].every(function (checkIsTrue) {\n return checkIsTrue;\n });\n\n if (!checkParams) {\n console.log(\"\"(_templateObject2(), indexerName, seriesId, season, episode)(_templateObject()));\n return;\n }\n\n var urlParams = '?indexername=' + indexerName + '&seriesid=' + seriesId + '&season=' + season + '&episode=' + episode;\n\n if (manualSearchType === 'season') {\n urlParams += '&manual_search_type=' + manualSearchType;\n }\n\n if (!$.isNumeric(seriesId) || !$.isNumeric(season) || !$.isNumeric(episode)) {\n setTimeout(function () {\n checkCacheUpdates(true);\n }, 200);\n }\n\n $.ajax({\n url: 'home/manualSearchCheckCache' + urlParams,\n type: 'GET',\n data: data,\n contentType: 'application/json',\n error: function error() {\n // Repeat = false;\n console.log('Error occurred!!');\n $('.manualSearchButton').removeAttr('disabled');\n },\n complete: function complete() {\n if (repeat) {\n setTimeout(checkCacheUpdates, pollInterval);\n }\n },\n timeout: 15000 // Timeout after 15s\n\n }).done(function (data) {\n // @TODO: Combine the lower if statements\n if (data === '') {\n updateSpinner('Search finished', false);\n $('.manualSearchButton').removeAttr('disabled');\n repeat = false;\n }\n\n if (data.result === 'refresh') {\n window.location.reload();\n updateSpinner('Refreshed results...', true);\n }\n\n if (data.result === 'searching') {\n // Ep is searched, you will get a results any minute now\n pollInterval = 5000;\n $('.manualSearchButton').prop('disabled', true);\n updateSpinner('The episode is being searched, please wait......', true);\n }\n\n if (data.result === 'queued') {\n // Ep is queued, this might take some time to get results\n pollInterval = 7000;\n $('.manualSearchButton').prop('disabled', true);\n updateSpinner('The episode has been queued, because another search is taking place. please wait..', true);\n }\n\n if (data.result === 'finished') {\n // Ep search is finished\n updateSpinner('Search finished', false);\n $('.manualSearchButton').removeAttr('disabled');\n repeat = false;\n $('#srchresults').trigger('update', true);\n $('[datetime]').timeago();\n }\n\n if (data.result === 'error') {\n // Ep search is finished but with an error\n console.log('Probably tried to call manualSelectCheckCache, while page was being refreshed.');\n $('.manualSearchButton').removeAttr('disabled');\n repeat = true;\n }\n });\n }\n\n setTimeout(checkCacheUpdates, 2000); // Click event for the reload results and force search buttons\n\n $(document.body).on('click', '.manualSearchButton', function (event) {\n event.preventDefault();\n $('.manualSearchButton').prop('disabled', true);\n var indexerName = $('meta[data-last-prov-updates]').attr('data-indexer-name');\n var seriesId = $('meta[data-last-prov-updates]').attr('data-series-id');\n var season = $('meta[data-last-prov-updates]').attr('data-season');\n var episode = $('meta[data-last-prov-updates]').attr('data-episode');\n var manualSearchType = $('meta[data-last-prov-updates]').attr('data-manual-search-type');\n var forceSearch = $(event.currentTarget).attr('data-force-search');\n var checkParams = [indexerName, seriesId, season, episode].every(function (checkIsTrue) {\n return checkIsTrue;\n });\n\n if (!checkParams) {\n console.log(\"\"(_templateObject4(), indexerName, seriesId, season, episode)(_templateObject3()));\n return;\n }\n\n if ($.isNumeric(seriesId) && $.isNumeric(season) && $.isNumeric(episode)) {\n updateSpinner('Started a forced manual search...', true);\n $.getJSON('home/snatchSelection', {\n indexername: indexerName,\n seriesid: seriesId,\n season: season,\n episode: episode,\n manual_search_type: manualSearchType,\n // eslint-disable-line camelcase\n perform_search: forceSearch // eslint-disable-line camelcase\n\n }); // Force the search, but give the checkCacheUpdates the time to start up a search thread\n\n setTimeout(function () {\n checkCacheUpdates(true);\n }, 2000);\n }\n }); // Moved and rewritten this from displayShow. This changes the button when clicked for collapsing/expanding the\n // \"Show History\" button to show or hide the snatch/download/failed history for a manual searched episode or pack.\n\n $('#popover').popover({\n placement: 'bottom',\n html: true,\n // Required if content has HTML\n content: ''\n }).on('shown.bs.popover', function () {\n // Bootstrap popover event triggered when the popover opens\n $.tablesorter.columnSelector.attachTo($('#srchresults'), '#popover-target');\n });\n $('#btnReset').click(function () {\n $('#showTable').trigger('saveSortReset') // Clear saved sort\n .trigger('sortReset'); // Reset current table sort\n\n return false;\n });\n $(function () {\n initTableSorter('#srchresults');\n moveSummaryBackground();\n $('body').on('hide.bs.collapse', '.collapse.toggle', function () {\n $('#showhistory').text('Show History');\n $('#wrapper').prop('data-history-toggle', 'hide');\n });\n $('body').on('show.bs.collapse', '.collapse.toggle', function () {\n $('#showhistory').text('Hide History');\n $('#wrapper').prop('data-history-toggle', 'show');\n });\n });\n $(document.body).on('click', '.release-name-ellipses, .release-name-ellipses-toggled', function (event) {\n var target = $(event.currentTarget);\n\n if (target.hasClass('release-name-ellipses')) {\n target.switchClass('release-name-ellipses', 'release-name-ellipses-toggled', 100);\n } else {\n target.switchClass('release-name-ellipses-toggled', 'release-name-ellipses', 100);\n }\n });\n }\n};\nexports.default = _default;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\")))\n\n//# sourceURL=webpack:///./src/components/snatch-selection.vue?./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), @@ -3151,7 +3151,7 @@ eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack:///./src/ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _vueRouter = _interopRequireDefault(__webpack_require__(/*! vue-router */ \"./node_modules/vue-router/dist/vue-router.esm.js\"));\n\nvar _components = __webpack_require__(/*! ./components */ \"./src/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar homeRoutes = {\n path: '/home',\n children: [{\n path: '',\n name: 'home',\n meta: {\n title: 'Home',\n header: 'Show List'\n }\n }, {\n path: 'editShow',\n name: 'editShow'\n }, {\n path: 'displayShow',\n name: 'displayShow'\n }]\n};\nvar configRoutes = {\n path: '/config',\n component: {\n template: ''\n },\n children: [{\n path: '',\n name: 'config',\n meta: {\n title: 'Help & Info',\n header: 'Medusa Configuration'\n },\n component: _components.Config\n }, {\n path: 'anime',\n name: 'configAnime',\n meta: {\n title: 'Config - Anime',\n header: 'Anime'\n }\n }, {\n path: 'backuprestore',\n name: 'configBackupRestore',\n meta: {\n title: 'Config - Backup/Restore',\n header: 'Backup/Restore'\n }\n }, {\n path: 'general',\n name: 'configGeneral',\n meta: {\n title: 'Config - General',\n header: 'General Configuration'\n }\n }, {\n path: 'notifications',\n name: 'configNotifications',\n meta: {\n title: 'Config - Notifications',\n header: 'Notifications'\n }\n }, {\n path: 'postProcessing',\n name: 'configPostProcessing',\n meta: {\n title: 'Config - Post Processing',\n header: 'Post Processing'\n }\n }, {\n path: 'providers',\n name: 'configSearchProviders',\n meta: {\n title: 'Config - Providers',\n header: 'Search Providers'\n }\n }, {\n path: 'search',\n name: 'configSearchSettings',\n meta: {\n title: 'Config - Episode Search',\n header: 'Search Settings'\n }\n }, {\n path: 'subtitles',\n name: 'configSubtitles',\n meta: {\n title: 'Config - Subtitles',\n header: 'Subtitles'\n }\n }]\n};\nvar addShowRoutes = {\n path: '/addShows',\n component: {\n template: ' '\n },\n children: [{\n path: '',\n name: 'addShows',\n meta: {\n title: 'Add Shows',\n header: 'Add Shows'\n },\n component: _components.AddShows\n }, {\n path: 'addExistingShows',\n name: 'addExistingShows',\n meta: {\n title: 'Add Existing Shows',\n header: 'Add Existing Shows'\n }\n }, {\n path: 'newShow',\n name: 'addNewShow',\n meta: {\n title: 'Add New Show',\n header: 'Add New Show'\n }\n }]\n};\nvar loginRoute = {\n path: '/login',\n name: 'login',\n meta: {\n title: 'Login'\n },\n component: _components.Login\n};\nvar addRecommendedRoute = {\n path: '/addRecommended',\n name: 'addRecommended',\n meta: {\n title: 'Add Recommended Shows',\n header: 'Add Recommended Shows'\n },\n component: _components.AddRecommended\n};\nvar scheduleRoute = {\n path: '/schedule',\n name: 'schedule',\n meta: {\n title: 'Schedule',\n header: 'Schedule'\n }\n};\nvar historyRoute = {\n path: '/history',\n name: 'history',\n meta: {\n title: 'History',\n header: 'History'\n }\n};\nvar manageRoutes = {\n path: '/manage',\n component: {\n template: ' '\n },\n children: [{\n path: '',\n name: 'manage',\n meta: {\n title: 'Mass Update',\n header: 'Mass Update'\n }\n }, {\n path: 'backlogOverview',\n name: 'manageBacklogOverview',\n meta: {\n title: 'Backlog Overview',\n header: 'Backlog Overview'\n }\n }, {\n path: 'episodeStatuses',\n name: 'manageEpisodeOverview',\n meta: {\n title: 'Episode Overview',\n header: 'Episode Overview'\n }\n }, {\n path: 'failedDownloads',\n name: 'manageFailedDownloads',\n meta: {\n title: 'Failed Downloads',\n header: 'Failed Downlaods'\n }\n }, {\n path: 'manageSearches',\n name: 'manageManageSearches',\n meta: {\n title: 'Manage Searches',\n header: 'Manage Searches'\n }\n }, {\n path: 'massEdit',\n name: 'manageMassEdit',\n meta: {\n title: 'Mass Edit'\n }\n }, {\n path: 'subtitleMissed',\n name: 'manageSubtitleMissed',\n meta: {\n title: 'Missing Subtitles',\n header: 'Missing Subtitles'\n }\n }, {\n path: 'subtitleMissedPP',\n name: 'manageSubtitleMissedPP',\n meta: {\n title: 'Missing Subtitles in Post-Process folder',\n header: 'Missing Subtitles in Post-Process folder'\n }\n }]\n};\nvar notFoundRoutes = {\n path: '/not-found',\n name: 'not-found',\n meta: {\n title: '404',\n header: '404 - page not found'\n },\n component: _components.NotFound // @NOTE: Redirect can only be added once all routes are vue\n // }, {\n // path: '*',\n // redirect: '/not-found'\n\n};\nvar routes = [homeRoutes, configRoutes, addShowRoutes, loginRoute, addRecommendedRoute, scheduleRoute, historyRoute, manageRoutes, notFoundRoutes];\nvar router = new _vueRouter.default({\n base: document.body.getAttribute('web-root') + '/',\n mode: 'history',\n routes: routes\n});\nrouter.beforeEach(function (to, from, next) {\n var meta = to.meta;\n var title = meta.title; // If there's no title then it's not a .vue route\n // or it's handling its own title\n\n if (title) {\n document.title = \"\".concat(title, \" | Medusa\");\n } // Always call next otherwise the will be empty\n\n\n next();\n});\nvar _default = router;\nexports.default = _default;\n\n//# sourceURL=webpack:///./src/router.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _vueRouter = _interopRequireDefault(__webpack_require__(/*! vue-router */ \"./node_modules/vue-router/dist/vue-router.esm.js\"));\n\nvar _components = __webpack_require__(/*! ./components */ \"./src/components/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar homeRoutes = {\n path: '/home',\n children: [{\n path: '',\n name: 'home',\n meta: {\n title: 'Home',\n header: 'Show List'\n }\n }, {\n path: 'editShow',\n name: 'editShow'\n }, {\n path: 'displayShow',\n name: 'displayShow'\n }, {\n path: 'snatchSelection',\n name: 'snatchSelection'\n }, {\n path: 'testRename',\n name: 'testRename',\n meta: {\n title: 'Preview Rename',\n header: 'Preview Rename'\n }\n }, {\n path: 'postprocess',\n name: 'postprocess',\n meta: {\n title: 'Manual Post-Processing',\n header: 'Manual Post-Processing'\n }\n }, {\n path: 'status',\n name: 'status',\n meta: {\n title: 'Status'\n }\n }]\n};\nvar configRoutes = {\n path: '/config',\n component: {\n template: ' '\n },\n children: [{\n path: '',\n name: 'config',\n meta: {\n title: 'Help & Info',\n header: 'Medusa Configuration'\n },\n component: _components.Config\n }, {\n path: 'anime',\n name: 'configAnime',\n meta: {\n title: 'Config - Anime',\n header: 'Anime'\n }\n }, {\n path: 'backuprestore',\n name: 'configBackupRestore',\n meta: {\n title: 'Config - Backup/Restore',\n header: 'Backup/Restore'\n }\n }, {\n path: 'general',\n name: 'configGeneral',\n meta: {\n title: 'Config - General',\n header: 'General Configuration'\n }\n }, {\n path: 'notifications',\n name: 'configNotifications',\n meta: {\n title: 'Config - Notifications',\n header: 'Notifications'\n }\n }, {\n path: 'postProcessing',\n name: 'configPostProcessing',\n meta: {\n title: 'Config - Post Processing',\n header: 'Post Processing'\n }\n }, {\n path: 'providers',\n name: 'configSearchProviders',\n meta: {\n title: 'Config - Providers',\n header: 'Search Providers'\n }\n }, {\n path: 'search',\n name: 'configSearchSettings',\n meta: {\n title: 'Config - Episode Search',\n header: 'Search Settings'\n }\n }, {\n path: 'subtitles',\n name: 'configSubtitles',\n meta: {\n title: 'Config - Subtitles',\n header: 'Subtitles'\n }\n }]\n};\nvar addShowRoutes = {\n path: '/addShows',\n component: {\n template: ' '\n },\n children: [{\n path: '',\n name: 'addShows',\n meta: {\n title: 'Add Shows',\n header: 'Add Shows'\n },\n component: _components.AddShows\n }, {\n path: 'addExistingShows',\n name: 'addExistingShows',\n meta: {\n title: 'Add Existing Shows',\n header: 'Add Existing Shows'\n }\n }, {\n path: 'newShow',\n name: 'addNewShow',\n meta: {\n title: 'Add New Show',\n header: 'Add New Show'\n }\n }]\n};\nvar loginRoute = {\n path: '/login',\n name: 'login',\n meta: {\n title: 'Login'\n },\n component: _components.Login\n};\nvar addRecommendedRoute = {\n path: '/addRecommended',\n name: 'addRecommended',\n meta: {\n title: 'Add Recommended Shows',\n header: 'Add Recommended Shows'\n },\n component: _components.AddRecommended\n};\nvar scheduleRoute = {\n path: '/schedule',\n name: 'schedule',\n meta: {\n title: 'Schedule',\n header: 'Schedule'\n }\n};\nvar historyRoute = {\n path: '/history',\n name: 'history',\n meta: {\n title: 'History',\n header: 'History'\n }\n};\nvar manageRoutes = {\n path: '/manage',\n component: {\n template: ' '\n },\n children: [{\n path: '',\n name: 'manage',\n meta: {\n title: 'Mass Update',\n header: 'Mass Update'\n }\n }, {\n path: 'backlogOverview',\n name: 'manageBacklogOverview',\n meta: {\n title: 'Backlog Overview',\n header: 'Backlog Overview'\n }\n }, {\n path: 'episodeStatuses',\n name: 'manageEpisodeOverview',\n meta: {\n title: 'Episode Overview',\n header: 'Episode Overview'\n }\n }, {\n path: 'failedDownloads',\n name: 'manageFailedDownloads',\n meta: {\n title: 'Failed Downloads',\n header: 'Failed Downlaods'\n }\n }, {\n path: 'manageSearches',\n name: 'manageManageSearches',\n meta: {\n title: 'Manage Searches',\n header: 'Manage Searches'\n }\n }, {\n path: 'massEdit',\n name: 'manageMassEdit',\n meta: {\n title: 'Mass Edit'\n }\n }, {\n path: 'subtitleMissed',\n name: 'manageSubtitleMissed',\n meta: {\n title: 'Missing Subtitles',\n header: 'Missing Subtitles'\n }\n }, {\n path: 'subtitleMissedPP',\n name: 'manageSubtitleMissedPP',\n meta: {\n title: 'Missing Subtitles in Post-Process folder',\n header: 'Missing Subtitles in Post-Process folder'\n }\n }]\n};\nvar notFoundRoutes = {\n path: '/not-found',\n name: 'not-found',\n meta: {\n title: '404',\n header: '404 - page not found'\n },\n component: _components.NotFound // @NOTE: Redirect can only be added once all routes are vue\n // }, {\n // path: '*',\n // redirect: '/not-found'\n\n};\nvar routes = [homeRoutes, configRoutes, addShowRoutes, loginRoute, addRecommendedRoute, scheduleRoute, historyRoute, manageRoutes, notFoundRoutes];\nvar router = new _vueRouter.default({\n base: document.body.getAttribute('web-root') + '/',\n mode: 'history',\n routes: routes\n});\nrouter.beforeEach(function (to, from, next) {\n var meta = to.meta;\n var title = meta.title; // If there's no title then it's not a .vue route\n // or it's handling its own title\n\n if (title) {\n document.title = \"\".concat(title, \" | Medusa\");\n } // Always call next otherwise the will be empty\n\n\n next();\n});\nvar _default = router;\nexports.default = _default;\n\n//# sourceURL=webpack:///./src/router.js?"); /***/ }), diff --git a/themes/light/templates/home_postprocess.mako b/themes/light/templates/home_postprocess.mako index 7f39c7f967..72caa571f4 100644 --- a/themes/light/templates/home_postprocess.mako +++ b/themes/light/templates/home_postprocess.mako @@ -8,7 +8,7 @@ -{{header}}
+{{ $route.meta.header }}
@@ -112,6 +112,7 @@ window.app = {}; window.app = new Vue({ el: '#vue-wrap', store, + router, data() { return { // This loads manual-post-process.vue diff --git a/themes/light/templates/testRename.mako b/themes/light/templates/testRename.mako index 7d6b51410c..5822873ee9 100644 --- a/themes/light/templates/testRename.mako +++ b/themes/light/templates/testRename.mako @@ -12,63 +12,54 @@ <%block name="scripts"> %block> <%block name="content"> @@ -82,7 +73,7 @@ const startVue = () => { -{{header}}
+{{ $route.meta.header }}
Preview of the proposed name changes
% if int(show.air_by_date) == 1 and app.NAMING_CUSTOM_ABD: