diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d075cdfe8..10c6fd375f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Remove git username/password authentication. No longer supported by github. ([10144](https://github.com/pymedusa/Medusa/pull/10144)) - Add option to allow for overwriting nfo files. ([10237](https://github.com/pymedusa/Medusa/pull/10237)) - Improve kodi nfo file creation. ([10237](https://github.com/pymedusa/Medusa/pull/10237)) +- Add filter options to the manual search results table. ([10252](https://github.com/pymedusa/Medusa/pull/10252)) #### Fixes - Fix displayShow search subtitle button ([10214](https://github.com/pymedusa/Medusa/pull/10214)) diff --git a/themes-default/slim/src/components/show-results.vue b/themes-default/slim/src/components/show-results.vue index b16b1b3692..eff1e46a63 100644 --- a/themes-default/slim/src/components/show-results.vue +++ b/themes-default/slim/src/components/show-results.vue @@ -10,23 +10,30 @@ {{loadingMessage}} - @@ -74,7 +81,6 @@ No search results available - @@ -124,27 +130,51 @@ export default { }, data() { const { getCookie } = this; + const perPageDropdown = [25, 50, 100, 250, 500]; + const getPaginationPerPage = () => { + const rows = getCookie('pagination-perPage'); + if (!rows) { + return 50; + } + + if (!perPageDropdown.includes(rows)) { + return 500; + } + return rows; + }; return { columns: [{ label: 'Release', field: 'release', tdClass: 'release', + filterOptions: { + enabled: true + }, hidden: getCookie('Release') }, { label: 'Group', field: 'releaseGroup', + filterOptions: { + enabled: true + }, hidden: getCookie('Group') }, { label: 'Provider', field: 'provider.name', + filterOptions: { + enabled: true + }, hidden: getCookie('Provider') }, { label: 'Quality', field: 'quality', type: 'number', + filterOptions: { + customFilter: true + }, hidden: getCookie('Quality') }, { @@ -199,7 +229,9 @@ export default { sortable: false }], loading: false, - loadingMessage: '' + loadingMessage: '', + perPageDropdown, + getPaginationPerPage }; }, async mounted() { @@ -363,6 +395,11 @@ export default { console.error(String(error)); evt.target.src = 'images/no16.png'; } + }, + updatePaginationPerPage(rows) { + const { setCookie } = this; + this.paginationPerPage = rows; + setCookie('pagination-perPage', rows); } }, watch: { diff --git a/themes/dark/assets/js/medusa-runtime.js b/themes/dark/assets/js/medusa-runtime.js index a493d670a1..9ead233aa3 100644 --- a/themes/dark/assets/js/medusa-runtime.js +++ b/themes/dark/assets/js/medusa-runtime.js @@ -1093,7 +1093,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../api */ \"./src/api.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var vue_good_table__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vue-good-table */ \"./node_modules/vue-good-table/dist/vue-good-table.esm.js\");\n/* harmony import */ var _mixins_manage_cookie__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mixins/manage-cookie */ \"./src/mixins/manage-cookie.js\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n/* harmony import */ var _helpers_quality_pill_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/quality-pill.vue */ \"./src/components/helpers/quality-pill.vue\");\n/* harmony import */ var _utils_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/core */ \"./src/utils/core.js\");\n/* harmony import */ var v_tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! v-tooltip */ \"./node_modules/v-tooltip/dist/v-tooltip.esm.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'show-results',\n components: {\n VueGoodTable: vue_good_table__WEBPACK_IMPORTED_MODULE_6__.VueGoodTable,\n StateSwitch: _helpers__WEBPACK_IMPORTED_MODULE_2__.StateSwitch,\n QualityPill: _helpers_quality_pill_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n directives: {\n tooltip: v_tooltip__WEBPACK_IMPORTED_MODULE_5__.VTooltip\n },\n mixins: [(0,_mixins_manage_cookie__WEBPACK_IMPORTED_MODULE_1__.manageCookieMixin)('showResults')],\n props: {\n show: {\n type: Object,\n required: true\n },\n season: {\n type: Number,\n required: true\n },\n episode: {\n type: Number,\n required: false\n },\n searchType: {\n type: String,\n default: 'episode'\n }\n },\n\n data() {\n const {\n getCookie\n } = this;\n return {\n columns: [{\n label: 'Release',\n field: 'release',\n tdClass: 'release',\n hidden: getCookie('Release')\n }, {\n label: 'Group',\n field: 'releaseGroup',\n hidden: getCookie('Group')\n }, {\n label: 'Provider',\n field: 'provider.name',\n hidden: getCookie('Provider')\n }, {\n label: 'Quality',\n field: 'quality',\n type: 'number',\n hidden: getCookie('Quality')\n }, {\n label: 'Seeds',\n field: 'seeders',\n type: 'number',\n hidden: getCookie('Seeds')\n }, {\n label: 'Peers',\n field: 'leechers',\n type: 'number',\n hidden: getCookie('Peers')\n }, {\n label: 'Size',\n field: 'size',\n formatFn: _utils_core__WEBPACK_IMPORTED_MODULE_4__.humanFileSize,\n type: 'number',\n hidden: getCookie('Size')\n }, {\n label: 'Added',\n field: 'dateAdded',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ss',\n // E.g. 07-09-2017 19:16:25\n dateOutputFormat: 'yyyy/MM/dd HH:mm:ss',\n hidden: getCookie('Added')\n }, {\n label: 'Published',\n field: 'pubdate',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ssXXX',\n dateOutputFormat: 'yyyy-MM-dd HH:mm:ss',\n hidden: getCookie('Published')\n }, {\n label: 'Updated',\n field: 'time',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ss',\n dateOutputFormat: 'yyyy/MM/dd HH:mm:ss',\n hidden: getCookie('Updated')\n }, {\n label: 'Snatch',\n field: 'snatch',\n sortable: false\n }],\n loading: false,\n loadingMessage: ''\n };\n },\n\n async mounted() {\n const {\n forceSearch,\n getProviders,\n getProviderCacheResults,\n show,\n season,\n episode\n } = this;\n await getProviders();\n const result = await getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n }); // TODO: put a modal in between\n\n if (result.providersSearched > 0 && result.totalSearchResults.length === 0) {\n forceSearch();\n }\n },\n\n computed: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapState)({\n config: state => state.config.general,\n layout: state => state.config.layout,\n search: state => state.config.search,\n providers: state => state.provider.providers,\n queueitems: state => state.queue.queueitems,\n history: state => state.history.episodeHistory\n }),\n ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapGetters)({\n fuzzyParseDateTime: 'fuzzyParseDateTime',\n effectiveIgnored: 'effectiveIgnored',\n effectiveRequired: 'effectiveRequired'\n }),\n\n combinedResults() {\n const {\n episode,\n episodeHistory,\n providers,\n season,\n show\n } = this;\n let results = [];\n\n const getLastHistoryStatus = result => {\n const sortedHistory = episodeHistory.sort(item => item.actionDate).reverse();\n\n for (const historyRow of sortedHistory) {\n if (historyRow.resource === result.release && historyRow.size === result.size) {\n return historyRow.statusName.toLocaleLowerCase();\n }\n }\n\n return 'skipped';\n };\n\n for (const provider of Object.values(providers).filter(provider => provider.config.enabled)) {\n if (provider.cache && provider.cache.length > 0) {\n results = [...results, ...provider.cache.filter(searchResult => {\n if (episode) {\n return searchResult.showSlug === show.id.slug && searchResult.season === season && searchResult.episodes.includes(episode);\n }\n\n return searchResult.showSlug === show.id.slug && searchResult.season === season && searchResult.seasonPack;\n }).map(result => {\n return { ...result,\n status: getLastHistoryStatus(result)\n };\n })];\n }\n }\n\n return results;\n },\n\n /**\n * Helper to get the current episode or season slug.\n * @returns {string} episode slug.\n */\n episodeSlug() {\n const {\n season,\n episode\n } = this;\n return (0,_utils_core__WEBPACK_IMPORTED_MODULE_4__.episodeToSlug)(season, episode);\n },\n\n /**\n * Helper to check if showSlug and season/episode slug exist.\n * @returns {array} history for episode or empty array.\n */\n episodeHistory() {\n const {\n episodeSlug,\n history,\n show\n } = this;\n\n if (!history[show.id.slug] || !history[show.id.slug][episodeSlug]) {\n return [];\n }\n\n return history[show.id.slug][episodeSlug];\n }\n\n },\n methods: {\n humanFileSize: _utils_core__WEBPACK_IMPORTED_MODULE_4__.humanFileSize,\n ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapActions)({\n getProviders: 'getProviders',\n getProviderCacheResults: 'getProviderCacheResults',\n getShowEpisodeHistory: 'getShowEpisodeHistory'\n }),\n\n close() {\n this.$emit('close'); // Destroy the vue listeners, etc\n\n this.$destroy(); // Remove the element from the DOM\n\n this.$el.remove();\n },\n\n getProviderResults() {\n const {\n episode,\n getProviderCacheResults,\n season,\n show\n } = this;\n getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n });\n },\n\n forceSearch() {\n const {\n episode,\n episodeSlug,\n season,\n show\n } = this;\n let data = {};\n data = {\n showSlug: show.id.slug,\n options: {},\n [episode ? 'episodes' : 'season']: [episodeSlug]\n };\n this.loading = true;\n this.loadingMessage = 'Queue search...';\n api.put('search/manual', data) // eslint-disable-line no-undef\n .then(() => {\n console.info(`Queued search for show: ${show.id.slug} season: ${season}, episode: ${episode}`);\n this.loadingMessage = 'Queued search...';\n }).catch(error => {\n console.error(String(error));\n });\n },\n\n rowStyleClassFn(row) {\n const {\n effectiveIgnored,\n effectiveRequired,\n search,\n show\n } = this;\n const classes = [row.status || 'skipped'];\n\n const getReleaseNameClasses = name => {\n const classes = [];\n\n if (effectiveIgnored(show).map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-ignored');\n }\n\n if (effectiveRequired(show).map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-required');\n }\n\n if (search.filters.undesired.map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-undesired');\n }\n\n return classes;\n };\n\n return [...classes, ...getReleaseNameClasses(row.release)].join(' ');\n },\n\n async snatchResult(evt, result) {\n const {\n layout\n } = this;\n evt.target.src = `images/loading16-${layout.themeName}.gif`;\n\n try {\n const response = await (0,_api__WEBPACK_IMPORTED_MODULE_0__.apiRoute)('home/pickManualSearch', {\n params: {\n provider: result.provider.id,\n identifier: result.identifier\n }\n });\n\n if (response.data.result === 'success') {\n evt.target.src = 'images/save.png';\n } else {\n evt.target.src = 'images/no16.png';\n }\n } catch (error) {\n console.error(String(error));\n evt.target.src = 'images/no16.png';\n }\n }\n\n },\n watch: {\n queueitems: {\n async handler(queue) {\n // Check for manual searches\n const queueForThisEpisode = queue.filter(q => ['MANUAL-SEARCH'].includes(q.name) && q.segment.length && q.segment.find(ep => ep.season === this.season && ep.episode === this.episode));\n const [last] = queueForThisEpisode.slice(-1);\n\n if (last) {\n const searchStatus = last.success === null ? 'running' : 'finished';\n\n if (searchStatus === 'running') {\n this.loading = true;\n this.loadingMessage = 'Started searching providers...';\n } else {\n this.loadingMessage = 'Finished manual search';\n setTimeout(() => {\n this.loading = false;\n this.loadingMessage = '';\n }, 5000);\n }\n } // Check for snach selection\n\n\n const snatchedForThisEpisode = queue.filter(q => q.name === 'SNATCH-RESULT' && q.segment.length && q.segment.find(ep => ep.season === this.season && ep.episode === this.episode));\n const [lastSnatch] = snatchedForThisEpisode.slice(-1);\n\n if (lastSnatch && lastSnatch.success === true) {\n const {\n getProviderCacheResults,\n getShowEpisodeHistory,\n show,\n season,\n episode,\n episodeSlug\n } = this; // Something changed, let's get a new batch of provider results.\n\n await getShowEpisodeHistory({\n showSlug: show.id.slug,\n episodeSlug\n });\n await getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n });\n }\n },\n\n deep: true,\n immediate: false\n }\n }\n});\n\n//# sourceURL=webpack://slim/./src/components/show-results.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-1%5B0%5D.rules%5B0%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../api */ \"./src/api.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var vue_good_table__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vue-good-table */ \"./node_modules/vue-good-table/dist/vue-good-table.esm.js\");\n/* harmony import */ var _mixins_manage_cookie__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mixins/manage-cookie */ \"./src/mixins/manage-cookie.js\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n/* harmony import */ var _helpers_quality_pill_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/quality-pill.vue */ \"./src/components/helpers/quality-pill.vue\");\n/* harmony import */ var _utils_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/core */ \"./src/utils/core.js\");\n/* harmony import */ var v_tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! v-tooltip */ \"./node_modules/v-tooltip/dist/v-tooltip.esm.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'show-results',\n components: {\n VueGoodTable: vue_good_table__WEBPACK_IMPORTED_MODULE_6__.VueGoodTable,\n StateSwitch: _helpers__WEBPACK_IMPORTED_MODULE_2__.StateSwitch,\n QualityPill: _helpers_quality_pill_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n directives: {\n tooltip: v_tooltip__WEBPACK_IMPORTED_MODULE_5__.VTooltip\n },\n mixins: [(0,_mixins_manage_cookie__WEBPACK_IMPORTED_MODULE_1__.manageCookieMixin)('showResults')],\n props: {\n show: {\n type: Object,\n required: true\n },\n season: {\n type: Number,\n required: true\n },\n episode: {\n type: Number,\n required: false\n },\n searchType: {\n type: String,\n default: 'episode'\n }\n },\n\n data() {\n const {\n getCookie\n } = this;\n const perPageDropdown = [25, 50, 100, 250, 500];\n\n const getPaginationPerPage = () => {\n const rows = getCookie('pagination-perPage');\n\n if (!rows) {\n return 50;\n }\n\n if (!perPageDropdown.includes(rows)) {\n return 500;\n }\n\n return rows;\n };\n\n return {\n columns: [{\n label: 'Release',\n field: 'release',\n tdClass: 'release',\n filterOptions: {\n enabled: true\n },\n hidden: getCookie('Release')\n }, {\n label: 'Group',\n field: 'releaseGroup',\n filterOptions: {\n enabled: true\n },\n hidden: getCookie('Group')\n }, {\n label: 'Provider',\n field: 'provider.name',\n filterOptions: {\n enabled: true\n },\n hidden: getCookie('Provider')\n }, {\n label: 'Quality',\n field: 'quality',\n type: 'number',\n filterOptions: {\n customFilter: true\n },\n hidden: getCookie('Quality')\n }, {\n label: 'Seeds',\n field: 'seeders',\n type: 'number',\n hidden: getCookie('Seeds')\n }, {\n label: 'Peers',\n field: 'leechers',\n type: 'number',\n hidden: getCookie('Peers')\n }, {\n label: 'Size',\n field: 'size',\n formatFn: _utils_core__WEBPACK_IMPORTED_MODULE_4__.humanFileSize,\n type: 'number',\n hidden: getCookie('Size')\n }, {\n label: 'Added',\n field: 'dateAdded',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ss',\n // E.g. 07-09-2017 19:16:25\n dateOutputFormat: 'yyyy/MM/dd HH:mm:ss',\n hidden: getCookie('Added')\n }, {\n label: 'Published',\n field: 'pubdate',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ssXXX',\n dateOutputFormat: 'yyyy-MM-dd HH:mm:ss',\n hidden: getCookie('Published')\n }, {\n label: 'Updated',\n field: 'time',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ss',\n dateOutputFormat: 'yyyy/MM/dd HH:mm:ss',\n hidden: getCookie('Updated')\n }, {\n label: 'Snatch',\n field: 'snatch',\n sortable: false\n }],\n loading: false,\n loadingMessage: '',\n perPageDropdown,\n getPaginationPerPage\n };\n },\n\n async mounted() {\n const {\n forceSearch,\n getProviders,\n getProviderCacheResults,\n show,\n season,\n episode\n } = this;\n await getProviders();\n const result = await getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n }); // TODO: put a modal in between\n\n if (result.providersSearched > 0 && result.totalSearchResults.length === 0) {\n forceSearch();\n }\n },\n\n computed: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapState)({\n config: state => state.config.general,\n layout: state => state.config.layout,\n search: state => state.config.search,\n providers: state => state.provider.providers,\n queueitems: state => state.queue.queueitems,\n history: state => state.history.episodeHistory\n }),\n ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapGetters)({\n fuzzyParseDateTime: 'fuzzyParseDateTime',\n effectiveIgnored: 'effectiveIgnored',\n effectiveRequired: 'effectiveRequired'\n }),\n\n combinedResults() {\n const {\n episode,\n episodeHistory,\n providers,\n season,\n show\n } = this;\n let results = [];\n\n const getLastHistoryStatus = result => {\n const sortedHistory = episodeHistory.sort(item => item.actionDate).reverse();\n\n for (const historyRow of sortedHistory) {\n if (historyRow.resource === result.release && historyRow.size === result.size) {\n return historyRow.statusName.toLocaleLowerCase();\n }\n }\n\n return 'skipped';\n };\n\n for (const provider of Object.values(providers).filter(provider => provider.config.enabled)) {\n if (provider.cache && provider.cache.length > 0) {\n results = [...results, ...provider.cache.filter(searchResult => {\n if (episode) {\n return searchResult.showSlug === show.id.slug && searchResult.season === season && searchResult.episodes.includes(episode);\n }\n\n return searchResult.showSlug === show.id.slug && searchResult.season === season && searchResult.seasonPack;\n }).map(result => {\n return { ...result,\n status: getLastHistoryStatus(result)\n };\n })];\n }\n }\n\n return results;\n },\n\n /**\n * Helper to get the current episode or season slug.\n * @returns {string} episode slug.\n */\n episodeSlug() {\n const {\n season,\n episode\n } = this;\n return (0,_utils_core__WEBPACK_IMPORTED_MODULE_4__.episodeToSlug)(season, episode);\n },\n\n /**\n * Helper to check if showSlug and season/episode slug exist.\n * @returns {array} history for episode or empty array.\n */\n episodeHistory() {\n const {\n episodeSlug,\n history,\n show\n } = this;\n\n if (!history[show.id.slug] || !history[show.id.slug][episodeSlug]) {\n return [];\n }\n\n return history[show.id.slug][episodeSlug];\n }\n\n },\n methods: {\n humanFileSize: _utils_core__WEBPACK_IMPORTED_MODULE_4__.humanFileSize,\n ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapActions)({\n getProviders: 'getProviders',\n getProviderCacheResults: 'getProviderCacheResults',\n getShowEpisodeHistory: 'getShowEpisodeHistory'\n }),\n\n close() {\n this.$emit('close'); // Destroy the vue listeners, etc\n\n this.$destroy(); // Remove the element from the DOM\n\n this.$el.remove();\n },\n\n getProviderResults() {\n const {\n episode,\n getProviderCacheResults,\n season,\n show\n } = this;\n getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n });\n },\n\n forceSearch() {\n const {\n episode,\n episodeSlug,\n season,\n show\n } = this;\n let data = {};\n data = {\n showSlug: show.id.slug,\n options: {},\n [episode ? 'episodes' : 'season']: [episodeSlug]\n };\n this.loading = true;\n this.loadingMessage = 'Queue search...';\n api.put('search/manual', data) // eslint-disable-line no-undef\n .then(() => {\n console.info(`Queued search for show: ${show.id.slug} season: ${season}, episode: ${episode}`);\n this.loadingMessage = 'Queued search...';\n }).catch(error => {\n console.error(String(error));\n });\n },\n\n rowStyleClassFn(row) {\n const {\n effectiveIgnored,\n effectiveRequired,\n search,\n show\n } = this;\n const classes = [row.status || 'skipped'];\n\n const getReleaseNameClasses = name => {\n const classes = [];\n\n if (effectiveIgnored(show).map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-ignored');\n }\n\n if (effectiveRequired(show).map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-required');\n }\n\n if (search.filters.undesired.map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-undesired');\n }\n\n return classes;\n };\n\n return [...classes, ...getReleaseNameClasses(row.release)].join(' ');\n },\n\n async snatchResult(evt, result) {\n const {\n layout\n } = this;\n evt.target.src = `images/loading16-${layout.themeName}.gif`;\n\n try {\n const response = await (0,_api__WEBPACK_IMPORTED_MODULE_0__.apiRoute)('home/pickManualSearch', {\n params: {\n provider: result.provider.id,\n identifier: result.identifier\n }\n });\n\n if (response.data.result === 'success') {\n evt.target.src = 'images/save.png';\n } else {\n evt.target.src = 'images/no16.png';\n }\n } catch (error) {\n console.error(String(error));\n evt.target.src = 'images/no16.png';\n }\n },\n\n updatePaginationPerPage(rows) {\n const {\n setCookie\n } = this;\n this.paginationPerPage = rows;\n setCookie('pagination-perPage', rows);\n }\n\n },\n watch: {\n queueitems: {\n async handler(queue) {\n // Check for manual searches\n const queueForThisEpisode = queue.filter(q => ['MANUAL-SEARCH'].includes(q.name) && q.segment.length && q.segment.find(ep => ep.season === this.season && ep.episode === this.episode));\n const [last] = queueForThisEpisode.slice(-1);\n\n if (last) {\n const searchStatus = last.success === null ? 'running' : 'finished';\n\n if (searchStatus === 'running') {\n this.loading = true;\n this.loadingMessage = 'Started searching providers...';\n } else {\n this.loadingMessage = 'Finished manual search';\n setTimeout(() => {\n this.loading = false;\n this.loadingMessage = '';\n }, 5000);\n }\n } // Check for snach selection\n\n\n const snatchedForThisEpisode = queue.filter(q => q.name === 'SNATCH-RESULT' && q.segment.length && q.segment.find(ep => ep.season === this.season && ep.episode === this.episode));\n const [lastSnatch] = snatchedForThisEpisode.slice(-1);\n\n if (lastSnatch && lastSnatch.success === true) {\n const {\n getProviderCacheResults,\n getShowEpisodeHistory,\n show,\n season,\n episode,\n episodeSlug\n } = this; // Something changed, let's get a new batch of provider results.\n\n await getShowEpisodeHistory({\n showSlug: show.id.slug,\n episodeSlug\n });\n await getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n });\n }\n },\n\n deep: true,\n immediate: false\n }\n }\n});\n\n//# sourceURL=webpack://slim/./src/components/show-results.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-1%5B0%5D.rules%5B0%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), @@ -7919,7 +7919,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => (/* binding */ render),\n/* harmony export */ \"staticRenderFns\": () => (/* binding */ staticRenderFns)\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"show-results-wrapper\" }, [\n _c(\"div\", { staticClass: \"row horizontal-scroll\" }, [\n _c(\n \"div\",\n { staticClass: \"col-md-12 top-15\" },\n [\n _c(\n \"div\",\n { staticClass: \"button-row\" },\n [\n _c(\"input\", {\n staticClass: \"btn-medusa manualSearchButton top-5 bottom-5\",\n attrs: { type: \"button\", value: \"Refresh Results\" },\n on: { click: _vm.getProviderResults }\n }),\n _vm._v(\" \"),\n _c(\"input\", {\n staticClass: \"btn-medusa manualSearchButton top-5 bottom-5\",\n attrs: { type: \"button\", value: \"Force Search\" },\n on: { click: _vm.forceSearch }\n }),\n _vm._v(\" \"),\n _vm.loading\n ? [\n _c(\"state-switch\", { attrs: { state: \"loading\" } }),\n _vm._v(\" \"),\n _c(\"span\", [_vm._v(_vm._s(_vm.loadingMessage))])\n ]\n : _vm._e()\n ],\n 2\n ),\n _vm._v(\" \"),\n _c(\n \"vue-good-table\",\n {\n directives: [\n {\n name: \"show\",\n rawName: \"v-show\",\n value: _vm.show.id.slug,\n expression: \"show.id.slug\"\n }\n ],\n ref: \"vgt-show-results\",\n attrs: {\n columns: _vm.columns,\n rows: _vm.combinedResults,\n \"search-options\": {\n enabled: false\n },\n \"sort-options\": {\n enabled: true,\n initialSortBy: _vm.getSortBy(\"quality\", \"desc\")\n },\n \"column-filter-options\": {\n enabled: true\n },\n \"row-style-class\": _vm.rowStyleClassFn,\n styleClass: \"vgt-table condensed\"\n },\n on: { \"on-sort-change\": _vm.saveSorting },\n scopedSlots: _vm._u([\n {\n key: \"table-row\",\n fn: function(props) {\n return [\n props.column.label === \"Provider\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _c(\"img\", {\n directives: [\n {\n name: \"tooltip\",\n rawName: \"v-tooltip.right\",\n value: props.row.provider.name,\n expression: \"props.row.provider.name\",\n modifiers: { right: true }\n }\n ],\n attrs: {\n src:\n \"images/providers/\" +\n props.row.provider.imageName,\n alt: props.row.provider.name,\n width: \"16\",\n title: props.row.provider.name,\n onError:\n \"this.onerror=null;this.src='images/providers/missing.png';\"\n }\n })\n ])\n : props.column.label === \"Quality\"\n ? _c(\n \"span\",\n { staticClass: \"align-center\" },\n [\n props.row.quality !== 0\n ? _c(\"quality-pill\", {\n attrs: { quality: props.row.quality }\n })\n : _vm._e()\n ],\n 1\n )\n : props.column.label === \"Seeds\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.seeders !== -1\n ? props.row.seeders\n : \"-\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Peers\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.leechers !== -1\n ? props.row.leechers\n : \"-\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Added\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.dateAdded\n ? _vm.fuzzyParseDateTime(\n props.row.dateAdded\n )\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Published\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.pubdate\n ? _vm.fuzzyParseDateTime(props.row.pubdate)\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Updated\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.time\n ? _vm.fuzzyParseDateTime(props.row.time)\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label == \"Snatch\"\n ? _c(\"span\", [\n _c(\"img\", {\n attrs: {\n src: \"images/download.png\",\n width: \"16\",\n height: \"16\",\n alt: \"snatch\",\n title: \"Download selected episode\",\n \"data-identifier\": props.row.identifier\n },\n on: {\n click: function($event) {\n return _vm.snatchResult($event, props.row)\n }\n }\n })\n ])\n : _c(\"span\", [\n _vm._v(\n \"\\n \" +\n _vm._s(props.formattedRow[props.column.field]) +\n \"\\n \"\n )\n ])\n ]\n }\n }\n ])\n },\n [\n _vm._v(\" \"),\n _c(\n \"div\",\n {\n attrs: { slot: \"emptystate\", id: \"no-result\" },\n slot: \"emptystate\"\n },\n [\n _vm._v(\n \"\\n No search results available\\n \"\n )\n ]\n )\n ]\n )\n ],\n 1\n )\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://slim/./src/components/show-results.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => (/* binding */ render),\n/* harmony export */ \"staticRenderFns\": () => (/* binding */ staticRenderFns)\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"show-results-wrapper\" }, [\n _c(\"div\", { staticClass: \"row horizontal-scroll\" }, [\n _c(\n \"div\",\n { staticClass: \"col-md-12 top-15\" },\n [\n _c(\n \"div\",\n { staticClass: \"button-row\" },\n [\n _c(\"input\", {\n staticClass: \"btn-medusa manualSearchButton top-5 bottom-5\",\n attrs: { type: \"button\", value: \"Refresh Results\" },\n on: { click: _vm.getProviderResults }\n }),\n _vm._v(\" \"),\n _c(\"input\", {\n staticClass: \"btn-medusa manualSearchButton top-5 bottom-5\",\n attrs: { type: \"button\", value: \"Force Search\" },\n on: { click: _vm.forceSearch }\n }),\n _vm._v(\" \"),\n _vm.loading\n ? [\n _c(\"state-switch\", { attrs: { state: \"loading\" } }),\n _vm._v(\" \"),\n _c(\"span\", [_vm._v(_vm._s(_vm.loadingMessage))])\n ]\n : _vm._e()\n ],\n 2\n ),\n _vm._v(\" \"),\n _c(\n \"vue-good-table\",\n {\n directives: [\n {\n name: \"show\",\n rawName: \"v-show\",\n value: _vm.show.id.slug,\n expression: \"show.id.slug\"\n }\n ],\n ref: \"vgt-show-results\",\n attrs: {\n columns: _vm.columns,\n rows: _vm.combinedResults,\n \"search-options\": {\n enabled: false\n },\n \"sort-options\": {\n enabled: true,\n initialSortBy: _vm.getSortBy(\"quality\", \"desc\")\n },\n \"column-filter-options\": {\n enabled: true\n },\n \"row-style-class\": _vm.rowStyleClassFn,\n styleClass: \"vgt-table condensed\",\n \"pagination-options\": {\n enabled: true,\n perPage: _vm.getPaginationPerPage(),\n perPageDropdown: _vm.perPageDropdown\n }\n },\n on: {\n \"on-per-page-change\": function($event) {\n return _vm.updatePaginationPerPage($event.currentPerPage)\n },\n \"on-sort-change\": _vm.saveSorting\n },\n scopedSlots: _vm._u([\n {\n key: \"table-row\",\n fn: function(props) {\n return [\n props.column.label === \"Provider\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _c(\"img\", {\n directives: [\n {\n name: \"tooltip\",\n rawName: \"v-tooltip.right\",\n value: props.row.provider.name,\n expression: \"props.row.provider.name\",\n modifiers: { right: true }\n }\n ],\n attrs: {\n src:\n \"images/providers/\" +\n props.row.provider.imageName,\n alt: props.row.provider.name,\n width: \"16\",\n title: props.row.provider.name,\n onError:\n \"this.onerror=null;this.src='images/providers/missing.png';\"\n }\n })\n ])\n : props.column.label === \"Quality\"\n ? _c(\n \"span\",\n { staticClass: \"align-center\" },\n [\n props.row.quality !== 0\n ? _c(\"quality-pill\", {\n attrs: { quality: props.row.quality }\n })\n : _vm._e()\n ],\n 1\n )\n : props.column.label === \"Seeds\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.seeders !== -1\n ? props.row.seeders\n : \"-\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Peers\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.leechers !== -1\n ? props.row.leechers\n : \"-\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Added\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.dateAdded\n ? _vm.fuzzyParseDateTime(\n props.row.dateAdded\n )\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Published\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.pubdate\n ? _vm.fuzzyParseDateTime(props.row.pubdate)\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Updated\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.time\n ? _vm.fuzzyParseDateTime(props.row.time)\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label == \"Snatch\"\n ? _c(\"span\", [\n _c(\"img\", {\n attrs: {\n src: \"images/download.png\",\n width: \"16\",\n height: \"16\",\n alt: \"snatch\",\n title: \"Download selected episode\",\n \"data-identifier\": props.row.identifier\n },\n on: {\n click: function($event) {\n return _vm.snatchResult($event, props.row)\n }\n }\n })\n ])\n : _c(\"span\", [\n _vm._v(\n \"\\n \" +\n _vm._s(props.formattedRow[props.column.field]) +\n \"\\n \"\n )\n ])\n ]\n }\n }\n ])\n },\n [\n _vm._v(\" \"),\n _c(\n \"div\",\n {\n attrs: { slot: \"emptystate\", id: \"no-result\" },\n slot: \"emptystate\"\n },\n [\n _vm._v(\n \"\\n No search results available\\n \"\n )\n ]\n )\n ]\n )\n ],\n 1\n )\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://slim/./src/components/show-results.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), diff --git a/themes/light/assets/js/medusa-runtime.js b/themes/light/assets/js/medusa-runtime.js index a493d670a1..9ead233aa3 100644 --- a/themes/light/assets/js/medusa-runtime.js +++ b/themes/light/assets/js/medusa-runtime.js @@ -1093,7 +1093,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../api */ \"./src/api.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var vue_good_table__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vue-good-table */ \"./node_modules/vue-good-table/dist/vue-good-table.esm.js\");\n/* harmony import */ var _mixins_manage_cookie__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mixins/manage-cookie */ \"./src/mixins/manage-cookie.js\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n/* harmony import */ var _helpers_quality_pill_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/quality-pill.vue */ \"./src/components/helpers/quality-pill.vue\");\n/* harmony import */ var _utils_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/core */ \"./src/utils/core.js\");\n/* harmony import */ var v_tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! v-tooltip */ \"./node_modules/v-tooltip/dist/v-tooltip.esm.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'show-results',\n components: {\n VueGoodTable: vue_good_table__WEBPACK_IMPORTED_MODULE_6__.VueGoodTable,\n StateSwitch: _helpers__WEBPACK_IMPORTED_MODULE_2__.StateSwitch,\n QualityPill: _helpers_quality_pill_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n directives: {\n tooltip: v_tooltip__WEBPACK_IMPORTED_MODULE_5__.VTooltip\n },\n mixins: [(0,_mixins_manage_cookie__WEBPACK_IMPORTED_MODULE_1__.manageCookieMixin)('showResults')],\n props: {\n show: {\n type: Object,\n required: true\n },\n season: {\n type: Number,\n required: true\n },\n episode: {\n type: Number,\n required: false\n },\n searchType: {\n type: String,\n default: 'episode'\n }\n },\n\n data() {\n const {\n getCookie\n } = this;\n return {\n columns: [{\n label: 'Release',\n field: 'release',\n tdClass: 'release',\n hidden: getCookie('Release')\n }, {\n label: 'Group',\n field: 'releaseGroup',\n hidden: getCookie('Group')\n }, {\n label: 'Provider',\n field: 'provider.name',\n hidden: getCookie('Provider')\n }, {\n label: 'Quality',\n field: 'quality',\n type: 'number',\n hidden: getCookie('Quality')\n }, {\n label: 'Seeds',\n field: 'seeders',\n type: 'number',\n hidden: getCookie('Seeds')\n }, {\n label: 'Peers',\n field: 'leechers',\n type: 'number',\n hidden: getCookie('Peers')\n }, {\n label: 'Size',\n field: 'size',\n formatFn: _utils_core__WEBPACK_IMPORTED_MODULE_4__.humanFileSize,\n type: 'number',\n hidden: getCookie('Size')\n }, {\n label: 'Added',\n field: 'dateAdded',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ss',\n // E.g. 07-09-2017 19:16:25\n dateOutputFormat: 'yyyy/MM/dd HH:mm:ss',\n hidden: getCookie('Added')\n }, {\n label: 'Published',\n field: 'pubdate',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ssXXX',\n dateOutputFormat: 'yyyy-MM-dd HH:mm:ss',\n hidden: getCookie('Published')\n }, {\n label: 'Updated',\n field: 'time',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ss',\n dateOutputFormat: 'yyyy/MM/dd HH:mm:ss',\n hidden: getCookie('Updated')\n }, {\n label: 'Snatch',\n field: 'snatch',\n sortable: false\n }],\n loading: false,\n loadingMessage: ''\n };\n },\n\n async mounted() {\n const {\n forceSearch,\n getProviders,\n getProviderCacheResults,\n show,\n season,\n episode\n } = this;\n await getProviders();\n const result = await getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n }); // TODO: put a modal in between\n\n if (result.providersSearched > 0 && result.totalSearchResults.length === 0) {\n forceSearch();\n }\n },\n\n computed: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapState)({\n config: state => state.config.general,\n layout: state => state.config.layout,\n search: state => state.config.search,\n providers: state => state.provider.providers,\n queueitems: state => state.queue.queueitems,\n history: state => state.history.episodeHistory\n }),\n ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapGetters)({\n fuzzyParseDateTime: 'fuzzyParseDateTime',\n effectiveIgnored: 'effectiveIgnored',\n effectiveRequired: 'effectiveRequired'\n }),\n\n combinedResults() {\n const {\n episode,\n episodeHistory,\n providers,\n season,\n show\n } = this;\n let results = [];\n\n const getLastHistoryStatus = result => {\n const sortedHistory = episodeHistory.sort(item => item.actionDate).reverse();\n\n for (const historyRow of sortedHistory) {\n if (historyRow.resource === result.release && historyRow.size === result.size) {\n return historyRow.statusName.toLocaleLowerCase();\n }\n }\n\n return 'skipped';\n };\n\n for (const provider of Object.values(providers).filter(provider => provider.config.enabled)) {\n if (provider.cache && provider.cache.length > 0) {\n results = [...results, ...provider.cache.filter(searchResult => {\n if (episode) {\n return searchResult.showSlug === show.id.slug && searchResult.season === season && searchResult.episodes.includes(episode);\n }\n\n return searchResult.showSlug === show.id.slug && searchResult.season === season && searchResult.seasonPack;\n }).map(result => {\n return { ...result,\n status: getLastHistoryStatus(result)\n };\n })];\n }\n }\n\n return results;\n },\n\n /**\n * Helper to get the current episode or season slug.\n * @returns {string} episode slug.\n */\n episodeSlug() {\n const {\n season,\n episode\n } = this;\n return (0,_utils_core__WEBPACK_IMPORTED_MODULE_4__.episodeToSlug)(season, episode);\n },\n\n /**\n * Helper to check if showSlug and season/episode slug exist.\n * @returns {array} history for episode or empty array.\n */\n episodeHistory() {\n const {\n episodeSlug,\n history,\n show\n } = this;\n\n if (!history[show.id.slug] || !history[show.id.slug][episodeSlug]) {\n return [];\n }\n\n return history[show.id.slug][episodeSlug];\n }\n\n },\n methods: {\n humanFileSize: _utils_core__WEBPACK_IMPORTED_MODULE_4__.humanFileSize,\n ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapActions)({\n getProviders: 'getProviders',\n getProviderCacheResults: 'getProviderCacheResults',\n getShowEpisodeHistory: 'getShowEpisodeHistory'\n }),\n\n close() {\n this.$emit('close'); // Destroy the vue listeners, etc\n\n this.$destroy(); // Remove the element from the DOM\n\n this.$el.remove();\n },\n\n getProviderResults() {\n const {\n episode,\n getProviderCacheResults,\n season,\n show\n } = this;\n getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n });\n },\n\n forceSearch() {\n const {\n episode,\n episodeSlug,\n season,\n show\n } = this;\n let data = {};\n data = {\n showSlug: show.id.slug,\n options: {},\n [episode ? 'episodes' : 'season']: [episodeSlug]\n };\n this.loading = true;\n this.loadingMessage = 'Queue search...';\n api.put('search/manual', data) // eslint-disable-line no-undef\n .then(() => {\n console.info(`Queued search for show: ${show.id.slug} season: ${season}, episode: ${episode}`);\n this.loadingMessage = 'Queued search...';\n }).catch(error => {\n console.error(String(error));\n });\n },\n\n rowStyleClassFn(row) {\n const {\n effectiveIgnored,\n effectiveRequired,\n search,\n show\n } = this;\n const classes = [row.status || 'skipped'];\n\n const getReleaseNameClasses = name => {\n const classes = [];\n\n if (effectiveIgnored(show).map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-ignored');\n }\n\n if (effectiveRequired(show).map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-required');\n }\n\n if (search.filters.undesired.map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-undesired');\n }\n\n return classes;\n };\n\n return [...classes, ...getReleaseNameClasses(row.release)].join(' ');\n },\n\n async snatchResult(evt, result) {\n const {\n layout\n } = this;\n evt.target.src = `images/loading16-${layout.themeName}.gif`;\n\n try {\n const response = await (0,_api__WEBPACK_IMPORTED_MODULE_0__.apiRoute)('home/pickManualSearch', {\n params: {\n provider: result.provider.id,\n identifier: result.identifier\n }\n });\n\n if (response.data.result === 'success') {\n evt.target.src = 'images/save.png';\n } else {\n evt.target.src = 'images/no16.png';\n }\n } catch (error) {\n console.error(String(error));\n evt.target.src = 'images/no16.png';\n }\n }\n\n },\n watch: {\n queueitems: {\n async handler(queue) {\n // Check for manual searches\n const queueForThisEpisode = queue.filter(q => ['MANUAL-SEARCH'].includes(q.name) && q.segment.length && q.segment.find(ep => ep.season === this.season && ep.episode === this.episode));\n const [last] = queueForThisEpisode.slice(-1);\n\n if (last) {\n const searchStatus = last.success === null ? 'running' : 'finished';\n\n if (searchStatus === 'running') {\n this.loading = true;\n this.loadingMessage = 'Started searching providers...';\n } else {\n this.loadingMessage = 'Finished manual search';\n setTimeout(() => {\n this.loading = false;\n this.loadingMessage = '';\n }, 5000);\n }\n } // Check for snach selection\n\n\n const snatchedForThisEpisode = queue.filter(q => q.name === 'SNATCH-RESULT' && q.segment.length && q.segment.find(ep => ep.season === this.season && ep.episode === this.episode));\n const [lastSnatch] = snatchedForThisEpisode.slice(-1);\n\n if (lastSnatch && lastSnatch.success === true) {\n const {\n getProviderCacheResults,\n getShowEpisodeHistory,\n show,\n season,\n episode,\n episodeSlug\n } = this; // Something changed, let's get a new batch of provider results.\n\n await getShowEpisodeHistory({\n showSlug: show.id.slug,\n episodeSlug\n });\n await getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n });\n }\n },\n\n deep: true,\n immediate: false\n }\n }\n});\n\n//# sourceURL=webpack://slim/./src/components/show-results.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-1%5B0%5D.rules%5B0%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../api */ \"./src/api.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.esm.js\");\n/* harmony import */ var vue_good_table__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vue-good-table */ \"./node_modules/vue-good-table/dist/vue-good-table.esm.js\");\n/* harmony import */ var _mixins_manage_cookie__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../mixins/manage-cookie */ \"./src/mixins/manage-cookie.js\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers */ \"./src/components/helpers/index.js\");\n/* harmony import */ var _helpers_quality_pill_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/quality-pill.vue */ \"./src/components/helpers/quality-pill.vue\");\n/* harmony import */ var _utils_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/core */ \"./src/utils/core.js\");\n/* harmony import */ var v_tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! v-tooltip */ \"./node_modules/v-tooltip/dist/v-tooltip.esm.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: 'show-results',\n components: {\n VueGoodTable: vue_good_table__WEBPACK_IMPORTED_MODULE_6__.VueGoodTable,\n StateSwitch: _helpers__WEBPACK_IMPORTED_MODULE_2__.StateSwitch,\n QualityPill: _helpers_quality_pill_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n directives: {\n tooltip: v_tooltip__WEBPACK_IMPORTED_MODULE_5__.VTooltip\n },\n mixins: [(0,_mixins_manage_cookie__WEBPACK_IMPORTED_MODULE_1__.manageCookieMixin)('showResults')],\n props: {\n show: {\n type: Object,\n required: true\n },\n season: {\n type: Number,\n required: true\n },\n episode: {\n type: Number,\n required: false\n },\n searchType: {\n type: String,\n default: 'episode'\n }\n },\n\n data() {\n const {\n getCookie\n } = this;\n const perPageDropdown = [25, 50, 100, 250, 500];\n\n const getPaginationPerPage = () => {\n const rows = getCookie('pagination-perPage');\n\n if (!rows) {\n return 50;\n }\n\n if (!perPageDropdown.includes(rows)) {\n return 500;\n }\n\n return rows;\n };\n\n return {\n columns: [{\n label: 'Release',\n field: 'release',\n tdClass: 'release',\n filterOptions: {\n enabled: true\n },\n hidden: getCookie('Release')\n }, {\n label: 'Group',\n field: 'releaseGroup',\n filterOptions: {\n enabled: true\n },\n hidden: getCookie('Group')\n }, {\n label: 'Provider',\n field: 'provider.name',\n filterOptions: {\n enabled: true\n },\n hidden: getCookie('Provider')\n }, {\n label: 'Quality',\n field: 'quality',\n type: 'number',\n filterOptions: {\n customFilter: true\n },\n hidden: getCookie('Quality')\n }, {\n label: 'Seeds',\n field: 'seeders',\n type: 'number',\n hidden: getCookie('Seeds')\n }, {\n label: 'Peers',\n field: 'leechers',\n type: 'number',\n hidden: getCookie('Peers')\n }, {\n label: 'Size',\n field: 'size',\n formatFn: _utils_core__WEBPACK_IMPORTED_MODULE_4__.humanFileSize,\n type: 'number',\n hidden: getCookie('Size')\n }, {\n label: 'Added',\n field: 'dateAdded',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ss',\n // E.g. 07-09-2017 19:16:25\n dateOutputFormat: 'yyyy/MM/dd HH:mm:ss',\n hidden: getCookie('Added')\n }, {\n label: 'Published',\n field: 'pubdate',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ssXXX',\n dateOutputFormat: 'yyyy-MM-dd HH:mm:ss',\n hidden: getCookie('Published')\n }, {\n label: 'Updated',\n field: 'time',\n type: 'date',\n sortable: true,\n dateInputFormat: 'yyyy-MM-dd\\'T\\'HH:mm:ss',\n dateOutputFormat: 'yyyy/MM/dd HH:mm:ss',\n hidden: getCookie('Updated')\n }, {\n label: 'Snatch',\n field: 'snatch',\n sortable: false\n }],\n loading: false,\n loadingMessage: '',\n perPageDropdown,\n getPaginationPerPage\n };\n },\n\n async mounted() {\n const {\n forceSearch,\n getProviders,\n getProviderCacheResults,\n show,\n season,\n episode\n } = this;\n await getProviders();\n const result = await getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n }); // TODO: put a modal in between\n\n if (result.providersSearched > 0 && result.totalSearchResults.length === 0) {\n forceSearch();\n }\n },\n\n computed: { ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapState)({\n config: state => state.config.general,\n layout: state => state.config.layout,\n search: state => state.config.search,\n providers: state => state.provider.providers,\n queueitems: state => state.queue.queueitems,\n history: state => state.history.episodeHistory\n }),\n ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapGetters)({\n fuzzyParseDateTime: 'fuzzyParseDateTime',\n effectiveIgnored: 'effectiveIgnored',\n effectiveRequired: 'effectiveRequired'\n }),\n\n combinedResults() {\n const {\n episode,\n episodeHistory,\n providers,\n season,\n show\n } = this;\n let results = [];\n\n const getLastHistoryStatus = result => {\n const sortedHistory = episodeHistory.sort(item => item.actionDate).reverse();\n\n for (const historyRow of sortedHistory) {\n if (historyRow.resource === result.release && historyRow.size === result.size) {\n return historyRow.statusName.toLocaleLowerCase();\n }\n }\n\n return 'skipped';\n };\n\n for (const provider of Object.values(providers).filter(provider => provider.config.enabled)) {\n if (provider.cache && provider.cache.length > 0) {\n results = [...results, ...provider.cache.filter(searchResult => {\n if (episode) {\n return searchResult.showSlug === show.id.slug && searchResult.season === season && searchResult.episodes.includes(episode);\n }\n\n return searchResult.showSlug === show.id.slug && searchResult.season === season && searchResult.seasonPack;\n }).map(result => {\n return { ...result,\n status: getLastHistoryStatus(result)\n };\n })];\n }\n }\n\n return results;\n },\n\n /**\n * Helper to get the current episode or season slug.\n * @returns {string} episode slug.\n */\n episodeSlug() {\n const {\n season,\n episode\n } = this;\n return (0,_utils_core__WEBPACK_IMPORTED_MODULE_4__.episodeToSlug)(season, episode);\n },\n\n /**\n * Helper to check if showSlug and season/episode slug exist.\n * @returns {array} history for episode or empty array.\n */\n episodeHistory() {\n const {\n episodeSlug,\n history,\n show\n } = this;\n\n if (!history[show.id.slug] || !history[show.id.slug][episodeSlug]) {\n return [];\n }\n\n return history[show.id.slug][episodeSlug];\n }\n\n },\n methods: {\n humanFileSize: _utils_core__WEBPACK_IMPORTED_MODULE_4__.humanFileSize,\n ...(0,vuex__WEBPACK_IMPORTED_MODULE_7__.mapActions)({\n getProviders: 'getProviders',\n getProviderCacheResults: 'getProviderCacheResults',\n getShowEpisodeHistory: 'getShowEpisodeHistory'\n }),\n\n close() {\n this.$emit('close'); // Destroy the vue listeners, etc\n\n this.$destroy(); // Remove the element from the DOM\n\n this.$el.remove();\n },\n\n getProviderResults() {\n const {\n episode,\n getProviderCacheResults,\n season,\n show\n } = this;\n getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n });\n },\n\n forceSearch() {\n const {\n episode,\n episodeSlug,\n season,\n show\n } = this;\n let data = {};\n data = {\n showSlug: show.id.slug,\n options: {},\n [episode ? 'episodes' : 'season']: [episodeSlug]\n };\n this.loading = true;\n this.loadingMessage = 'Queue search...';\n api.put('search/manual', data) // eslint-disable-line no-undef\n .then(() => {\n console.info(`Queued search for show: ${show.id.slug} season: ${season}, episode: ${episode}`);\n this.loadingMessage = 'Queued search...';\n }).catch(error => {\n console.error(String(error));\n });\n },\n\n rowStyleClassFn(row) {\n const {\n effectiveIgnored,\n effectiveRequired,\n search,\n show\n } = this;\n const classes = [row.status || 'skipped'];\n\n const getReleaseNameClasses = name => {\n const classes = [];\n\n if (effectiveIgnored(show).map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-ignored');\n }\n\n if (effectiveRequired(show).map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-required');\n }\n\n if (search.filters.undesired.map(word => {\n return name.toLowerCase().includes(word.toLowerCase());\n }).filter(x => x === true).length > 0) {\n classes.push('global-undesired');\n }\n\n return classes;\n };\n\n return [...classes, ...getReleaseNameClasses(row.release)].join(' ');\n },\n\n async snatchResult(evt, result) {\n const {\n layout\n } = this;\n evt.target.src = `images/loading16-${layout.themeName}.gif`;\n\n try {\n const response = await (0,_api__WEBPACK_IMPORTED_MODULE_0__.apiRoute)('home/pickManualSearch', {\n params: {\n provider: result.provider.id,\n identifier: result.identifier\n }\n });\n\n if (response.data.result === 'success') {\n evt.target.src = 'images/save.png';\n } else {\n evt.target.src = 'images/no16.png';\n }\n } catch (error) {\n console.error(String(error));\n evt.target.src = 'images/no16.png';\n }\n },\n\n updatePaginationPerPage(rows) {\n const {\n setCookie\n } = this;\n this.paginationPerPage = rows;\n setCookie('pagination-perPage', rows);\n }\n\n },\n watch: {\n queueitems: {\n async handler(queue) {\n // Check for manual searches\n const queueForThisEpisode = queue.filter(q => ['MANUAL-SEARCH'].includes(q.name) && q.segment.length && q.segment.find(ep => ep.season === this.season && ep.episode === this.episode));\n const [last] = queueForThisEpisode.slice(-1);\n\n if (last) {\n const searchStatus = last.success === null ? 'running' : 'finished';\n\n if (searchStatus === 'running') {\n this.loading = true;\n this.loadingMessage = 'Started searching providers...';\n } else {\n this.loadingMessage = 'Finished manual search';\n setTimeout(() => {\n this.loading = false;\n this.loadingMessage = '';\n }, 5000);\n }\n } // Check for snach selection\n\n\n const snatchedForThisEpisode = queue.filter(q => q.name === 'SNATCH-RESULT' && q.segment.length && q.segment.find(ep => ep.season === this.season && ep.episode === this.episode));\n const [lastSnatch] = snatchedForThisEpisode.slice(-1);\n\n if (lastSnatch && lastSnatch.success === true) {\n const {\n getProviderCacheResults,\n getShowEpisodeHistory,\n show,\n season,\n episode,\n episodeSlug\n } = this; // Something changed, let's get a new batch of provider results.\n\n await getShowEpisodeHistory({\n showSlug: show.id.slug,\n episodeSlug\n });\n await getProviderCacheResults({\n showSlug: show.id.slug,\n season,\n episode\n });\n }\n },\n\n deep: true,\n immediate: false\n }\n }\n});\n\n//# sourceURL=webpack://slim/./src/components/show-results.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-1%5B0%5D.rules%5B0%5D!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), @@ -7919,7 +7919,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => (/* binding */ render),\n/* harmony export */ \"staticRenderFns\": () => (/* binding */ staticRenderFns)\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"show-results-wrapper\" }, [\n _c(\"div\", { staticClass: \"row horizontal-scroll\" }, [\n _c(\n \"div\",\n { staticClass: \"col-md-12 top-15\" },\n [\n _c(\n \"div\",\n { staticClass: \"button-row\" },\n [\n _c(\"input\", {\n staticClass: \"btn-medusa manualSearchButton top-5 bottom-5\",\n attrs: { type: \"button\", value: \"Refresh Results\" },\n on: { click: _vm.getProviderResults }\n }),\n _vm._v(\" \"),\n _c(\"input\", {\n staticClass: \"btn-medusa manualSearchButton top-5 bottom-5\",\n attrs: { type: \"button\", value: \"Force Search\" },\n on: { click: _vm.forceSearch }\n }),\n _vm._v(\" \"),\n _vm.loading\n ? [\n _c(\"state-switch\", { attrs: { state: \"loading\" } }),\n _vm._v(\" \"),\n _c(\"span\", [_vm._v(_vm._s(_vm.loadingMessage))])\n ]\n : _vm._e()\n ],\n 2\n ),\n _vm._v(\" \"),\n _c(\n \"vue-good-table\",\n {\n directives: [\n {\n name: \"show\",\n rawName: \"v-show\",\n value: _vm.show.id.slug,\n expression: \"show.id.slug\"\n }\n ],\n ref: \"vgt-show-results\",\n attrs: {\n columns: _vm.columns,\n rows: _vm.combinedResults,\n \"search-options\": {\n enabled: false\n },\n \"sort-options\": {\n enabled: true,\n initialSortBy: _vm.getSortBy(\"quality\", \"desc\")\n },\n \"column-filter-options\": {\n enabled: true\n },\n \"row-style-class\": _vm.rowStyleClassFn,\n styleClass: \"vgt-table condensed\"\n },\n on: { \"on-sort-change\": _vm.saveSorting },\n scopedSlots: _vm._u([\n {\n key: \"table-row\",\n fn: function(props) {\n return [\n props.column.label === \"Provider\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _c(\"img\", {\n directives: [\n {\n name: \"tooltip\",\n rawName: \"v-tooltip.right\",\n value: props.row.provider.name,\n expression: \"props.row.provider.name\",\n modifiers: { right: true }\n }\n ],\n attrs: {\n src:\n \"images/providers/\" +\n props.row.provider.imageName,\n alt: props.row.provider.name,\n width: \"16\",\n title: props.row.provider.name,\n onError:\n \"this.onerror=null;this.src='images/providers/missing.png';\"\n }\n })\n ])\n : props.column.label === \"Quality\"\n ? _c(\n \"span\",\n { staticClass: \"align-center\" },\n [\n props.row.quality !== 0\n ? _c(\"quality-pill\", {\n attrs: { quality: props.row.quality }\n })\n : _vm._e()\n ],\n 1\n )\n : props.column.label === \"Seeds\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.seeders !== -1\n ? props.row.seeders\n : \"-\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Peers\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.leechers !== -1\n ? props.row.leechers\n : \"-\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Added\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.dateAdded\n ? _vm.fuzzyParseDateTime(\n props.row.dateAdded\n )\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Published\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.pubdate\n ? _vm.fuzzyParseDateTime(props.row.pubdate)\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Updated\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.time\n ? _vm.fuzzyParseDateTime(props.row.time)\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label == \"Snatch\"\n ? _c(\"span\", [\n _c(\"img\", {\n attrs: {\n src: \"images/download.png\",\n width: \"16\",\n height: \"16\",\n alt: \"snatch\",\n title: \"Download selected episode\",\n \"data-identifier\": props.row.identifier\n },\n on: {\n click: function($event) {\n return _vm.snatchResult($event, props.row)\n }\n }\n })\n ])\n : _c(\"span\", [\n _vm._v(\n \"\\n \" +\n _vm._s(props.formattedRow[props.column.field]) +\n \"\\n \"\n )\n ])\n ]\n }\n }\n ])\n },\n [\n _vm._v(\" \"),\n _c(\n \"div\",\n {\n attrs: { slot: \"emptystate\", id: \"no-result\" },\n slot: \"emptystate\"\n },\n [\n _vm._v(\n \"\\n No search results available\\n \"\n )\n ]\n )\n ]\n )\n ],\n 1\n )\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://slim/./src/components/show-results.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => (/* binding */ render),\n/* harmony export */ \"staticRenderFns\": () => (/* binding */ staticRenderFns)\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"show-results-wrapper\" }, [\n _c(\"div\", { staticClass: \"row horizontal-scroll\" }, [\n _c(\n \"div\",\n { staticClass: \"col-md-12 top-15\" },\n [\n _c(\n \"div\",\n { staticClass: \"button-row\" },\n [\n _c(\"input\", {\n staticClass: \"btn-medusa manualSearchButton top-5 bottom-5\",\n attrs: { type: \"button\", value: \"Refresh Results\" },\n on: { click: _vm.getProviderResults }\n }),\n _vm._v(\" \"),\n _c(\"input\", {\n staticClass: \"btn-medusa manualSearchButton top-5 bottom-5\",\n attrs: { type: \"button\", value: \"Force Search\" },\n on: { click: _vm.forceSearch }\n }),\n _vm._v(\" \"),\n _vm.loading\n ? [\n _c(\"state-switch\", { attrs: { state: \"loading\" } }),\n _vm._v(\" \"),\n _c(\"span\", [_vm._v(_vm._s(_vm.loadingMessage))])\n ]\n : _vm._e()\n ],\n 2\n ),\n _vm._v(\" \"),\n _c(\n \"vue-good-table\",\n {\n directives: [\n {\n name: \"show\",\n rawName: \"v-show\",\n value: _vm.show.id.slug,\n expression: \"show.id.slug\"\n }\n ],\n ref: \"vgt-show-results\",\n attrs: {\n columns: _vm.columns,\n rows: _vm.combinedResults,\n \"search-options\": {\n enabled: false\n },\n \"sort-options\": {\n enabled: true,\n initialSortBy: _vm.getSortBy(\"quality\", \"desc\")\n },\n \"column-filter-options\": {\n enabled: true\n },\n \"row-style-class\": _vm.rowStyleClassFn,\n styleClass: \"vgt-table condensed\",\n \"pagination-options\": {\n enabled: true,\n perPage: _vm.getPaginationPerPage(),\n perPageDropdown: _vm.perPageDropdown\n }\n },\n on: {\n \"on-per-page-change\": function($event) {\n return _vm.updatePaginationPerPage($event.currentPerPage)\n },\n \"on-sort-change\": _vm.saveSorting\n },\n scopedSlots: _vm._u([\n {\n key: \"table-row\",\n fn: function(props) {\n return [\n props.column.label === \"Provider\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _c(\"img\", {\n directives: [\n {\n name: \"tooltip\",\n rawName: \"v-tooltip.right\",\n value: props.row.provider.name,\n expression: \"props.row.provider.name\",\n modifiers: { right: true }\n }\n ],\n attrs: {\n src:\n \"images/providers/\" +\n props.row.provider.imageName,\n alt: props.row.provider.name,\n width: \"16\",\n title: props.row.provider.name,\n onError:\n \"this.onerror=null;this.src='images/providers/missing.png';\"\n }\n })\n ])\n : props.column.label === \"Quality\"\n ? _c(\n \"span\",\n { staticClass: \"align-center\" },\n [\n props.row.quality !== 0\n ? _c(\"quality-pill\", {\n attrs: { quality: props.row.quality }\n })\n : _vm._e()\n ],\n 1\n )\n : props.column.label === \"Seeds\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.seeders !== -1\n ? props.row.seeders\n : \"-\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Peers\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.leechers !== -1\n ? props.row.leechers\n : \"-\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Added\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.dateAdded\n ? _vm.fuzzyParseDateTime(\n props.row.dateAdded\n )\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Published\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.pubdate\n ? _vm.fuzzyParseDateTime(props.row.pubdate)\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label === \"Updated\"\n ? _c(\"span\", { staticClass: \"align-center\" }, [\n _vm._v(\n \"\\n \" +\n _vm._s(\n props.row.time\n ? _vm.fuzzyParseDateTime(props.row.time)\n : \"\"\n ) +\n \"\\n \"\n )\n ])\n : props.column.label == \"Snatch\"\n ? _c(\"span\", [\n _c(\"img\", {\n attrs: {\n src: \"images/download.png\",\n width: \"16\",\n height: \"16\",\n alt: \"snatch\",\n title: \"Download selected episode\",\n \"data-identifier\": props.row.identifier\n },\n on: {\n click: function($event) {\n return _vm.snatchResult($event, props.row)\n }\n }\n })\n ])\n : _c(\"span\", [\n _vm._v(\n \"\\n \" +\n _vm._s(props.formattedRow[props.column.field]) +\n \"\\n \"\n )\n ])\n ]\n }\n }\n ])\n },\n [\n _vm._v(\" \"),\n _c(\n \"div\",\n {\n attrs: { slot: \"emptystate\", id: \"no-result\" },\n slot: \"emptystate\"\n },\n [\n _vm._v(\n \"\\n No search results available\\n \"\n )\n ]\n )\n ]\n )\n ],\n 1\n )\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://slim/./src/components/show-results.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }),