fix movie request page not loading

This commit is contained in:
maxDorninger
2025-07-19 14:33:35 +02:00
parent 6224d418be
commit 608bdf32e7
6 changed files with 37 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { getFullyQualifiedMediaName, getTorrentQualityString } from '$lib/utils.js';
import type { SeasonRequest, User } from '$lib/types.js';
import type { MovieRequest, SeasonRequest, User } from '$lib/types.js';
import CheckmarkX from '$lib/components/checkmark-x.svelte';
import * as Table from '$lib/components/ui/table/index.js';
import { getContext } from 'svelte';
@@ -13,13 +13,11 @@
const apiUrl = env.PUBLIC_API_URL;
let {
requests,
filter = () => {
return true;
},
filter = () => true,
isShow = true
}: {
requests: SeasonRequest[];
filter?: (request: SeasonRequest) => boolean;
requests: (SeasonRequest | MovieRequest)[];
filter?: (request: SeasonRequest | MovieRequest) => boolean;
isShow: boolean;
} = $props();
const user: () => User = getContext('user');
@@ -114,14 +112,14 @@
<Table.Row>
<Table.Cell>
{#if isShow}
{getFullyQualifiedMediaName(request.show)}
{getFullyQualifiedMediaName((request as SeasonRequest).show)}
{:else}
{getFullyQualifiedMediaName(request.show)}
{getFullyQualifiedMediaName((request as MovieRequest).movie)}
{/if}
</Table.Cell>
{#if isShow}
<Table.Cell>
{request.season.number}
{(request as SeasonRequest).season.number}
</Table.Cell>
{/if}
<Table.Cell>
@@ -154,7 +152,7 @@
class=""
size="sm"
variant="outline"
onclick={() => goto(base + '/dashboard/tv/' + request.show.id)}
onclick={() => goto(base + '/dashboard/tv/' + (request as SeasonRequest).show.id)}
>
Download manually
</Button>
@@ -163,7 +161,8 @@
class=""
size="sm"
variant="outline"
onclick={() => goto(base + '/dashboard/tv/' + request.show.id)}
onclick={() =>
goto(base + '/dashboard/movies/' + (request as MovieRequest).movie.id)}
>
Download manually
</Button>

View File

@@ -53,13 +53,14 @@
} catch (error) {
console.error('Error updating user:', error);
toast.error(
'Error updating user: ' + (error instanceof Error ? error.message : String(error))
'Error updating user: ' + (error instanceof Error ? error.message : String(error))
);
} finally {
newPassword = '';
}
}
</script>
<Table.Root>
<Table.Caption>A list of all users.</Table.Caption>
<Table.Header>
@@ -175,11 +176,11 @@
<div>
<Label class="mb-1 block text-sm font-medium" for="superuser">Password</Label>
<Input
bind:value={newEmail}
class="w-full"
id="email"
placeholder={selectedUser?.email}
type="text"
bind:value={newEmail}
class="w-full"
id="email"
placeholder={selectedUser?.email}
type="text"
/>
</div>
<!-- Password -->