This commit is contained in:
Tommy Mikkelsen 2022-03-24 01:07:12 +01:00
parent 50201a4561
commit ee6f019eca
9 changed files with 235 additions and 8 deletions

View file

@ -1,6 +1,19 @@
# ![Logo](https://github.com/WebTools-NG/WebTools-NG/blob/master/src/assets/WebTools-48x48.png) WebTools-ng Change log
## V0.3.14 (Not yet released)
## V0.3.15 (Not released yet)
**Note**: This version is an Beta version
**Note 2**: In this version, the following is disabled:
* Export to xlsx format ([See #331](https://github.com/WebTools-NG/WebTools-NG/issues/331))
* Photo export
**Changes**:
* [#453 Kickstart Butler Scheduled tasks](https://github.com/WebTools-NG/WebTools-NG/issues/453)
## V0.3.14 (20220323)
**Note**: This version is an Beta version

View file

@ -1,7 +1,7 @@
{
"name": "webtools-ng",
"productName": "WebTools-NG",
"version": "0.3.14",
"version": "0.3.15",
"description": "WebTools Next Generation 4 Plex",
"author": "dane22 & CPSO",
"license": "MPL-2.0",

View file

@ -111,7 +111,8 @@
"NavTitle": "Global Settings"
},
"PMS": {
"Settings": "Settings"
"Settings": "Settings",
"Butler": "Butler scheduled tasks"
}
}
},
@ -326,6 +327,29 @@
"Description": "@:Modules.PMS.Name module allows you to manage your server",
"ErrorNoServerSelectedTitle": "No server selected",
"ErrorNoServerSelectedMsg": "You need to select a server on the top of the screen",
"Butler": {
"Title": "Butler Scheduled Tasks",
"Description": "Here you can kickstart a scheduled task",
"SelectTask": "Select the scheduled task to run now",
"TTSelectTask": "Here you select among the scheduled tasks that kan be started now",
"BackupDatabase": "Backup your database",
"BuildGracenoteCollections": "Build Gracenote Collections",
"CheckForUpdates": "Check for updates",
"CleanOldBundles": "Clean old bundles",
"CleanOldCacheFiles": "Clean old Cache Files",
"DeepMediaAnalysis": "Deep Media Analysis",
"GenerateAutoTags": "Generate Auto Tags",
"GenerateChapterThumbs": "Generate Chapter Thumbs",
"GenerateMediaIndexFiles": "Generate Media Index Files",
"OptimizeDatabase": "Optimize Database",
"RefreshLibraries": "Refresh Libraries",
"RefreshLocalMedia": "Refresh Local Media",
"RefreshPeriodicMetadata": "Refresh Periodic Metadata",
"UpgradeMediaAnalysis": "UpgradeMediaAnalysis",
"RunTask": "Run selected task",
"TaskStarted": "The selected task has been started",
"TaskDetails": "To follow progress, see Plex WebClient Dashboard"
},
"Settings": {
"Settings": "Settings",
"Description": "Here you can define the settings for the selected server",

View file

@ -57,6 +57,11 @@
href: '/pms/settings',
title: this.$t("Common.Menu.Sidebar.PMS.Settings"),
icon: 'fa fa-cog'
},
{
href: '/pms/butler',
title: this.$t("Common.Menu.Sidebar.PMS.Butler"),
icon: 'fa fa-tasks'
}
]
},

View file

