.
This commit is contained in:
parent
0cf801d3dc
commit
1735d4ef65
4 changed files with 15 additions and 7 deletions
|
@ -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: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue