.
This commit is contained in:
parent
0cf801d3dc
commit
1735d4ef65
4 changed files with 15 additions and 7 deletions
|
@ -56,6 +56,5 @@ export const auth = betterAuth({
|
||||||
});
|
});
|
||||||
|
|
||||||
export const { signIn, signOut, useSession, ...client } = createAuthClient({
|
export const { signIn, signOut, useSession, ...client } = createAuthClient({
|
||||||
baseURL: "http://localhost:3000",
|
|
||||||
plugins: [genericOAuthClient()],
|
plugins: [genericOAuthClient()],
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,14 +3,23 @@ import type { paths } from "./jellyfin.generated"; // generated by openapi-types
|
||||||
import { query } from "@solidjs/router";
|
import { query } from "@solidjs/router";
|
||||||
import { Entry } from "../types";
|
import { Entry } from "../types";
|
||||||
|
|
||||||
const baseUrl = "http://ulmo:8096/";
|
const baseUrl = process.env.JELLYFIN_BASE_URL;
|
||||||
const client = createClient<paths>({
|
const client = createClient<paths>({
|
||||||
baseUrl,
|
baseUrl,
|
||||||
headers: {
|
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) => {
|
export const getItem = query(async (userId: string, itemId: string) => {
|
||||||
const { data, error } = await client.GET("/Items/{itemId}", {
|
const { data, error } = await client.GET("/Items/{itemId}", {
|
||||||
params: {
|
params: {
|
||||||
|
|
|
@ -70,4 +70,4 @@ export const getEntry = query(
|
||||||
"series.get",
|
"series.get",
|
||||||
);
|
);
|
||||||
|
|
||||||
export { getContinueWatching } from "./apis/jellyfin";
|
export { listUsers, getItem, getContinueWatching } from "./apis/jellyfin";
|
||||||
|
|
|
@ -29,11 +29,11 @@ export default function Home() {
|
||||||
<>
|
<>
|
||||||
<Title>Home</Title>
|
<Title>Home</Title>
|
||||||
|
|
||||||
<Show when={continueWatching()}>
|
<Show when={continueWatching()}>{
|
||||||
<List label="Continue watching" items={continueWatching()}>
|
entries => <List label="Continue watching" items={entries()}>
|
||||||
{(item) => <ListItem entry={item()} />}
|
{(item) => <ListItem entry={item()} />}
|
||||||
</List>
|
</List>
|
||||||
</Show>
|
}</Show>
|
||||||
|
|
||||||
<Show when={highlight() && categories()}>
|
<Show when={highlight() && categories()}>
|
||||||
<Overview highlight={highlight()!} categories={categories()!} />
|
<Overview highlight={highlight()!} categories={categories()!} />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue