style: biome format browse/ensurePath changes
This commit is contained in:
parent
5a291a9127
commit
99fd2a58e7
|
|
@ -22,10 +22,7 @@ function BrowseInner(props: { locale: Locale }) {
|
||||||
const [path, setPath] = useState("/");
|
const [path, setPath] = useState("/");
|
||||||
const [crumbs, setCrumbs] = useState<string[]>([]);
|
const [crumbs, setCrumbs] = useState<string[]>([]);
|
||||||
|
|
||||||
const dir = trpc.media.mountListDir.useQuery(
|
const dir = trpc.media.mountListDir.useQuery({ mountId, path }, { enabled: Boolean(mountId) });
|
||||||
{ mountId, path },
|
|
||||||
{ enabled: Boolean(mountId) },
|
|
||||||
);
|
|
||||||
const scan = trpc.media.libraryScan.useMutation();
|
const scan = trpc.media.libraryScan.useMutation();
|
||||||
const ensure = trpc.media.libraryEnsurePath.useMutation();
|
const ensure = trpc.media.libraryEnsurePath.useMutation();
|
||||||
|
|
||||||
|
|
@ -107,9 +104,7 @@ function BrowseInner(props: { locale: Locale }) {
|
||||||
{t(locale, "browse.scanDone", { count: scan.data.scanned })}
|
{t(locale, "browse.scanDone", { count: scan.data.scanned })}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{scan.isError && (
|
{scan.isError && <p className="text-sm text-red-600">{scan.error.message}</p>}
|
||||||
<p className="text-sm text-red-600">{scan.error.message}</p>
|
|
||||||
)}
|
|
||||||
<div className="flex flex-wrap items-center gap-2 text-sm text-muted-foreground">
|
<div className="flex flex-wrap items-center gap-2 text-sm text-muted-foreground">
|
||||||
<button type="button" onClick={goRoot}>
|
<button type="button" onClick={goRoot}>
|
||||||
{t(locale, "browse.root")}
|
{t(locale, "browse.root")}
|
||||||
|
|
@ -141,7 +136,10 @@ function BrowseInner(props: { locale: Locale }) {
|
||||||
{(dir.data?.entries ?? []).map((e) => {
|
{(dir.data?.entries ?? []).map((e) => {
|
||||||
const isVideo = e.type === "file" && VIDEO_RE.test(e.basename);
|
const isVideo = e.type === "file" && VIDEO_RE.test(e.basename);
|
||||||
return (
|
return (
|
||||||
<li key={e.filename} className="flex items-center justify-between gap-3 p-3 text-sm">
|
<li
|
||||||
|
key={e.filename}
|
||||||
|
className="flex items-center justify-between gap-3 p-3 text-sm"
|
||||||
|
>
|
||||||
{e.type === "directory" ? (
|
{e.type === "directory" ? (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
@ -195,4 +193,3 @@ export function BrowseBody(props: { locale: Locale }) {
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,4 +134,3 @@ export const en: Record<MessageKey, string> = {
|
||||||
"error.internal.desc":
|
"error.internal.desc":
|
||||||
"The server hit an unexpected error. Retry later and report the path if it persists.",
|
"The server hit an unexpected error. Retry later and report the path if it persists.",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -136,4 +136,3 @@ export const zhCN = {
|
||||||
|
|
||||||
export type MessageKey = keyof typeof zhCN;
|
export type MessageKey = keyof typeof zhCN;
|
||||||
export type Messages = Record<MessageKey, string>;
|
export type Messages = Record<MessageKey, string>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,4 +88,3 @@ export const mediaRouter = t.router({
|
||||||
.input(danmakuSchemas.settings)
|
.input(danmakuSchemas.settings)
|
||||||
.mutation(({ input }) => input),
|
.mutation(({ input }) => input),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,4 +124,3 @@ export const libraryService = {
|
||||||
return item;
|
return item;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,4 +99,3 @@ export type DanmakuFetchOutput = {
|
||||||
xml: string;
|
xml: string;
|
||||||
message?: string;
|
message?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue