feat: localize UI and improve playback
Continuous Integration / build_web (push) Failing after 1s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Continuous Integration / build_web (push) Failing after 1s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
- translate the interface into Russian - add picture-in-picture and video fit modes - derive skip segments from Jellyfin chapter markers - align player navigation and add a window drag region - keep audio playback alive across routes
This commit is contained in:
1 parent
5784036eb1
commit
d9bce4de04
100 files changed
+1364
-706
No files matched your search
@@ -12,8 +12,8 @@ export default function BackButton() {
|
||||
<IconButton
|
||||
onClick={handleClick}
|
||||
disabled={history.length === 0}
|
||||
aria-label="Back"
|
||||
title="Back"
|
||||
aria-label="Назад"
|
||||
title="Назад"
|
||||
>
|
||||
<span className="material-symbols-rounded">arrow_back</span>
|
||||
</IconButton>
|
||||
|
||||
@@ -22,10 +22,10 @@ const CastButton = ({
|
||||
}: CastButtonProps) => {
|
||||
const openDialog = useRemoteControlStore((s) => s.openDialog);
|
||||
return (
|
||||
<Tooltip title={item ? "Play on another device" : "Remote control"}>
|
||||
<Tooltip title={item ? "Воспроизвести на другом устройстве" : "Удалённое управление"}>
|
||||
<IconButton
|
||||
size={size}
|
||||
aria-label={item ? "Play on another device" : "Remote control"}
|
||||
aria-label={item ? "Воспроизвести на другом устройстве" : "Удалённое управление"}
|
||||
onClick={() =>
|
||||
openDialog({
|
||||
...(getTransfer ? getTransfer() : transfer),
|
||||
|
||||
@@ -25,28 +25,28 @@ const InstantMixButton = ({ item, withLabel = false }: InstantMixButtonProps) =>
|
||||
try {
|
||||
const { count } = await startInstantMix(api, user.Id, item);
|
||||
if (count === 0) {
|
||||
enqueueSnackbar("No tracks found for this Instant Mix", {
|
||||
enqueueSnackbar("Треки для микса не найдены", {
|
||||
variant: "warning",
|
||||
});
|
||||
} else {
|
||||
enqueueSnackbar(`Instant Mix: ${count} tracks`, {
|
||||
enqueueSnackbar(`Микс: ${count} треков`, {
|
||||
variant: "success",
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Instant Mix failed", error);
|
||||
enqueueSnackbar("Could not start Instant Mix", { variant: "error" });
|
||||
enqueueSnackbar("Не удалось запустить микс", { variant: "error" });
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Tooltip title="Instant Mix">
|
||||
<Tooltip title="Микс">
|
||||
<span>
|
||||
{withLabel ? (
|
||||
<IconButton
|
||||
aria-label="Instant Mix"
|
||||
aria-label="Микс"
|
||||
onClick={handleClick}
|
||||
disabled={busy || !item}
|
||||
>
|
||||
@@ -54,7 +54,7 @@ const InstantMixButton = ({ item, withLabel = false }: InstantMixButtonProps) =>
|
||||
</IconButton>
|
||||
) : (
|
||||
<IconButton
|
||||
aria-label="Instant Mix"
|
||||
aria-label="Микс"
|
||||
onClick={handleClick}
|
||||
disabled={busy || !item}
|
||||
>
|
||||
|
||||
@@ -50,7 +50,7 @@ export default function LikeButton({
|
||||
const mutation = useMutation({
|
||||
mutationFn: handleLiking,
|
||||
onError: (error) => {
|
||||
enqueueSnackbar(`An error occured while updating "${itemName}"`, {
|
||||
enqueueSnackbar(`Не удалось обновить «${itemName}»`, {
|
||||
variant: "error",
|
||||
});
|
||||
console.error(error);
|
||||
|
||||
@@ -54,7 +54,7 @@ export default function MarkPlayedButton({
|
||||
enqueueSnackbar(`${error}`, {
|
||||
variant: "error",
|
||||
});
|
||||
enqueueSnackbar(`An error occured while updating "${itemName}"`, {
|
||||
enqueueSnackbar(`Не удалось обновить «${itemName}»`, {
|
||||
variant: "error",
|
||||
});
|
||||
console.error(error);
|
||||
|
||||
@@ -90,13 +90,13 @@ const PlayButton = ({
|
||||
mutationKey: ["playButton", item?.Id, userId],
|
||||
mutationFn: async (currentEpisodeId?: string) => {
|
||||
if (!api) {
|
||||
throw new Error("API is not available");
|
||||
throw new Error("API недоступно");
|
||||
}
|
||||
if (!userId) {
|
||||
throw new Error("User ID is not available");
|
||||
throw new Error("Не указан пользователь");
|
||||
}
|
||||
if (!item.Id) {
|
||||
throw new Error("Item ID is not available");
|
||||
throw new Error("Не найден идентификатор элемента");
|
||||
}
|
||||
|
||||
return await getPlaybackInfo(api, userId, item, {
|
||||
@@ -109,23 +109,23 @@ const PlayButton = ({
|
||||
},
|
||||
onSuccess: async (result: PlayResult | null) => {
|
||||
if (!api) {
|
||||
console.error("API is not available");
|
||||
enqueueSnackbar("API is not available", { variant: "error" });
|
||||
console.error("API недоступно");
|
||||
enqueueSnackbar("API недоступно", { variant: "error" });
|
||||
return;
|
||||
}
|
||||
if (!userId) {
|
||||
console.error("User ID is not available");
|
||||
enqueueSnackbar("User ID is not available", { variant: "error" });
|
||||
console.error("Не указан пользователь");
|
||||
enqueueSnackbar("Не указан пользователь", { variant: "error" });
|
||||
return;
|
||||
}
|
||||
if (!result?.item?.Items?.length) {
|
||||
console.error("No items found");
|
||||
enqueueSnackbar("No items found", { variant: "error" });
|
||||
console.error("Ничего не найдено");
|
||||
enqueueSnackbar("Ничего не найдено", { variant: "error" });
|
||||
return;
|
||||
}
|
||||
if (!result?.item?.Items?.[0]?.Id) {
|
||||
console.error("No item ID found");
|
||||
enqueueSnackbar("No item ID found", { variant: "error" });
|
||||
console.error("Не найден идентификатор элемента");
|
||||
enqueueSnackbar("Не найден идентификатор элемента", { variant: "error" });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -148,8 +148,8 @@ const PlayButton = ({
|
||||
}
|
||||
} else {
|
||||
if (!result?.mediaSource?.MediaSources?.[0]?.Id) {
|
||||
console.error("No media source ID found");
|
||||
enqueueSnackbar("No media source ID found", { variant: "error" });
|
||||
console.error("Не найден источник медиа");
|
||||
enqueueSnackbar("Не найден источник медиа", { variant: "error" });
|
||||
return;
|
||||
}
|
||||
const episodeIndex = result.episodeIndex;
|
||||
@@ -205,13 +205,13 @@ const PlayButton = ({
|
||||
queryKey: ["playButton", "currentEpisode", item?.Id],
|
||||
queryFn: async () => {
|
||||
if (!api) {
|
||||
throw new Error("API is not available");
|
||||
throw new Error("API недоступно");
|
||||
}
|
||||
if (!userId) {
|
||||
throw new Error("User ID is not available");
|
||||
throw new Error("Не указан пользователь");
|
||||
}
|
||||
if (!item.Id) {
|
||||
throw new Error("Item ID is not available");
|
||||
throw new Error("Не найден идентификатор элемента");
|
||||
}
|
||||
const seasons = await getShowApi(api).getSeasons({
|
||||
seriesId: item.Id,
|
||||
@@ -237,12 +237,26 @@ const PlayButton = ({
|
||||
enabled: itemType === BaseItemKind.Series,
|
||||
});
|
||||
|
||||
const isAudioItem =
|
||||
item?.Type === "MusicAlbum" ||
|
||||
item?.Type === "Audio" ||
|
||||
item?.Type === "AudioBook" ||
|
||||
item?.Type === "Playlist" ||
|
||||
audio;
|
||||
const playLabel = item.UserData?.PlaybackPositionTicks
|
||||
? isAudioItem
|
||||
? "Продолжить прослушивание"
|
||||
: "Продолжить просмотр"
|
||||
: isAudioItem
|
||||
? "Слушать"
|
||||
: "Смотреть";
|
||||
|
||||
if (iconOnly) {
|
||||
return (
|
||||
//@ts-expect-error
|
||||
<Fab
|
||||
color="primary"
|
||||
aria-label="Play"
|
||||
aria-label={isAudioItem ? "Слушать" : "Смотреть"}
|
||||
className={className}
|
||||
onClick={(e) => {
|
||||
if (item.Type === "Episode") {
|
||||
@@ -322,14 +336,14 @@ const PlayButton = ({
|
||||
}
|
||||
>
|
||||
{currentEpisode.isPending ? (
|
||||
"Loading..."
|
||||
"Загрузка..."
|
||||
) : !currentEpisode.data ||
|
||||
!currentEpisode.data.Items ||
|
||||
currentEpisode.data.Items.length === 0 ? (
|
||||
"No episodes to watch found"
|
||||
"Нет серий для просмотра"
|
||||
) : (
|
||||
<>
|
||||
Watch S{currentEpisode.data.Items[0].ParentIndexNumber ?? 1}E
|
||||
Смотреть S{currentEpisode.data.Items[0].ParentIndexNumber ?? 1}E
|
||||
{currentEpisode.data.Items[0]?.IndexNumber ?? 1}
|
||||
<MemoizedLinearProgress
|
||||
//@ts-expect-error
|
||||
@@ -363,7 +377,7 @@ const PlayButton = ({
|
||||
(currentEpisode.data?.Items?.[0]?.UserData
|
||||
?.PlaybackPositionTicks ?? 0),
|
||||
)}{" "}
|
||||
left
|
||||
осталось
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
@@ -403,15 +417,7 @@ const PlayButton = ({
|
||||
color="white"
|
||||
size={size}
|
||||
>
|
||||
{item.UserData?.PlaybackPositionTicks
|
||||
? "Continue Watching"
|
||||
: item?.Type === "MusicAlbum" ||
|
||||
item?.Type === "Audio" ||
|
||||
item?.Type === "AudioBook" ||
|
||||
item?.Type === "Playlist" ||
|
||||
audio
|
||||
? "Play Now"
|
||||
: "Watch Now"}
|
||||
{playLabel}
|
||||
<MemoizedLinearProgress
|
||||
//@ts-expect-error
|
||||
value={
|
||||
@@ -437,7 +443,7 @@ const PlayButton = ({
|
||||
(item.RunTimeTicks ?? 0) -
|
||||
(item.UserData?.PlaybackPositionTicks ?? 0),
|
||||
)}{" "}
|
||||
left
|
||||
осталось
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -10,8 +10,8 @@ const QueueButton = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="Queue">
|
||||
<IconButton onClick={() => setOpen(true)} aria-label="Open queue">
|
||||
<Tooltip title="Очередь">
|
||||
<IconButton onClick={() => setOpen(true)} aria-label="Открыть очередь">
|
||||
<span className="material-symbols-rounded">queue_music</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
@@ -86,7 +86,7 @@ const QuickConnectButton = (props: LoadingButtonProps) => {
|
||||
const { AccessToken, User } = result?.data ?? {};
|
||||
if (api && AccessToken && User?.Name && User.Id) {
|
||||
setCheckForQuickConnect(false);
|
||||
enqueueSnackbar(`Logged in as ${User.Name}!`, {
|
||||
enqueueSnackbar(`Вы вошли как ${User.Name}!`, {
|
||||
variant: "success",
|
||||
});
|
||||
createApi(api.basePath, AccessToken);
|
||||
@@ -99,7 +99,7 @@ const QuickConnectButton = (props: LoadingButtonProps) => {
|
||||
}
|
||||
},
|
||||
onError: (error) => {
|
||||
enqueueSnackbar("Error authenticating user.", { variant: "error" });
|
||||
enqueueSnackbar("Не удалось войти.", { variant: "error" });
|
||||
console.error(error);
|
||||
},
|
||||
});
|
||||
@@ -126,7 +126,7 @@ const QuickConnectButton = (props: LoadingButtonProps) => {
|
||||
mutationKey: ["quick-connect-button", "initiate-connection"],
|
||||
mutationFn: async () => {
|
||||
if (!quickConnectEnabled.data?.data) {
|
||||
enqueueSnackbar("Quick Connect is not enabled on server.", {
|
||||
enqueueSnackbar("Quick Connect не включён на сервере.", {
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
@@ -142,7 +142,7 @@ const QuickConnectButton = (props: LoadingButtonProps) => {
|
||||
setCheckForQuickConnect(true);
|
||||
},
|
||||
onError: (error) => {
|
||||
enqueueSnackbar("Error initiating Quick Connect.", { variant: "error" });
|
||||
enqueueSnackbar("Не удалось запустить Quick Connect.", { variant: "error" });
|
||||
console.error(error);
|
||||
},
|
||||
});
|
||||
@@ -182,8 +182,8 @@ const QuickConnectButton = (props: LoadingButtonProps) => {
|
||||
onClick={() => initQuickConnect.mutate()}
|
||||
>
|
||||
{quickConnectEnabled.data?.data
|
||||
? "Use Quick Connect"
|
||||
: "Quick Connect Disabled"}
|
||||
? "Войти через Quick Connect"
|
||||
: "Quick Connect недоступен"}
|
||||
</LoadingButton>
|
||||
<Dialog
|
||||
open={Boolean(quickConnectCode)}
|
||||
@@ -213,22 +213,22 @@ const QuickConnectButton = (props: LoadingButtonProps) => {
|
||||
mb: 2,
|
||||
}}
|
||||
>
|
||||
Quick Connect Code:
|
||||
Код Quick Connect:
|
||||
</Typography>
|
||||
<DialogContentText>
|
||||
Use this code in the Quick Connect tab in your server to login.
|
||||
Введите этот код в разделе Quick Connect на сервере, чтобы войти.
|
||||
</DialogContentText>
|
||||
<div
|
||||
className="flex flex-row"
|
||||
style={{ gap: "1em", alignItems: "center", marginTop: "1em" }}
|
||||
>
|
||||
<Tooltip title="Click to copy" arrow placement="top">
|
||||
<Tooltip title="Нажмите, чтобы скопировать" arrow placement="top">
|
||||
<Typography
|
||||
variant="h3"
|
||||
color="textPrimary"
|
||||
onClick={async () => {
|
||||
quickConnectCode && (await writeText(quickConnectCode));
|
||||
enqueueSnackbar("Quick Connect Code copied!", {
|
||||
enqueueSnackbar("Код Quick Connect скопирован!", {
|
||||
variant: "info",
|
||||
key: "copiedText",
|
||||
});
|
||||
@@ -252,8 +252,7 @@ const QuickConnectButton = (props: LoadingButtonProps) => {
|
||||
variant="body2"
|
||||
sx={{ mt: 2, opacity: 0.75, textAlign: "center" }}
|
||||
>
|
||||
Or scan this code with Blink on your phone to approve the
|
||||
login.
|
||||
Или отсканируйте код в Blink на телефоне, чтобы подтвердить вход.
|
||||
</Typography>
|
||||
<div style={{ marginTop: "1em", background: "#08001f", borderRadius: 12, padding: 8 }}>
|
||||
<QRCodeImage
|
||||
@@ -278,10 +277,10 @@ const QuickConnectButton = (props: LoadingButtonProps) => {
|
||||
onChange={(e) => setRememberUser(e.target.checked)}
|
||||
/>
|
||||
}
|
||||
label="Remember device"
|
||||
label="Запомнить устройство"
|
||||
/>
|
||||
<Button variant="contained" onClick={handleQuickConnectClose}>
|
||||
Close
|
||||
Закрыть
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
Reference in new issue
Block a user