mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-04-25 10:04:42 +01:00
fix: add hw/sw badge to session
This commit is contained in:
@@ -4,7 +4,7 @@ import { FlashList } from "@shopify/flash-list";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { View } from "react-native";
|
import { View } from "react-native";
|
||||||
import { Loader } from "@/components/Loader";
|
import { Loader } from "@/components/Loader";
|
||||||
import { SessionInfoDto } from "@jellyfin/sdk/lib/generated-client";
|
import { HardwareAccelerationType, SessionInfoDto } from "@jellyfin/sdk/lib/generated-client";
|
||||||
import { useAtomValue } from "jotai";
|
import { useAtomValue } from "jotai";
|
||||||
import { apiAtom } from "@/providers/JellyfinProvider";
|
import { apiAtom } from "@/providers/JellyfinProvider";
|
||||||
import Poster from "@/components/posters/Poster";
|
import Poster from "@/components/posters/Poster";
|
||||||
@@ -186,6 +186,7 @@ const TranscodingBadges = ({ properties }: TranscodingBadgesProps) => {
|
|||||||
resolution: <Ionicons name="film-outline" size={12} color="white" />,
|
resolution: <Ionicons name="film-outline" size={12} color="white" />,
|
||||||
language: <Ionicons name="language-outline" size={12} color="white" />,
|
language: <Ionicons name="language-outline" size={12} color="white" />,
|
||||||
audioChannels: <Ionicons name="mic-outline" size={12} color="white" />,
|
audioChannels: <Ionicons name="mic-outline" size={12} color="white" />,
|
||||||
|
hwType: <Ionicons name="hardware-chip-outline" size={12} color="white" />,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
const icon = (val: string) => {
|
const icon = (val: string) => {
|
||||||
@@ -200,6 +201,8 @@ const TranscodingBadges = ({ properties }: TranscodingBadgesProps) => {
|
|||||||
switch (key) {
|
switch (key) {
|
||||||
case "bitrate":
|
case "bitrate":
|
||||||
return formatBitrate(val);
|
return formatBitrate(val);
|
||||||
|
case "hwType":
|
||||||
|
return val === HardwareAccelerationType.None ? "sw" : "hw";
|
||||||
default:
|
default:
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
@@ -219,6 +222,7 @@ const TranscodingBadges = ({ properties }: TranscodingBadgesProps) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
interface StreamProps {
|
interface StreamProps {
|
||||||
|
hwType?: HardwareAccelerationType | null | undefined;
|
||||||
resolution?: string | null | undefined;
|
resolution?: string | null | undefined;
|
||||||
language?: string | null | undefined;
|
language?: string | null | undefined;
|
||||||
codec?: string | null | undefined;
|
codec?: string | null | undefined;
|
||||||
@@ -313,6 +317,7 @@ const TranscodingView = ({ session }: SessionCardProps) => {
|
|||||||
codec: videoStream?.Codec,
|
codec: videoStream?.Codec,
|
||||||
}}
|
}}
|
||||||
transcodeProperties={{
|
transcodeProperties={{
|
||||||
|
hwType: session.TranscodingInfo?.HardwareAccelerationType,
|
||||||
bitrate: session.TranscodingInfo?.Bitrate,
|
bitrate: session.TranscodingInfo?.Bitrate,
|
||||||
codec: session.TranscodingInfo?.VideoCodec,
|
codec: session.TranscodingInfo?.VideoCodec,
|
||||||
}}
|
}}
|
||||||
@@ -332,7 +337,6 @@ const TranscodingView = ({ session }: SessionCardProps) => {
|
|||||||
audioChannels: audioStream?.ChannelLayout,
|
audioChannels: audioStream?.ChannelLayout,
|
||||||
}}
|
}}
|
||||||
transcodeProperties={{
|
transcodeProperties={{
|
||||||
bitrate: session.TranscodingInfo?.Bitrate,
|
|
||||||
codec: session.TranscodingInfo?.AudioCodec,
|
codec: session.TranscodingInfo?.AudioCodec,
|
||||||
audioChannels: session.TranscodingInfo?.AudioChannels?.toString(),
|
audioChannels: session.TranscodingInfo?.AudioChannels?.toString(),
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user