From 2ea07ba9fe9f5216020dcbc5b89e092a1d83353b Mon Sep 17 00:00:00 2001 From: Eclypsed Date: Sat, 13 Apr 2024 00:45:35 -0400 Subject: [PATCH] Fixed audio api endpoint, media player mostly functional --- src/app.d.ts | 2 +- src/lib/components/media/mediaPlayer.svelte | 225 ++++++++---------- src/lib/components/util/searchBar.svelte | 5 +- src/lib/components/util/slider.svelte | 30 ++- src/lib/components/util/volumeSlider.svelte | 50 ---- src/lib/server/jellyfin.ts | 11 +- src/lib/server/youtube-music.ts | 65 +++-- src/lib/utils.ts | 8 - src/routes/(app)/+layout.svelte | 5 +- src/routes/(app)/search/+page.svelte | 8 +- .../(app)/user/connectionProfile.svelte | 2 +- src/routes/api/audio/+server.ts | 29 ++- src/routes/api/remoteImage/+server.ts | 25 +- 13 files changed, 214 insertions(+), 251 deletions(-) delete mode 100644 src/lib/components/util/volumeSlider.svelte diff --git a/src/app.d.ts b/src/app.d.ts index 9a9e06e..ba78252 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -45,7 +45,7 @@ declare global { getRecommendations: () => Promise<(Song | Album | Artist | Playlist)[]> getConnectionInfo: () => Promise search: (searchTerm: string, filter?: 'song' | 'album' | 'artist' | 'playlist') => Promise<(Song | Album | Artist | Playlist)[]> - getAudioStream: (id: string) => Promise + getAudioStream: (id: string, range: string | null) => Promise } // These Schemas should only contain general info data that is necessary for data fetching purposes. // They are NOT meant to be stores for large amounts of data, i.e. Don't include the data for every single song the Playlist type. diff --git a/src/lib/components/media/mediaPlayer.svelte b/src/lib/components/media/mediaPlayer.svelte index a5eac40..87ae6a0 100644 --- a/src/lib/components/media/mediaPlayer.svelte +++ b/src/lib/components/media/mediaPlayer.svelte @@ -1,154 +1,121 @@ -
- -
-
{song.name}
-
{song.artists?.map((artist) => artist.name) || song.createdBy?.name}
-
-
-
- - - - - -
- -
-
- - +
+ + { + currentTimeTimestamp.innerText = formatTime(event.detail.value) + seeking = true + }} + on:seeked={(event) => { + currentTime = event.detail.value + seeking = false + }} + /> + +
+ +
+
+ +
+ +
+
+ +
+