2018-08-11 07:47:10 +02:00
|
|
|
<template>
|
2022-02-19 06:18:01 +01:00
|
|
|
<div class="fd-page-with-tabs">
|
2022-02-19 06:39:14 +01:00
|
|
|
<tabs-music />
|
2018-08-11 07:47:10 +02:00
|
|
|
|
|
|
|
<content-with-heading>
|
2022-02-19 06:39:14 +01:00
|
|
|
<template #heading-left>
|
2018-08-11 07:47:10 +02:00
|
|
|
<p class="title is-4">Recently added</p>
|
2021-01-10 11:36:31 +01:00
|
|
|
<p class="heading">albums</p>
|
2020-12-01 12:07:48 +00:00
|
|
|
</template>
|
2022-02-19 06:39:14 +01:00
|
|
|
<template #content>
|
|
|
|
<list-albums :albums="albums_list" />
|
2018-08-11 07:47:10 +02:00
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-02-19 06:18:01 +01:00
|
|
|
import ContentWithHeading from '@/templates/ContentWithHeading.vue'
|
|
|
|
import TabsMusic from '@/components/TabsMusic.vue'
|
|
|
|
import ListAlbums from '@/components/ListAlbums.vue'
|
2018-08-11 07:47:10 +02:00
|
|
|
import webapi from '@/webapi'
|
2020-12-01 16:50:58 +00:00
|
|
|
import store from '@/store'
|
2021-01-10 11:36:31 +01:00
|
|
|
import Albums from '@/lib/Albums'
|
2018-08-11 07:47:10 +02:00
|
|
|
|
2022-02-19 06:18:01 +01:00
|
|
|
const dataObject = {
|
2018-08-11 07:47:10 +02:00
|
|
|
load: function (to) {
|
2021-01-10 11:36:31 +01:00
|
|
|
const limit = store.getters.settings_option_recently_added_limit
|
|
|
|
return webapi.search({
|
|
|
|
type: 'album',
|
2022-02-19 06:39:14 +01:00
|
|
|
expression:
|
|
|
|
'media_kind is music having track_count > 3 order by time_added desc',
|
2021-01-10 11:36:31 +01:00
|
|
|
limit: limit
|
|
|
|
})
|
2018-08-11 07:47:10 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
set: function (vm, response) {
|
2021-01-10 11:36:31 +01:00
|
|
|
vm.recently_added = response.data.albums
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PageBrowseType',
|
2021-01-10 11:36:31 +01:00
|
|
|
components: { ContentWithHeading, TabsMusic, ListAlbums },
|
2020-12-01 16:50:13 +00:00
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
beforeRouteEnter(to, from, next) {
|
|
|
|
dataObject.load(to).then((response) => {
|
|
|
|
next((vm) => dataObject.set(vm, response))
|
|
|
|
})
|
|
|
|
},
|
|
|
|
beforeRouteUpdate(to, from, next) {
|
|
|
|
const vm = this
|
|
|
|
dataObject.load(to).then((response) => {
|
|
|
|
dataObject.set(vm, response)
|
|
|
|
next()
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
2018-08-11 07:47:10 +02:00
|
|
|
return {
|
2021-01-10 11:36:31 +01:00
|
|
|
recently_added: { items: [] }
|
2020-12-18 21:15:27 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2020-11-30 21:16:32 +00:00
|
|
|
computed: {
|
2022-02-19 06:39:14 +01:00
|
|
|
albums_list() {
|
2021-01-10 11:36:31 +01:00
|
|
|
return new Albums(this.recently_added.items, {
|
|
|
|
hideSingles: false,
|
|
|
|
hideSpotify: false,
|
|
|
|
sort: 'Recently added (browse)',
|
|
|
|
group: true
|
|
|
|
})
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
<style></style>
|