mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-28 05:08:00 +02:00
Added Sync for Playlists
This commit is contained in:
parent
a88c9081f1
commit
e867ab25e9
11 changed files with 287 additions and 41 deletions
|
@ -12,7 +12,7 @@ export function useRand() {
|
|||
}
|
||||
|
||||
export function useRandColor() {
|
||||
const r = Math.random().toString(16)
|
||||
const r = Math.random().toString(16);
|
||||
|
||||
return '#' + r.substr(r.length - 6)
|
||||
}
|
||||
return '#' + r.substr(r.length - 6);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { useStore } from './util.js'
|
||||
import { useStore } from './util.js';
|
||||
|
||||
export function getPipedQuery() {
|
||||
const papi = new URLSearchParams(location.search).get('pipedapi');
|
||||
|
@ -14,12 +14,11 @@ export async function getJson(url) {
|
|||
const res = await fetch(url)
|
||||
.then(res => res.json())
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
alert(err);
|
||||
});
|
||||
|
||||
if (!res.error) {
|
||||
return res;
|
||||
} else {
|
||||
if (res && res.error) {
|
||||
alert(
|
||||
res.message
|
||||
.replaceAll('Video', 'Audio')
|
||||
|
@ -27,6 +26,10 @@ export async function getJson(url) {
|
|||
.replaceAll('watched', 'heard'),
|
||||
);
|
||||
console.error(res.message);
|
||||
} else if (res) {
|
||||
return res;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue