2018-08-11 07:47:10 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<tabs-music></tabs-music>
|
|
|
|
|
|
|
|
<content-with-heading>
|
|
|
|
<template slot="heading-left">
|
|
|
|
<p class="title is-4">Recently added</p>
|
2020-11-30 21:16:32 +00:00
|
|
|
<p class="heading">{{ recently_added }} albums</p>
|
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
|
|
|
|
<content-with-heading v-if="show_recent_today && recently_added_today.items.length">
|
|
|
|
<template slot="heading-left">
|
|
|
|
<p class="title is-6">Today</p>
|
|
|
|
<p class="heading">{{ recently_added_today.items.length }} albums</p>
|
|
|
|
</template>
|
2020-12-01 12:07:48 +00:00
|
|
|
<template slot="heading-right">
|
|
|
|
<div class="buttons is-centered">
|
|
|
|
<a class="button is-small is-light is-rounded" @click="show_modal_today = true">
|
|
|
|
<span class="icon"><i class="mdi mdi-dots-horizontal mdi-18px"></i></span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</template>
|
2020-11-30 21:16:32 +00:00
|
|
|
<template slot="content">
|
|
|
|
<list-albums :albums="recently_added_today.items"></list-albums>
|
2020-12-01 12:07:48 +00:00
|
|
|
<modal-dialog-albums :show="show_modal_today" title='Recently Added - Today' :albums="recently_added_today" @close="show_modal_today = false" />
|
2020-11-30 21:16:32 +00:00
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
|
|
|
|
<content-with-heading v-if="show_recent_week && recently_added_week.items.length">
|
|
|
|
<template slot="heading-left">
|
|
|
|
<p class="title is-6">This Week</p>
|
|
|
|
<p class="heading">{{ recently_added_week.items.length }} albums</p>
|
|
|
|
</template>
|
2020-12-01 12:07:48 +00:00
|
|
|
<template slot="heading-right">
|
|
|
|
<div class="buttons is-centered">
|
|
|
|
<a class="button is-small is-light is-rounded" @click="show_modal_week = true">
|
|
|
|
<span class="icon"><i class="mdi mdi-dots-horizontal mdi-18px"></i></span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</template>
|
2020-11-30 21:16:32 +00:00
|
|
|
<template slot="content">
|
|
|
|
<list-albums :albums="recently_added_week.items"></list-albums>
|
2020-12-01 12:07:48 +00:00
|
|
|
<modal-dialog-albums :show="show_modal_week" title='Recently Added - Past Week' :albums="recently_added_week" @close="show_modal_week = false" />
|
2020-11-30 21:16:32 +00:00
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
|
|
|
|
<content-with-heading v-if="show_recent_month && recently_added_month.items.length">
|
|
|
|
<template slot="heading-left">
|
|
|
|
<p class="title is-6">This Month </p>
|
|
|
|
<p class="heading">{{ recently_added_month.items.length }} albums</p>
|
2018-08-11 07:47:10 +02:00
|
|
|
</template>
|
2020-12-01 12:07:48 +00:00
|
|
|
<template slot="heading-right">
|
|
|
|
<div class="buttons is-centered">
|
|
|
|
<a class="button is-small is-light is-rounded" @click="show_modal_month = true">
|
|
|
|
<span class="icon"><i class="mdi mdi-dots-horizontal mdi-18px"></i></span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</template>
|
2018-08-11 07:47:10 +02:00
|
|
|
<template slot="content">
|
2020-11-30 21:16:32 +00:00
|
|
|
<list-albums :albums="recently_added_month.items"></list-albums>
|
2020-12-01 12:07:48 +00:00
|
|
|
<modal-dialog-albums :show="show_modal_month" title='Recently Added - Past Month' :albums="recently_added_month" @close="show_modal_month = false" />
|
2020-11-30 21:16:32 +00:00
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
|
|
|
|
<content-with-heading v-if="show_recent_older && recently_added_older.items.length">
|
|
|
|
<template slot="heading-left">
|
|
|
|
<p class="title is-6">Older</p>
|
|
|
|
<p class="heading">{{ recently_added_older.items.length }} albums</p>
|
|
|
|
</template>
|
2020-12-01 12:07:48 +00:00
|
|
|
<template slot="heading-right">
|
|
|
|
<div class="buttons is-centered">
|
|
|
|
<a class="button is-small is-light is-rounded" @click="show_modal_older = true">
|
|
|
|
<span class="icon"><i class="mdi mdi-dots-horizontal mdi-18px"></i></span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</template>
|
2020-11-30 21:16:32 +00:00
|
|
|
<template slot="content">
|
|
|
|
<list-albums :albums="recently_added_older.items"></list-albums>
|
2020-12-01 12:07:48 +00:00
|
|
|
<modal-dialog-albums :show="show_modal_older" title='Recently Added - Older than Month' :albums="recently_added_older" @close="show_modal_older = false" />
|
2018-08-11 07:47:10 +02:00
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { LoadDataBeforeEnterMixin } from './mixin'
|
|
|
|
import ContentWithHeading from '@/templates/ContentWithHeading'
|
|
|
|
import TabsMusic from '@/components/TabsMusic'
|
2020-09-20 12:25:38 +02:00
|
|
|
import ListAlbums from '@/components/ListAlbums'
|
2020-12-01 12:07:48 +00:00
|
|
|
import ModalDialogAlbums from '@/components/ModalDialogAlbums'
|
2018-08-11 07:47:10 +02:00
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
const browseData = {
|
|
|
|
load: function (to) {
|
2020-12-01 16:50:13 +00:00
|
|
|
const recentlyAddedLimit = 100
|
|
|
|
return Promise.all([
|
|
|
|
webapi.search({
|
|
|
|
type: 'album',
|
|
|
|
expression: 'time_added after today and media_kind is music order by time_added desc',
|
|
|
|
limit: recentlyAddedLimit
|
|
|
|
}),
|
|
|
|
webapi.search({
|
|
|
|
type: 'album',
|
|
|
|
expression: 'time_added after this week and media_kind is music order by time_added desc',
|
|
|
|
limit: recentlyAddedLimit
|
|
|
|
}),
|
|
|
|
webapi.search({
|
|
|
|
type: 'album',
|
|
|
|
expression: 'time_added after last month and media_kind is music order by time_added desc',
|
|
|
|
limit: recentlyAddedLimit
|
|
|
|
}),
|
|
|
|
webapi.search({
|
|
|
|
type: 'album',
|
|
|
|
expression: 'time_added before last month and media_kind is music order by time_added desc',
|
|
|
|
limit: recentlyAddedLimit
|
|
|
|
})
|
|
|
|
])
|
2018-08-11 07:47:10 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
set: function (vm, response) {
|
2020-12-01 16:50:13 +00:00
|
|
|
vm.recently_added_today = response[0].data.albums
|
|
|
|
vm.recently_added_week = response[1].data.albums
|
|
|
|
vm.recently_added_month = response[2].data.albums
|
|
|
|
vm.recently_added_older = response[3].data.albums
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PageBrowseType',
|
2020-04-11 19:43:53 +02:00
|
|
|
mixins: [LoadDataBeforeEnterMixin(browseData)],
|
2020-12-01 12:07:48 +00:00
|
|
|
components: { ContentWithHeading, TabsMusic, ListAlbums, ModalDialogAlbums },
|
2020-12-01 16:50:13 +00:00
|
|
|
|
2018-08-11 07:47:10 +02:00
|
|
|
data () {
|
|
|
|
return {
|
2020-11-30 21:16:32 +00:00
|
|
|
recently_added_today: { items: [] },
|
|
|
|
recently_added_week: { items: [] },
|
|
|
|
recently_added_month: { items: [] },
|
|
|
|
recently_added_older: { items: [] },
|
|
|
|
|
2020-12-01 12:07:48 +00:00
|
|
|
show_modal_today: false,
|
|
|
|
show_modal_week: false,
|
|
|
|
show_modal_month: false,
|
|
|
|
show_modal_older: false
|
2020-11-30 21:16:32 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
show_recent_today () {
|
|
|
|
return this.recently_added_today.items.length > 0
|
|
|
|
},
|
|
|
|
show_recent_week () {
|
|
|
|
return this.recently_added_week.items.length > 0
|
|
|
|
},
|
|
|
|
show_recent_month () {
|
|
|
|
return this.recently_added_month.items.length > 0
|
|
|
|
},
|
|
|
|
show_recent_older () {
|
|
|
|
return this.recently_added_older.items.length > 0
|
|
|
|
},
|
|
|
|
recently_added () {
|
|
|
|
return this.recently_added_today.items.length + this.recently_added_week.items.length + this.recently_added_month.items.length + this.recently_added_older.items.length
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
</style>
|