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,
|
...x,
|
||||||
logo: imageFn(`/user/${x.slug}/logo`),
|
logo: imageFn(`/user/${x.slug}/logo`),
|
||||||
isVerified: x.permissions.length > 0,
|
isVerified: x.permissions.length > 0,
|
||||||
|
isAdmin: x.permissions?.includes("admin.write")
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export type User = z.infer<typeof UserP>;
|
export type User = z.infer<typeof UserP>;
|
||||||
|
@ -178,7 +178,7 @@ export const UserList = () => {
|
|||||||
id={user.id}
|
id={user.id}
|
||||||
username={user.username}
|
username={user.username}
|
||||||
avatar={user.logo}
|
avatar={user.logo}
|
||||||
isAdmin={user.permissions?.includes("admin.write")}
|
isAdmin={user.isAdmin}
|
||||||
isVerified={user.isVerified}
|
isVerified={user.isVerified}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -18,20 +18,21 @@
|
|||||||
* along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
|
* 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 { 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 { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
import { watchListIcon } from "./watchlist-info";
|
import { ComponentProps } from "react";
|
||||||
import { useDownloader } from "../downloads";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Platform } from "react-native";
|
import { Platform } from "react-native";
|
||||||
import { useYoshiki } from "yoshiki/native";
|
import { useYoshiki } from "yoshiki/native";
|
||||||
|
import { useDownloader } from "../downloads";
|
||||||
import { MediaInfoPopup } from "./media-info";
|
import { MediaInfoPopup } from "./media-info";
|
||||||
|
import { watchListIcon } from "./watchlist-info";
|
||||||
|
|
||||||
export const EpisodesContext = ({
|
export const EpisodesContext = ({
|
||||||
type = "episode",
|
type = "episode",
|
||||||
@ -63,6 +64,14 @@ export const EpisodesContext = ({
|
|||||||
onSettled: async () => await queryClient.invalidateQueries({ queryKey: [type, slug] }),
|
onSettled: async () => await queryClient.invalidateQueries({ queryKey: [type, slug] }),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const metadataRefreshMutation = useMutation({
|
||||||
|
mutationFn: () =>
|
||||||
|
queryFn({
|
||||||
|
path: [type, slug, "refresh"],
|
||||||
|
method: "POST",
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Menu
|
<Menu
|
||||||
@ -114,6 +123,16 @@ export const EpisodesContext = ({
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
{account?.isAdmin === true && (
|
||||||
|
<>
|
||||||
|
<HR />
|
||||||
|
<Menu.Item
|
||||||
|
label={t("home.refreshMetadata")}
|
||||||
|
icon={Refresh}
|
||||||
|
onSelect={() => metadataRefreshMutation.mutate()}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Menu>
|
</Menu>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
"info": "See more",
|
"info": "See more",
|
||||||
"none": "No episodes",
|
"none": "No episodes",
|
||||||
"watchlistLogin": "To keep track of what you watched or plan to watch, you need to login.",
|
"watchlistLogin": "To keep track of what you watched or plan to watch, you need to login.",
|
||||||
|
"refreshMetadata": "Refresh metadata",
|
||||||
"episodeMore": {
|
"episodeMore": {
|
||||||
"goToShow": "Go to show",
|
"goToShow": "Go to show",
|
||||||
"download": "Download",
|
"download": "Download",
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
"info": "Voir plus",
|
"info": "Voir plus",
|
||||||
"none": "Aucun episode",
|
"none": "Aucun episode",
|
||||||
"watchlistLogin": "Pour suivre ce que vous avez regardé ou prévoyez de regarder, vous devez vous connecter.",
|
"watchlistLogin": "Pour suivre ce que vous avez regardé ou prévoyez de regarder, vous devez vous connecter.",
|
||||||
|
"refreshMetadata": "Actualiser les métadonnées",
|
||||||
"episodeMore": {
|
"episodeMore": {
|
||||||
"goToShow": "Aller a la serie",
|
"goToShow": "Aller a la serie",
|
||||||
"download": "Télécharger",
|
"download": "Télécharger",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user