Commit acc8bf8e authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

FEAT: add playlist description field

parent f0fc01d0
...@@ -346,13 +346,34 @@ ...@@ -346,13 +346,34 @@
:title="playlistEditor.mode === 'edit' ? 'Edit playlist' : 'Add new playlist'" :title="playlistEditor.mode === 'edit' ? 'Edit playlist' : 'Add new playlist'"
@ok="storePlaylist" @ok="storePlaylist"
> >
<div v-if="playlistEditor.mode === 'edit'"> <b-row
Editing playlist with index: {{ playlistEditor.id }} v-if="playlistEditor.mode === 'edit'"
</div> style="padding-bottom: 1em;"
<p>Playlist entries:</p> >
<b-col
cols="3"
>
Playlist index:
</b-col>
<b-col>{{ playlistEditor.id }}</b-col>
</b-row>
<b-row>
<b-col cols="3">
Description:
</b-col>
<b-col>
<b-form-input
v-model="playlistEditor.description"
type="text"
/>
</b-col>
</b-row>
<hr> <hr>
<p>Playlist entries:</p>
<!-- If no entries are here (i.e. we add a new playlist), only show <!-- If no entries are here (i.e. we add a new playlist), only show
a hint that there's nothing here yet. --> a hint that there's nothing here yet. -->
<div <div
...@@ -659,6 +680,7 @@ export default { ...@@ -659,6 +680,7 @@ export default {
playlistEditor: { playlistEditor: {
id: null, id: null,
mode: 'add', // should be either 'add' or 'edit' mode: 'add', // should be either 'add' or 'edit'
description: '',
entries: [], entries: [],
newStreamURL: null newStreamURL: null
}, },
...@@ -691,6 +713,7 @@ export default { ...@@ -691,6 +713,7 @@ export default {
// configuration of the playlists table, which will use the playlists array as data // configuration of the playlists table, which will use the playlists array as data
playlistsTableFields: [ playlistsTableFields: [
{ key: 'id', label: 'Index' }, { key: 'id', label: 'Index' },
{ key: 'description', label: 'Description' },
{ key: 'entries', label: 'Entries' }, { key: 'entries', label: 'Entries' },
{ key: 'updated', label: 'Last edit' }, { key: 'updated', label: 'Last edit' },
{ key: 'actions', label: 'Actions', class: 'text-right' }, { key: 'actions', label: 'Actions', class: 'text-right' },
...@@ -867,8 +890,9 @@ export default { ...@@ -867,8 +890,9 @@ export default {
addPlaylist: function () { addPlaylist: function () {
this.playlistEditor.mode = 'add' this.playlistEditor.mode = 'add'
this.playlistEditor.entries = []
this.playlistEditor.id = null this.playlistEditor.id = null
this.playlistEditor.description = ''
this.playlistEditor.entries = []
this.$bvModal.show('modal-edit-playlist') this.$bvModal.show('modal-edit-playlist')
}, },
...@@ -877,6 +901,7 @@ export default { ...@@ -877,6 +901,7 @@ export default {
this.playlistEditor.entries = [] this.playlistEditor.entries = []
this.playlistEditor.id = id this.playlistEditor.id = id
var playlist = this.getPlaylistById(id) var playlist = this.getPlaylistById(id)
this.playlistEditor.description = playlist.description
for (var i in playlist.entries) { for (var i in playlist.entries) {
var entry = {} var entry = {}
if (playlist.entries[i].file) { if (playlist.entries[i].file) {
...@@ -894,7 +919,10 @@ export default { ...@@ -894,7 +919,10 @@ export default {
// Adds a new or updates an existing playlist by sending a POST/PUT // Adds a new or updates an existing playlist by sending a POST/PUT
// request to the AURA tank API // request to the AURA tank API
storePlaylist: function () { storePlaylist: function () {
var data = { entries: this.playlistEditor.entries } var data = {
description: this.playlistEditor.description,
entries: this.playlistEditor.entries
}
var uri = process.env.VUE_APP_API_TANK + 'shows/' + this.shows[this.currentShow].slug + '/playlists' var uri = process.env.VUE_APP_API_TANK + 'shows/' + this.shows[this.currentShow].slug + '/playlists'
// TODO: add some spinner or other visualisation while the playlist is added/updated // TODO: add some spinner or other visualisation while the playlist is added/updated
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment