From 269d79327ebbf7ec52c1cd412d8f732fb23559cd Mon Sep 17 00:00:00 2001 From: Eclypsed Date: Mon, 12 Feb 2024 12:22:17 -0500 Subject: [PATCH] New styling on connection profiles --- src/app.d.ts | 3 +- src/lib/server/users.db | Bin 24576 -> 24576 bytes .../settings/connections/+page.server.ts | 4 +- src/routes/settings/connections/+page.svelte | 2 +- .../connections/connectionProfile.svelte | 40 +++++++++--------- 5 files changed, 25 insertions(+), 24 deletions(-) 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 df45a2b3d6ac2f9d12c6f35d316b8677d464070a..c1dfafcb281b70d892a3a3289ececeb6fcb236eb 100644 GIT binary patch delta 899 zcma))&2G~`0E83T0-_ZGBqXFFfubG&v1q;C_1Z`vxlPifBynxWZQM&(@2=xCX`Q&_ z&l2KCz!gwlfHQ|mE#l5waN)``a3$~rxy)%s-$*mBe`H_($bMSSu719~m0dl1uHT7R z$aDrV0|+w?up|m#f>3}}4QmhyDJiLUcog^8$p&H@3fw3MzINR4n!!lAVNul&%mJ)e zYI)c$i-SkhFAqwaBI=H}CG=CfgQKP$?VsQMmD^YZb`F=XUB0lklv!K4`upt7pH=65 zYx$Dry(1r1DCHW~u>dM01YjlPfN>mxK&V;}GKdUL7Gcc1>eCx1GC5{PGXFSVt z9`2IOX8+hjNUCNpZjh8E`jGEYRH+&c{Gsg~)wdL;F=?@_w*SoJwre^yw`7;Mo2b?~ zWX$abBud&6c)h|w+1ZR)duG+wUrndbuZHb`Wh?V!#dJ(_+w|P}xCE+3CE53zu``*E zHk?YM_M*{OT9b;$y1KB_G}#+9hi*D@+f~)o6k8mixWb#^Xgpz-GC6mcq$em_#KXa$wu3t-Y s>AfW{tB05qWauEo#=K961E3pN2MkKVMJNP<^1p9^-Yfr%i=1=$F9H7!9RL6T delta 859 zcma))y>8P`0ELql1cFLwg~U=MswhJT++JT_Utd=O$xg|Sz%v9< zMzaw)9#4Fs-vhYRZbVX5R;12}Z$Wj|u1*|WD37h;)QZ9&5s6C5gHzQGhDL#Q%GBx% z%322~at-oRi{YAss_RK}BP=yqsMDJDX7X8!Q(Zr%$D$IC{5gbj&==b6f|5jaFq!cq z_MB=RJ)o`p!VON0aA6e_RbJ41uU(N^XAP-dZ4``Bu?4Gv)Hg8+=unG&2~`PRjJbJW zEOl-7a^!enNkLs+NmgW8s!LK)G8@{wz^Gz5Iwj5aX@4Aa{RXher@_9*+` z$mNaBFjVjaggBQ41UaHZI7kU35ZVs(EC{j}k5a3wjLQ7V{Q14J_dR3mZ<^_KWZGDP I`|Aw(2jVvShX4Qo 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