@@ -148,13 +154,13 @@
/>
{
jfDisabled = true;
@@ -165,6 +171,23 @@
disabled={jfDisabled}
/>
+
+ {
+ useEmbyDisabled = true;
+ updateServerConfig("USE_EMBY", on, () => {
+ useEmbyDisabled = false;
+ });
+ }}
+ />
+
- Play On Jellyfin
+ {#if localStorage.getItem("useEmby")}
+ Play On Emby
+ {:else}
+ Play On Jellyfin
+ {/if}
{/if}
{#if $serverFeatures.sonarr && data.tvId}
diff --git a/src/routes/(plain)/login/+page.svelte b/src/routes/(plain)/login/+page.svelte
index 79828cc6..0acc6b5d 100644
--- a/src/routes/(plain)/login/+page.svelte
+++ b/src/routes/(plain)/login/+page.svelte
@@ -11,6 +11,7 @@
let login = true;
let availableProviders: string[] = [];
let signupEnabled = true;
+ let useEmby = false;
onMount(() => {
if (localStorage.getItem("token")) {
@@ -25,6 +26,7 @@
}
availableProviders = r.data.available;
signupEnabled = r.data.signupEnabled;
+ useEmby = r.data.useEmby;
}
});
});
@@ -60,6 +62,11 @@
if (resp.data?.token) {
console.log("Received token... logging in.");
localStorage.setItem("token", resp.data.token);
+ if (useEmby) {
+ localStorage.setItem("useEmby", "1");
+ } else {
+ localStorage.removeItem("useEmby");
+ }
goto("/");
notify({ id: nid, text: `Welcome ${user}!`, type: "success" });
}
@@ -142,9 +149,19 @@
{#if availableProviders?.length > 0}
- {#each availableProviders.filter((ap) => ap !== "plex") as p}
-
- {/each}
+ {#if availableProviders.find((ap) => ap === "jellyfin")}
+ {#if useEmby}
+
+ {:else}
+
+ {/if}
+ {/if}
{/if}
{#if availableProviders?.findIndex((provider) => provider == "plex") > -1}
diff --git a/src/types.ts b/src/types.ts
index 52d38eed..749ff87f 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -11,6 +11,7 @@ export type Icon =
| "play"
| "pause"
| "jellyfin"
+ | "emby"
| "plex"
| "trash"
| "close"
@@ -207,6 +208,7 @@ export interface AvailableAuthProviders {
available: string[];
signupEnabled: boolean;
isInSetup: boolean;
+ useEmby: boolean;
}
export interface TokenClaims {
@@ -788,6 +790,7 @@ export interface ManagedUser {
export interface ServerConfig {
DEFAULT_COUNTRY: string;
JELLYFIN_HOST: string;
+ USE_EMBY: boolean;
SIGNUP_ENABLED: boolean;
TMDB_KEY: string;
PLEX_HOST: string;