diff --git a/src/routes/list/+page.svelte b/src/routes/list/+page.svelte new file mode 100644 index 0000000..7ff25ee --- /dev/null +++ b/src/routes/list/+page.svelte @@ -0,0 +1,340 @@ + + +

MAL List → Songs

+ +

+ Enter a MAL username in the URL as /list?mal=USERNAME. This will fetch up to 20 anime from MAL (for now) and then query your local + client DB for related songs. +

+ +{#if status === "loading"} +

Loading…

+{:else if status === "error"} +

Error: {error}

+{:else if status === "ready"} +
+ + + (params.mal = (e.currentTarget as HTMLInputElement).value)} + autocomplete="off" + spellcheck={false} + /> + +
+ {#if !params.mal.trim()} + Waiting for username… + {:else} + {#if isLoadingMal} + Fetching MAL list… + {:else} + MAL entries: {malEntries.length} (limited to 20) + {/if} + {" • "} + {#if isLoadingDb} + Querying songs… + {:else} + Songs found: {songRows.length} + {/if} + {/if} +
+ + {#if malUsername} +
+ + View {malUsername} on MAL + +
+ {/if} +
+ + {#if params.mal.trim() && !isLoadingMal && malEntries.length === 0} +

+ No anime returned from MAL (did you set a restrictive status/sort?). +

+ {/if} + + {#if params.mal.trim() && !isLoadingDb && malEntries.length > 0 && songRows.length === 0} +

+ No songs matched in the local database. This likely means none of the MAL + anime IDs exist in the snapshot DB. +

+ {/if} + + {#if songRows.length > 0} +

Songs

+ + + {/if} + + {#if malResponse?.paging?.next} +

+ More results exist on MAL, but pagination is not wired yet. +

+ {/if} +{/if}