feat: log torrent errors
Some checks are pending
Check / check (push) Waiting to run

fix: disabling discord details
This commit is contained in:
ThaUnknown 2025-06-15 23:40:47 +02:00
parent a9db439a26
commit 342327b14a
No known key found for this signature in database
4 changed files with 9 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"name": "ui",
"version": "6.3.62",
"version": "6.3.63",
"license": "BUSL-1.1",
"private": true,
"packageManager": "pnpm@9.14.4",

1
src/app.d.ts vendored
View file

@ -91,6 +91,7 @@ export interface Native {
attachments: (hash: string, id: number) => Promise<Attachment[]>
tracks: (hash: string, id: number) => Promise<Array<{ number: string, language?: string, type: string, header?: string, name?: string }>>
subtitles: (hash: string, id: number, cb: (subtitle: { text: string, time: number, duration: number }, trackNumber: number) => void) => Promise<void>
errors: (cb: (error: Error) => void) => Promise<void>
chapters: (hash: string, id: number) => Promise<Array<{ start: number, end: number, text: string }>>
torrentStats: (hash: string) => Promise<TorrentInfo>
torrents: () => Promise<TorrentInfo[]>

View file

@ -92,6 +92,7 @@ export default Object.assign<Native, Partial<Native>>({
updateProgress: async () => undefined,
torrentStats: async (): Promise<TorrentInfo> => ({ peers: rnd(), seeders: rnd(), leechers: rnd(), progress: Math.random(), down: rnd(100000000), up: rnd(100000000), name: 'Amebku.webm', downloaded: rnd(100000), hash: '1234567890abcdef', size: 1234567890, eta: rnd() }),
torrents: async (): Promise<TorrentInfo[]> => [{ peers: rnd(), seeders: rnd(), leechers: rnd(), progress: Math.random(), down: rnd(100000000), up: rnd(100000000), name: 'Amebku.webm', downloaded: rnd(100000), hash: '1234567890abcdef', size: 1234567890, eta: rnd() }],
defaultTransparency: () => false
defaultTransparency: () => false,
errors: async () => undefined
// @ts-expect-error idk
}, globalThis.native as Partial<Native>)

View file

@ -3,6 +3,7 @@
import '@fontsource-variable/nunito'
import '$lib/modules/navigate'
import { ProgressBar } from '@prgm/sveltekit-progress-bar'
import { toast } from 'svelte-sonner'
import Backplate from '$lib/components/Backplate.svelte'
import Online from '$lib/components/Online.svelte'
@ -18,6 +19,10 @@
native.updateProgress(progress => {
updateProgress = progress
})
native.errors(error => {
toast.error('Torrent Process Error!', { description: error?.stack ?? error?.message })
console.error(error)
})
</script>
<svelte:head>