This commit is contained in:
Shiny Nematoda 2022-10-02 16:49:55 +00:00
parent a9d7d07e7b
commit f48149d0c9
No known key found for this signature in database
GPG key ID: 6506D50F5613A42D
7 changed files with 29 additions and 13 deletions

View file

@ -1,6 +1,6 @@
# Hyperpipe
![Logo](https://codeberg.org/Hyperpipe/Hyperpipe/raw/branch/main/public/android-chrome-192x192.png)
![Logo](https://codeberg.org/Hyperpipe/Hyperpipe/raw/branch/main/public/android-chrome-512x512.png)
A Privacy Respecting Frontend for YouTube Music inspired and built with the help of [Piped][piped] and YouTube's InnerTube API.

View file

@ -185,7 +185,7 @@ onMounted(() => {
</KeepAlive>
<KeepAlive>
<Charts v-if="nav.state.page == 'charts'" />
<Charts v-if="nav.state.page == 'charts'" @play-urls="playList" />
</KeepAlive>
<NewPlaylist

View file

@ -9,6 +9,8 @@ import { getJsonHyp } from '@/scripts/fetch.js';
import { useResults, useArtist } from '@/stores/results.js';
import { useI18n } from '@/stores/misc.js';
defineEmits(['play-urls']);
const { getArtist } = useArtist(),
results = useResults(),
{ t } = useI18n();
@ -73,7 +75,20 @@ onMounted(() => {
:title="i.title"
:author="i.subtitle"
:channel="'/channel/' + i.subId"
:art="i.thumbnails[0].url" />
:art="i.thumbnails[0].url"
@open-song="
$emit('play-urls', [
{
url: '/watch?v=' + i.id,
title: i.title,
thumbnails: [
{
url: i.thumbnails[1]?.url || i.thumbnails[0]?.url,
},
],
},
])
" />
</div>
</template>
</template>

View file

@ -22,8 +22,6 @@ defineEmits(['get-artist']);
<style scoped>
h1 {
font-weight: 500;
font-size: 2.6rem;
top: -10px;
}
h3 {

View file

@ -196,6 +196,7 @@ onUpdated(() => {
<template v-for="(song, index) in results.items.songs.items">
<SongItem
:index="index"
:playlistId="song.playlistId"
:author="song.uploaderName || song.subtitle"
:title="song.title || song.name"
:channel="song.uploaderUrl || '/channel/' + song.subId"

View file

@ -11,8 +11,7 @@ import { useData, usePlayer } from '@/stores/player.js';
const rand = useRand(),
data = useData(),
player = usePlayer(),
artist = useArtist(),
{ playlistId } = useResults();
artist = useArtist();
const props = defineProps({
index: Number,
@ -21,6 +20,7 @@ const props = defineProps({
channel: String,
play: String,
art: String,
playlistId: String,
}),
emit = defineEmits(['open-song', 'remove']),
show = ref(false);
@ -58,7 +58,7 @@ const openSong = el => {
},
body: JSON.stringify({
index: props.index,
playlistId,
playlistId: props.playlistId,
}),
}).then(json => {
console.log(json);
@ -120,12 +120,10 @@ onMounted(() => {
<div v-if="show" class="popup ign">
<!-- TODO: Check if user is admin -->
<span
v-if="useStore().auth && playlistId"
v-if="playlistId"
class="bi bi-dash-lg clickable ign"
@click="Remove"></span>
<span class="bi bi-plus-lg clickable ign" @click="addSong"></span>
<span class="bi bi-share clickable ign" @click="Share"></span>
</div>
</Transition>

View file

@ -51,8 +51,12 @@ export const useResults = defineStore('results', () => {
/[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}/.test(
hash,
)
)
console.log('Piped playlists!!'); //json.relatedStreams = json.relatedStreams.map(i => ({ ...i, ...{auth: true}))
) {
json.relatedStreams = json.relatedStreams.map(i => {
i.playlistId = hash;
return i;
});
}
setItem('songs', {
items: json.relatedStreams,