set global playlist start and length

This commit is contained in:
jb-alvarado 2021-01-28 15:51:35 +01:00
parent 4106b3c8bf
commit 872512a401

View File

@ -1,6 +1,8 @@
export const state = () => ({
configGui: null,
netChoices: [],
startInSec: null,
playlistLength: 86400.0,
configPlayout: [],
currentUser: null,
configUser: null
@ -13,6 +15,12 @@ export const mutations = {
UPDATE_NET_CHOICES (state, list) {
state.netChoices = list
},
UPDATE_START_TIME (state, sec) {
state.startInSec = sec
},
UPDATE_PLAYLIST_LENGTH (state, sec) {
state.playlistLength = sec
},
UPDATE_PLAYLOUT_CONFIG (state, config) {
state.configPlayout = config
},
@ -84,6 +92,14 @@ export const actions = {
const response = await this.$axios.get('api/player/config/?configPlayout')
if (response.data) {
if (response.data.playlist.day_start) {
commit('UPDATE_START_TIME', this.$timeToSeconds(response.data.playlist.day_start))
}
if (response.data.playlist.length) {
commit('UPDATE_PLAYLIST_LENGTH', this.$timeToSeconds(response.data.playlist.length))
}
commit('UPDATE_PLAYLOUT_CONFIG', response.data)
}
},