-
-
-
-
- {{ playlist.tracks_count }} tracks
- Last modification {{ playlist.modification_date | ago}}
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ Name |
+ Last modification |
+ Tracks |
+ Visibility |
+ |
+
+
+
+
+ {{ playlist.name }} |
+ |
+ {{ playlist.tracks_count }} |
+ {{ playlist.privacy_level }} |
+
+
+
+
+ |
+
+
+
-
+
+
@@ -48,10 +65,6 @@ export default {
Modal,
PlaylistForm
},
- props: {
- track: {type: Object},
- show: {type: Boolean}
- },
data () {
return {
errors: []
@@ -59,7 +72,7 @@ export default {
},
methods: {
update (v) {
- this.$emit('update:show', v)
+ this.$store.commit('playlists/showModal', v)
},
addToPlaylist (playlistId) {
let self = this
@@ -69,7 +82,7 @@ export default {
}
return axios.post('playlist-tracks/', payload).then(response => {
logger.default.info('Successfully added track to playlist')
- self.$emit('update:show', false)
+ self.update(false)
self.$store.dispatch('playlists/fetchOwn')
}, error => {
logger.default.error('Error while adding track to playlist')
@@ -79,7 +92,8 @@ export default {
},
computed: {
...mapState({
- playlists: state => state.playlists.playlists
+ playlists: state => state.playlists.playlists,
+ track: state => state.playlists.modalTrack
}),
sortedPlaylists () {
let p = _.sortBy(this.playlists, [(e) => { return e.modification_date }])
diff --git a/front/src/components/playlists/TrackPlaylistIcon.vue b/front/src/components/playlists/TrackPlaylistIcon.vue
index 2684f7cb6..843d15392 100644
--- a/front/src/components/playlists/TrackPlaylistIcon.vue
+++ b/front/src/components/playlists/TrackPlaylistIcon.vue
@@ -1,28 +1,22 @@
-