fix build

This commit is contained in:
Violet Caulfield
2024-11-22 10:04:01 -06:00
parent a90ee6f94b
commit 71c3bbb684
3 changed files with 17 additions and 4 deletions

15
api/server.ts Normal file
View File

@@ -0,0 +1,15 @@
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
import { buildApiClient } from "./client";
export const serverMutation = async (serverUrl: string) => {
console.log("Mutating server URL");
if (!!!serverUrl)
throw Error("Server URL is empty")
const api = buildApiClient(serverUrl);
console.log(`Created API client for ${api.basePath}`)
return await getSystemApi(api).getPublicSystemInfo();
}

View File

@@ -3,16 +3,15 @@ import _ from "lodash";
import { useMutation } from "@tanstack/react-query";
import { MMKVStorageKeys } from "../../../enums/mmkv-storage-keys";
import { JellifyServer } from "../../../types/JellifyServer";
import { mutateServer, serverMutation } from "../../../api/mutators/functions/storage";
import { useApiClientContext } from "../../jellyfin-api-provider";
import { View, XStack } from "tamagui";
import { SwitchWithLabel } from "../../helpers/switch-with-label";
import { useAuthenticationContext } from "../provider";
import { Heading } from "../../helpers/text";
import Input from "../../helpers/input";
import Button from "../../helpers/button";
import { http, https } from "../utils/constants";
import { storage } from "../../../constants/storage";
import { serverMutation } from "../../../api/server";
export default function ServerAddress(): React.JSX.Element {

View File

@@ -1,9 +1,8 @@
import { useMutation, useQuery } from "@tanstack/react-query";
import { useQuery } from "@tanstack/react-query";
import React, { useEffect, useState } from "react";
import { useApiClientContext } from "../../jellyfin-api-provider";
import { Select, View } from "tamagui";
import { JellifyLibrary } from "../../../types/JellifyLibrary";
import { mutateServerCredentials } from "../../../api/mutators/functions/storage";
import { useAuthenticationContext } from "../provider";
import { Heading } from "../../helpers/text";
import Button from "../../helpers/button";