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
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user