From d4719422d8e1596d599b1f9cd600cf3c4e816d7a Mon Sep 17 00:00:00 2001 From: Tommy Mikkelsen Date: Sun, 3 Jul 2022 00:18:16 +0200 Subject: [PATCH] Fix #508 --- CHANGELOG.md | 1 + public/locales/en.json | 3 ++- src/components/modules/ExportTools/Settings/settings.vue | 7 ++++--- src/components/modules/ExportTools/scripts/ethelper.js | 6 ++++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43afbcf..eb4d1c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * [#509 Refactor Settings](https://github.com/WebTools-NG/WebTools-NG/issues/509) * [#512 ET Intro Start/End isn't exported](https://github.com/WebTools-NG/WebTools-NG/issues/512) * [#514 Bring back EN translations from Romain](https://github.com/WebTools-NG/WebTools-NG/issues/514) +* [#508 No timestamp in output file](https://github.com/WebTools-NG/WebTools-NG/issues/508) ## V0.3.17 (20220601) diff --git a/public/locales/en.json b/public/locales/en.json index d1f543e..80b70a2 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -231,7 +231,8 @@ "ttShowsUseId": "If exporting Suggested Filename or Folder for shows, default to selected naming if available. Fallback to TMDB if not", "Name": "@:Modules.ET.Name Settings", "Note": "Note: * Click here for general settings regarding export *", - "Return": "Return to @:Modules.ET.Name" + "Return": "Return to @:Modules.ET.Name", + "NoTimeStamp": "Don't add a timestamp to export file name" }, "LevelInfo": "Export level determines which data are going to be exported.", "SelectLevel": "Select level", diff --git a/src/components/modules/ExportTools/Settings/settings.vue b/src/components/modules/ExportTools/Settings/settings.vue index 8bc2379..f6b6935 100644 --- a/src/components/modules/ExportTools/Settings/settings.vue +++ b/src/components/modules/ExportTools/Settings/settings.vue @@ -74,7 +74,8 @@ { text: i18n.t('Modules.ET.Settings.OrgTitleNull'), value: 'OrgTitleNull' }, { text: i18n.t('Modules.ET.Settings.SortTitleNull'), value: 'SortTitleNull' }, { text: i18n.t('Modules.ET.Settings.suggestedFileNoExtra'), value: 'suggestedFileNoExtra' }, - { text: i18n.t('Modules.ET.Settings.suggestedUseOrigenTitle'), value: 'suggestedUseOrigenTitle' } + { text: i18n.t('Modules.ET.Settings.suggestedUseOrigenTitle'), value: 'suggestedUseOrigenTitle' }, + { text: i18n.t('Modules.ET.Settings.NoTimeStamp'), value: 'NoTimeStamp' } ], SelectedMoviesIDOptions: ['imdb', 'tmdb'], SelectedMoviesID: '', @@ -91,7 +92,7 @@ dialog.ShowMsg( i18n.t("Modules.ET.Name"), i18n.t("Common.Ok"), i18n.t("Common.AppName"), 'For this version, export to XLSX is currently disabled', 'info'); }, getDefaults(){ - const cbItems = ["ExpCSV","ExpXLSX", "OrgTitleNull", "SortTitleNull", "suggestedFileNoExtra", "suggestedUseOrigenTitle"]; + const cbItems = ["ExpCSV","ExpXLSX", "OrgTitleNull", "SortTitleNull", "suggestedFileNoExtra", "suggestedUseOrigenTitle", "NoTimeStamp"]; for(let i = 0; i < cbItems.length; i++){ if (wtconfig.get("ET." + cbItems[i], false)){ this.cbSelected.push(cbItems[i]); @@ -104,7 +105,7 @@ }, filterTable(){ this.$nextTick(()=>{console.log(this.cbSelected);}) - for( var cbItem of ["ExpCSV","ExpXLSX","OrgTitleNull", "SortTitleNull", "AutoXLSCol", "AutoXLSRow", "suggestedFileNoExtra", "suggestedUseOrigenTitle"]){ + for( var cbItem of ["ExpCSV","ExpXLSX","OrgTitleNull", "SortTitleNull", "AutoXLSCol", "AutoXLSRow", "suggestedFileNoExtra", "suggestedUseOrigenTitle", "NoTimeStamp"]){ wtconfig.set("ET." + cbItem, (this.cbSelected.includes(cbItem))) } }, diff --git a/src/components/modules/ExportTools/scripts/ethelper.js b/src/components/modules/ExportTools/scripts/ethelper.js index ba33c78..3626d52 100644 --- a/src/components/modules/ExportTools/scripts/ethelper.js +++ b/src/components/modules/ExportTools/scripts/ethelper.js @@ -1649,8 +1649,10 @@ const etHelper = new class ETHELPER { arrFile.push(this.Settings.fileMinor); arrFile.push(this.Settings.levelName); arrFile.push('Item ' + this.Settings.startItem + '-' + this.Settings.endItem); - arrFile.push(timeStamp + '.' + Type + '.tmp'); - this.Settings.outFile = arrFile.join('_'); + if (!wtconfig.get('ET.NoTimeStamp', false)){ + arrFile.push(timeStamp); + } + this.Settings.outFile = arrFile.join('_') + '.' + Type + '.tmp'; // Remove unwanted chars from outfile name const targetDir = path.join( OutDir, wtutils.AppName, i18n.t('Modules.ET.Name'));