show starred artists and albums

This commit is contained in:
Thomas Amland
2020-08-12 17:52:50 +02:00
parent e12c1f8d33
commit b8db546f64
2 changed files with 30 additions and 9 deletions
+20 -3
View File
@@ -1,22 +1,39 @@
<template>
<TrackList v-if="items" :tracks="items" />
<div v-if="result">
<div v-if="result.albums.length > 0" class="mb-4">
<h1>Albums</h1>
<AlbumList :items="result.albums" />
</div>
<div v-if="result.artists.length > 0" class="mb-4">
<h1>Artists</h1>
<ArtistList :items="result.artists" />
</div>
<div v-if="result.tracks.length > 0" class="mb-4">
<h1>Tracks</h1>
<TrackList :tracks="result.tracks" />
</div>
</div>
</template>
<script lang="ts">
import Vue from 'vue'
import AlbumList from '@/library/album/AlbumList.vue'
import ArtistList from '@/library/artist/ArtistList.vue'
import TrackList from '@/library/TrackList.vue'
export default Vue.extend({
components: {
AlbumList,
ArtistList,
TrackList,
},
data() {
return {
items: null as any,
result: null as any,
}
},
created() {
this.$api.getStarred().then(result => {
this.items = result
this.result = result
})
}
})