feat(lint): use biome instead
This commit is contained in:
1 parent
dca2a31639
commit
8d68eb546d
129 files changed
+2352
-4366
No files matched your search
+27
-27
@@ -1,6 +1,6 @@
|
||||
import { Api, Jellyfin } from "@jellyfin/sdk";
|
||||
/** @format */
|
||||
import { create } from "zustand";
|
||||
import { Api, Jellyfin } from "@jellyfin/sdk";
|
||||
import { version as appVer } from "../../../package.json";
|
||||
|
||||
// Initial custom axios client to use tauri's http module
|
||||
@@ -9,46 +9,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) {
|
||||
let 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,16 +1,16 @@
|
||||
/** @format */
|
||||
|
||||
import { create } from "zustand";
|
||||
import { version } from "../../../package.json";
|
||||
import { getAllServers, getDefaultServer, getServer } from "../storage/servers";
|
||||
import { getUser } from "../storage/user";
|
||||
import { version } from "../../../package.json";
|
||||
/**
|
||||
* Central Store controls the base state required by the app
|
||||
*/
|
||||
export const useCentralStore = create(() => ({
|
||||
defaultServerOnDisk: async () => await getDefaultServer(),
|
||||
defaultServerInfoOnDisk: async () => {
|
||||
let a = await getDefaultServer();
|
||||
const a = await getDefaultServer();
|
||||
return await getServer(a);
|
||||
},
|
||||
allServersOnDisk: async () => getAllServers(),
|
||||
|
||||
@@ -32,8 +32,7 @@ export const usePlaybackStore = create((set) => ({
|
||||
setSeriesId: (anm) => set((state) => ({ ...state, seriesId: anm })),
|
||||
setMediaContainer: (anm) =>
|
||||
set((state) => ({ ...state, mediaContainer: anm })),
|
||||
setMediaSourceId: (anm) =>
|
||||
set((state) => ({ ...state, mediaSourceId: anm })),
|
||||
setMediaSourceId: (anm) => set((state) => ({ ...state, mediaSourceId: anm })),
|
||||
setAudioStreamIndex: (anm) =>
|
||||
set((state) => ({ ...state, audioStreamIndex: anm })),
|
||||
setVideoStreamIndex: (anm) =>
|
||||
|
||||
Reference in new issue
Block a user