mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-28 05:08:00 +02:00
Added Explore Tab
This commit is contained in:
parent
466068ae12
commit
a43b0907e2
6 changed files with 214 additions and 17 deletions
43
src/App.vue
43
src/App.vue
|
@ -7,6 +7,7 @@ import { ref, reactive, onBeforeMount, onMounted } from 'vue';
|
|||
import NavBar from './components/NavBar.vue';
|
||||
import StatusBar from './components/StatusBar.vue';
|
||||
import NowPlaying from './components/NowPlaying.vue';
|
||||
import Genres from './components/Genres.vue';
|
||||
import Search from './components/Search.vue';
|
||||
import NewPlaylist from './components/NewPlaylist.vue';
|
||||
import Playlists from './components/Playlists.vue';
|
||||
|
@ -52,36 +53,44 @@ const artist = reactive({
|
|||
});
|
||||
|
||||
const search = ref(''),
|
||||
genreid = ref(''),
|
||||
page = ref('home'),
|
||||
title = ref('');
|
||||
path = ref(location.pathname);
|
||||
|
||||
const audio = ref(null);
|
||||
|
||||
/* Functions */
|
||||
function parseUrl() {
|
||||
const loc = location.href.split('/');
|
||||
const loc = location.pathname.split('/'),
|
||||
base = loc[1].replace(location.search, '');
|
||||
|
||||
console.log(loc, loc[3].replace(location.search, ''));
|
||||
console.log(loc, base);
|
||||
|
||||
switch (loc[3].replace(location.search, '')) {
|
||||
path.value = location.pathname;
|
||||
|
||||
switch (base) {
|
||||
case '':
|
||||
getExplore();
|
||||
break;
|
||||
case 'search':
|
||||
search.value = loc[4];
|
||||
search.value = loc[2];
|
||||
console.log(search.value);
|
||||
break;
|
||||
case 'watch':
|
||||
getSong(loc[3]);
|
||||
console.log(loc[3]);
|
||||
getSong(loc[1] + location.search);
|
||||
console.log(loc[1]);
|
||||
break;
|
||||
case 'playlist':
|
||||
getAlbum(loc[3]);
|
||||
console.log(loc[3]);
|
||||
getAlbum(loc[1] + location.search);
|
||||
console.log(loc[1]);
|
||||
break;
|
||||
case 'channel':
|
||||
getArtist(loc[4]);
|
||||
console.log(loc[4]);
|
||||
getArtist(loc[1]);
|
||||
console.log(loc[1]);
|
||||
break;
|
||||
case 'explore':
|
||||
genreid.value = loc[2];
|
||||
page.value = 'genres';
|
||||
default:
|
||||
console.log(loc);
|
||||
}
|
||||
|
@ -476,6 +485,18 @@ onMounted(() => {
|
|||
:search="search" />
|
||||
</KeepAlive>
|
||||
|
||||
<KeepAlive>
|
||||
<Genres
|
||||
v-if="page == 'genres'"
|
||||
:id="genreid"
|
||||
@get-album="
|
||||
e => {
|
||||
getAlbum(e);
|
||||
page = 'home';
|
||||
}
|
||||
" />
|
||||
</KeepAlive>
|
||||
|
||||
<NewPlaylist v-if="page == 'playlist'" @play-urls="playList" />
|
||||
|
||||
<Prefs v-if="page == 'prefs'" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue