mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-28 13:08:01 +02:00
Bug Fixes:
- Fixed Navbar links (closes #8) - Fixed Lyrics not updating
This commit is contained in:
parent
4ac524dcf2
commit
e0bc3c61a2
6 changed files with 93 additions and 46 deletions
|
@ -14,31 +14,29 @@ const data = useData(),
|
|||
function get() {
|
||||
status.value = false;
|
||||
|
||||
if (data.state.lyrics && data.state.urls === data.state.urls[0]?.url) {
|
||||
getJsonHyp('/browse/' + data.state.lyrics).then(res => {
|
||||
const set = id => {
|
||||
getJsonHyp('/browse/' + id).then(res => {
|
||||
text.value = res.text;
|
||||
source.value = res.source;
|
||||
status.value = true;
|
||||
});
|
||||
} else if (data.state.urls[0]?.url) {
|
||||
getJsonHyp(
|
||||
'/next/' + data.state.urls[0]?.url.replace('/watch?v=', ''),
|
||||
).then(next => {
|
||||
if (next.lyricsId) {
|
||||
getJsonHyp('/browse/' + next.lyricsId).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);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
get();
|
||||
|
||||
watch(
|
||||
() => data.state.urls[0]?.url,
|
||||
() => data.state.url,
|
||||
() => {
|
||||
get();
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue