mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-22 15:12:28 -04:00
Implement manual metadata refresh
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
// import Download from "@material-symbols/svg-400/rounded/download.svg";
|
||||
import Refresh from "@material-symbols/svg-400/rounded/autorenew.svg";
|
||||
import Info from "@material-symbols/svg-400/rounded/info.svg";
|
||||
import MoreVert from "@material-symbols/svg-400/rounded/more_vert.svg";
|
||||
import MovieInfo from "@material-symbols/svg-400/rounded/movie_info.svg";
|
||||
import type { ComponentProps } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { WatchStatusV } from "~/models";
|
||||
import { IconButton, Menu, tooltip } from "~/primitives";
|
||||
import { HR, IconButton, Menu, tooltip } from "~/primitives";
|
||||
import { useAccount } from "~/providers/account-context";
|
||||
import { useMutation } from "~/query";
|
||||
import { cn } from "~/utils";
|
||||
@@ -89,11 +90,11 @@ export const ItemContext = ({
|
||||
invalidate: [kind, slug],
|
||||
});
|
||||
|
||||
// const metadataRefreshMutation = useMutation({
|
||||
// method: "POST",
|
||||
// path: [kind, slug, "refresh"],
|
||||
// invalidate: null,
|
||||
// });
|
||||
const metadataRefreshMutation = useMutation({
|
||||
method: "POST",
|
||||
path: ["scanner", `${kind}s`, slug, "refresh"],
|
||||
invalidate: null,
|
||||
});
|
||||
|
||||
return (
|
||||
<Menu
|
||||
@@ -139,16 +140,16 @@ export const ItemContext = ({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{/* {account?.isAdmin === true && ( */}
|
||||
{/* <> */}
|
||||
{/* <HR /> */}
|
||||
{/* <Menu.Item */}
|
||||
{/* label={t("home.refreshMetadata")} */}
|
||||
{/* icon={Refresh} */}
|
||||
{/* onSelect={() => metadataRefreshMutation.mutate()} */}
|
||||
{/* /> */}
|
||||
{/* </> */}
|
||||
{/* )} */}
|
||||
{account?.isAdmin === true && (
|
||||
<>
|
||||
<HR />
|
||||
<Menu.Item
|
||||
label={t("home.refreshMetadata")}
|
||||
icon={Refresh}
|
||||
onSelect={() => metadataRefreshMutation.mutate()}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Menu>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user