work on media handling
This commit is contained in:
parent
0ad3593aac
commit
d758062ff4
@ -358,14 +358,10 @@ export default {
|
||||
|
||||
async onSubmitCreateFolder (evt) {
|
||||
evt.preventDefault()
|
||||
const path = this.crumbs.map(e => e.text).join('/') + '/' + this.folderName
|
||||
|
||||
await this.$axios.post(
|
||||
'api/player/media/op/',
|
||||
{
|
||||
folder: this.folderName,
|
||||
path: this.crumbs.map(e => e.text).join('/'),
|
||||
channel: this.configGui[this.configID].id
|
||||
}
|
||||
`api/file/${this.configGui[this.configID].id}/create-folder/`, { source: path }
|
||||
)
|
||||
|
||||
this.$root.$emit('bv::hide::modal', 'folder-modal')
|
||||
@ -451,7 +447,7 @@ export default {
|
||||
this.previewName = src.split('/').slice(-1)[0]
|
||||
const ext = this.previewName.split('.').slice(-1)[0]
|
||||
|
||||
if (this.configPlayout.storage.extensions.includes(`.${ext}`)) {
|
||||
if (this.configPlayout.storage.extensions.includes(`${ext}`)) {
|
||||
this.isImage = false
|
||||
this.previewOptions = {
|
||||
liveui: false,
|
||||
@ -462,7 +458,7 @@ export default {
|
||||
sources: [
|
||||
{
|
||||
type: `video/${ext}`,
|
||||
src: '/' + encodeURIComponent(src.replace(/^\//, ''))
|
||||
src: '/' + encodeURIComponent(src.replace(/^[/]+/, ''))
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -25,20 +25,21 @@ export const actions = {
|
||||
`api/file/${channel}/browse/`, { source: path })
|
||||
|
||||
if (response.data) {
|
||||
const pathStr = 'Home/' + response.data.source
|
||||
const pathArr = pathStr.split('/')
|
||||
console.log(response.data)
|
||||
const pathArr = response.data.source.split('/')
|
||||
|
||||
console.log(pathArr)
|
||||
console.log('path', path)
|
||||
|
||||
if (path) {
|
||||
for (const crumb of pathArr) {
|
||||
if (crumb === 'Home') {
|
||||
crumbs.push({ text: crumb, path: root })
|
||||
} else if (crumb) {
|
||||
if (crumb) {
|
||||
root += crumb + '/'
|
||||
crumbs.push({ text: crumb, path: root })
|
||||
}
|
||||
}
|
||||
} else {
|
||||
crumbs.push({ text: 'Home', path: '' })
|
||||
crumbs.push({ text: pathArr[0], path: '' })
|
||||
}
|
||||
|
||||
commit('UPDATE_CURRENT_PATH', path)
|
||||
|
Loading…
Reference in New Issue
Block a user