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 [crumbs, setCrumbs] = useState<string[]>([]);
|
||||
|
||||
const dir = trpc.media.mountListDir.useQuery(
|
||||
{ mountId, path },
|
||||
{ enabled: Boolean(mountId) },
|
||||
);
|
||||
const dir = trpc.media.mountListDir.useQuery({ mountId, path }, { enabled: Boolean(mountId) });
|
||||
const scan = trpc.media.libraryScan.useMutation();
|
||||
const ensure = trpc.media.libraryEnsurePath.useMutation();
|
||||
|
||||
|
|
@ -107,9 +104,7 @@ function BrowseInner(props: { locale: Locale }) {
|
|||
{t(locale, "browse.scanDone", { count: scan.data.scanned })}
|
||||
</p>
|
||||
)}
|
||||
{scan.isError && (
|
||||
<p className="text-sm text-red-600">{scan.error.message}</p>
|
||||
)}
|
||||
{scan.isError && <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">
|
||||
<button type="button" onClick={goRoot}>
|
||||
{t(locale, "browse.root")}
|
||||
|
|
@ -141,7 +136,10 @@ function BrowseInner(props: { locale: Locale }) {
|
|||
{(dir.data?.entries ?? []).map((e) => {
|
||||
const isVideo = e.type === "file" && VIDEO_RE.test(e.basename);
|
||||
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" ? (
|
||||
<button
|
||||
type="button"
|
||||
|
|
@ -195,4 +193,3 @@ export function BrowseBody(props: { locale: Locale }) {
|
|||
</QueryClientProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -134,4 +134,3 @@ export const en: Record<MessageKey, string> = {
|
|||
"error.internal.desc":
|
||||
"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 Messages = Record<MessageKey, string>;
|
||||
|
||||
|
|
|
|||
|
|
@ -88,4 +88,3 @@ export const mediaRouter = t.router({
|
|||
.input(danmakuSchemas.settings)
|
||||
.mutation(({ input }) => input),
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -124,4 +124,3 @@ export const libraryService = {
|
|||
return item;
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -99,4 +99,3 @@ export type DanmakuFetchOutput = {
|
|||
xml: string;
|
||||
message?: string;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue