- smaller json structure for xml conv
- fix minor typos and bugs in scripts/
- parallel fetching upto 2 concurrent segments
This commit is contained in:
Shiny Nematoda 2023-09-02 11:21:25 +00:00
parent 62e7cffbc4
commit c7add3708e
15 changed files with 115 additions and 148 deletions

View file

@ -78,7 +78,7 @@ export const SUPPORTED_LOCALES = [
{
code: 'nl',
name: 'Nederlands',
cc: 'NL'
cc: 'NL',
},
{
code: 'pt',
@ -162,10 +162,10 @@ export const useI18n = defineStore('i18n', () => {
locale.value = code;
localStorage.locale ??= code;
if (localStorage.to_cc == 'true') {
const cc = SUPPORTED_LOCALES.find(i => i.code == code).cc
if (cc) localStorage.cc = cc
else localStorage.cc = ''
} else localStorage.cc = ''
const cc = SUPPORTED_LOCALES.find(i => i.code == code).cc;
if (cc) localStorage.cc = cc;
else localStorage.cc = '';
} else localStorage.cc = '';
});
}
@ -182,7 +182,7 @@ export const useAlert = defineStore('alert', () => {
setTimeout(() => {
if (msg.value == m) msg.value = '';
}, 3000);
}, 4000);
}
return { msg, add };

View file

@ -2,7 +2,7 @@ import { reactive } from 'vue';
import { defineStore } from 'pinia';
import { getJsonPiped, getJsonHyp } from '@/scripts/fetch.js';
import { useStore, useMetadata } from '@/scripts/util.js';
import { useStore, useMetadata, AMP } from '@/scripts/util.js';
const store = useStore();
@ -24,12 +24,10 @@ export const useData = defineStore('data', () => {
const hash = new URLSearchParams(e.substring(e.indexOf('?'))).get('v'),
json = await getJsonPiped('/streams/' + hash);
state.art = json.thumbnailUrl.replaceAll('&', '&');
state.art = json.thumbnailUrl.replace(AMP, '&');
state.description = json.description;
state.title = json.title.replaceAll('&', '&');
state.artist = json.uploader
.replace(' - Topic', '')
.replaceAll('&', '&');
state.title = json.title.replace(AMP, '&');
state.artist = json.uploader.replace(' - Topic', '').replace(AMP, '&');
state.artistUrl = json.uploaderUrl;
player.state.duration = json.duration;
player.state.hls = json.hls;