diff --git a/src/app.d.ts b/src/app.d.ts index 837385b..7e6ab48 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -24,6 +24,7 @@ declare global { interface Service { type: 'jellyfin' | 'youtube-music' userId: string + username: string urlOrigin: string } @@ -95,7 +96,6 @@ declare global { // So, ONLY DEFINE THE INTERFACES FOR DATA THAT IS GARUNTEED TO BE RETURNED (unless the data value itself is inherently optional) interface JFService extends Service { type: 'jellyfin' - username: string serverName: string } @@ -178,7 +178,6 @@ declare global { namespace YouTubeMusic { interface YTService extends Service { type: 'youtube-music' - username: string profilePicture?: string } diff --git a/src/lib/server/users.db b/src/lib/server/users.db index df45a2b..c1dfafc 100644 Binary files a/src/lib/server/users.db and b/src/lib/server/users.db differ diff --git a/src/routes/settings/connections/+page.server.ts b/src/routes/settings/connections/+page.server.ts index 1df60d4..611320e 100644 --- a/src/routes/settings/connections/+page.server.ts +++ b/src/routes/settings/connections/+page.server.ts @@ -51,8 +51,8 @@ export const actions: Actions = { const serviceData: Jellyfin.JFService = { type: 'jellyfin', userId: authData.User.Id, - urlOrigin: serverUrl.toString(), username: userData.Name, + urlOrigin: serverUrl.toString(), serverName: systemData.ServerName, } const tokenData: Jellyfin.JFTokens = { @@ -89,8 +89,8 @@ export const actions: Actions = { const serviceData: YouTubeMusic.YTService = { type: 'youtube-music', userId: userChannel.id as string, - urlOrigin: 'https://www.googleapis.com/youtube/v3', username: userChannel.snippet?.title as string, + urlOrigin: 'https://www.googleapis.com/youtube/v3', profilePicture: userChannel.snippet?.thumbnails?.default?.url as string | undefined, } diff --git a/src/routes/settings/connections/+page.svelte b/src/routes/settings/connections/+page.svelte index fb94def..c1a4990 100644 --- a/src/routes/settings/connections/+page.svelte +++ b/src/routes/settings/connections/+page.svelte @@ -108,7 +108,7 @@ -
+
{#each connections as connection} {/each} diff --git a/src/routes/settings/connections/connectionProfile.svelte b/src/routes/settings/connections/connectionProfile.svelte index d2d19d5..3f0738d 100644 --- a/src/routes/settings/connections/connectionProfile.svelte +++ b/src/routes/settings/connections/connectionProfile.svelte @@ -3,22 +3,27 @@ import IconButton from '$lib/components/util/iconButton.svelte' import Toggle from '$lib/components/util/toggle.svelte' import type { SubmitFunction } from '@sveltejs/kit' - import { fly, scale } from 'svelte/transition' + import { fly } from 'svelte/transition' import { enhance } from '$app/forms' export let connection: Connection export let submitFunction: SubmitFunction - const serviceData = Services[connection.service.type] + $: serviceData = Services[connection.service.type] - let showUnlinkModal = false + let showModal = false -
+
- {serviceData.displayName} icon +
+ {serviceData.displayName} icon + {#if 'profilePicture' in connection.service && typeof connection.service.profilePicture === 'string'} + + {/if} +
-
{'username' in connection.service ? connection.service.username : 'Placeholder Account Name'}
+
{connection.service.username}
{serviceData.displayName} {#if 'serverName' in connection.service} @@ -26,23 +31,20 @@ {/if}
-
- (showUnlinkModal = !showUnlinkModal)}> - +
+ showModal = !showModal}> + - {#if showUnlinkModal} + {#if showModal}
- Delete Connection -
- - -
+ {/if} @@ -52,7 +54,7 @@
console.log(event.detail.toggled)} /> - Enable Connection + Place for config