don't send path to config, only channel id
This commit is contained in:
parent
7223ad8773
commit
cfa9b20bed
2
.gitignore
vendored
2
.gitignore
vendored
@ -13,6 +13,8 @@ pids
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
jsconfig.json
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
|
@ -223,6 +223,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import Menu from '@/components/Menu.vue'
|
||||
|
||||
export default {
|
||||
@ -261,6 +262,7 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState('config', ['configID', 'configGui'])
|
||||
},
|
||||
|
||||
watch: {
|
||||
@ -406,7 +408,10 @@ export default {
|
||||
boxborderw: this.form.border
|
||||
}
|
||||
|
||||
const response = await this.$axios.post('api/player/send/message/', { data: obj })
|
||||
const response = await this.$axios.post('api/player/send/message/', {
|
||||
data: obj,
|
||||
channel: this.configGui[this.configID].id
|
||||
})
|
||||
|
||||
if (response.data && response.data.status.Success && response.data.status.Success === '0 Success') {
|
||||
this.success = true
|
||||
|
@ -398,6 +398,7 @@ export default {
|
||||
}
|
||||
]
|
||||
|
||||
this.getPath(this.extensions, '')
|
||||
this.getPlaylist()
|
||||
setTimeout(() => { scrollTo(this) }, 3000)
|
||||
}
|
||||
@ -566,7 +567,7 @@ export default {
|
||||
'api/player/playlist/',
|
||||
{
|
||||
data: { channel: this.$store.state.config.configGui.channel, date: saveDate, program: saveList },
|
||||
config_path: this.configGui[this.configID].playout_config
|
||||
channel: this.configGui[this.configID].id
|
||||
}
|
||||
)
|
||||
},
|
||||
|
@ -140,8 +140,8 @@ export const actions = {
|
||||
},
|
||||
|
||||
async getPlayoutConfig ({ commit, state, rootState }) {
|
||||
const path = state.configGui[state.configID].playout_config
|
||||
const response = await this.$axios.get(`api/player/config/?configPlayout&path=${path}`)
|
||||
const channel = state.configGui[state.configID].id
|
||||
const response = await this.$axios.get(`api/player/config/?configPlayout&channel=${channel}`)
|
||||
|
||||
if (response.data) {
|
||||
if (response.data.playlist.day_start) {
|
||||
@ -160,8 +160,10 @@ export const actions = {
|
||||
},
|
||||
|
||||
async setPlayoutConfig ({ commit, state }, obj) {
|
||||
const path = state.configGui[state.configID].playout_config
|
||||
const update = await this.$axios.post(`api/player/config/?configPlayout&path=${path}`, { data: obj })
|
||||
const update = await this.$axios.post('api/player/config/?configPlayout', {
|
||||
data: obj,
|
||||
channel: state.configGui[state.configID].id
|
||||
})
|
||||
return update
|
||||
},
|
||||
|
||||
|
@ -20,9 +20,9 @@ export const actions = {
|
||||
async getTree ({ commit, dispatch, state, rootState }, { extensions, path }) {
|
||||
const crumbs = []
|
||||
let root = '/'
|
||||
const configPath = rootState.config.configGui[rootState.config.configID].playout_config
|
||||
const channel = rootState.config.configGui[rootState.config.configID].id
|
||||
const response = await this.$axios.get(
|
||||
`api/player/media/?extensions=${extensions}&config_path=${configPath}&path=${path}`)
|
||||
`api/player/media/?extensions=${extensions}&channel=${channel}&path=${path}`)
|
||||
|
||||
if (response.data.tree) {
|
||||
const pathArr = response.data.tree[0].split('/')
|
||||
|
@ -53,14 +53,14 @@ export const mutations = {
|
||||
export const actions = {
|
||||
async getPlaylist ({ commit, dispatch, state, rootState }, { date }) {
|
||||
const timeInSec = this.$timeToSeconds(this.$dayjs().tz(rootState.config.timezone).format('HH:mm:ss'))
|
||||
const configPath = rootState.config.configGui[rootState.config.configID].playout_config
|
||||
const channel = rootState.config.configGui[rootState.config.configID].id
|
||||
let dateToday = this.$dayjs().tz(this.timezone).format('YYYY-MM-DD')
|
||||
|
||||
if (rootState.config.startInSec > timeInSec) {
|
||||
dateToday = this.$dayjs(dateToday).tz(rootState.config.timezone).subtract(1, 'day').format('YYYY-MM-DD')
|
||||
}
|
||||
|
||||
const response = await this.$axios.get(`api/player/playlist/?date=${date}&config_path=${configPath}`)
|
||||
const response = await this.$axios.get(`api/player/playlist/?date=${date}&channel=${channel}`)
|
||||
|
||||
if (response.data && response.data.program) {
|
||||
commit('UPDATE_PLAYLIST', this.$processPlaylist(rootState.config.startInSec, response.data.program))
|
||||
|
Loading…
Reference in New Issue
Block a user