mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-28 05:08:00 +02:00
parent
d673c0d998
commit
d4eee69077
11 changed files with 30 additions and 29 deletions
|
@ -23,9 +23,7 @@ import Artist from '@/components/Artist.vue';
|
||||||
/* Async Components */
|
/* Async Components */
|
||||||
const Genres = defineAsyncComponent(() => import('@/components/Genres.vue')),
|
const Genres = defineAsyncComponent(() => import('@/components/Genres.vue')),
|
||||||
Charts = defineAsyncComponent(() => import('@/components/Charts.vue')),
|
Charts = defineAsyncComponent(() => import('@/components/Charts.vue')),
|
||||||
NewPlaylist = defineAsyncComponent(() =>
|
Library = defineAsyncComponent(() => import('@/components/Library.vue')),
|
||||||
import('@/components/NewPlaylist.vue'),
|
|
||||||
),
|
|
||||||
Prefs = defineAsyncComponent(() => import('@/components/Prefs.vue'));
|
Prefs = defineAsyncComponent(() => import('@/components/Prefs.vue'));
|
||||||
|
|
||||||
/* Composables */
|
/* Composables */
|
||||||
|
@ -77,6 +75,9 @@ function parseUrl() {
|
||||||
genreid.value = loc[2];
|
genreid.value = loc[2];
|
||||||
nav.state.page = 'explore';
|
nav.state.page = 'explore';
|
||||||
break;
|
break;
|
||||||
|
case 'browse':
|
||||||
|
if (loc[2].startsWith('MPRE')) results.getAlbum('?list=' + loc[2]);
|
||||||
|
break;
|
||||||
case 'charts':
|
case 'charts':
|
||||||
nav.state.page = 'charts';
|
nav.state.page = 'charts';
|
||||||
break;
|
break;
|
||||||
|
@ -171,7 +172,7 @@ onMounted(() => {
|
||||||
<Charts v-if="nav.state.page == 'charts'" @play-urls="playList" />
|
<Charts v-if="nav.state.page == 'charts'" @play-urls="playList" />
|
||||||
</KeepAlive>
|
</KeepAlive>
|
||||||
|
|
||||||
<NewPlaylist
|
<Library
|
||||||
v-if="nav.state.page == 'library'"
|
v-if="nav.state.page == 'library'"
|
||||||
@play-urls="playList"
|
@play-urls="playList"
|
||||||
@open-playlist="results.getAlbum" />
|
@open-playlist="results.getAlbum" />
|
||||||
|
|
|
@ -347,7 +347,8 @@ img {
|
||||||
box-shadow: 0 0 0.5rem var(--color-border);
|
box-shadow: 0 0 0.5rem var(--color-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid, .grid-3 {
|
.grid,
|
||||||
|
.grid-3 {
|
||||||
--col: 1;
|
--col: 1;
|
||||||
grid-template-columns: repeat(var(--col), 1fr);
|
grid-template-columns: repeat(var(--col), 1fr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"date": "2023-07-30"
|
"date": "2023-08-12"
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,10 +40,7 @@ function Sub() {
|
||||||
{{ artist.state.description }}
|
{{ artist.state.description }}
|
||||||
</p>
|
</p>
|
||||||
<div class="us-playwrap">
|
<div class="us-playwrap">
|
||||||
<Btn
|
<Btn @click="results.getAlbum('?list=' + artist.state.playlistId)" />
|
||||||
@click="
|
|
||||||
results.getAlbum('/playlist?list=' + artist.state.playlistId)
|
|
||||||
" />
|
|
||||||
<span
|
<span
|
||||||
class="us-box subs"
|
class="us-box subs"
|
||||||
:data-active="isSub"
|
:data-active="isSub"
|
||||||
|
|
|
@ -66,7 +66,7 @@ onMounted(get);
|
||||||
:author="i.subtitle"
|
:author="i.subtitle"
|
||||||
:art="i.thumbnails[0].url"
|
:art="i.thumbnails[0].url"
|
||||||
@open-album="
|
@open-album="
|
||||||
getAlbum('/playlist?list=' + i.id);
|
getAlbum('?list=' + i.id);
|
||||||
nav.state.page = 'home';
|
nav.state.page = 'home';
|
||||||
" />
|
" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -82,7 +82,7 @@ onMounted(get);
|
||||||
:author="i.subtitle"
|
:author="i.subtitle"
|
||||||
:art="i.thumbnails[0].url"
|
:art="i.thumbnails[0].url"
|
||||||
@open-album="
|
@open-album="
|
||||||
getAlbum('/playlist?list=' + i.id);
|
getAlbum('?list=' + i.id);
|
||||||
nav.state.page = 'home';
|
nav.state.page = 'home';
|
||||||
" />
|
" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useI18n } from '@/stores/misc.js';
|
||||||
|
|
||||||
import TextModal from './TextModal.vue';
|
import TextModal from './TextModal.vue';
|
||||||
|
|
||||||
defineProps(['text']);
|
defineProps({ text: String });
|
||||||
|
|
||||||
const { t } = useI18n(),
|
const { t } = useI18n(),
|
||||||
parse = d => new DOMParser().parseFromString(d, 'text/html').body.innerText;
|
parse = d => new DOMParser().parseFromString(d, 'text/html').body.innerText;
|
||||||
|
|
|
@ -436,7 +436,10 @@ onMounted(async () => {
|
||||||
<h2 v-if="list.length > 0">{{ t('playlist.local') }}</h2>
|
<h2 v-if="list.length > 0">{{ t('playlist.local') }}</h2>
|
||||||
|
|
||||||
<div class="grid-3">
|
<div class="grid-3">
|
||||||
<AlbumItem name="Offline" :grad="useRand()" @open-album="OpenOffline()" />
|
<AlbumItem
|
||||||
|
:name="t('title.offline')"
|
||||||
|
:grad="useRand()"
|
||||||
|
@open-album="OpenOffline()" />
|
||||||
<AlbumItem
|
<AlbumItem
|
||||||
v-for="i in list"
|
v-for="i in list"
|
||||||
:key="i.name"
|
:key="i.name"
|
||||||
|
@ -456,7 +459,7 @@ onMounted(async () => {
|
||||||
:name="i.name.replace('Playlist - ', '')"
|
:name="i.name.replace('Playlist - ', '')"
|
||||||
:author="t('title.songs') + ' • ' + i.videos"
|
:author="t('title.songs') + ' • ' + i.videos"
|
||||||
:art="pathname(i.thumbnail) != '/' ? i.thumbnail : undefined"
|
:art="pathname(i.thumbnail) != '/' ? i.thumbnail : undefined"
|
||||||
@open-album="$emit('open-playlist', '/playlist?list=' + i.id)" />
|
@open-album="$emit('open-playlist', '?list=' + i.id)" />
|
||||||
</div>
|
</div>
|
||||||
<form v-else class="login" @submit.prevent>
|
<form v-else class="login" @submit.prevent>
|
||||||
<input
|
<input
|
|
@ -21,9 +21,7 @@ function audioCanPlay() {
|
||||||
player.state.status = 'play';
|
player.state.status = 'play';
|
||||||
});
|
});
|
||||||
|
|
||||||
if (location.pathname != '/playlist') {
|
if (location.pathname != '/playlist') useRoute(data.state.url);
|
||||||
useRoute(data.state.url);
|
|
||||||
}
|
|
||||||
|
|
||||||
document.title = `Playing: ${data.state.title} by ${data.state.artist}`;
|
document.title = `Playing: ${data.state.title} by ${data.state.artist}`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,9 +341,7 @@ onDeactivated(() => {
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
v-if="artist.state.playlistId"
|
v-if="artist.state.playlistId"
|
||||||
@click.prevent="
|
@click.prevent="results.getAlbum('?list=' + artist.state.playlistId)"
|
||||||
results.getAlbum('/playlist?list=' + artist.state.playlistId)
|
|
||||||
"
|
|
||||||
class="more"
|
class="more"
|
||||||
:href="'/playlist?list=' + artist.state.playlistId"
|
:href="'/playlist?list=' + artist.state.playlistId"
|
||||||
>{{ t('info.see_all') }}</a
|
>{{ t('info.see_all') }}</a
|
||||||
|
@ -361,9 +359,7 @@ onDeactivated(() => {
|
||||||
:author="album.uploaderName || album.subtitle"
|
:author="album.uploaderName || album.subtitle"
|
||||||
:name="album.name || album.title"
|
:name="album.name || album.title"
|
||||||
:art="album.thumbnail || album.thumbnails[0].url"
|
:art="album.thumbnail || album.thumbnails[0].url"
|
||||||
@open-album="
|
@open-album="results.getAlbum(album.url || '?list=' + album.id)" />
|
||||||
results.getAlbum(album.url || '/playlist?list=' + album.id)
|
|
||||||
" />
|
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
v-if="results.items.albums.more?.params"
|
v-if="results.items.albums.more?.params"
|
||||||
|
@ -399,7 +395,7 @@ onDeactivated(() => {
|
||||||
:author="single.subtitle"
|
:author="single.subtitle"
|
||||||
:name="single.title"
|
:name="single.title"
|
||||||
:art="single.thumbnails[0].url"
|
:art="single.thumbnails[0].url"
|
||||||
@open-album="results.getAlbum('/playlist?list=' + single.id)" />
|
@open-album="results.getAlbum('?list=' + single.id)" />
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
v-if="results.items.singles.more?.params"
|
v-if="results.items.singles.more?.params"
|
||||||
|
@ -429,7 +425,7 @@ onDeactivated(() => {
|
||||||
? results.items.artists.items
|
? results.items.artists.items
|
||||||
: results.items.recommendedArtists.items"
|
: results.items.recommendedArtists.items"
|
||||||
:key="a.id || a.url"
|
:key="a.id || a.url"
|
||||||
:author="a.subtitle"
|
:author="a.subtitle.replace('subscribers', t('artist.subscribers'))"
|
||||||
:name="a.name || a.title"
|
:name="a.name || a.title"
|
||||||
:art="a.thumbnail || a.thumbnails[0].url"
|
:art="a.thumbnail || a.thumbnails[0].url"
|
||||||
@open-album="
|
@open-album="
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
"local": "Local",
|
"local": "Local",
|
||||||
"remote": "Remote",
|
"remote": "Remote",
|
||||||
"search": "Search",
|
"search": "Search",
|
||||||
"feeds": "Feeds"
|
"feeds": "Feeds",
|
||||||
|
"offline": "Offline"
|
||||||
},
|
},
|
||||||
"action": {
|
"action": {
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
|
|
|
@ -40,7 +40,11 @@ export const useResults = defineStore('results', () => {
|
||||||
async function getAlbum(e) {
|
async function getAlbum(e) {
|
||||||
const hash = new URLSearchParams(e.substring(e.indexOf('?'))).get('list'),
|
const hash = new URLSearchParams(e.substring(e.indexOf('?'))).get('list'),
|
||||||
isAuth = useVerifyAuth(hash),
|
isAuth = useVerifyAuth(hash),
|
||||||
path = '/playlists/' + hash,
|
path =
|
||||||
|
'/playlists/' +
|
||||||
|
(hash.startsWith('MPRE')
|
||||||
|
? (await getJsonHyp('/album/' + hash))?.id
|
||||||
|
: hash),
|
||||||
json = isAuth ? await getJsonAuth(path) : await getJsonPiped(path);
|
json = isAuth ? await getJsonAuth(path) : await getJsonPiped(path);
|
||||||
|
|
||||||
resetItems();
|
resetItems();
|
||||||
|
@ -58,7 +62,7 @@ export const useResults = defineStore('results', () => {
|
||||||
title: json.name,
|
title: json.name,
|
||||||
});
|
});
|
||||||
|
|
||||||
useRoute(e);
|
useRoute('/playlist?list=' + hash);
|
||||||
useNav().state.page = 'home';
|
useNav().state.page = 'home';
|
||||||
document.body.scrollIntoView();
|
document.body.scrollIntoView();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue