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

@ -56,6 +56,5 @@ export const auth = betterAuth({
});
export const { signIn, signOut, useSession, ...client } = createAuthClient({
baseURL: "http://localhost:3000",
plugins: [genericOAuthClient()],
});

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: {

View file

@ -70,4 +70,4 @@ export const getEntry = query(
"series.get",
);
export { getContinueWatching } from "./apis/jellyfin";
export { listUsers, getItem, getContinueWatching } from "./apis/jellyfin";

View file

@ -29,11 +29,11 @@ export default function Home() {
<>
<Title>Home</Title>
<Show when={continueWatching()}>
<List label="Continue watching" items={continueWatching()}>
<Show when={continueWatching()}>{
entries => <List label="Continue watching" items={entries()}>
{(item) => <ListItem entry={item()} />}
</List>
</Show>
}</Show>
<Show when={highlight() && categories()}>
<Overview highlight={highlight()!} categories={categories()!} />