2018-08-11 01:47:10 -04:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<tabs-music></tabs-music>
|
|
|
|
|
|
|
|
<content-with-heading>
|
|
|
|
<template slot="heading-left">
|
|
|
|
<p class="title is-4">Recently played</p>
|
|
|
|
<p class="heading">tracks</p>
|
|
|
|
</template>
|
|
|
|
<template slot="content">
|
2018-12-15 03:56:09 -05:00
|
|
|
<list-item-track v-for="track in recently_played.items" :key="track.id" :track="track" :position="0" :context_uri="track.uri">
|
|
|
|
<template slot="actions">
|
|
|
|
<a @click="open_dialog(track)">
|
|
|
|
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
</list-item-track>
|
|
|
|
<modal-dialog-track :show="show_details_modal" :track="selected_track" @close="show_details_modal = false" />
|
2018-08-11 01:47:10 -04:00
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
|
|
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
|
|
|
import TabsMusic from '@/components/TabsMusic'
|
|
|
|
import ListItemTrack from '@/components/ListItemTrack'
|
2018-12-15 03:56:09 -05:00
|
|
|
import ModalDialogTrack from '@/components/ModalDialogTrack'
|
2018-08-11 01:47:10 -04:00
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
const browseData = {
|
|
|
|
load: function (to) {
|
|
|
|
return webapi.search({
|
|
|
|
type: 'track',
|
|
|
|
expression: 'time_played after 8 weeks ago order by time_played desc',
|
|
|
|
limit: 50
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function (vm, response) {
|
|
|
|
vm.recently_played = response.data.tracks
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PageBrowseType',
|
|
|
|
mixins: [ LoadDataBeforeEnterMixin(browseData) ],
|
2018-12-15 03:56:09 -05:00
|
|
|
components: { ContentWithHeading, TabsMusic, ListItemTrack, ModalDialogTrack },
|
2018-08-11 01:47:10 -04:00
|
|
|
|
|
|
|
data () {
|
|
|
|
return {
|
2018-12-15 03:56:09 -05:00
|
|
|
recently_played: {},
|
|
|
|
|
|
|
|
show_details_modal: false,
|
|
|
|
selected_track: {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
open_dialog: function (track) {
|
|
|
|
this.selected_track = track
|
|
|
|
this.show_details_modal = true
|
2018-08-11 01:47:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|