diff --git a/CHANGELOG.md b/CHANGELOG.md index 44a1bcd..a1bc73d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * [#257 Plex.TV Export notify when done](https://github.com/WebTools-NG/WebTools-NG/issues/257) * [#256 PMS Export notify when done](https://github.com/WebTools-NG/WebTools-NG/issues/256) +* [#255 Warn if no output dir](https://github.com/WebTools-NG/WebTools-NG/issues/255) ## V0.1.15 diff --git a/src/components/modules/PMS/Settings/settings.vue b/src/components/modules/PMS/Settings/settings.vue index 93e8a0c..4b7aa86 100644 --- a/src/components/modules/PMS/Settings/settings.vue +++ b/src/components/modules/PMS/Settings/settings.vue @@ -159,7 +159,19 @@ } }, methods: { - exportSettings: async function(){ + exportSettings: async function(){ + if (wtconfig.get('General.ExportPath', "") == "") + { + log.info('ET: No output dir defined') + this.$bvToast.toast(this.$t("Common.ErrorNoOutDirMsg"), { + title: this.$t("Common.ErrorNoOutDirTitle"), + autoHideDelay: 3000, + solid: true, + variant: 'primary', + toaster: 'b-toaster-bottom-right' + }) + return + } log.info(`Export Group Settings: ${this.selSection}`); const path = require('path'); const dirPath = path.join(i18n.t("Modules.PMS.Name"), i18n.t("Modules.PMS.Settings.Settings")); @@ -173,7 +185,19 @@ toaster: 'b-toaster-bottom-right' }); }, - exportAllSettings: async function(){ + exportAllSettings: async function(){ + if (wtconfig.get('General.ExportPath', "") == "") + { + log.info('ET: No output dir defined') + this.$bvToast.toast(this.$t("Common.ErrorNoOutDirMsg"), { + title: this.$t("Common.ErrorNoOutDirTitle"), + autoHideDelay: 3000, + solid: true, + variant: 'primary', + toaster: 'b-toaster-bottom-right' + }) + return + } log.info(`Export All Settings: ${this.selSection}`); const path = require('path'); const dirPath = path.join(i18n.t("Modules.PMS.Name"), i18n.t("Modules.PMS.Settings.Settings")); diff --git a/src/components/modules/PlexTV/PlexTV.vue b/src/components/modules/PlexTV/PlexTV.vue index 7ed9f54..0026ec6 100644 --- a/src/components/modules/PlexTV/PlexTV.vue +++ b/src/components/modules/PlexTV/PlexTV.vue @@ -64,8 +64,7 @@ import store from '../../../store'; import { plextv } from "./scripts/plextv"; import i18n from '../../../i18n'; - - plextv + import { wtconfig } from '../General/wtutils'; const log = require("electron-log"); export default { @@ -107,7 +106,19 @@ } }, methods: { - exportUsr: async function(){ + exportUsr: async function(){ + if (wtconfig.get('General.ExportPath', "") == "") + { + log.info('ET: No output dir defined') + this.$bvToast.toast(this.$t("Common.ErrorNoOutDirMsg"), { + title: this.$t("Common.ErrorNoOutDirTitle"), + autoHideDelay: 3000, + solid: true, + variant: 'primary', + toaster: 'b-toaster-bottom-right' + }) + return + } log.info(`Export Plex.TV User: ${this.usrName}`); let Data = this.selUserDetails; const outFile = await plextv.exportUsr({Module: i18n.t("Modules.PlexTV.Name"), Usr: this.usrID, Data: Data}); @@ -120,7 +131,19 @@ toaster: 'b-toaster-bottom-right' }); }, - exportAllUsr: async function(){ + exportAllUsr: async function(){ + if (wtconfig.get('General.ExportPath', "") == "") + { + log.info('ET: No output dir defined') + this.$bvToast.toast(this.$t("Common.ErrorNoOutDirMsg"), { + title: this.$t("Common.ErrorNoOutDirTitle"), + autoHideDelay: 3000, + solid: true, + variant: 'primary', + toaster: 'b-toaster-bottom-right' + }) + return + } log.info(`Export All Plex.TV Users`) let Data = this.$store.getters.getUsers; const outFile = await plextv.exportUsr({Module: i18n.t("Modules.PlexTV.Name"), Usr: 'All', Data: Data}); diff --git a/src/components/modules/PlexTV/scripts/plextv.js b/src/components/modules/PlexTV/scripts/plextv.js index e238632..9a1829e 100644 --- a/src/components/modules/PlexTV/scripts/plextv.js +++ b/src/components/modules/PlexTV/scripts/plextv.js @@ -37,7 +37,7 @@ const plextv = new class PlexTV { async exportUsr({ Module, Usr, Data }){ /* Will export selected user to a file - */ + */ let strTmp = ''; // Set result file to users title let fName = 'All';