mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-04-26 18:44:41 +01:00
feat: refresh metadata for item
This commit is contained in:
@@ -35,6 +35,7 @@ import { ItemTechnicalDetails } from "./ItemTechnicalDetails";
|
||||
import { MediaSourceSheet } from "./MediaSourceSheet";
|
||||
import { MoreMoviesWithActor } from "./MoreMoviesWithActor";
|
||||
import { PlayInRemoteSessionButton } from "./PlayInRemoteSession";
|
||||
import { RefreshMetadata } from "./RefreshMetadata";
|
||||
import { TrackSheet } from "./TrackSheet";
|
||||
|
||||
const Chromecast = !Platform.isTV ? require("./Chromecast") : null;
|
||||
@@ -115,7 +116,10 @@ export const ItemContent: React.FC<ItemContentProps> = React.memo(
|
||||
<DownloadSingleItem item={item} size='large' />
|
||||
)}
|
||||
{user?.Policy?.IsAdministrator && (
|
||||
<PlayInRemoteSessionButton item={item} size='large' />
|
||||
<>
|
||||
<PlayInRemoteSessionButton item={item} size='large' />
|
||||
<RefreshMetadata item={item} />
|
||||
</>
|
||||
)}
|
||||
|
||||
<PlayedStatus items={[item]} size='large' />
|
||||
@@ -132,7 +136,10 @@ export const ItemContent: React.FC<ItemContentProps> = React.memo(
|
||||
<DownloadSingleItem item={item} size='large' />
|
||||
)}
|
||||
{user?.Policy?.IsAdministrator && (
|
||||
<PlayInRemoteSessionButton item={item} size='large' />
|
||||
<>
|
||||
<PlayInRemoteSessionButton item={item} size='large' />
|
||||
<RefreshMetadata item={item} />
|
||||
</>
|
||||
)}
|
||||
|
||||
<PlayedStatus items={[item]} size='large' />
|
||||
|
||||
37
components/RefreshMetadata.tsx
Normal file
37
components/RefreshMetadata.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import type { FC } from "react";
|
||||
import { Platform, View, type ViewProps } from "react-native";
|
||||
import { RoundButton } from "@/components/RoundButton";
|
||||
import { useRefreshMetadata } from "@/hooks/useRefreshMetadata";
|
||||
|
||||
interface Props extends ViewProps {
|
||||
item: BaseItemDto;
|
||||
}
|
||||
|
||||
export const RefreshMetadata: FC<Props> = ({ item, ...props }) => {
|
||||
const { refreshMetadata, isRefreshing } = useRefreshMetadata(item);
|
||||
|
||||
if (Platform.OS === "ios") {
|
||||
return (
|
||||
<View {...props}>
|
||||
<RoundButton
|
||||
size='large'
|
||||
icon='reload-outline'
|
||||
onPress={refreshMetadata}
|
||||
hapticFeedback={!isRefreshing}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View {...props}>
|
||||
<RoundButton
|
||||
size='large'
|
||||
icon='reload-outline'
|
||||
onPress={refreshMetadata}
|
||||
hapticFeedback={!isRefreshing}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user