-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BEGIN_COMMIT_OVERRIDE feat: add library filtering feat: add library filtering chore: format refactor: use locals for DB and BACKEND_URL fix: add comet and all-debrid fix: add notifications fix: check for updates feat: show request button in ui chore: format END_COMMIT_OVERRIDE
- Loading branch information
1 parent
08b31b3
commit ad8a9ba
Showing
22 changed files
with
478 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<script lang="ts"> | ||
import * as AlertDialog from '$lib/components/ui/alert-dialog'; | ||
import { Button } from '$lib/components/ui/button'; | ||
import { toast } from 'svelte-sonner'; | ||
import { invalidateAll } from '$app/navigation'; | ||
import { getExternalID } from '$lib/tmdb'; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
export let data: any; | ||
export let type: string; | ||
async function requestItem(id: number) { | ||
const externalIds = await getExternalID(fetch, type, id); | ||
const response = await fetch(`/api/media/${externalIds.imdb_id}`, { | ||
method: 'POST' | ||
}); | ||
if (response.ok) { | ||
toast.success('Media requested successfully'); | ||
invalidateAll(); | ||
} else { | ||
toast.error('An error occurred while requesting the media'); | ||
} | ||
} | ||
</script> | ||
|
||
<AlertDialog.Root> | ||
<AlertDialog.Trigger asChild let:builder> | ||
<Button | ||
on:click={(e) => { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
}} | ||
variant="outline" | ||
size="sm" | ||
builders={[builder]}>Request</Button | ||
> | ||
</AlertDialog.Trigger> | ||
<AlertDialog.Content> | ||
<AlertDialog.Header> | ||
<AlertDialog.Title | ||
>Requesting {data.title || data.name || data.original_name}</AlertDialog.Title | ||
> | ||
</AlertDialog.Header> | ||
<AlertDialog.Footer> | ||
<AlertDialog.Cancel>Cancel</AlertDialog.Cancel> | ||
<AlertDialog.Action | ||
on:click={async () => { | ||
await requestItem(data.id); | ||
}}>Continue</AlertDialog.Action | ||
> | ||
</AlertDialog.Footer> | ||
</AlertDialog.Content> | ||
</AlertDialog.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.