update jellyfin api implementation

This commit is contained in:
Chris Kruining 2025-05-14 13:54:06 +02:00
parent 81491482e4
commit 873677ea04
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
6 changed files with 59362 additions and 7 deletions

File diff suppressed because it is too large Load diff

View file

@ -19,9 +19,9 @@ const client = createClient<paths>({
});
export const TEST = query(async () => {
const userId = "a9c51af84bf54578a99ab4dd0ebf0763";
const itemId = "919dfa97e4dad2758a925d056e590a28";
const seriesId = "5230ddbcd9400733dc07e5b8cb7a4f49";
const userId = "a9c51af8-4bf5-4578-a99a-b4dd0ebf0763";
const itemId = "919dfa97-e4da-d275-8a92-5d056e590a28";
const seriesId = "5230ddbcd-9400-733d-c07e-5b8cb7a4f49";
const { data: seriesData } = await client.GET("/UserItems/{itemId}/UserData", {
params: {
@ -159,7 +159,7 @@ export const getContinueWatching = query(
return [];
}
const uniqueIds = new Set<string>(data.Items.map(item => item.Type === 'Episode' ? item.SeriesId! : 'MOVIE_ID'));
const uniqueIds = new Set<string>(data.Items.map(item => item.Type === 'Episode' ? item.SeriesId! : item.Id));
const results = await Promise.allSettled(uniqueIds.values().map(id => getItem(userId, id)).toArray());
assertNoErrors(results);

View file

@ -3,7 +3,7 @@ import { query } from "@solidjs/router";
import { entries } from "./data";
import { getContinueWatching, getItem, TEST } from "./apis/jellyfin";
const jellyfinUserId = "a9c51af84bf54578a99ab4dd0ebf0763";
const jellyfinUserId = "a9c51af8-4bf5-4578-a99a-b4dd0ebf0763";
export const listCategories = query(async (): Promise<Category[]> => {
"use server";

View file

@ -9,15 +9,17 @@ import {
import { Show } from "solid-js";
import css from "./index.module.css";
const highlightId = 'c97185ed-e0cf-4945-9120-9d15bb8e5998';
export const route = {
preload: async () => ({
highlight: await getEntry("14"),
highlight: await getEntry(highlightId),
categories: await listCategories(),
}),
};
export default function Home() {
const highlight = createAsync(() => getEntry("14"));
const highlight = createAsync(() => getEntry(highlightId));
const categories = createAsync(() => listCategories());
return (