"See more" for albums and singles in artist page

This commit is contained in:
Shiny Nematoda 2023-03-24 10:34:26 +00:00
parent 9dd4534f83
commit 3f5abe967b
7 changed files with 81 additions and 85 deletions

View file

@ -13,23 +13,23 @@ const { t } = useI18n(),
source = ref(''),
status = ref(false);
function set(id) {
getJsonHyp('/lyrics/' + id).then(res => {
text.value = res.text;
source.value = res.source;
status.value = true;
});
}
function get() {
status.value = false;
const set = id => {
getJsonHyp('/browse/' + id).then(res => {
text.value = res.text;
source.value = res.source;
status.value = true;
});
};
if (data.state.lyrics && data.state.urls === data.state.url) {
set(data.state.lyrics);
} else if (data.state.url) {
getJsonHyp('/next/' + data.state.url.replace('/watch?v=', '')).then(
next => {
if (next.lyricsId) set(next.lyricsId);
({ lyricsId }) => {
if (lyricsId) set(lyricsId);
},
);
}

View file

@ -44,8 +44,6 @@ const shuffleAdd = () => {
delete songs[nos];
}
console.log(songs, copy);
emit('play-urls', copy);
},
openSong = (song, nxt = false) => {
@ -75,8 +73,6 @@ const shuffleAdd = () => {
}
},
removeSong = i => {
console.log(i);
results.items.songs.items.splice(i, 1);
},
shareAlbum = () => {
@ -158,7 +154,6 @@ const shuffleAdd = () => {
items = json.items;
} else {
console.log(results.next);
const json = await getJsonPiped(`/nextpage/playlists/${results.next}`);
key = 'songs';
@ -168,8 +163,6 @@ const shuffleAdd = () => {
results.items[key].items.push(...items);
loading.value = false;
console.log(items, results.items);
}
},
getResults = async q => {
@ -182,7 +175,6 @@ const shuffleAdd = () => {
results.next = json.nextpage;
results.setItem(key, json);
console.log(json, key);
};
watch(
@ -191,8 +183,6 @@ watch(
if (n) {
n = n.replace(location.search || '', '');
console.log(n);
artist.reset();
getSearch(n);
}
@ -341,6 +331,12 @@ onDeactivated(() => {
results.getAlbum(album.url || '/playlist?list=' + album.id)
" />
</div>
<a
v-if="results.items.albums.more?.params"
@click.prevent="artist.getArtistNext('albums', results.items.albums.more)"
class="more"
>{{ t('info.see_all') }}</a
>
</div>
<div
@ -371,6 +367,14 @@ onDeactivated(() => {
:art="single.thumbnails[0].url"
@open-album="results.getAlbum('/playlist?list=' + single.id)" />
</div>
<a
v-if="results.items.singles.more?.params"
@click.prevent="
artist.getArtistNext('singles', results.items.singles.more)
"
class="more"
>{{ t('info.see_all') }}</a
>
</div>
<div