chore: remove prettier pragma
This commit is contained in:
1 parent
f1920b5235
commit
0f9afd5f5b
165 files changed
+65
-240
No files matched your search
+26
-27
@@ -1,5 +1,4 @@
|
||||
import { Api, Jellyfin } from "@jellyfin/sdk";
|
||||
/** @format */
|
||||
import { create } from "zustand";
|
||||
import { version as appVer } from "../../../package.json";
|
||||
|
||||
@@ -9,46 +8,46 @@ import axiosTauriApiAdapter from "axios-tauri-api-adapter";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
export const axiosClient = axios.create({
|
||||
adapter: axiosTauriApiAdapter,
|
||||
headers: { "Access-Control-Allow-Origin": "*" },
|
||||
timeout: 60000,
|
||||
adapter: axiosTauriApiAdapter,
|
||||
headers: { "Access-Control-Allow-Origin": "*" },
|
||||
timeout: 60000,
|
||||
});
|
||||
|
||||
let deviceId = localStorage.getItem("deviceId");
|
||||
|
||||
if (!deviceId) {
|
||||
const randomId = uuidv4();
|
||||
localStorage.setItem("deviceId", randomId);
|
||||
const randomId = uuidv4();
|
||||
localStorage.setItem("deviceId", randomId);
|
||||
|
||||
deviceId = randomId;
|
||||
deviceId = randomId;
|
||||
}
|
||||
|
||||
const jellyfin = new Jellyfin({
|
||||
clientInfo: {
|
||||
name: "JellyPlayer",
|
||||
version: appVer,
|
||||
},
|
||||
deviceInfo: {
|
||||
name: "JellyPlayer",
|
||||
id: deviceId!,
|
||||
},
|
||||
clientInfo: {
|
||||
name: "JellyPlayer",
|
||||
version: appVer,
|
||||
},
|
||||
deviceInfo: {
|
||||
name: "JellyPlayer",
|
||||
id: deviceId!,
|
||||
},
|
||||
});
|
||||
|
||||
export const useApi = create<{
|
||||
api: Api | null;
|
||||
deviceId: string | null;
|
||||
jellyfin: Jellyfin;
|
||||
api: Api | null;
|
||||
deviceId: string | null;
|
||||
jellyfin: Jellyfin;
|
||||
}>(() => ({
|
||||
api: null,
|
||||
deviceId: deviceId,
|
||||
jellyfin: jellyfin,
|
||||
api: null,
|
||||
deviceId: deviceId,
|
||||
jellyfin: jellyfin,
|
||||
}));
|
||||
|
||||
export const createApi = (
|
||||
serverAddress: string,
|
||||
accessToken: string | undefined,
|
||||
serverAddress: string,
|
||||
accessToken: string | undefined
|
||||
) =>
|
||||
useApi.setState((state) => ({
|
||||
...state,
|
||||
api: jellyfin.createApi(serverAddress, accessToken, axiosClient),
|
||||
}));
|
||||
useApi.setState((state) => ({
|
||||
...state,
|
||||
api: jellyfin.createApi(serverAddress, accessToken, axiosClient),
|
||||
}));
|
||||
@@ -1,4 +1,3 @@
|
||||
/** @format */
|
||||
|
||||
import { create } from "zustand";
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/** @format */
|
||||
|
||||
import { create } from "zustand";
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/** @format */
|
||||
|
||||
import { create } from "zustand";
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/** @format */
|
||||
|
||||
import { create } from "zustand";
|
||||
import { version } from "../../../package.json";
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/** @format */
|
||||
|
||||
import { create } from "zustand";
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/** @format */
|
||||
|
||||
import { create } from "zustand";
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/** @format */
|
||||
|
||||
import { create } from "zustand";
|
||||
|
||||
|
||||
Reference in new issue
Block a user