From 4f9dc1afcb030ee7cc89ebe744b01b906262320d Mon Sep 17 00:00:00 2001 From: UKDTOM Date: Sun, 20 Sep 2020 23:28:04 +0200 Subject: [PATCH] #94 Loglevels changed a tad --- src/components/layout/Header.vue | 2 +- src/components/modules/ExportTools/Export.vue | 2 +- src/components/modules/ExportTools/scripts/et.js | 4 ++-- src/components/modules/General/plextv.js | 14 +++++++------- src/components/modules/General/wtutils.js | 4 ++-- src/main.js | 4 ++-- src/store/modules/plextv.js | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/layout/Header.vue b/src/components/layout/Header.vue index d3b73ec..d3d6e7a 100644 --- a/src/components/layout/Header.vue +++ b/src/components/layout/Header.vue @@ -105,7 +105,7 @@ export default { this.active = e; }, selected: function () { - log.info('HEADER: selected server: ' + this.selectedOption.name) + log.info('Selected server: ' + this.selectedOption.name) ptv.checkServerConnect(this.selectedOption) this.$store.commit("UPDATE_SELECTED_SERVER", this.selectedOption); }, diff --git a/src/components/modules/ExportTools/Export.vue b/src/components/modules/ExportTools/Export.vue index 6db1a29..bff596d 100644 --- a/src/components/modules/ExportTools/Export.vue +++ b/src/components/modules/ExportTools/Export.vue @@ -261,7 +261,7 @@ this.$store.dispatch("exportMedias"); }, async fetchSelection() { - log.debug("fetchSelection"); + log.debug("fetchSelection started"); let serverCheck = this.$store.getters.getSelectedServer; if (serverCheck !== "none") { log.debug("serverCheck is not null, running fetchSections "); diff --git a/src/components/modules/ExportTools/scripts/et.js b/src/components/modules/ExportTools/scripts/et.js index e81bd17..5960209 100644 --- a/src/components/modules/ExportTools/scripts/et.js +++ b/src/components/modules/ExportTools/scripts/et.js @@ -627,7 +627,7 @@ const excel2 = new class Excel { break; case "time": val = JSONPath({path: String(lookup), json: data}); - if ( typeof val !== 'undefined' && val ) + if ( typeof val !== 'undefined' && val && val != '') { seconds = '0' + (Math.round(val/1000)%60).toString(); minutes = '0' + (Math.round((val/(1000 * 60))) % 60).toString(); @@ -637,7 +637,7 @@ const excel2 = new class Excel { } else { - val = null + val = wtconfig.get('ET.NotAvail', 'N/A') } break; case "datetime": diff --git a/src/components/modules/General/plextv.js b/src/components/modules/General/plextv.js index bf0b557..0772ea3 100644 --- a/src/components/modules/General/plextv.js +++ b/src/components/modules/General/plextv.js @@ -7,7 +7,7 @@ const ptv = new class PTV { constructor() { } async checkServerConnect(server) { - log.info(`Checking address for server: ${server.name}`); + log.verbose(`Checking address for server: ${server.name}`); // Set WaitState store.commit("UPDATE_PLEX_SELECTED_SERVER_STATUS", true); let PMSAddress = ''; @@ -16,7 +16,7 @@ const ptv = new class PTV { for (var i = 0; i < server.connections.length; i++) { //server.connections.forEach((val) => { let val = server.connections[i]; - log.info(`Checking: ${val.uri}`); + log.verbose(`Checking: ${val.uri}`); let baseurl = val.uri; await axios.get(baseurl + '/identity', { headers: { @@ -26,12 +26,12 @@ const ptv = new class PTV { }) .then(response => { if(response.status == 200){ - log.info(`Address ${baseurl} is alive, so check if local`); + log.verbose(`Address ${baseurl} is alive, so check if local`); if ( val.local == true){ - log.info(`It's a local server, so need to check if correct one`); + log.verbose(`It's a local server, so need to check if correct one`); const machineIdentifier = response.data['MediaContainer']['machineIdentifier']; if (machineIdentifier == server.clientIdentifier){ - log.info(`Local server found as: ${baseurl}`); + log.verbose(`Local server found as: ${baseurl}`); PMSAddress = baseurl; local = true; } @@ -41,10 +41,10 @@ const ptv = new class PTV { // only if we didn't find the local one? if ( local == false) { - log.info(`No local server found yet, so checking ${baseurl}`) + log.verbose(`No local server found yet, so checking ${baseurl}`) const machineIdentifier = response.data['MediaContainer']['machineIdentifier']; if (machineIdentifier == server.clientIdentifier){ - log.info(`Remote server found as: ${baseurl}`); + log.verbose(`Remote server found as: ${baseurl}`); PMSAddress = baseurl; } } diff --git a/src/components/modules/General/wtutils.js b/src/components/modules/General/wtutils.js index 3965243..2ab0ed4 100644 --- a/src/components/modules/General/wtutils.js +++ b/src/components/modules/General/wtutils.js @@ -174,8 +174,8 @@ const wtutils = new class WTUtils { } UpdateConfigFile() { - // Update config file with defaults if missing - console.log('Updating config file') + // Update config file with defaults if missing + log.verbose('Updating config file'); // General section if ( wtconfig.get('General.username', 'N/A') == 'N/A' ){ wtconfig.set('General.username', '') diff --git a/src/main.js b/src/main.js index 4f85e63..32dc14b 100644 --- a/src/main.js +++ b/src/main.js @@ -47,11 +47,11 @@ if (wtconfig.get("general.version", "") != wtutils.AppVersion){ i18n.locale = wtconfig.get('General.language', 'en') // App Menu Bar -log.info('Starting to build App Menu') +log.verbose('Starting to build App Menu') const menuTemplate = require('./components/layout/script/menubar') const menu = require('electron').remote.Menu.buildFromTemplate(menuTemplate.default) require('electron').remote.Menu.setApplicationMenu(menu) -log.info('App Menu builded') +log.verbose('App Menu builded') Vue.config.productionTip = false diff --git a/src/store/modules/plextv.js b/src/store/modules/plextv.js index 61b7e32..2647fb9 100644 --- a/src/store/modules/plextv.js +++ b/src/store/modules/plextv.js @@ -71,7 +71,7 @@ const actions = { pmsServer['accessToken'] = req.accessToken; pmsServer['connections'] = req.connections; pmsServer['clientIdentifier'] = req.clientIdentifier - log.verbose('fetchPlexServers : See not owned servers as well') + log.debug('fetchPlexServers : See not owned servers as well') result.push(pmsServer); } } else {