work on multi channel

This commit is contained in:
jb-alvarado 2021-03-18 18:16:47 +01:00
parent 6f7cac4c53
commit 0068027218
3 changed files with 16 additions and 8 deletions

View File

@ -297,12 +297,12 @@ export default {
},
computed: {
...mapState('config', ['configGui', 'configPlayout']),
...mapState('config', ['configID', 'configGui', 'configPlayout']),
...mapState('media', ['crumbs', 'folderTree'])
},
created () {
this.extensions = [...this.configPlayout.storage.extensions, ...this.configGui.extra_extensions].join(',')
this.extensions = [...this.configPlayout.storage.extensions, ...this.configGui[this.configID].extra_extensions].join(',')
this.getPath(this.extensions, '')
},
@ -354,7 +354,11 @@ export default {
await this.$axios.post(
'api/player/media/op/',
{ folder: this.folderName, path: this.crumbs.map(e => e.text).join('/') }
{
folder: this.folderName,
path: this.crumbs.map(e => e.text).join('/'),
config_path: this.configGui[this.configID].playout_config
}
)
this.$root.$emit('bv::hide::modal', 'folder-modal')
@ -389,6 +393,8 @@ export default {
this.currentProgress = progress
}
const configPath = this.configGui[this.configID].playout_config
for (const [i, file] of this.inputFiles.entries()) {
this.uploadTask = file.name
@ -399,7 +405,7 @@ export default {
}
await this.$axios.put(
`api/player/media/upload/${encodeURIComponent(file.name)}?path=${encodeURIComponent(this.crumbs.map(e => e.text).join('/'))}`,
`api/player/media/upload/${encodeURIComponent(file.name)}?path=${encodeURIComponent(this.crumbs.map(e => e.text).join('/'))}&config_path=${configPath}`,
file,
config
)

View File

@ -17,10 +17,12 @@ export const mutations = {
}
export const actions = {
async getTree ({ commit, dispatch, state }, { extensions, path }) {
async getTree ({ commit, dispatch, state, rootState }, { extensions, path }) {
const crumbs = []
let root = '/'
const response = await this.$axios.get(`api/player/media/?extensions=${extensions}&path=${path}`)
const configPath = rootState.config.configGui[rootState.config.configID].playout_config
const response = await this.$axios.get(
`api/player/media/?extensions=${extensions}&config_path=${configPath}&path=${path}`)
if (response.data.tree) {
const pathArr = response.data.tree[0].split('/')

View File

@ -49,7 +49,7 @@ export const mutations = {
}
export const actions = {
async getPlaylist ({ commit, dispatch, state, rootState }, { dayStart, date }) {
async getPlaylist ({ commit, dispatch, state, rootState }, { dayStart, date, configPath }) {
const timeInSec = this.$timeToSeconds(this.$dayjs().format('HH:mm:ss'))
let dateToday = this.$dayjs().format('YYYY-MM-DD')
@ -57,7 +57,7 @@ export const actions = {
dateToday = this.$dayjs(dateToday).subtract(1, 'day').format('YYYY-MM-DD')
}
const response = await this.$axios.get(`api/player/playlist/?date=${date}`)
const response = await this.$axios.get(`api/player/playlist/?date=${date}&config_path=${configPath}`)
if (response.data && response.data.program) {
commit('UPDATE_PLAYLIST', this.$processPlaylist(dayStart, response.data.program))