diff --git a/package.json b/package.json index 8aa6998..678a90d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ui", - "version": "6.0.18", + "version": "6.0.19", "license": "BUSL-1.1", "private": true, "packageManager": "pnpm@9.14.4", diff --git a/src/app.d.ts b/src/app.d.ts index 982e567..2c11898 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -85,7 +85,7 @@ export interface Native { setPlayBackState: (paused: 'none' | 'paused' | 'playing') => Promise setActionHandler: (action: MediaSessionAction | 'enterpictureinpicture', handler: MediaSessionActionHandler | null) => void checkAvailableSpace: (_?: unknown) => Promise - checkIncomingConnections: (_?: unknown) => Promise + checkIncomingConnections: (port: number) => Promise updatePeerCounts: (hashes: string[]) => Promise> playTorrent: (id: string) => Promise attachments: (hash: string, id: number) => Promise diff --git a/src/lib/components/ui/forums/Comments.svelte b/src/lib/components/ui/forums/Comments.svelte index 6fe76d4..37d5ed5 100644 --- a/src/lib/components/ui/forums/Comments.svelte +++ b/src/lib/components/ui/forums/Comments.svelte @@ -9,8 +9,44 @@ export let threadId: number -{#each $comments.data?.Page?.threadComments ?? [] as comment, i (comment?.id ?? i)} - {#if comment} - - {/if} -{/each} +{#if $comments.fetching} + {#each Array.from({ length: 4 }) as _, i (i)} +
+
+
+
+
+
+ {/each} +{:else if $comments.error} +
+
+
+ Ooops! +
+
+ Looks like something went wrong! +
+
+ {$comments.error.message} +
+
+
+{:else} + {#each $comments.data?.Page?.threadComments ?? [] as comment, i (comment?.id ?? i)} + {#if comment} + + {/if} + {:else} +
+
+
+ Ooops! +
+
+ Looks like there's nothing here yet! +
+
+
+ {/each} +{/if} diff --git a/src/lib/components/ui/forums/Threads.svelte b/src/lib/components/ui/forums/Threads.svelte index 743e833..33d6185 100644 --- a/src/lib/components/ui/forums/Threads.svelte +++ b/src/lib/components/ui/forums/Threads.svelte @@ -37,7 +37,12 @@
{#if $currentPageStore.fetching} - Loading threads... + {#each Array.from({ length: 4 }) as _, i (i)} +
+
+
+
+ {/each} {:else if $currentPageStore.error}
@@ -93,6 +98,17 @@
{/if} + {:else} +
+
+
+ Ooops! +
+
+ Looks like there's nothing here yet! +
+
+
{/each} {/if}
diff --git a/src/lib/components/ui/player/resolver.ts b/src/lib/components/ui/player/resolver.ts index 5fc328f..15c04d7 100644 --- a/src/lib/components/ui/player/resolver.ts +++ b/src/lib/components/ui/player/resolver.ts @@ -89,7 +89,7 @@ const TYPE_EXCLUSIONS = ['ED', 'ENDING', 'NCED', 'NCOP', 'OP', 'OPENING', 'PREVI // find best media in batch to play // currently in progress or unwatched // tv, movie, ona, ova -// TODO: load magnets manually + // function findPreferredPlaybackMedia (videoFiles) { // for (const { media } of videoFiles) { // if (media.media?.mediaListEntry?.status === 'CURRENT') return { media: media.media, episode: (media.media.mediaListEntry.progress || 0) + 1 } diff --git a/src/lib/index.ts b/src/lib/index.ts index 4d1feae..2b59a96 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -3,4 +3,4 @@ export const CHANGELOG_URL = 'https://api.github.com/repos/ThaUnknown/miru/releases' export const WEB_URL = 'https://miru.watch' export const DEFAULT_EXTENSIONS = 'gh:hayase-app/extensions' -export const SETUP_VERSION = 1 +export const SETUP_VERSION = 2 diff --git a/src/lib/modules/anilist/queries.ts b/src/lib/modules/anilist/queries.ts index c98d765..fe7338a 100644 --- a/src/lib/modules/anilist/queries.ts +++ b/src/lib/modules/anilist/queries.ts @@ -383,7 +383,7 @@ export const CommentFrag = gql(` } `, [UserFrag]) -// AL in their infinite wisdom decided to make childComments infer the schema of the parent comment, so we can't use the CommentFrag here +// AL in their infinite wisdom decided to make childComments infer the schema of the parent comment, but fragments break it, so we can't use any fragments here export const Comments = gql(` query Comments($threadId: Int, $page: Int) { Page(page: $page, perPage: 15) { @@ -397,14 +397,38 @@ export const Comments = gql(` likeCount, createdAt, user { - ...UserFrag + id, + bannerImage, + about, + isFollowing, + isFollower, + donatorBadge, + options { + profileColor + }, + createdAt, + name, + avatar { + medium + }, + statistics { + anime { + count, + minutesWatched, + episodesWatched, + genres(limit: 3, sort: COUNT_DESC) { + genre, + count + } + } + } }, childComments, isLocked } } } -`, [UserFrag]) +`) export const ToggleLike = gql(` mutation ToggleLike ($id: Int!, $type: LikeableType!) {