feat: Make Jellyfin environment variables optional

This commit is contained in:
Aleksi Lassila
2023-08-15 12:23:49 +03:00
parent 95dd5e070c
commit b64989c517
9 changed files with 217 additions and 167 deletions

View File

@@ -1,9 +1,5 @@
<script lang="ts">
import {
PUBLIC_JELLYFIN_URL,
PUBLIC_RADARR_BASE_URL,
PUBLIC_SONARR_BASE_URL
} from '$env/static/public';
import { env } from '$env/dynamic/public';
import { setJellyfinItemUnwatched, setJellyfinItemWatched } from '$lib/apis/jellyfin/jellyfinApi';
import { library, type LibraryItemStore } from '$lib/stores/library.store';
import type { TitleType } from '$lib/types';
@@ -40,7 +36,7 @@
function handleOpenInJellyfin() {
window.open(
PUBLIC_JELLYFIN_URL + '/web/index.html#!/details?id=' + $itemStore.item?.jellyfinItem?.Id
env.PUBLIC_JELLYFIN_URL + '/web/index.html#!/details?id=' + $itemStore.item?.jellyfinItem?.Id
);
}
</script>
@@ -63,7 +59,7 @@
<ContextMenuItem
disabled={!$itemStore.item.radarrMovie}
on:click={() =>
window.open(PUBLIC_RADARR_BASE_URL + '/movie/' + $itemStore.item?.radarrMovie?.tmdbId)}
window.open(env.PUBLIC_RADARR_BASE_URL + '/movie/' + $itemStore.item?.radarrMovie?.tmdbId)}
>
Open in Radarr
</ContextMenuItem>
@@ -71,7 +67,9 @@
<ContextMenuItem
disabled={!$itemStore.item.sonarrSeries}
on:click={() =>
window.open(PUBLIC_SONARR_BASE_URL + '/series/' + $itemStore.item?.sonarrSeries?.titleSlug)}
window.open(
env.PUBLIC_SONARR_BASE_URL + '/series/' + $itemStore.item?.sonarrSeries?.titleSlug
)}
>
Open in Sonarr
</ContextMenuItem>