This commit is contained in:
Chris Kruining 2025-04-16 13:19:12 +02:00
parent 0cf801d3dc
commit 1735d4ef65
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
4 changed files with 15 additions and 7 deletions

View file

@ -3,14 +3,23 @@ import type { paths } from "./jellyfin.generated"; // generated by openapi-types
import { query } from "@solidjs/router";
import { Entry } from "../types";
const baseUrl = "http://ulmo:8096/";
const baseUrl = process.env.JELLYFIN_BASE_URL;
const client = createClient<paths>({
baseUrl,
headers: {
Authorization: `MediaBrowser DeviceId="Streamarr", Token="b3c44db1e31f4349b19d1ff0bc487da2"`,
Authorization: `MediaBrowser DeviceId="Streamarr", Token="${process.env.JELLYFIN_API_KEY}"`,
},
});
export const listUsers = query(async () => {
const { data, error } = await client.GET("/Users", {
params: {
},
});
return data ?? [];
}, "jellyfin.listUsers");
export const getItem = query(async (userId: string, itemId: string) => {
const { data, error } = await client.GET("/Items/{itemId}", {
params: {