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 added</p>
|
|
|
|
<p class="heading">albums</p>
|
|
|
|
</template>
|
|
|
|
<template slot="content">
|
2018-12-16 03:17:43 -05:00
|
|
|
<list-item-album v-for="album in recently_added.items" :key="album.id" :album="album" @click="open_album(album)">
|
2018-12-15 03:56:09 -05:00
|
|
|
<template slot="actions">
|
|
|
|
<a @click="open_dialog(album)">
|
|
|
|
<span class="icon has-text-dark"><i class="mdi mdi-dots-vertical mdi-18px"></i></span>
|
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
</list-item-album>
|
|
|
|
<modal-dialog-album :show="show_details_modal" :album="selected_album" @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 ListItemAlbum from '@/components/ListItemAlbum'
|
2018-12-15 03:56:09 -05:00
|
|
|
import ModalDialogAlbum from '@/components/ModalDialogAlbum'
|
2018-08-11 01:47:10 -04:00
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
const browseData = {
|
|
|
|
load: function (to) {
|
|
|
|
return webapi.search({
|
|
|
|
type: 'album',
|
2019-02-09 02:48:42 -05:00
|
|
|
expression: 'time_added after 8 weeks ago and media_kind is music having track_count > 3 order by time_added desc',
|
2018-08-11 01:47:10 -04:00
|
|
|
limit: 50
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function (vm, response) {
|
|
|
|
vm.recently_added = response.data.albums
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PageBrowseType',
|
2020-04-11 13:43:53 -04:00
|
|
|
mixins: [LoadDataBeforeEnterMixin(browseData)],
|
2018-12-15 03:56:09 -05:00
|
|
|
components: { ContentWithHeading, TabsMusic, ListItemAlbum, ModalDialogAlbum },
|
2018-08-11 01:47:10 -04:00
|
|
|
|
|
|
|
data () {
|
|
|
|
return {
|
2018-12-15 03:56:09 -05:00
|
|
|
recently_added: {},
|
|
|
|
|
|
|
|
show_details_modal: false,
|
|
|
|
selected_album: {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2018-12-16 03:17:43 -05:00
|
|
|
open_album: function (album) {
|
|
|
|
this.$router.push({ path: '/music/albums/' + album.id })
|
|
|
|
},
|
|
|
|
|
2018-12-15 03:56:09 -05:00
|
|
|
open_dialog: function (album) {
|
|
|
|
this.selected_album = album
|
|
|
|
this.show_details_modal = true
|
2018-08-11 01:47:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|