New Golang Backend + Minor Fixes

This commit is contained in:
shiny_nematoda 2022-04-13 08:03:42 -04:00
parent f80a86a3ae
commit 03b4c151f9
8 changed files with 24 additions and 20 deletions

View file

@ -160,8 +160,15 @@ export default {
timeUpdate(t) {
this.time = Math.floor((t / this.duration) * 100);
},
getJson(url) {
return fetch(url).then((res) => res.json());
async getJson(url) {
const res = await fetch(url).then((res) => res.json());
if (!res.error) {
return res;
} else {
alert(res.message.replaceAll('Video', 'Audio').replaceAll('video', 'audio').replaceAll('watched', 'heard'));
console.error(res.message);
}
},
setSong(s) {
this.urls = [s];
@ -255,7 +262,7 @@ export default {
console.log(e);
const json = await this.getJson(
'https://hypipeapi.onrender.com/browse/' + e,
'https://hyperpipeapi.onrender.com/channel/' + e,
);
console.log(json);
@ -485,17 +492,12 @@ button {
}
@media (min-width: 1024px) {
#app {
display: flex;
place-items: center;
flex-direction: column;
}
main .grid {
display: grid;
grid-template-columns: 1fr 1fr;
}
header {
margin: auto;
display: flex;
place-items: center;
}