Bug Fixes:

- Closes #42
- Closes #44
- Closes #45
This commit is contained in:
Shiny Nematoda 2022-10-08 11:02:28 +00:00
parent 5449523f2a
commit 7905394b26
No known key found for this signature in database
GPG key ID: 6506D50F5613A42D
7 changed files with 143 additions and 134 deletions

View file

@ -29,7 +29,7 @@ const Genres = defineAsyncComponent(() => import('@/components/Genres.vue')),
Prefs = defineAsyncComponent(() => import('@/components/Prefs.vue'));
/* Composables */
import { useStore } from '@/scripts/util.js';
import { useStore, useUnwrap } from '@/scripts/util.js';
import { useSetupDB, useUpdatePlaylist } from '@/scripts/db.js';
/* Stores */
@ -62,8 +62,7 @@ function parseUrl() {
results.getExplore();
break;
case 'search':
nav.state.search = loc[2];
console.log(nav.state.search);
nav.state.search = useUnwrap(loc[2]);
break;
case 'watch':
player.state.status = 'circle';

View file

@ -48,7 +48,7 @@ function set(page) {
:data-active="nav.state.page == 'explore'"
@click="set('explore')"></span>
<span
class="nav-ico bi bi-graph-down clickable"
class="nav-ico bi bi-graph-up-arrow clickable"
:data-active="nav.state.page == 'charts'"
@click="set('charts')"></span>
<span

View file

@ -6,7 +6,7 @@ import SongItem from './SongItem.vue';
import AlbumItem from './AlbumItem.vue';
import { getJsonPiped, getPipedQuery } from '@/scripts/fetch.js';
import { useRoute } from '@/scripts/util.js';
import { useRoute, useWrap } from '@/scripts/util.js';
import { useCreatePlaylist } from '@/scripts/db.js';
import { useResults, useArtist } from '@/stores/results.js';
@ -74,7 +74,7 @@ const shuffleAdd = () => {
},
getSearch = q => {
if (q) {
const pq = q.split(' ').join('+');
const pq = useWrap(q);
history.pushState({}, '', `/search/${pq + getPipedQuery()}`);

View file

@ -10,6 +10,14 @@ export function useRoute(l) {
history.pushState({}, '', l);
}
export function useWrap(txt) {
return encodeURIComponent(txt).replaceAll('%20', '+');
}
export function useUnwrap(txt) {
return decodeURIComponent(txt).replaceAll('+', ' ');
}
export function useStore() {
try {
return window.localStorage;

View file

@ -31,8 +31,10 @@ export const useData = defineStore('data', () => {
state.art = json.thumbnailUrl;
state.description = json.description;
state.title = json.title;
state.artist = json.uploader.replace(' - Topic', '');
state.title = json.title.replaceAll('&amp;', '&');
state.artist = json.uploader
.replace(' - Topic', '')
.replaceAll('&amp;', '&');
state.artistUrl = json.uploaderUrl;
player.state.duration = json.duration;
player.state.hls = json.hls;