Added Sync for Playlists

This commit is contained in:
Shiny Nematoda 2022-06-05 20:35:58 +05:30
parent a88c9081f1
commit e867ab25e9
11 changed files with 287 additions and 41 deletions

View file

@ -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);
}

View file

@ -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;
}
}