mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Add episode refresh button on the front
This commit is contained in:
parent
2273e99074
commit
525da02fce
@ -82,6 +82,7 @@ export const UserP = ResourceP("user")
|
||||
...x,
|
||||
logo: imageFn(`/user/${x.slug}/logo`),
|
||||
isVerified: x.permissions.length > 0,
|
||||
isAdmin: x.permissions?.includes("admin.write")
|
||||
}));
|
||||
|
||||
export type User = z.infer<typeof UserP>;
|
||||
|
@ -178,7 +178,7 @@ export const UserList = () => {
|
||||
id={user.id}
|
||||
username={user.username}
|
||||
avatar={user.logo}
|
||||
isAdmin={user.permissions?.includes("admin.write")}
|
||||
isAdmin={user.isAdmin}
|
||||
isVerified={user.isVerified}
|
||||
/>
|
||||
)}
|
||||
|
@ -18,20 +18,21 @@
|
||||
* along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { IconButton, Menu, tooltip, usePopup } from "@kyoo/primitives";
|
||||
import { ComponentProps, ReactElement, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import MoreVert from "@material-symbols/svg-400/rounded/more_vert.svg";
|
||||
import Info from "@material-symbols/svg-400/rounded/info.svg";
|
||||
import MovieInfo from "@material-symbols/svg-400/rounded/movie_info.svg";
|
||||
import Download from "@material-symbols/svg-400/rounded/download.svg";
|
||||
import { WatchStatusV, queryFn, useAccount } from "@kyoo/models";
|
||||
import { HR, IconButton, Menu, tooltip, usePopup } from "@kyoo/primitives";
|
||||
import Refresh from "@material-symbols/svg-400/rounded/autorenew.svg";
|
||||
import Download from "@material-symbols/svg-400/rounded/download.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 { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { watchListIcon } from "./watchlist-info";
|
||||
import { useDownloader } from "../downloads";
|
||||
import { ComponentProps } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Platform } from "react-native";
|
||||
import { useYoshiki } from "yoshiki/native";
|
||||
import { useDownloader } from "../downloads";
|
||||
import { MediaInfoPopup } from "./media-info";
|
||||
import { watchListIcon } from "./watchlist-info";
|
||||
|
||||
export const EpisodesContext = ({
|
||||
type = "episode",
|
||||
@ -63,6 +64,14 @@ export const EpisodesContext = ({
|
||||
onSettled: async () => await queryClient.invalidateQueries({ queryKey: [type, slug] }),
|
||||
});
|
||||
|
||||
const metadataRefreshMutation = useMutation({
|
||||
mutationFn: () =>
|
||||
queryFn({
|
||||
path: [type, slug, "refresh"],
|
||||
method: "POST",
|
||||
}),
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<Menu
|
||||
@ -114,6 +123,16 @@ export const EpisodesContext = ({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{account?.isAdmin === true && (
|
||||
<>
|
||||
<HR />
|
||||
<Menu.Item
|
||||
label={t("home.refreshMetadata")}
|
||||
icon={Refresh}
|
||||
onSelect={() => metadataRefreshMutation.mutate()}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</Menu>
|
||||
</>
|
||||
);
|
||||
|
@ -6,6 +6,7 @@
|
||||
"info": "See more",
|
||||
"none": "No episodes",
|
||||
"watchlistLogin": "To keep track of what you watched or plan to watch, you need to login.",
|
||||
"refreshMetadata": "Refresh metadata",
|
||||
"episodeMore": {
|
||||
"goToShow": "Go to show",
|
||||
"download": "Download",
|
||||
|
@ -6,6 +6,7 @@
|
||||
"info": "Voir plus",
|
||||
"none": "Aucun episode",
|
||||
"watchlistLogin": "Pour suivre ce que vous avez regardé ou prévoyez de regarder, vous devez vous connecter.",
|
||||
"refreshMetadata": "Actualiser les métadonnées",
|
||||
"episodeMore": {
|
||||
"goToShow": "Aller a la serie",
|
||||
"download": "Télécharger",
|
||||
|
Loading…
x
Reference in New Issue
Block a user