forked from platypush/platypush
[Media UI] Adapted media browser to the new file browser plugin.
This commit is contained in:
parent
9493445af6
commit
496dfdb50b
2 changed files with 40 additions and 1 deletions
|
@ -1,9 +1,10 @@
|
|||
<template>
|
||||
<div class="media-file-browser">
|
||||
<Loading v-if="loading" />
|
||||
<Loading v-if="isLoading" />
|
||||
<Browser :is-media="true"
|
||||
:filter="filter"
|
||||
:has-back="true"
|
||||
:homepage="mediaDirs"
|
||||
@back="$emit('back')"
|
||||
@path-change="$emit('path-change', $event)"
|
||||
@play="$emit('play', $event)"
|
||||
|
@ -22,6 +23,40 @@ export default {
|
|||
Browser,
|
||||
Loading,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
loading_: false,
|
||||
mediaDirs: {},
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
isLoading() {
|
||||
return this.loading_ || this.loading
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
async refresh() {
|
||||
this.loading_ = true
|
||||
|
||||
try {
|
||||
this.mediaDirs = await this.request(`${this.mediaPlugin}.get_media_dirs`)
|
||||
} finally {
|
||||
this.loading_ = false
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
async mounted() {
|
||||
const urlPath = this.getUrlArgs().path
|
||||
if (urlPath) {
|
||||
await this.$emit('path-change', urlPath)
|
||||
}
|
||||
|
||||
await this.refresh()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -27,6 +27,10 @@ export default {
|
|||
default: false,
|
||||
},
|
||||
|
||||
mediaPlugin: {
|
||||
type: String,
|
||||
},
|
||||
|
||||
selectedPlaylist: {
|
||||
default: null,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue