This commit is contained in:
Shiny Nematoda 2023-03-21 15:13:19 +00:00
parent 06c27fb910
commit 1cacd02979
4 changed files with 247 additions and 3886 deletions

View file

@ -18,35 +18,27 @@ const data = reactive({
spotlight: [],
featured: [],
community: [],
list: {},
}),
btns = reactive({
moods: [],
genres: [],
}),
todo = ['title', 'community', 'spotlight', 'featured'];
todo = ['title', 'community', 'spotlight', 'featured', 'shelf'];
function get(id) {
if (props.id || typeof id == 'string') {
getJsonHyp('/genres/' + (props.id || id)).then(res => {
console.log(res);
for (let i of todo) {
data[i] = res[i];
}
for (let i of todo) data[i] = res[i];
useRoute('/explore/' + (props.id || id));
});
} else {
getJsonHyp('/genres').then(res => {
console.log(res);
for (let i of todo) {
data[i] = undefined;
}
for (let i of ['moods', 'genres']) {
btns[i] = res[i];
}
for (let i of todo) data[i] = undefined;
for (let i of ['moods', 'genres']) btns[i] = res[i];
useRoute('/explore/');
});
@ -65,7 +57,7 @@ onMounted(get);
<template
v-for="type in ['featured', 'spotlight', 'community']"
:key="type">
<h3 class="head">{{ t('title.' + type) }}</h3>
<h3 class="head" v-if="data[type].length > 0">{{ t('title.' + type) }}</h3>
<div class="grid-3">
<AlbumItem
v-for="i in data[type]"
@ -79,6 +71,22 @@ onMounted(get);
" />
</div>
</template>
<template v-for="(type, title) in data.shelf">
<h3 class="head">{{ title }}</h3>
<div class="grid-3">
<AlbumItem
v-for="i in type"
:key="i.id"
:name="i.title"
:author="i.subtitle"
:art="i.thumbnails[0].url"
@open-album="
getAlbum('/playlist?list=' + i.id);
nav.state.page = 'home';
" />
</div>
</template>
</template>
<template v-else>