@ -58,8 +58,6 @@
"all": 2
},
"Include": {
"GED SLET Level 11": "",
"GED SLET Level 21": "",
"Suggest Naming": "includeGuids=1&checkFiles=0&includeRelated=0&includeExtras=0&includeBandwidths=0&includeChapters=0&excludeElements=Actor,Collection,Country,Director,Genre,Label,Mood,Producer,Similar,Writer,Role&excludeFields=summary,tagline",
"all": "checkFiles=1&includeExtras=1&includeBandwidths=1&includeChapters=1",
"GED SLET Missing1": "includeAllConcerts=1&includeChildren=1&includeConcerts=1&includeFields=1&includeGeolocation=1&includeLoudnessRamps=1&includeMarkers=1&includeOnDeck=1&includePopularLeaves=1&includePreferences=1&includeRelated=1&includeRelatedCount=1&includeReviews=1&includeStations=1",

View file

@ -0,0 +1,152 @@
<template>
<b-container fluid>
<div class="col-lg-10 col-md-12 col-xs-12">
<h1>{{ $t("Modules.PMS.Butler.Title") }}</h1>
<p>{{ $t("Modules.PMS.Butler.Description") }}</p>
</div>
<div class="d-flex align-items-center">
<b-form-group id="ButlerGroup" v-bind:label="$t('Modules.PMS.Butler.SelectTask')" label-size="lg" label-class="font-weight-bold pt-0">
<b-tooltip target="ButlerGroup" triggers="hover">
{{ $t('Modules.PMS.Butler.TTSelectTask') }}
</b-tooltip>
<b-form-select
v-model="selTask"
id="selTask"
:options="selTaskOptions"
name="selTask">
</b-form-select>
</b-form-group>
</div>
<br>
<br>
<div class="buttons">
<!-- Buttons -->
<div id="buttons" class="text-center">
<b-button-group >
<b-button variant="success" class="mr-1" :disabled="this.selTask == ''" @click="executeButlerTask"> {{ $t('Modules.PMS.Butler.RunTask') }} </b-button>
</b-button-group>
</div>
</div>
</b-container>
</template>
<script>
const log = require("electron-log");
import i18n from '../../../../i18n';
import store from '../../../../store';
export default {
data() {
return {
selTaskOptions: [
{
"text": i18n.t('Modules.PMS.Butler.BackupDatabase'),
"value": "BackupDatabase"
},
{
"text": i18n.t('Modules.PMS.Butler.BuildGracenoteCollections'),
"value": "BuildGracenoteCollections"
},
{
"text": i18n.t('Modules.PMS.Butler.CheckForUpdates'),
"value": "CheckForUpdates"
},
{
"text": i18n.t('Modules.PMS.Butler.CleanOldBundles'),
"value": "CleanOldBundles"
},
{
"text": i18n.t('Modules.PMS.Butler.CleanOldCacheFiles'),
"value": "CleanOldCacheFiles"
},
{
"text": i18n.t('Modules.PMS.Butler.DeepMediaAnalysis'),
"value": "DeepMediaAnalysis"
},
{
"text": i18n.t('Modules.PMS.Butler.GenerateAutoTags'),
"value": "GenerateAutoTags"
},
{
"text": i18n.t('Modules.PMS.Butler.GenerateChapterThumbs'),
"value": "GenerateChapterThumbs"
},
{
"text": i18n.t('Modules.PMS.Butler.GenerateMediaIndexFiles'),
"value": "GenerateMediaIndexFiles"
},
{
"text": i18n.t('Modules.PMS.Butler.OptimizeDatabase'),
"value": "OptimizeDatabase"
},
{
"text": i18n.t('Modules.PMS.Butler.RefreshLibraries'),
"value": "RefreshLibraries"
},
{
"text": i18n.t('Modules.PMS.Butler.RefreshLocalMedia'),
"value": "RefreshLocalMedia"
},
{
"text": i18n.t('Modules.PMS.Butler.RefreshPeriodicMetadata'),
"value": "RefreshPeriodicMetadata"
},
{
"text": i18n.t('Modules.PMS.Butler.UpgradeMediaAnalysis'),
"value": "UpgradeMediaAnalysis"
}
],
selTask : "",
};
},
created() {
log.info("PMS Butler Created");
this.serverSelected();
},
computed: {
selectedServerAddress: function(){
return this.$store.getters.getSelectedServerAddress;
}
},
methods: {
async executeButlerTask() {
log.debug(`Starting Butler Task: ${this.selTask}`);
await store.dispatch('startButlerTask', {
Token: this.$store.getters.getAuthToken,
Address: this.$store.getters.getSelectedServerAddress,
Job: this.selTask});
this.$bvToast.toast(this.$t("Modules.PMS.Butler.TaskDetails"), {
title: this.$t("Modules.PMS.Butler.TaskStarted"),
autoHideDelay: 4000,
solid: true,
variant: 'primary',
toaster: 'b-toaster-bottom-right'
});
},
async serverSelected() {
let serverCheck = this.$store.getters.getSelectedServer;
if (serverCheck == "none") {
log.debug("serverCheck is none");
this.$bvToast.toast(this.$t("Modules.PMS.ErrorNoServerSelectedMsg"), {
title: this.$t("Modules.PMS.ErrorNoServerSelectedTitle"),
autoHideDelay: 4000,
solid: true,
variant: 'primary',
toaster: 'b-toaster-bottom-right'
}
);
}
}
}
};
</script>
<style scoped>
.outDirbox{
margin-right:10px;
}
#b-form-group{
margin-top: 20px;
}
</style>

View file

@ -150,7 +150,6 @@
this.serverSelected();
this.getFilterSettings();
this.getServerSettings();
this.getcbDefaults();
},
computed: {
selectedServerAddress: function(){

View file

@ -8,6 +8,7 @@ import ExportCustom from '../components/modules/ExportTools/Custom/custom';
import PlexTV from '../components/modules/PlexTV/PlexTV';
import PMS from '../components/modules/PMS/PMS';
import PMSSettings from '../components/modules/PMS/Settings/settings';
import Butler from '../components/modules/PMS/Butler/butler';
import Language from '../components/modules/Main/Language.vue';
import GlobalSettings from '../components/modules/Main/GlobalSettings';
import About from '../components/modules/Main/About';
@ -68,6 +69,12 @@ Vue.use(VueRouter)
component: PMSSettings,
meta: {requiresAuth: true}
},
{
path: '/pms/butler',
name: "butler",
component: Butler,
meta: {requiresAuth: true}
},
{
path: '/plextv',
name: "plextv",

View file

@ -20,6 +20,35 @@ const getters = {
}
const actions = {
async startButlerTask({ commit }, payload) {
commit
let header = wtutils.PMSHeader;
header['X-Plex-Token'] = payload.Token;
const url = `${payload.Address}/butler/${payload.Job}`;
log.debug(`Setting new setting with url ${url}`);
await axios({
method: 'post',
url: url,
headers: header
})
.then((response) => {
log.debug('Response from startButlerTask recieved')
response
})
.catch(function (error) {
if (error.response) {
log.error('startButlerTask: ' + error.response.data)
alert(error.response.data.errors[0].code + " " + error.response.data.errors[0].message)
} else if (error.request) {
log.error('startButlerTask: ' + error.request)
} else {
log.error('startButlerTask: ' + error.message)
}
});
},
async setPMSSetting({ commit }, payload) {
commit