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
+2
-2
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="ru">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@@ -57,7 +57,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="app-loading" role="status" aria-label="Loading Blink">
|
||||
<div class="app-loading" role="status" aria-label="Загрузка Blink">
|
||||
<img
|
||||
class="app-loading-logo"
|
||||
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAX8AAACqCAYAAABFwE9PAAAAAXNSR0IArs4c6QAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAABf6ADAAQAAAABAAAAqgAAAAAX35FHAAA3E0lEQVR4Ae2dB/wcRfn/CSGEGgi9hNB7b9IhQAhFQHqTjhRFQRB/gAiIggIK/hWkozQhRIr03nsvIiWUQCD03kNJ/u9PuPt6ue/e3c7sM3u7d/O8Xs/3dmdnPk+Z2Wdnp+y3zySRGnpg/Pjxfbk4KzwQnq7C/fn9HP64wh/y+2afPn3G8RspeiB6IHqgFB7oUwotc1KSYD8Fos6BB8FzwXPCegC0orFkeBEeCT9fw8/xUHiD80jRA9ED0QOF8kBXBX+C+0J4fw14PlgBfnJYPXcF/QHwyvAcsCW9ANgN8I3wbTwMPrEEj1jRA9ED0QM+Hujo4E+w74dT1oO3rfzO7uMkwzJfg3UfrAfBCB4EekuIlMID1KXaKi6Lw2sp3BWzlNgDtHV1SteE1RmdDdbQ85Swhprfgx+Ab+ZeeJPfSFUP4LhJ4SHw6fC7cFFpHIpdDevhFKnGA/hkefhgeAT8CPwO/C38MjxPTdZ4GD3QMR6gbU8GHwZ/ArcixY/jYHVwu5twwvfgE+ExcNnovyi8NzxVt9Yitg+CFfBvhptRfAB0ayPpYLtp8Oq0XtWs4Te4diXpaeYlO8t7GD0APgB+Hu4Eeg8j9oQ7ejiuvhVi7+rw23Baig+AeifG81J7gIZ/fNrGn5Dv9FIb76o8DvgZrGDZiXQHRi3s6pMy5sfOGWCXwF+tbz0A5i6jzVHn6IFaD9CO14Y1jJOFtqrF7NhjPKTecafTlxh4BKzJn44l7MvS43mB8lqOGyl6oJQeoP1OA6sjk5XeAsBp/H/SUnpskkkGl1RvF7W1mewo+FEqtZN7uKu7OKUu7/yc34J/tBoiUvRAGT1wJEpb3N+zgLOMiwPKGvy1VLJbaHEM1TDQPB1qsOzLQhoe0yTxTFlAYtnogbw9QJtdApk/N5S7ggtWWYP/3Rj5uouhJc+rnoEeANqc1jFUsUeb67KSbqIzs4LE8tEDOXvgb8ibzFDmNy5YpQz+bG4Yj5FXuBjaAXk11HU7AVNDHZ1CQwwN2QzfrGuIF6GiB4J5gLaqjadrGgt4zgWvlMG/YuBx/L7rYmwH5NX3hvQAmL4DbJEJGxjbsb8xXoSLHjD3APevdusebwysXv9TLpilDf70/l/BUH03p9toEAYfUXajuQG0MmGYsR0a/okUPVB0DxyEgnqTt6QriYnvuwCWejMRAWQMxlp/iM3Ff+3Kq28ELUllO73mtUvZJLnU3VDSb0q6liFNw4FT4ZcvM2DEotEDwTxAu9fS5JGw9W7+YbR7p/uptD1/nKghkG4M/GqY6jWfqIMS02aBdNcDIFL0QFE98AcUsw78GgG52dXg0gZ/DF3f1dgOy78RD8ANy2gTeqvdbRFA99fo/YwNgBshowcye4B2vzwgO2YG6g3wO9q9c6enzMF/694+6LqUY0pq8WroPXsA3dUDihQ9UFQPnIBi1kPtj4F5vo/BlmtMfeR7leEJqt1seS3rew1Z+n62+GH4LVgTK+JxsHaXKpCJF4KHwFrCNQAOTcvii8E89UeHFmSMH+rBHYO/cUVFOBsPcJ9uCtJaNmgToRzk0+ufCKFMJzjyIDgkvQ/4ybBe05yJcn1hfWL6LPgrOCTt7axgGwvgiD7wa4Ec8n9tNC2Kjh5I9ABtXd/pfyZAm78mUWCnJuJABY+RARwpyG/gk2CzdfRgzVXBDPUQKNVmN3yxGhyKNu/Udh/tKq8HaOz7BGjw+udGi5XXKx6aY/A6ARxZhdzBQ6VURRCwPpzmP/RUdUn7+ykZS/PlT3T9S1rDHPPpK6h5DLWlqu+YKXpAHqBN6qudbzq25TTZR3Sdh/HKFWk845HHa9LEpQLQaXlYn161Jq2ZLzxhtP5b0evWxlfwLiu8A6KCXecB2uZvArX35bI6s1SrfXDi/Bi8cVajG5S/vkG6WTITM48ApiWO35qBfgc0xBgvFJz0DLHKR/oO159I0QNF8QDxSotBfhFAn5uIJY9mxS1V8MfYn8GhdH4yqzPTlKfS7iGf9RLNsmx22z6Njzzy6BtPpZr78LAxFimfB45E5WkCqK3/89E9xFNUY2cfwSFIkyf98/ImsjT7/x9DQ67KS3dfOdjaD9YqqhB0rK9esVz0QAgP0MgXhL8O0Ngvt9I3VC/aSr9anF04CTWh9yI98rG1wkIeI+sb8G80lDGzIVYoKO3IHhgAXHstTguAGyGjB7J4QG/31vuovgLz4CxK1Za1Vq4W2+yYp6d2xf3UDLA30Dm9k4Kn3G8ooQzBP9SQz7U8TF/29SVtSw+kTWHNJ+l+GA0/A99TeUhzGCl6IL0HaFMrknvr9CVS5zyONjkyde5OyIgzh8KhSMsvZ8jbT8hcwdCgj/PW30UedmrITktSQ5DXSicU6Q8fCzfS6x2unQ7P62JrzBs9QJu5FbYm7W3KbWi6MLWI0aGWd6qCNImcOyF3Twk3pMI2DGzcxdDOWqgnfCsOkHNqgZoca//A7+EQE3e+6sdyBfUA7UT7eUJQXp+zKY5n8eK8sCZkQ5D+L25b5j2Qe6GxQbMVp9Ym1gQ7Q/SE5D7NAzkT5bZQYUfS/oSdnYXFAl3jAdqHvj7wiGO7SpP9oq5xYq2heOaPabzjkWcMZdoSMJE7PfyZh87NirTFltq6SjpG4cHwuGaKe17T94H6JclslkaZaeE3PGWq2GHN8OO17vUAbWOrDO2qUVENS+ofwJhTW3q9aa3AaP3Tgz3S5nfM92cmT950LGOVfTeALP+hw0fg6WujRaSdUEoT9tb0/6i/rz1A96NMlgfl0bTLUG3Sw5xYpAgeoE30RY+jA+jye9r5mAC4xYbEodbj4kBOII3jzt0O65HbD35xghZ2f25phy1pZGLic3Zm9iB9yJHzsl/KqNf/Xg+K/4E+ALhJGvtjnu7wAO1hd//m1LDkK1yZIpQHC93zx+hQk7FH8TR9JZRTW+D+iOvztcjjevkh1wJ55Kfhrowc/Y8DazqV+vNZ4aT2ZLGyS728M7BPv5G63AO0Ay220G5ea/oV7fxLa9DC4+HQtWBrGg3glXBbHnrInQoO8WGzrYpYodh6CmxNemtzHrahjFWvv9Yer2WmRayrqJO/B2gQ+9U2CqPjB8EJMVzaY2hbgmCP9OYHIXr92lm7A09T7QptBx2AUOsPm30B5s3tMKaZTBquekPbNcvjee1c6s9nrsaq11+r9g61J/G4+zxAO9ewzCEBLD+Kdj4+AG6xIXHoXLDGVa3p1HZZjiFzw9YrfOSfv7fLpmZy0SvEyge1iQWayU26RpkQvX5gx8d/G5nk8C5Kow3sr4ZgTC+BF7xjHlyAZzv4CeWsx1P1XYzjPPWxKPYXQCxX+FR1Oq16ULDfEGvi/0VvyCfghuj1y92DuEmDvpoXrE6jOjUeoO7V6zf71k4N9MG083aNTtSokfOhHAq/C1vTCTmb0iMOQza2NqaC90iPkAIdoNsscIgvGi7taiZ6hOr1V6pgwjfbXdWK+TvAAzSAEGP9ub3JF7Hnrw+AzWjcNt4G77fGmKngaCAa+1avPwQVtdevsfDJjA3WB9ye8MAM1euvqmKxeqiKFX9L4gHua/3r1F8aq7srbXx3Y8zywOHUx2Br2q1dHsCQg62NqeDpw2NTt8uuZnLR69EANq/ZTGbSNXQI3euXmdYT+EmmxLSCeYB630uVb0jayWs91F0wrzVRB+NXN3RmFeoRDtoyLovcWeGPq4oY/+7fxJVtu4SNSxrbKbgHfQyi3DEBdKmF1GcrrN9wfEyNZXL0AHWujZqjYEsy+yctaV1RtGGfEN/s/wWvUu1aMvV7KmLatJXhkG8Uedu2cqmFnru2uO5z+U+uhbgr16JMiMm4WlWeoW1p+XCk7vKAFjPMY2zyxcZ45YHjZp0d/sryUQrWte3yALKXg0N9jbSQ68uxd3L4bdiStOzN6XWY/DPC+vBbaDq8Xe0rym2PB2hQk8HWn2d5C0zNIeRKRer5743lzl9pbOGto1tcD3KZipwS4PPgEP59FNyLgiieHVT/Ecv6v4rpA27fOqqmJb1BvoRYp8fwuvN42vke0MbF+YzNPJs2rqXo3UcES42hWX/24LZ2eRJbzoRD0dB22dVKLgZfb2y0/uG786Q2ZZ4w1iMJrpDfU2pVR/F6Ng/QEPTZBUvS6MDc2bTyKx2iZ+qjyZYUsl41cayPIlnLUJHbgvGjrDgNyl9ND6Fwn3KQrtg9mJ/1Gujtm3wa9n7mUVibb0LT+aEFRPxieYA2vgoarWis1XW08VeMMVPBFSX4W0/0Pof1N6bygGEmGodeB88whKyF+oiTfWoTCnas5bSW7UmvwSd52vi+Z7m0xZ4kY1En3NPaEPO5eyDECrvT3dWwKWF5s3ppRMBchoKreRVuXOhknqbjG1+2v4Id+r68lmvpNwQdiE2F/KcO2K52tLux0Rdg7xuemArOoUire7QZx+cfyYTSKeIG9gBtXHNIGqGwpFcBa9uilLYHf4y37vV/Aua5ljXUCouGoZn6y+ClWuX1vH4DwSa3bd8eOmq4R8M+VjQOoCzfYbrPSpEEnGOoi8cS0mNSZ3tA3xuz3tNxFm3JdTFDZ3iZoDkQ/hy2pFDDLolOR3H90+YLLA2ow9ImsbkShRckEf0urdM562mmNc8Inwb+JKsSCeUfJ816RVpBajGq0cgD1Lm+N6Yd9Zakb1/N0UhmHunt7vnvgZFaFmlJZ1uCpcD6A3l+mCKfb5aD6B3o9bCQRAOeDcU2MVbu+Cx4+OtTyl+YBSOh7Aek7Qh2HO5JcE6HJ+2AfTMZ2ziCtvS6MWY54Agak8LWmyWeytN69N8XDklX5WmPjyLine truncated
|
||||
|
||||
@@ -37,7 +37,7 @@ export default function AddServerDialog(props: AddServerDialogProps) {
|
||||
await setServer(bestServer.systemInfo?.Id ?? "", bestServer);
|
||||
setAddServerDialog(false);
|
||||
enqueueSnackbar(
|
||||
"Client added successfully. You might need to refresh client list.",
|
||||
"Сервер добавлен. Возможно, потребуется обновить список серверов.",
|
||||
{
|
||||
variant: "success",
|
||||
},
|
||||
@@ -50,11 +50,11 @@ export default function AddServerDialog(props: AddServerDialogProps) {
|
||||
onError: (err) => {
|
||||
console.error(err);
|
||||
enqueueSnackbar(`${err}`, { variant: "error" });
|
||||
enqueueSnackbar("Something went wrong", { variant: "error" });
|
||||
enqueueSnackbar("Что-то пошло не так", { variant: "error" });
|
||||
},
|
||||
onSettled: async (bestServer) => {
|
||||
if (!bestServer) {
|
||||
enqueueSnackbar("Provided server address is not a Jellyfin server.", {
|
||||
enqueueSnackbar("Указанный адрес не является сервером Jellyfin.", {
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
@@ -112,7 +112,7 @@ export default function AddServerDialog(props: AddServerDialogProps) {
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
Connect to Server
|
||||
Подключиться к серверу
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="body2"
|
||||
@@ -121,7 +121,7 @@ export default function AddServerDialog(props: AddServerDialogProps) {
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
Enter your Jellyfin server address to continue
|
||||
Введите адрес сервера Jellyfin, чтобы продолжить
|
||||
</Typography>
|
||||
</Stack>
|
||||
|
||||
@@ -174,7 +174,7 @@ export default function AddServerDialog(props: AddServerDialogProps) {
|
||||
variant="text"
|
||||
sx={{ borderRadius: 2 }}
|
||||
>
|
||||
Cancel
|
||||
Отмена
|
||||
</Button>
|
||||
<LoadingButton
|
||||
loading={addServer.isPending}
|
||||
@@ -184,7 +184,7 @@ export default function AddServerDialog(props: AddServerDialogProps) {
|
||||
sx={{ borderRadius: 2, px: 3 }}
|
||||
disabled={!serverIp}
|
||||
>
|
||||
Connect
|
||||
Подключиться
|
||||
</LoadingButton>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
@@ -45,7 +45,7 @@ export default function AlbumMusicTrack(props: AlbumMusicTrackProps) {
|
||||
) => {
|
||||
if (!user?.Id || !api) {
|
||||
console.error("User not logged in");
|
||||
enqueueSnackbar("You need to be logged in to play music", {
|
||||
enqueueSnackbar("Войдите, чтобы слушать музыку", {
|
||||
variant: "error",
|
||||
});
|
||||
return;
|
||||
@@ -96,7 +96,7 @@ export default function AlbumMusicTrack(props: AlbumMusicTrackProps) {
|
||||
fontWeight: 300,
|
||||
}}
|
||||
>
|
||||
{track.HasLyrics && <img src={lyricsIcon} alt="lyrics" />}
|
||||
{track.HasLyrics && <img src={lyricsIcon} alt="Текст песни" />}
|
||||
{track.Artists?.join(", ")}
|
||||
</Typography>
|
||||
</div>
|
||||
|
||||
@@ -19,11 +19,11 @@ export const AlphaSelector = React.memo(function AlphaSelector() {
|
||||
const arr = Array.from({ length: 26 }, (_, i) =>
|
||||
String.fromCharCode(65 + i),
|
||||
);
|
||||
return ["All", ...arr];
|
||||
return ["Все", ...arr];
|
||||
}, []);
|
||||
|
||||
const handleSelect = (letter: string) => {
|
||||
const value = letter === "All" ? undefined : letter;
|
||||
const value = letter === "Все" ? undefined : letter;
|
||||
if (currentLibraryId)
|
||||
updateLibrary(currentLibraryId, { nameStartsWith: value });
|
||||
};
|
||||
@@ -31,13 +31,13 @@ export const AlphaSelector = React.memo(function AlphaSelector() {
|
||||
return (
|
||||
<div className="alpha-selector">
|
||||
{letters.map((l) => {
|
||||
const active = (nameStartsWith || "All") === l;
|
||||
const active = (nameStartsWith || "Все") === l;
|
||||
return (
|
||||
<button
|
||||
key={l}
|
||||
className={active ? "alpha-letter active" : "alpha-letter"}
|
||||
onClick={() => handleSelect(l)}
|
||||
aria-label={`Filter by ${l}`}
|
||||
aria-label={`Фильтр по букве ${l}`}
|
||||
type="button"
|
||||
>
|
||||
{l}
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
z-index: 999 !important;
|
||||
top: 0 !important;
|
||||
|
||||
// Keep the left controls clear of the macOS traffic lights.
|
||||
// Keep the left controls clear of the macOS traffic lights and put the
|
||||
// header row on the same level as them.
|
||||
html.is-macos & {
|
||||
padding-top: 0.6rem;
|
||||
padding-left: calc(#{$page-margin} - 1.7em + 72px);
|
||||
}
|
||||
|
||||
|
||||
@@ -76,9 +76,9 @@ const AppBarContent = () => {
|
||||
|
||||
const fallbackTitle = (() => {
|
||||
const path = location.pathname;
|
||||
if (path === "/favorite") return "Favorites";
|
||||
if (path.startsWith("/music/")) return "Music";
|
||||
if (path.startsWith("/player/audio")) return "Now Playing";
|
||||
if (path === "/favorite") return "Избранное";
|
||||
if (path.startsWith("/music/")) return "Музыка";
|
||||
if (path.startsWith("/player/audio")) return "Сейчас играет";
|
||||
return "";
|
||||
})();
|
||||
const title = pageTitle || fallbackTitle;
|
||||
@@ -100,14 +100,14 @@ const AppBarContent = () => {
|
||||
data-tauri-drag-region
|
||||
style={{ gap: "0.6em" }}
|
||||
>
|
||||
<Tooltip title="Open navigation">
|
||||
<IconButton onClick={handleDrawerOpen} aria-label="Open navigation">
|
||||
<Tooltip title="Открыть меню">
|
||||
<IconButton onClick={handleDrawerOpen} aria-label="Открыть меню">
|
||||
<span className="material-symbols-rounded">menu</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<MemoizeBackButton />
|
||||
<Tooltip title="Home">
|
||||
<IconButton onClick={handleNavigateToHome} aria-label="Home">
|
||||
<Tooltip title="Главная">
|
||||
<IconButton onClick={handleNavigateToHome} aria-label="Главная">
|
||||
<span
|
||||
className={
|
||||
location.pathname === "/home"
|
||||
@@ -132,24 +132,24 @@ const AppBarContent = () => {
|
||||
data-tauri-drag-region
|
||||
style={{ gap: "0.6em" }}
|
||||
>
|
||||
<Tooltip title="Watch together">
|
||||
<Tooltip title="Смотреть вместе">
|
||||
<IconButton
|
||||
onClick={openSyncPlayDialog}
|
||||
aria-label="Watch together"
|
||||
aria-label="Смотреть вместе"
|
||||
>
|
||||
<span className="material-symbols-rounded">groups</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<CastButton />
|
||||
<Tooltip title="Search">
|
||||
<IconButton onClick={toggleSearchDialog} aria-label="Search">
|
||||
<Tooltip title="Поиск">
|
||||
<IconButton onClick={toggleSearchDialog} aria-label="Поиск">
|
||||
<span className="material-symbols-rounded">search</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Tooltip title="Favorites">
|
||||
<Tooltip title="Избранное">
|
||||
<IconButton
|
||||
onClick={handleNavigateToFavorite}
|
||||
aria-label="Favorites"
|
||||
aria-label="Избранное"
|
||||
>
|
||||
<span className="material-symbols-rounded">favorite</span>
|
||||
</IconButton>
|
||||
|
||||
@@ -23,7 +23,7 @@ export default function AppBarBackOnly() {
|
||||
edge="start"
|
||||
//@ts-ignore
|
||||
color="white"
|
||||
aria-label="back"
|
||||
aria-label="Назад"
|
||||
disabled={history.length <= 1}
|
||||
onClick={handleBack}
|
||||
sx={{ mr: 2 }}
|
||||
|
||||
@@ -63,7 +63,7 @@ export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => {
|
||||
<ListItem>
|
||||
<ListItemButton onClick={onClose}>
|
||||
<span className="material-symbols-rounded">menu_open</span>
|
||||
<div style={{ marginLeft: "8px" }}>Close</div>
|
||||
<div style={{ marginLeft: "8px" }}>Закрыть</div>
|
||||
</ListItemButton>
|
||||
</ListItem>
|
||||
</List>
|
||||
@@ -72,14 +72,14 @@ export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => {
|
||||
variant="overline"
|
||||
sx={{ display: "block", px: 2, pt: 1.5, opacity: 0.55 }}
|
||||
>
|
||||
Browse
|
||||
Обзор
|
||||
</Typography>
|
||||
<List>
|
||||
<ListItemLink
|
||||
className="library-drawer-item"
|
||||
to="/home"
|
||||
icon="home"
|
||||
primary="Home"
|
||||
primary="Главная"
|
||||
onClick={onClose}
|
||||
/>
|
||||
<ListItemLink
|
||||
@@ -87,14 +87,14 @@ export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => {
|
||||
to="/search"
|
||||
search={{ query: "" }}
|
||||
icon="search"
|
||||
primary="Search"
|
||||
primary="Поиск"
|
||||
onClick={onClose}
|
||||
/>
|
||||
<ListItemLink
|
||||
className="library-drawer-item"
|
||||
to="/favorite"
|
||||
icon="favorite"
|
||||
primary="Favorites"
|
||||
primary="Избранное"
|
||||
onClick={onClose}
|
||||
/>
|
||||
{libraries.isSuccess &&
|
||||
@@ -107,7 +107,7 @@ export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => {
|
||||
icon={
|
||||
library.CollectionType && getTypeIcon(library.CollectionType)
|
||||
}
|
||||
primary={library.Name ?? "Library"}
|
||||
primary={library.Name ?? "Библиотека"}
|
||||
onClick={onClose}
|
||||
/>
|
||||
))}
|
||||
@@ -117,27 +117,27 @@ export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => {
|
||||
variant="overline"
|
||||
sx={{ display: "block", px: 2, pt: 1.5, opacity: 0.55 }}
|
||||
>
|
||||
Settings
|
||||
Настройки
|
||||
</Typography>
|
||||
<List>
|
||||
<ListItemLink
|
||||
to="/settings/preferences"
|
||||
icon="settings"
|
||||
primary="Settings"
|
||||
primary="Настройки"
|
||||
className="library-drawer-item"
|
||||
onClick={onClose}
|
||||
/>
|
||||
<ListItemLink
|
||||
to="/settings/changeServer"
|
||||
icon="dns"
|
||||
primary="Change Server"
|
||||
primary="Сменить сервер"
|
||||
className="library-drawer-item"
|
||||
onClick={onClose}
|
||||
/>
|
||||
<ListItemLink
|
||||
to="/settings/about"
|
||||
icon="info"
|
||||
primary="About"
|
||||
primary="О приложении"
|
||||
className="library-drawer-item"
|
||||
onClick={onClose}
|
||||
/>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -37,7 +37,7 @@ const trendingImageUrl = (
|
||||
const trendingLabel = (item: BaseItemDto): string => {
|
||||
const genre = item.Genres?.[0];
|
||||
if (genre) return genre.charAt(0).toUpperCase() + genre.slice(1);
|
||||
return item.Type === BaseItemKind.Series ? "Series" : "Movie";
|
||||
return item.Type === BaseItemKind.Series ? "Сериал" : "Фильм";
|
||||
};
|
||||
|
||||
const Carousel = ({
|
||||
@@ -97,7 +97,7 @@ const Carousel = ({
|
||||
<section
|
||||
className={`cinema-hero ${isPaused ? "paused" : ""}`}
|
||||
aria-roledescription="carousel"
|
||||
aria-label="Featured"
|
||||
aria-label="Рекомендуемое"
|
||||
onMouseEnter={() => setIsPaused(true)}
|
||||
onMouseLeave={() => setIsPaused(false)}
|
||||
>
|
||||
@@ -108,7 +108,7 @@ const Carousel = ({
|
||||
type="button"
|
||||
className="cinema-arrow right"
|
||||
onClick={next}
|
||||
aria-label="Next"
|
||||
aria-label="Далее"
|
||||
>
|
||||
<span className="material-symbols-rounded">chevron_right</span>
|
||||
</button>
|
||||
@@ -116,7 +116,7 @@ const Carousel = ({
|
||||
|
||||
<div className="cinema-trending">
|
||||
<div className="cinema-trending-head">
|
||||
<h3>Trending now</h3>
|
||||
<h3>В тренде</h3>
|
||||
{total > 1 && (
|
||||
<div className="cinema-dots">
|
||||
{content.map((item, index) => (
|
||||
@@ -143,7 +143,7 @@ const Carousel = ({
|
||||
index === currentSlide ? "active" : ""
|
||||
}`}
|
||||
onClick={() => goTo(index)}
|
||||
aria-label={item.Name ?? "Featured item"}
|
||||
aria-label={item.Name ?? "Рекомендуемое"}
|
||||
>
|
||||
{imageUrl ? (
|
||||
<img
|
||||
|
||||
@@ -146,10 +146,10 @@ const CarouselSlide = ({ item }: { item: BaseItemDto }) => {
|
||||
>
|
||||
<span className="hero-carousel-label">
|
||||
{item.UserData?.PlaybackPositionTicks
|
||||
? "Continue watching"
|
||||
? "Продолжить просмотр"
|
||||
: item.Type === BaseItemKind.Series
|
||||
? "New series"
|
||||
: "New movie"}
|
||||
? "Новый сериал"
|
||||
: "Новый фильм"}
|
||||
</span>
|
||||
</MotionStack>
|
||||
<MotionTypography
|
||||
@@ -315,7 +315,7 @@ const CarouselSlide = ({ item }: { item: BaseItemDto }) => {
|
||||
}
|
||||
onClick={handleMoreInfo}
|
||||
>
|
||||
More info
|
||||
Подробнее
|
||||
</Button>
|
||||
<Stack
|
||||
direction="row"
|
||||
|
||||
@@ -27,15 +27,15 @@ import { useLibraryStateStore } from "@/utils/store/libraryState";
|
||||
const route = getRouteApi("/_api/library/$id");
|
||||
|
||||
const FILTER_LABELS: Record<FILTERS, string> = {
|
||||
isPlayed: "Played",
|
||||
isUnPlayed: "Unplayed",
|
||||
isResumable: "Resumable",
|
||||
isFavorite: "Favorite",
|
||||
hasSubtitles: "Has Subtitles",
|
||||
hasTrailer: "Has Trailer",
|
||||
hasSpecialFeature: "Special Feature",
|
||||
hasThemeSong: "Theme Song",
|
||||
hasThemeVideo: "Theme Video",
|
||||
isPlayed: "Просмотрено",
|
||||
isUnPlayed: "Не просмотрено",
|
||||
isResumable: "Можно продолжить",
|
||||
isFavorite: "Избранное",
|
||||
hasSubtitles: "Есть субтитры",
|
||||
hasTrailer: "Есть трейлер",
|
||||
hasSpecialFeature: "Дополнительные материалы",
|
||||
hasThemeSong: "Тематическая песня",
|
||||
hasThemeVideo: "Тематическое видео",
|
||||
isSD: "SD",
|
||||
isHD: "HD",
|
||||
is4K: "4K",
|
||||
@@ -173,7 +173,7 @@ export const FiltersDialog: React.FC<FiltersDialogProps> = React.memo(
|
||||
paper: { className: "glass-dialog-paper" },
|
||||
}}
|
||||
>
|
||||
<DialogTitle>Filters</DialogTitle>
|
||||
<DialogTitle>Фильтры</DialogTitle>
|
||||
<DialogContent
|
||||
dividers
|
||||
sx={{ borderColor: "rgba(255, 255, 255, 0.1)" }}
|
||||
@@ -200,7 +200,7 @@ export const FiltersDialog: React.FC<FiltersDialogProps> = React.memo(
|
||||
<span className="material-symbols-rounded">expand_more</span>
|
||||
}
|
||||
>
|
||||
<Typography variant="subtitle2">General</Typography>
|
||||
<Typography variant="subtitle2">Общие</Typography>
|
||||
</AccordionSummary>
|
||||
<AccordionDetails sx={{ px: 1.5, py: 1.25 }}>
|
||||
<FormGroup>
|
||||
@@ -252,7 +252,7 @@ export const FiltersDialog: React.FC<FiltersDialogProps> = React.memo(
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<Typography variant="subtitle2">Video features</Typography>
|
||||
<Typography variant="subtitle2">Видео</Typography>
|
||||
</AccordionSummary>
|
||||
<AccordionDetails sx={{ px: 1.5, py: 1.25 }}>
|
||||
<FormGroup>
|
||||
@@ -306,7 +306,7 @@ export const FiltersDialog: React.FC<FiltersDialogProps> = React.memo(
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<Typography variant="subtitle2">Resolution</Typography>
|
||||
<Typography variant="subtitle2">Разрешение</Typography>
|
||||
</AccordionSummary>
|
||||
<AccordionDetails sx={{ px: 1.5, py: 1.25 }}>
|
||||
<FormGroup>
|
||||
@@ -354,7 +354,7 @@ export const FiltersDialog: React.FC<FiltersDialogProps> = React.memo(
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<Typography variant="subtitle2">Media type</Typography>
|
||||
<Typography variant="subtitle2">Тип медиа</Typography>
|
||||
</AccordionSummary>
|
||||
<AccordionDetails sx={{ px: 1.5, py: 1.25 }}>
|
||||
<FormGroup>
|
||||
@@ -374,7 +374,17 @@ export const FiltersDialog: React.FC<FiltersDialogProps> = React.memo(
|
||||
size="small"
|
||||
/>
|
||||
}
|
||||
label={k}
|
||||
label={
|
||||
k === "VideoFile"
|
||||
? "Видеофайл"
|
||||
: k === "BluRay"
|
||||
? "Blu-ray"
|
||||
: k === "Dvd"
|
||||
? "DVD"
|
||||
: k === "Iso"
|
||||
? "ISO"
|
||||
: k
|
||||
}
|
||||
/>
|
||||
),
|
||||
)}
|
||||
@@ -405,7 +415,7 @@ export const FiltersDialog: React.FC<FiltersDialogProps> = React.memo(
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<Typography variant="subtitle2">Genres</Typography>
|
||||
<Typography variant="subtitle2">Жанры</Typography>
|
||||
</AccordionSummary>
|
||||
<AccordionDetails sx={{ px: 1.5, py: 1.25 }}>
|
||||
<FormGroup>
|
||||
@@ -440,7 +450,7 @@ export const FiltersDialog: React.FC<FiltersDialogProps> = React.memo(
|
||||
color="inherit"
|
||||
disabled={Object.keys(localFilters).length === 0}
|
||||
>
|
||||
Clear
|
||||
Сбросить
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
@@ -451,11 +461,11 @@ export const FiltersDialog: React.FC<FiltersDialogProps> = React.memo(
|
||||
color="inherit"
|
||||
disabled={!dirty}
|
||||
>
|
||||
Reset
|
||||
Сбросить всё
|
||||
</Button>
|
||||
<Button onClick={onClose}>Cancel</Button>
|
||||
<Button onClick={onClose}>Отмена</Button>
|
||||
<Button onClick={apply} disabled={!dirty} variant="contained">
|
||||
Apply
|
||||
Применить
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
@@ -488,11 +498,11 @@ export const FiltersDialogTrigger: React.FC = () => {
|
||||
return (
|
||||
<>
|
||||
<Tooltip
|
||||
title={activeCount ? `${activeCount} active filters` : "Filters"}
|
||||
title={activeCount ? `${activeCount} активных фильтров` : "Фильтры"}
|
||||
>
|
||||
<IconButton
|
||||
onClick={() => setOpen(true)}
|
||||
aria-label="Open filters dialog"
|
||||
aria-label="Открыть фильтры"
|
||||
>
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
|
||||
@@ -54,7 +54,7 @@ const formatTime = (ticks: number) => {
|
||||
};
|
||||
|
||||
const deviceLabel = (session: SessionInfoDto) =>
|
||||
session.DeviceName || session.Client || "another device";
|
||||
session.DeviceName || session.Client || "другое устройство";
|
||||
|
||||
const posterId = (item: BaseItemDto) =>
|
||||
item.ImageTags?.Primary ? item.Id : (item.SeriesId ?? item.Id);
|
||||
@@ -167,13 +167,13 @@ const FollowMe = () => {
|
||||
if (kind === "video") navigate({ to: "/player" });
|
||||
if (kind === "audio") navigate({ to: "/player/audio" });
|
||||
if (kind !== "none") {
|
||||
enqueueSnackbar(`Continuing from ${deviceLabel(candidate.session)}`, {
|
||||
enqueueSnackbar(`Продолжаем с ${deviceLabel(candidate.session)}`, {
|
||||
variant: "success",
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Follow-me transfer failed", error);
|
||||
enqueueSnackbar("Could not continue playback here", {
|
||||
enqueueSnackbar("Не удалось продолжить воспроизведение здесь", {
|
||||
variant: "error",
|
||||
});
|
||||
} finally {
|
||||
@@ -230,10 +230,10 @@ const FollowMe = () => {
|
||||
variant="overline"
|
||||
sx={{ lineHeight: 1.2, opacity: 0.65, letterSpacing: 0.8 }}
|
||||
>
|
||||
{paused ? "Paused on" : "Playing on"} {deviceLabel(session)}
|
||||
{paused ? "Пауза на" : "Идёт на"} {deviceLabel(session)}
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" noWrap sx={{ fontWeight: 700 }}>
|
||||
{item.SeriesName ?? item.Name ?? "Continue watching"}
|
||||
{item.SeriesName ?? item.Name ?? "Продолжить просмотр"}
|
||||
</Typography>
|
||||
<Typography variant="caption" noWrap sx={{ opacity: 0.65 }}>
|
||||
{item.SeriesName && item.Name ? `${item.Name} · ` : ""}
|
||||
@@ -247,21 +247,21 @@ const FollowMe = () => {
|
||||
disabled={transferring}
|
||||
sx={{ textTransform: "none", borderRadius: "999px" }}
|
||||
>
|
||||
{transferring ? "Starting…" : "Continue here"}
|
||||
{transferring ? "Запуск…" : "Продолжить здесь"}
|
||||
</Button>
|
||||
<Button
|
||||
size="small"
|
||||
onClick={() => dismiss(candidate.key)}
|
||||
sx={{ textTransform: "none", borderRadius: "999px", opacity: 0.7 }}
|
||||
>
|
||||
Not now
|
||||
Не сейчас
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
<Tooltip title="Dismiss">
|
||||
<Tooltip title="Скрыть">
|
||||
<IconButton
|
||||
size="small"
|
||||
aria-label="Dismiss continue prompt"
|
||||
aria-label="Скрыть предложение"
|
||||
onClick={() => dismiss(candidate.key)}
|
||||
sx={{ alignSelf: "flex-start", opacity: 0.55 }}
|
||||
>
|
||||
|
||||
@@ -7,10 +7,10 @@ import { getTypeIcon } from "@/components/utils/iconsCollection";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
|
||||
const groups = [
|
||||
{ type: "Actor", title: "Actors" },
|
||||
{ type: "Writer", title: "Writers" },
|
||||
{ type: "Director", title: "Directors" },
|
||||
{ type: "Producer", title: "Producers" },
|
||||
{ type: "Actor", title: "Актёры" },
|
||||
{ type: "Writer", title: "Сценаристы" },
|
||||
{ type: "Director", title: "Режиссёры" },
|
||||
{ type: "Producer", title: "Продюсеры" },
|
||||
] as const;
|
||||
|
||||
type CastAndCrewProps = {
|
||||
@@ -33,7 +33,7 @@ const CastAndCrew = ({ people, api }: CastAndCrewProps) => {
|
||||
return (
|
||||
<div className="item-detail-cast">
|
||||
<Typography variant="h5" sx={{ mb: 2 }}>
|
||||
Cast & Crew
|
||||
Актёры и команда
|
||||
</Typography>
|
||||
{grouped.map(
|
||||
(group) =>
|
||||
|
||||
@@ -118,7 +118,7 @@ export const TrackSelectors = ({
|
||||
<>
|
||||
{tracks.video.length > 0 && (
|
||||
<TextField
|
||||
label="Video"
|
||||
label="Видео"
|
||||
select
|
||||
style={{ width: "100%", marginBottom: "1em" }}
|
||||
value={selection.video}
|
||||
@@ -134,7 +134,7 @@ export const TrackSelectors = ({
|
||||
)}
|
||||
{tracks.audio.length > 0 && (
|
||||
<TextField
|
||||
label="Audio"
|
||||
label="Аудио"
|
||||
select
|
||||
style={{ width: "100%", marginBottom: "1em" }}
|
||||
value={selection.audio}
|
||||
@@ -150,7 +150,7 @@ export const TrackSelectors = ({
|
||||
)}
|
||||
{tracks.subtitle.length > 0 && (
|
||||
<TextField
|
||||
label="Subtitle"
|
||||
label="Субтитры"
|
||||
select
|
||||
style={{ width: "100%" }}
|
||||
value={selection.subtitle}
|
||||
@@ -159,7 +159,7 @@ export const TrackSelectors = ({
|
||||
onChange={(e) => setSelection({ subtitle: Number(e.target.value) })}
|
||||
>
|
||||
<MenuItem key={-1} value={-1}>
|
||||
No Subtitle
|
||||
Без субтитров
|
||||
</MenuItem>
|
||||
{tracks.subtitle.map((track) => (
|
||||
<MenuItem key={track.Index} value={track.Index}>
|
||||
|
||||
@@ -19,8 +19,8 @@ export const getItemCardCaption = (item: BaseItemDto) => {
|
||||
}
|
||||
if (item.Type === BaseItemKind.Series) {
|
||||
const end = item.EndDate
|
||||
? new Date(item.EndDate).toLocaleString([], { year: "numeric" })
|
||||
: "Present";
|
||||
? new Date(item.EndDate).toLocaleString("ru-RU", { year: "numeric" })
|
||||
: "н.в.";
|
||||
return `${item.ProductionYear} - ${end}`;
|
||||
}
|
||||
return item.ProductionYear;
|
||||
@@ -38,7 +38,7 @@ const SimilarItems = ({ item }: { item: BaseItemDto }) => {
|
||||
|
||||
return (
|
||||
<CardScroller
|
||||
title="You might also like"
|
||||
title="Вам может понравиться"
|
||||
displayCards={7}
|
||||
disableDecoration
|
||||
>
|
||||
|
||||
@@ -24,7 +24,7 @@ const UpcomingEpisodes = ({ episode }: { episode: BaseItemDto }) => {
|
||||
if (!upcomingEpisodes.data?.Items?.length) return null;
|
||||
|
||||
return (
|
||||
<CardScroller title="Upcoming Episodes" displayCards={4} disableDecoration>
|
||||
<CardScroller title="Будущие серии" displayCards={4} disableDecoration>
|
||||
{upcomingEpisodes.data.Items.map((upcoming) => (
|
||||
<Card
|
||||
key={upcoming.Id}
|
||||
|
||||
@@ -53,19 +53,19 @@ const PersonView = ({ item }: { item: BaseItemDto }) => {
|
||||
<>
|
||||
{item.PremiereDate && (
|
||||
<div>
|
||||
<Typography variant="h6">Birth</Typography>
|
||||
<Typography variant="h6">Дата рождения</Typography>
|
||||
<Typography variant="subtitle1" sx={{ opacity: 0.8 }}>
|
||||
{new Date(item.PremiereDate).toDateString()}
|
||||
{new Date(item.PremiereDate).toLocaleDateString("ru-RU")}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
{item.EndDate && (
|
||||
<div>
|
||||
<Typography variant="h6" sx={{ mt: 2 }}>
|
||||
Death
|
||||
Дата смерти
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" sx={{ opacity: 0.8 }}>
|
||||
{new Date(item.EndDate).toDateString()}
|
||||
{new Date(item.EndDate).toLocaleDateString("ru-RU")}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -36,7 +36,7 @@ import ItemDetailLayout, { ExternalLinks } from "../itemDetailLayout";
|
||||
import SimilarItems from "../similarItems";
|
||||
|
||||
const getEpisodeDateString = (date: Date) =>
|
||||
new Intl.DateTimeFormat(navigator.language ?? "en-US", {
|
||||
new Intl.DateTimeFormat("ru-RU", {
|
||||
dateStyle: "full",
|
||||
}).format(date);
|
||||
|
||||
@@ -339,7 +339,7 @@ const SeriesView = ({ item }: { item: BaseItemDto }) => {
|
||||
<CastAndCrew people={item.People} api={api} />
|
||||
{(specialFeatures.data?.length ?? 0) > 0 && (
|
||||
<CardScroller
|
||||
title="Special Features"
|
||||
title="Дополнительные материалы"
|
||||
displayCards={7}
|
||||
disableDecoration
|
||||
>
|
||||
|
||||
@@ -55,7 +55,7 @@ export const ArtistAlbum = ({ user, album, boxProps }: ArtistAlbumProps) => {
|
||||
{!!album.ImageTags?.Primary && (
|
||||
<div className="album-image">
|
||||
<img
|
||||
alt={album.Name ?? "Album Image"}
|
||||
alt={album.Name ?? "Обложка альбома"}
|
||||
src={`${api?.basePath}/Items/${album.Id}/Images/Primary?fillHeight=532&fillWidth=532&quality=96`}
|
||||
style={{
|
||||
width: "100%",
|
||||
@@ -150,8 +150,8 @@ export const ArtistAlbum = ({ user, album, boxProps }: ArtistAlbumProps) => {
|
||||
<div>
|
||||
<div className="item-info-track header">
|
||||
<span className="material-symbols-rounded index">tag</span>
|
||||
<Typography variant="subtitle1">Title</Typography>
|
||||
<Typography variant="subtitle1">Duration</Typography>
|
||||
<Typography variant="subtitle1">Название</Typography>
|
||||
<Typography variant="subtitle1">Длительность</Typography>
|
||||
</div>
|
||||
{albumTracks.data?.Items?.map((track, index) => (
|
||||
<AlbumMusicTrack
|
||||
|
||||
@@ -45,14 +45,14 @@ export const LatestMediaSection = ({
|
||||
item.Type === BaseItemKind.Episode
|
||||
? `S${item.ParentIndexNumber ?? 0}:E${
|
||||
item.IndexNumber ?? 0
|
||||
} - ${item.Name ?? "Unknown"}`
|
||||
} - ${item.Name ?? "Неизвестно"}`
|
||||
: item.Type === BaseItemKind.Series
|
||||
? `${item.ProductionYear} - ${
|
||||
item.EndDate
|
||||
? new Date(item.EndDate).toLocaleString([], {
|
||||
? new Date(item.EndDate).toLocaleString("ru-RU", {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
: "н.в."
|
||||
}`
|
||||
: item.ProductionYear
|
||||
}
|
||||
|
||||
@@ -272,16 +272,16 @@ export const LibraryHeader = () => {
|
||||
<div className="flex flex-row" data-tauri-drag-region style={{ gap: "0.6em" }}>
|
||||
<IconButton
|
||||
onClick={handleDrawerOpen}
|
||||
aria-label="Open navigation"
|
||||
title="Open navigation"
|
||||
aria-label="Открыть меню"
|
||||
title="Открыть меню"
|
||||
>
|
||||
<div className="material-symbols-rounded">menu</div>
|
||||
</IconButton>
|
||||
<MemoizeBackButton />
|
||||
<IconButton
|
||||
onClick={handleNavigateToHome}
|
||||
aria-label="Home"
|
||||
title="Home"
|
||||
aria-label="Главная"
|
||||
title="Главная"
|
||||
>
|
||||
<div
|
||||
className={
|
||||
@@ -300,7 +300,7 @@ export const LibraryHeader = () => {
|
||||
>
|
||||
<div
|
||||
className="library-title-count flex flex-row flex-align-center"
|
||||
title={`${libraryName}${typeof totalCount === "number" ? ` · ${totalCount.toLocaleString()} items` : ""}`}
|
||||
title={`${libraryName}${typeof totalCount === "number" ? ` · ${totalCount.toLocaleString()} элементов` : ""}`}
|
||||
>
|
||||
<Typography variant="subtitle1" noWrap align="center">
|
||||
{libraryName}
|
||||
@@ -324,7 +324,7 @@ export const LibraryHeader = () => {
|
||||
>
|
||||
<MenuItem disabled value="">
|
||||
<Typography variant="overline" color="textSecondary">
|
||||
View
|
||||
Вид
|
||||
</Typography>
|
||||
</MenuItem>
|
||||
{compatibleViews.map((v) => (
|
||||
@@ -335,7 +335,7 @@ export const LibraryHeader = () => {
|
||||
</TextField>
|
||||
<IconButton
|
||||
onClick={handleSortAscendingToggle}
|
||||
aria-label="Toggle sort order"
|
||||
aria-label="Изменить порядок сортировки"
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded"
|
||||
@@ -362,7 +362,7 @@ export const LibraryHeader = () => {
|
||||
>
|
||||
<MenuItem disabled value="">
|
||||
<Typography variant="overline" color="textSecondary">
|
||||
Sort By
|
||||
Сортировка
|
||||
</Typography>
|
||||
</MenuItem>
|
||||
{SORT_BY_OPTIONS.map((option) => {
|
||||
@@ -403,16 +403,16 @@ export const LibraryHeader = () => {
|
||||
</span>
|
||||
<IconButton
|
||||
onClick={toggleSearchDialog}
|
||||
aria-label="Search"
|
||||
title="Search"
|
||||
aria-label="Поиск"
|
||||
title="Поиск"
|
||||
>
|
||||
<div className="material-symbols-rounded">search</div>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
className="library-header-favorite"
|
||||
onClick={handleNavigateToFavorite}
|
||||
aria-label="Favorites"
|
||||
title="Favorites"
|
||||
aria-label="Избранное"
|
||||
title="Избранное"
|
||||
>
|
||||
<div className="material-symbols-rounded">favorite</div>
|
||||
</IconButton>
|
||||
|
||||
@@ -288,9 +288,9 @@ const LibraryItemsGrid = () => {
|
||||
>
|
||||
sentiment_dissatisfied
|
||||
</div>
|
||||
<div style={{ fontSize: 16 }}>No items to show</div>
|
||||
<div style={{ fontSize: 16 }}>Нет элементов для отображения</div>
|
||||
<div style={{ fontSize: 13, marginTop: 6 }}>
|
||||
Try adjusting filters, sort, or the A–Z selector.
|
||||
Попробуйте изменить фильтры, сортировку или выбор по алфавиту.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -357,7 +357,7 @@ const LibraryItemsGrid = () => {
|
||||
year: "numeric",
|
||||
},
|
||||
)
|
||||
: "Present"
|
||||
: "н.в."
|
||||
}`
|
||||
: item?.ProductionYear
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ const LoginShell = ({
|
||||
{serverName ?? serverHost}
|
||||
</span>
|
||||
<Link to="/setup/server/list" className="login-shell-server-change">
|
||||
Change
|
||||
Сменить
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -47,7 +47,7 @@ export const ProfileAvatar = ({
|
||||
</span>
|
||||
)}
|
||||
{locked && (
|
||||
<span className="profile-lock" title="Password protected">
|
||||
<span className="profile-lock" title="Защищено паролем">
|
||||
<span className="material-symbols-rounded">lock</span>
|
||||
</span>
|
||||
)}
|
||||
|
||||
@@ -46,7 +46,7 @@ const MusicTrack = ({
|
||||
</span>
|
||||
</div>
|
||||
<img
|
||||
alt={item.Name ?? "Music Track"}
|
||||
alt={item.Name ?? "Трек"}
|
||||
src={
|
||||
api &&
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
@@ -105,7 +105,7 @@ const MusicTrack = ({
|
||||
{item.HasLyrics && (
|
||||
<img
|
||||
src={lyrics_icon}
|
||||
alt="Lyrics"
|
||||
alt="Текст песни"
|
||||
className="music-track-info-lyrics"
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -34,7 +34,7 @@ export const EmptyNotice = ({ extraMsg }: { extraMsg?: string }) => {
|
||||
fontWeight: 300,
|
||||
}}
|
||||
>
|
||||
No results found
|
||||
Ничего не найдено
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
|
||||
@@ -42,7 +42,7 @@ export const ErrorNotice = ({ error }: { error?: unknown }) => {
|
||||
fontWeight: 300,
|
||||
}}
|
||||
>
|
||||
Something went wrong.
|
||||
Что-то пошло не так.
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="body2"
|
||||
@@ -66,7 +66,7 @@ export const ErrorNotice = ({ error }: { error?: unknown }) => {
|
||||
{normalizedError
|
||||
? normalizedError.stack ||
|
||||
`${normalizedError.name}: ${normalizedError.message}`
|
||||
: "Unknown error"}
|
||||
: "Неизвестная ошибка"}
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -26,7 +26,7 @@ const OutroCard = (props: { handleShowCredits: () => void }) => {
|
||||
if (!item || !item.Type) return null;
|
||||
return (
|
||||
<div className="outro-card">
|
||||
<Typography variant="h4">Up Next</Typography>
|
||||
<Typography variant="h4">Далее</Typography>
|
||||
<div className="outro-card-content">
|
||||
{item?.ImageTags?.Primary ? (
|
||||
<img
|
||||
@@ -73,7 +73,7 @@ const OutroCard = (props: { handleShowCredits: () => void }) => {
|
||||
</div>
|
||||
}
|
||||
>
|
||||
Play Now
|
||||
Смотреть
|
||||
</Button>
|
||||
<Button
|
||||
onClick={props.handleShowCredits}
|
||||
@@ -81,7 +81,7 @@ const OutroCard = (props: { handleShowCredits: () => void }) => {
|
||||
color="white"
|
||||
variant="outlined"
|
||||
>
|
||||
Watch Credits
|
||||
Смотреть титры
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -43,9 +43,9 @@ const DeviceMenu = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="Devices">
|
||||
<Tooltip title="Устройства">
|
||||
<IconButton
|
||||
aria-label="Devices"
|
||||
aria-label="Устройства"
|
||||
onClick={(event) => setAnchor(event.currentTarget)}
|
||||
>
|
||||
<span className="material-symbols-rounded">devices</span>
|
||||
@@ -68,16 +68,16 @@ const DeviceMenu = ({
|
||||
<span className="material-symbols-rounded">computer</span>
|
||||
</ListItemIcon>
|
||||
<ListItemText
|
||||
primary="This device"
|
||||
primary="Это устройство"
|
||||
secondary={
|
||||
localActive ? (localItem?.Name ?? "Playing") : "Idle"
|
||||
localActive ? (localItem?.Name ?? "Играет") : "Свободно"
|
||||
}
|
||||
/>
|
||||
</MenuItem>
|
||||
<Divider />
|
||||
{sessions.length === 0 ? (
|
||||
<MenuItem disabled>
|
||||
<ListItemText primary="No other devices are online" />
|
||||
<ListItemText primary="Другие устройства не в сети" />
|
||||
</MenuItem>
|
||||
) : (
|
||||
sessions.map((session) => (
|
||||
@@ -95,11 +95,11 @@ const DeviceMenu = ({
|
||||
</span>
|
||||
</ListItemIcon>
|
||||
<ListItemText
|
||||
primary={session.DeviceName || session.Client || "Device"}
|
||||
primary={session.DeviceName || session.Client || "Устройство"}
|
||||
secondary={
|
||||
session.NowPlayingItem?.Name ??
|
||||
session.Client ??
|
||||
"Not playing"
|
||||
"Ничего не играет"
|
||||
}
|
||||
/>
|
||||
</MenuItem>
|
||||
@@ -115,7 +115,7 @@ const DeviceMenu = ({
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">settings_remote</span>
|
||||
</ListItemIcon>
|
||||
<ListItemText primary="Remote control…" />
|
||||
<ListItemText primary="Удалённое управление…" />
|
||||
</MenuItem>
|
||||
<Divider />
|
||||
<MenuItem
|
||||
@@ -129,11 +129,11 @@ const DeviceMenu = ({
|
||||
<span className="material-symbols-rounded">sync</span>
|
||||
</ListItemIcon>
|
||||
<ListItemText
|
||||
primary="Sync playback"
|
||||
primary="Синхронизация воспроизведения"
|
||||
secondary={
|
||||
syncEnabled
|
||||
? "Devices follow this session"
|
||||
: "Keep devices in step"
|
||||
? "Устройства следуют за этим сеансом"
|
||||
: "Синхронизировать устройства"
|
||||
}
|
||||
/>
|
||||
<Switch
|
||||
|
||||
@@ -60,7 +60,7 @@ const LyricsPanel = ({ item, api, currentTime, onSeek }: LyricsPanelProps) => {
|
||||
if (lyrics.isLoading) {
|
||||
return (
|
||||
<div className="audio-lyrics-status">
|
||||
<Typography>Loading lyrics...</Typography>
|
||||
<Typography>Загрузка текста...</Typography>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ const LyricsPanel = ({ item, api, currentTime, onSeek }: LyricsPanelProps) => {
|
||||
if (lyrics.isError || !lyrics.data || !lyrics.data.Lyrics?.length) {
|
||||
return (
|
||||
<div className="audio-lyrics-status">
|
||||
<Typography>No lyrics available</Typography>
|
||||
<Typography>Текст недоступен</Typography>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ const LyricsPanel = ({ item, api, currentTime, onSeek }: LyricsPanelProps) => {
|
||||
{!hasSyncedLyrics && (
|
||||
<div className="audio-lyrics-unsynced-notice">
|
||||
<span className="material-symbols-rounded">info</span>
|
||||
<Typography variant="caption">Synced lyrics not available</Typography>
|
||||
<Typography variant="caption">Синхронизированный текст недоступен</Typography>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -42,13 +42,13 @@ const PlayerActions = ({
|
||||
/>}
|
||||
<QueueButton />
|
||||
<div className="audio-player-volume">{children}</div>
|
||||
<Tooltip title="Open player">
|
||||
<IconButton onClick={onExpand} aria-label="Open player">
|
||||
<Tooltip title="Открыть плеер">
|
||||
<IconButton onClick={onExpand} aria-label="Открыть плеер">
|
||||
<span className="material-symbols-rounded">open_in_full</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Tooltip title="Stop and close">
|
||||
<IconButton onClick={onClose} aria-label="Stop and close">
|
||||
<Tooltip title="Остановить и закрыть">
|
||||
<IconButton onClick={onClose} aria-label="Остановить и закрыть">
|
||||
<span className="material-symbols-rounded">close</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
||||
@@ -36,7 +36,7 @@ const PlayerInfo = ({ item, api, onOpen }: PlayerInfoProps) => {
|
||||
type="button"
|
||||
className="audio-player-image-container"
|
||||
onClick={onOpen}
|
||||
aria-label="Open player"
|
||||
aria-label="Открыть плеер"
|
||||
>
|
||||
<span className="material-symbols-rounded audio-player-image-icon">
|
||||
music_note
|
||||
|
||||
@@ -56,7 +56,7 @@ const PlayerProgress = ({
|
||||
max={duration}
|
||||
onChange={handleChange}
|
||||
onChangeCommitted={handleChangeCommitted}
|
||||
aria-label="Seek"
|
||||
aria-label="Перемотка"
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ const PlayerProgress = ({
|
||||
max={duration}
|
||||
onChange={handleChange}
|
||||
onChangeCommitted={handleChangeCommitted}
|
||||
aria-label="Seek"
|
||||
aria-label="Перемотка"
|
||||
/>
|
||||
<div className="player-progress-stacked-times">
|
||||
<span>{getRuntimeMusic(sliderValue)}</span>
|
||||
|
||||
@@ -64,7 +64,7 @@ const StatsPanel: React.FC<StatsPanelProps> = ({ item, audioRef }) => {
|
||||
return (
|
||||
<Box sx={{ p: 2 }}>
|
||||
<Typography variant="h6" sx={{ mb: 2 }}>
|
||||
Stats for Nerds
|
||||
Статистика
|
||||
</Typography>
|
||||
|
||||
<Paper
|
||||
@@ -78,11 +78,11 @@ const StatsPanel: React.FC<StatsPanelProps> = ({ item, audioRef }) => {
|
||||
variant="subtitle2"
|
||||
sx={{ mb: 1, opacity: 0.5, textTransform: "uppercase" }}
|
||||
>
|
||||
Media Source
|
||||
Источник медиа
|
||||
</Typography>
|
||||
<StatRow label="Container" value={mediaSource?.Container} />
|
||||
<StatRow label="Контейнер" value={mediaSource?.Container} />
|
||||
<StatRow
|
||||
label="Bitrate"
|
||||
label="Битрейт"
|
||||
value={
|
||||
mediaSource?.Bitrate
|
||||
? `${Math.round(mediaSource.Bitrate / 1000)} kbps`
|
||||
@@ -90,34 +90,34 @@ const StatsPanel: React.FC<StatsPanelProps> = ({ item, audioRef }) => {
|
||||
}
|
||||
/>
|
||||
<StatRow
|
||||
label="Size"
|
||||
label="Размер"
|
||||
value={
|
||||
mediaSource?.Size
|
||||
? `${(mediaSource.Size / 1024 / 1024).toFixed(2)} MB`
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
<StatRow label="Path" value={mediaSource?.Path} />
|
||||
<StatRow label="Путь" value={mediaSource?.Path} />
|
||||
|
||||
<Box sx={{ mt: 3 }}>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
sx={{ mb: 1, opacity: 0.5, textTransform: "uppercase" }}
|
||||
>
|
||||
Audio Stream
|
||||
Аудиопоток
|
||||
</Typography>
|
||||
<StatRow label="Codec" value={mediaStream?.Codec} />
|
||||
<StatRow label="Channels" value={mediaStream?.Channels} />
|
||||
<StatRow label="Кодек" value={mediaStream?.Codec} />
|
||||
<StatRow label="Каналы" value={mediaStream?.Channels} />
|
||||
<StatRow
|
||||
label="Sample Rate"
|
||||
label="Частота дискретизации"
|
||||
value={
|
||||
mediaStream?.SampleRate
|
||||
? `${mediaStream.SampleRate} Hz`
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
<StatRow label="Bit Depth" value={mediaStream?.BitDepth} />
|
||||
<StatRow label="Language" value={mediaStream?.Language} />
|
||||
<StatRow label="Глубина" value={mediaStream?.BitDepth} />
|
||||
<StatRow label="Язык" value={mediaStream?.Language} />
|
||||
</Box>
|
||||
|
||||
<Box sx={{ mt: 3 }}>
|
||||
@@ -125,11 +125,11 @@ const StatsPanel: React.FC<StatsPanelProps> = ({ item, audioRef }) => {
|
||||
variant="subtitle2"
|
||||
sx={{ mb: 1, opacity: 0.5, textTransform: "uppercase" }}
|
||||
>
|
||||
Player
|
||||
Плеер
|
||||
</Typography>
|
||||
<StatRow label="Buffered" value={buffered} />
|
||||
<StatRow label="Буфер" value={buffered} />
|
||||
<StatRow
|
||||
label="Volume"
|
||||
label="Громкость"
|
||||
value={
|
||||
audioRef?.current
|
||||
? `${Math.round(audioRef.current.volume * 100)}%`
|
||||
@@ -137,7 +137,7 @@ const StatsPanel: React.FC<StatsPanelProps> = ({ item, audioRef }) => {
|
||||
}
|
||||
/>
|
||||
<StatRow
|
||||
label="Playback Rate"
|
||||
label="Скорость воспроизведения"
|
||||
value={audioRef?.current?.playbackRate}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
@@ -139,12 +139,12 @@ const AudioPlayer = () => {
|
||||
: (activeItem?.AlbumArtists ?? []);
|
||||
const artistNames = artists.map((artist) => artist.Name).filter(Boolean);
|
||||
const remoteDevice = remote
|
||||
? remote.DeviceName || remote.Client || "another device"
|
||||
? remote.DeviceName || remote.Client || "другое устройство"
|
||||
: undefined;
|
||||
const subtitle = remote
|
||||
? artistNames.length > 0
|
||||
? `${artistNames.join(", ")} · ${remoteDevice}`
|
||||
: `Playing on ${remoteDevice}`
|
||||
: `Идёт на ${remoteDevice}`
|
||||
: artistNames.join(", ") || activeItem?.Album || "";
|
||||
const coverUrl =
|
||||
api && activeItem?.Id
|
||||
@@ -231,9 +231,9 @@ const AudioPlayer = () => {
|
||||
})
|
||||
: undefined;
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
title: item.Name ?? "Unknown Title",
|
||||
artist: item.Artists?.join(", ") ?? "Unknown Artist",
|
||||
album: item.Album ?? "Unknown Album",
|
||||
title: item.Name ?? "Неизвестное название",
|
||||
artist: item.Artists?.join(", ") ?? "Неизвестный исполнитель",
|
||||
album: item.Album ?? "Неизвестный альбом",
|
||||
artwork: imageUrl
|
||||
? [{ src: imageUrl, sizes: "512x512", type: "image/jpeg" }]
|
||||
: [],
|
||||
@@ -368,8 +368,8 @@ const AudioPlayer = () => {
|
||||
});
|
||||
await sessions.refetch();
|
||||
} catch (error) {
|
||||
console.error("Remote command failed", error);
|
||||
enqueueSnackbar("Remote command failed", { variant: "error" });
|
||||
console.error("Команда не выполнена", error);
|
||||
enqueueSnackbar("Команда не выполнена", { variant: "error" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -385,7 +385,7 @@ const AudioPlayer = () => {
|
||||
if (kind === "video") navigate({ to: "/player" });
|
||||
} catch (error) {
|
||||
console.error("Transfer failed", error);
|
||||
enqueueSnackbar("Could not transfer playback", { variant: "error" });
|
||||
enqueueSnackbar("Не удалось перенести воспроизведение", { variant: "error" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -432,8 +432,8 @@ const AudioPlayer = () => {
|
||||
setSelectedRemoteId(session.Id);
|
||||
await sessions.refetch();
|
||||
} catch (error) {
|
||||
console.error("Could not switch device", error);
|
||||
enqueueSnackbar("Could not switch device", { variant: "error" });
|
||||
console.error("Не удалось переключить устройство", error);
|
||||
enqueueSnackbar("Не удалось переключить устройство", { variant: "error" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -462,7 +462,7 @@ const AudioPlayer = () => {
|
||||
await sessions.refetch();
|
||||
} catch (error) {
|
||||
console.error("Remote general command failed", error);
|
||||
enqueueSnackbar("Remote command failed", { variant: "error" });
|
||||
enqueueSnackbar("Команда не выполнена", { variant: "error" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -512,13 +512,13 @@ const AudioPlayer = () => {
|
||||
try {
|
||||
const { count } = await startInstantMix(api, user.Id, activeItem);
|
||||
if (count === 0) {
|
||||
enqueueSnackbar("No tracks found for Instant Mix", {
|
||||
enqueueSnackbar("Нет треков для микса", {
|
||||
variant: "warning",
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
enqueueSnackbar("Could not start Instant Mix", { variant: "error" });
|
||||
enqueueSnackbar("Не удалось запустить микс", { variant: "error" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -534,11 +534,34 @@ const AudioPlayer = () => {
|
||||
});
|
||||
};
|
||||
|
||||
if (!barVisible || isFullPlayer) {
|
||||
const audioElement = display ? (
|
||||
<audio
|
||||
autoPlay
|
||||
src={url}
|
||||
ref={audioRef}
|
||||
key={item?.Id ?? "noItem"}
|
||||
onTimeUpdate={handleTimeUpdate}
|
||||
onEnded={handleEnded}
|
||||
onPlay={onPlay}
|
||||
onPause={onPause}
|
||||
onSeeked={updatePositionState}
|
||||
onLoadedMetadata={(event) => {
|
||||
const player = event.currentTarget;
|
||||
if (!seekAppliedRef.current && startTimeTicks > 0) {
|
||||
seekAppliedRef.current = true;
|
||||
player.currentTime = ticksToSec(startTimeTicks);
|
||||
}
|
||||
updatePositionState();
|
||||
}}
|
||||
id="audio-player"
|
||||
/>
|
||||
) : null;
|
||||
|
||||
if (!barVisible && !display) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
const bar = (
|
||||
<AnimatePresence mode="sync">
|
||||
<motion.div
|
||||
initial={{ transform: "translate(-50%, 150%)" }}
|
||||
@@ -552,7 +575,7 @@ const AudioPlayer = () => {
|
||||
type="button"
|
||||
className="media-bar-cover"
|
||||
onClick={handleNavigate}
|
||||
aria-label="Open player"
|
||||
aria-label="Открыть плеер"
|
||||
>
|
||||
{coverUrl ? (
|
||||
<img src={coverUrl} alt="" />
|
||||
@@ -567,7 +590,7 @@ const AudioPlayer = () => {
|
||||
title={activeItem?.Name ?? undefined}
|
||||
onClick={handleNavigate}
|
||||
>
|
||||
{activeItem?.Name ?? "Unknown"}
|
||||
{activeItem?.Name ?? "Неизвестно"}
|
||||
</Typography>
|
||||
<Typography variant="caption" noWrap className="media-bar-subtitle">
|
||||
{subtitle || "Blink"}
|
||||
@@ -575,7 +598,7 @@ const AudioPlayer = () => {
|
||||
</div>
|
||||
<IconButton
|
||||
size="small"
|
||||
aria-label="More"
|
||||
aria-label="Ещё"
|
||||
className="media-bar-more"
|
||||
onClick={handleMoreOpen}
|
||||
>
|
||||
@@ -585,7 +608,7 @@ const AudioPlayer = () => {
|
||||
|
||||
<div className="media-bar-center">
|
||||
<div className="media-bar-controls">
|
||||
<Tooltip title="Shuffle">
|
||||
<Tooltip title="Перемешать">
|
||||
<IconButton
|
||||
size="small"
|
||||
onClick={handleShuffle}
|
||||
@@ -594,21 +617,21 @@ const AudioPlayer = () => {
|
||||
<span className="material-symbols-rounded">shuffle</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Tooltip title="Previous">
|
||||
<Tooltip title="Предыдущий">
|
||||
<IconButton
|
||||
size="small"
|
||||
onClick={handlePrevious}
|
||||
aria-label="Previous"
|
||||
aria-label="Предыдущий"
|
||||
>
|
||||
<span className="material-symbols-rounded">
|
||||
skip_previous
|
||||
</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Tooltip title={isPlaying ? "Pause" : "Play"}>
|
||||
<Tooltip title={isPlaying ? "Пауза" : "Слушать"}>
|
||||
<IconButton
|
||||
className="media-bar-play"
|
||||
aria-label={isPlaying ? "Pause" : "Play"}
|
||||
aria-label={isPlaying ? "Пауза" : "Слушать"}
|
||||
onClick={() =>
|
||||
remote
|
||||
? remoteCommand(PlaystateCommand.PlayPause)
|
||||
@@ -620,8 +643,8 @@ const AudioPlayer = () => {
|
||||
</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Tooltip title="Next">
|
||||
<IconButton size="small" onClick={handleNext} aria-label="Next">
|
||||
<Tooltip title="Следующий">
|
||||
<IconButton size="small" onClick={handleNext} aria-label="Следующий">
|
||||
<span className="material-symbols-rounded">skip_next</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
@@ -629,15 +652,15 @@ const AudioPlayer = () => {
|
||||
title={
|
||||
remote
|
||||
? remoteRepeat === "RepeatNone"
|
||||
? "Repeat off"
|
||||
? "Повтор выкл."
|
||||
: remoteRepeat === "RepeatAll"
|
||||
? "Repeat all"
|
||||
: "Repeat one"
|
||||
? "Повтор всех"
|
||||
: "Повтор одного"
|
||||
: repeatMode === "off"
|
||||
? "Repeat off"
|
||||
? "Повтор выкл."
|
||||
: repeatMode === "all"
|
||||
? "Repeat all"
|
||||
: "Repeat one"
|
||||
? "Повтор всех"
|
||||
: "Повтор одного"
|
||||
}
|
||||
>
|
||||
<IconButton
|
||||
@@ -667,10 +690,10 @@ const AudioPlayer = () => {
|
||||
|
||||
<div className="media-bar-right">
|
||||
{remote && (
|
||||
<Tooltip title="Transfer to this device">
|
||||
<Tooltip title="Перенести на это устройство">
|
||||
<IconButton
|
||||
size="small"
|
||||
aria-label="Transfer to this device"
|
||||
aria-label="Перенести на это устройство"
|
||||
onClick={transferToLocal}
|
||||
>
|
||||
<span className="material-symbols-rounded">
|
||||
@@ -680,7 +703,7 @@ const AudioPlayer = () => {
|
||||
</Tooltip>
|
||||
)}
|
||||
{!remote && <QueueButton />}
|
||||
<Tooltip title={remote ? (remoteMuted ? "Unmute" : "Mute") : (isMuted ? "Unmute" : "Mute")}>
|
||||
<Tooltip title={remote ? (remoteMuted ? "Включить звук" : "Выключить звук") : (isMuted ? "Включить звук" : "Выключить звук")}>
|
||||
<IconButton size="small" onClick={handleMute}>
|
||||
<span className="material-symbols-rounded">
|
||||
{remote
|
||||
@@ -700,7 +723,7 @@ const AudioPlayer = () => {
|
||||
min={0}
|
||||
max={1}
|
||||
step={0.01}
|
||||
aria-label="Volume"
|
||||
aria-label="Громкость"
|
||||
onChange={(_, value) => {
|
||||
const next = Array.isArray(value) ? value[0] : value;
|
||||
if (remote) {
|
||||
@@ -730,7 +753,7 @@ const AudioPlayer = () => {
|
||||
canSync={canSync}
|
||||
onToggleSync={toggleSync}
|
||||
/>
|
||||
<Tooltip title="Open player">
|
||||
<Tooltip title="Открыть плеер">
|
||||
<IconButton size="small" onClick={handleNavigate}>
|
||||
<span className="material-symbols-rounded">open_in_full</span>
|
||||
</IconButton>
|
||||
@@ -747,7 +770,7 @@ const AudioPlayer = () => {
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">radio</span>
|
||||
</ListItemIcon>
|
||||
<ListItemText primary="Instant Mix" />
|
||||
<ListItemText primary="Микс" />
|
||||
</MenuItem>
|
||||
{remote ? (
|
||||
<MenuItem
|
||||
@@ -761,14 +784,14 @@ const AudioPlayer = () => {
|
||||
system_update_alt
|
||||
</span>
|
||||
</ListItemIcon>
|
||||
<ListItemText primary="Transfer to this device" />
|
||||
<ListItemText primary="Перенести на это устройство" />
|
||||
</MenuItem>
|
||||
) : (
|
||||
<MenuItem onClick={openCastForLocal}>
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">cast</span>
|
||||
</ListItemIcon>
|
||||
<ListItemText primary="Play on another device…" />
|
||||
<ListItemText primary="Воспроизвести на другом устройстве…" />
|
||||
</MenuItem>
|
||||
)}
|
||||
<MenuItem
|
||||
@@ -780,7 +803,7 @@ const AudioPlayer = () => {
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">settings_remote</span>
|
||||
</ListItemIcon>
|
||||
<ListItemText primary="Remote control…" />
|
||||
<ListItemText primary="Удалённое управление…" />
|
||||
</MenuItem>
|
||||
<Divider />
|
||||
<MenuItem
|
||||
@@ -797,35 +820,20 @@ const AudioPlayer = () => {
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">stop</span>
|
||||
</ListItemIcon>
|
||||
<ListItemText primary="Stop" />
|
||||
<ListItemText primary="Остановить" />
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
|
||||
{display && (
|
||||
<audio
|
||||
autoPlay
|
||||
src={url}
|
||||
ref={audioRef}
|
||||
key={item?.Id ?? "noItem"}
|
||||
onTimeUpdate={handleTimeUpdate}
|
||||
onEnded={handleEnded}
|
||||
onPlay={onPlay}
|
||||
onPause={onPause}
|
||||
onSeeked={updatePositionState}
|
||||
onLoadedMetadata={(event) => {
|
||||
const player = event.currentTarget;
|
||||
if (!seekAppliedRef.current && startTimeTicks > 0) {
|
||||
seekAppliedRef.current = true;
|
||||
player.currentTime = ticksToSec(startTimeTicks);
|
||||
}
|
||||
updatePositionState();
|
||||
}}
|
||||
id="audio-player"
|
||||
/>
|
||||
)}
|
||||
</motion.div>
|
||||
</AnimatePresence>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{audioElement}
|
||||
{barVisible && !isFullPlayer && bar}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default AudioPlayer;
|
||||
@@ -29,20 +29,20 @@ const ErrorDisplay = ({ error, onRetry, onExit }: ErrorDisplayProps) => {
|
||||
}}
|
||||
>
|
||||
<Typography variant="h5" color="error">
|
||||
Playback Error
|
||||
Ошибка воспроизведения
|
||||
</Typography>
|
||||
<Typography variant="body1">
|
||||
{error.message || "An unknown error occurred during playback."}
|
||||
{error.message || "Во время воспроизведения произошла неизвестная ошибка."}
|
||||
</Typography>
|
||||
<div style={{ display: "flex", gap: "1rem" }}>
|
||||
{onRetry && (
|
||||
<Button variant="contained" color="primary" onClick={onRetry}>
|
||||
Retry
|
||||
Повторить
|
||||
</Button>
|
||||
)}
|
||||
{onExit && (
|
||||
<Button variant="outlined" color="secondary" onClick={onExit}>
|
||||
Exit
|
||||
Выйти
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -115,7 +115,7 @@ const StatsForNerds = ({ playerRef }: StatsForNerdsProps) => {
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
Stats for Nerds
|
||||
Статистика
|
||||
</Typography>
|
||||
<IconButton
|
||||
size="small"
|
||||
@@ -138,29 +138,29 @@ const StatsForNerds = ({ playerRef }: StatsForNerdsProps) => {
|
||||
gap: "0.5em 1em",
|
||||
}}
|
||||
>
|
||||
<span>Video ID:</span> <span>{itemId}</span>
|
||||
<span>Media Source ID:</span> <span>{mediaSourceId}</span>
|
||||
<span>Play Session ID:</span> <span>{playsessionId}</span>
|
||||
<span>Playback Method:</span> <span>{mediaSource.playMethod}</span>
|
||||
<span>Container:</span> <span>{mediaSource.container}</span>
|
||||
<span>Video Codec:</span> <span>{mediaSource.videoCodec}</span>
|
||||
<span>Audio Codec:</span> <span>{mediaSource.audioCodec}</span>
|
||||
<span>Bitrate:</span>{" "}
|
||||
<span>ID видео:</span> <span>{itemId}</span>
|
||||
<span>ID источника:</span> <span>{mediaSourceId}</span>
|
||||
<span>ID сеанса:</span> <span>{playsessionId}</span>
|
||||
<span>Метод воспроизведения:</span> <span>{mediaSource.playMethod}</span>
|
||||
<span>Контейнер:</span> <span>{mediaSource.container}</span>
|
||||
<span>Видеокодек:</span> <span>{mediaSource.videoCodec}</span>
|
||||
<span>Аудиокодек:</span> <span>{mediaSource.audioCodec}</span>
|
||||
<span>Битрейт:</span>{" "}
|
||||
<span>
|
||||
{mediaSource.bitrate
|
||||
? `${(mediaSource.bitrate / 1000000).toFixed(2)} Mbps`
|
||||
: "-"}
|
||||
</span>
|
||||
<span>Stream URL:</span>{" "}
|
||||
<span>URL потока:</span>{" "}
|
||||
<span style={{ wordBreak: "break-all" }}>{playbackStream}</span>
|
||||
<span>Resolution:</span> <span>{videoStats.resolution}</span>
|
||||
<span>Volume:</span> <span>{Math.round(volume * 100)}%</span>
|
||||
<span>Buffer Health:</span> <span>{videoStats.buffered}</span>
|
||||
<span>Dropped Frames:</span>{" "}
|
||||
<span>Разрешение:</span> <span>{videoStats.resolution}</span>
|
||||
<span>Громкость:</span> <span>{Math.round(volume * 100)}%</span>
|
||||
<span>Буфер:</span> <span>{videoStats.buffered}</span>
|
||||
<span>Пропущенные кадры:</span>{" "}
|
||||
<span>
|
||||
{videoStats.droppedFrames} / {videoStats.totalFrames}
|
||||
</span>
|
||||
<span>Is Buffering:</span> <span>{isBuffering ? "Yes" : "No"}</span>
|
||||
<span>Буферизация:</span> <span>{isBuffering ? "Да" : "Нет"}</span>
|
||||
</div>
|
||||
</Paper>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
import { IconButton, Tooltip } from "@mui/material";
|
||||
import { useSnackbar } from "notistack";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import {
|
||||
getPlayerVideoElement,
|
||||
isPictureInPictureActive,
|
||||
supportsPictureInPicture,
|
||||
togglePictureInPicture,
|
||||
} from "@/utils/methods/pictureInPicture";
|
||||
import { usePlaybackStore } from "@/utils/store/playback";
|
||||
|
||||
const PictureInPictureButton = () => {
|
||||
const playsessionId = usePlaybackStore((state) => state.playsessionId);
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
const [supported, setSupported] = useState(() => supportsPictureInPicture());
|
||||
const [active, setActive] = useState(false);
|
||||
const [busy, setBusy] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const update = () => {
|
||||
const currentVideo = getPlayerVideoElement();
|
||||
if (currentVideo) {
|
||||
setSupported(supportsPictureInPicture(currentVideo));
|
||||
}
|
||||
setActive(currentVideo ? isPictureInPictureActive(currentVideo) : false);
|
||||
};
|
||||
|
||||
const video = getPlayerVideoElement();
|
||||
if (video) {
|
||||
setSupported(supportsPictureInPicture(video));
|
||||
setActive(isPictureInPictureActive(video));
|
||||
}
|
||||
|
||||
document.addEventListener("enterpictureinpicture", update, true);
|
||||
document.addEventListener("leavepictureinpicture", update, true);
|
||||
document.addEventListener("webkitpresentationmodechanged", update, true);
|
||||
const interval = window.setInterval(update, 1000);
|
||||
|
||||
return () => {
|
||||
window.clearInterval(interval);
|
||||
document.removeEventListener("enterpictureinpicture", update, true);
|
||||
document.removeEventListener("leavepictureinpicture", update, true);
|
||||
document.removeEventListener(
|
||||
"webkitpresentationmodechanged",
|
||||
update,
|
||||
true,
|
||||
);
|
||||
};
|
||||
}, [playsessionId]);
|
||||
|
||||
if (!supported) return null;
|
||||
|
||||
const label = active ? "Выйти из картинки в картинке" : "Картинка в картинке";
|
||||
|
||||
const handleClick = async () => {
|
||||
const video = getPlayerVideoElement();
|
||||
if (!video) {
|
||||
enqueueSnackbar("Видео ещё не готово", { variant: "info" });
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
setBusy(true);
|
||||
await togglePictureInPicture(video);
|
||||
setActive(isPictureInPictureActive(video));
|
||||
} catch (error) {
|
||||
console.error("Picture-in-picture failed", error);
|
||||
enqueueSnackbar("Не удалось включить картинку в картинке", {
|
||||
variant: "error",
|
||||
});
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Tooltip title={label}>
|
||||
<span>
|
||||
<IconButton
|
||||
onClick={handleClick}
|
||||
disabled={busy}
|
||||
aria-label={label}
|
||||
title={label}
|
||||
>
|
||||
<span className="material-symbols-rounded fill">
|
||||
{active ? "picture_in_picture" : "picture_in_picture_alt"}
|
||||
</span>
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
|
||||
export default PictureInPictureButton;
|
||||
@@ -35,7 +35,7 @@ const SkipSegmentButton = () => {
|
||||
currentSegmentIndex >= 0 &&
|
||||
activeSegmentId &&
|
||||
(segmentType !== "Outro" || !hasNextItem);
|
||||
const label = segmentType === "Outro" ? "Skip credits" : `Skip ${segmentType}`;
|
||||
const label = segmentType === "Outro" ? "Пропустить титры" : segmentType === "Intro" ? "Пропустить интро" : segmentType === "Recap" ? "Пропустить рекап" : segmentType === "Commercial" ? "Пропустить рекламу" : segmentType === "Preview" ? "Пропустить превью" : "Пропустить";
|
||||
|
||||
return (
|
||||
<AnimatePresence>
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
import {
|
||||
IconButton,
|
||||
ListItemIcon,
|
||||
ListItemText,
|
||||
Menu,
|
||||
MenuItem,
|
||||
Tooltip,
|
||||
} from "@mui/material";
|
||||
import React, { useState } from "react";
|
||||
import type { VideoFitMode } from "@/utils/types/videoFitMode";
|
||||
|
||||
const OPTIONS: Array<{
|
||||
value: VideoFitMode;
|
||||
label: string;
|
||||
icon: string;
|
||||
hint: string;
|
||||
}> = [
|
||||
{
|
||||
value: "fit",
|
||||
label: "По размеру",
|
||||
icon: "fit_screen",
|
||||
hint: "Вписать видео целиком",
|
||||
},
|
||||
{
|
||||
value: "fill",
|
||||
label: "Заполнить экран",
|
||||
icon: "zoom_out_map",
|
||||
hint: "Убрать полосы, обрезав края",
|
||||
},
|
||||
{
|
||||
value: "stretch",
|
||||
label: "Растянуть",
|
||||
icon: "aspect_ratio",
|
||||
hint: "Растянуть на весь экран",
|
||||
},
|
||||
];
|
||||
|
||||
type VideoFitButtonProps = {
|
||||
mode: VideoFitMode;
|
||||
onChange: (mode: VideoFitMode) => void;
|
||||
};
|
||||
|
||||
const VideoFitButton = ({ mode, onChange }: VideoFitButtonProps) => {
|
||||
const [anchor, setAnchor] = useState<HTMLButtonElement | null>(null);
|
||||
const current = OPTIONS.find((option) => option.value === mode) ?? OPTIONS[0];
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title={`Режим изображения: ${current.label}`}>
|
||||
<IconButton
|
||||
onClick={(event) => setAnchor(event.currentTarget)}
|
||||
aria-label="Режим изображения"
|
||||
>
|
||||
<span className="material-symbols-rounded">aspect_ratio</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Menu
|
||||
anchorEl={anchor}
|
||||
open={Boolean(anchor)}
|
||||
onClose={() => setAnchor(null)}
|
||||
anchorOrigin={{ vertical: "top", horizontal: "center" }}
|
||||
transformOrigin={{ vertical: "bottom", horizontal: "center" }}
|
||||
slotProps={{ paper: { className: "glass-menu-paper" } }}
|
||||
>
|
||||
{OPTIONS.map((option) => (
|
||||
<MenuItem
|
||||
key={option.value}
|
||||
selected={option.value === mode}
|
||||
onClick={() => {
|
||||
onChange(option.value);
|
||||
setAnchor(null);
|
||||
}}
|
||||
>
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">{option.icon}</span>
|
||||
</ListItemIcon>
|
||||
<ListItemText primary={option.label} secondary={option.hint} />
|
||||
{option.value === mode && (
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ marginLeft: "1em" }}
|
||||
>
|
||||
check
|
||||
</span>
|
||||
)}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Menu>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default VideoFitButton;
|
||||
@@ -1,10 +1,34 @@
|
||||
.video-player {
|
||||
--media-object-fit: contain;
|
||||
|
||||
background: black;
|
||||
position: absolute;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
video {
|
||||
object-fit: var(--media-object-fit);
|
||||
}
|
||||
|
||||
&.video-fit-fill {
|
||||
--media-object-fit: cover;
|
||||
}
|
||||
|
||||
&.video-fit-stretch {
|
||||
--media-object-fit: fill;
|
||||
}
|
||||
|
||||
&-drag-region {
|
||||
position: absolute;
|
||||
inset: 0 0 auto;
|
||||
height: 38px;
|
||||
z-index: 4;
|
||||
cursor: default;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
&-osd {
|
||||
position: absolute;
|
||||
width: 100vw;
|
||||
@@ -27,6 +51,29 @@
|
||||
&.hovering {
|
||||
cursor: default;
|
||||
}
|
||||
&-back,
|
||||
&-actions {
|
||||
position: absolute;
|
||||
top: 2em;
|
||||
z-index: 3;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.3em;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgb(255 255 255 / 0.08);
|
||||
background: rgb(0 0 0 / 0.28);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
&-back {
|
||||
left: 3em;
|
||||
}
|
||||
&-actions {
|
||||
right: 3em;
|
||||
gap: 0.35em;
|
||||
}
|
||||
&-info {
|
||||
margin-top: auto;
|
||||
}
|
||||
&-controls {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -17,19 +17,23 @@ import QueueButton from "@/components/buttons/queueButton";
|
||||
import BubbleSlider from "@/components/playback/videoPlayer/bubbleSlider";
|
||||
import { secToTicks, ticksToSec } from "@/utils/date/time";
|
||||
import { buildPlayDeepLink } from "@/utils/deepLinks";
|
||||
import { getPlayerVideoElement } from "@/utils/methods/pictureInPicture";
|
||||
import { openSyncPlayDialog } from "@/utils/methods/syncPlay";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useShareStore } from "@/utils/store/share";
|
||||
import { usePlaybackStore } from "@/utils/store/playback";
|
||||
import useSyncPlayback from "@/utils/store/syncPlayback";
|
||||
import type { VideoFitMode } from "@/utils/types/videoFitMode";
|
||||
import CaptionsButton from "./buttons/CaptionsButton";
|
||||
import ChaptersListButton from "./buttons/ChaptersListButton";
|
||||
import ForwardButton from "./buttons/ForwardButton";
|
||||
import FullscreenButton from "./buttons/FullscreenButton";
|
||||
import NextChapterButton from "./buttons/NextChapterButton";
|
||||
import PictureInPictureButton from "./buttons/PictureInPictureButton";
|
||||
import PlayPauseButton from "./buttons/PlayPauseButton";
|
||||
import PrevChapterButton from "./buttons/PrevChapterButton";
|
||||
import RewindButton from "./buttons/RewindButton";
|
||||
import VideoFitButton from "./buttons/VideoFitButton";
|
||||
import EndsAtDisplay from "./EndsAtDisplay";
|
||||
import VideoPlayerSettingsMenu from "./settingsMenu";
|
||||
|
||||
@@ -48,12 +52,16 @@ type VideoPlayerControlsProps = {
|
||||
// isVisible: boolean;
|
||||
onHover?: (event: MouseEvent<HTMLDivElement>) => void;
|
||||
onLeave?: (event: MouseEvent<HTMLDivElement>) => void;
|
||||
fitMode: VideoFitMode;
|
||||
onFitModeChange: (mode: VideoFitMode) => void;
|
||||
};
|
||||
|
||||
const VideoPlayerControls = ({
|
||||
// isVisible,
|
||||
onHover,
|
||||
onLeave,
|
||||
fitMode,
|
||||
onFitModeChange,
|
||||
}: VideoPlayerControlsProps) => {
|
||||
const playerOSDRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
@@ -145,6 +153,69 @@ const VideoPlayerControls = ({
|
||||
|
||||
const [settingsMenuRef, setSettingsMenuRef] =
|
||||
useState<HTMLButtonElement | null>(null);
|
||||
const [videoFrame, setVideoFrame] = useState<{
|
||||
top: number;
|
||||
left: number;
|
||||
right: number;
|
||||
} | null>(null);
|
||||
|
||||
// Keep the back button and the top action buttons on one line inside the
|
||||
// visible video area, below any letterbox bars.
|
||||
useEffect(() => {
|
||||
let frame = 0;
|
||||
const update = () => {
|
||||
const video = getPlayerVideoElement();
|
||||
if (!video) return;
|
||||
|
||||
const rect = video.getBoundingClientRect();
|
||||
const ratio =
|
||||
video.videoWidth > 0 && video.videoHeight > 0
|
||||
? video.videoWidth / video.videoHeight
|
||||
: null;
|
||||
const contentWidth = ratio
|
||||
? Math.min(rect.width, rect.height * ratio)
|
||||
: rect.width;
|
||||
const contentHeight = ratio ? contentWidth / ratio : rect.height;
|
||||
const contentLeft = rect.left + (rect.width - contentWidth) / 2;
|
||||
const contentTop = rect.top + (rect.height - contentHeight) / 2;
|
||||
|
||||
setVideoFrame((current) => {
|
||||
const next = {
|
||||
// 14% keeps the controls inside the picture even when the
|
||||
// file has letterbox bars baked into a 16:9 frame.
|
||||
top: Math.round(
|
||||
contentTop + Math.max(28, contentHeight * 0.14),
|
||||
),
|
||||
left: Math.round(contentLeft + 24),
|
||||
right: Math.round(
|
||||
window.innerWidth - contentLeft - contentWidth + 24,
|
||||
),
|
||||
};
|
||||
return current?.top === next.top &&
|
||||
current?.left === next.left &&
|
||||
current?.right === next.right
|
||||
? current
|
||||
: next;
|
||||
});
|
||||
};
|
||||
const schedule = () => {
|
||||
cancelAnimationFrame(frame);
|
||||
frame = requestAnimationFrame(update);
|
||||
};
|
||||
|
||||
schedule();
|
||||
const video = getPlayerVideoElement();
|
||||
video?.addEventListener("loadedmetadata", schedule);
|
||||
window.addEventListener("resize", schedule);
|
||||
const interval = window.setInterval(schedule, 1000);
|
||||
|
||||
return () => {
|
||||
cancelAnimationFrame(frame);
|
||||
window.clearInterval(interval);
|
||||
video?.removeEventListener("loadedmetadata", schedule);
|
||||
window.removeEventListener("resize", schedule);
|
||||
};
|
||||
}, [playsessionId]);
|
||||
|
||||
// const creditInfo = mediaSegments?.Items?.find(
|
||||
// (segment) => segment.Type === "Outro",
|
||||
@@ -229,14 +300,30 @@ const VideoPlayerControls = ({
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="video-player-osd-header flex flex-justify-spaced-between flex-align-center">
|
||||
<div
|
||||
className="video-player-osd-back"
|
||||
style={
|
||||
videoFrame
|
||||
? { top: videoFrame.top, left: videoFrame.left }
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<IconButton
|
||||
onClick={handleExitPlayer}
|
||||
aria-label="Exit player"
|
||||
title="Exit player"
|
||||
aria-label="Выйти из плеера"
|
||||
title="Выйти из плеера"
|
||||
>
|
||||
<span className="material-symbols-rounded">arrow_back</span>
|
||||
</IconButton>
|
||||
</div>
|
||||
<div
|
||||
className="video-player-osd-actions"
|
||||
style={
|
||||
videoFrame
|
||||
? { top: videoFrame.top, right: videoFrame.right }
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<IconButton
|
||||
onClick={() =>
|
||||
useShareStore
|
||||
@@ -246,25 +333,25 @@ const VideoPlayerControls = ({
|
||||
itemId ?? "",
|
||||
currentTime > 0 ? ticksToSec(currentTime) : getCurrentTime(),
|
||||
),
|
||||
"Share this scene",
|
||||
"Поделиться этой сценой",
|
||||
)
|
||||
}
|
||||
aria-label="Share scene"
|
||||
title="Share scene"
|
||||
aria-label="Поделиться сценой"
|
||||
title="Поделиться сценой"
|
||||
>
|
||||
<span className="material-symbols-rounded">share</span>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={openSyncPlayDialog}
|
||||
aria-label="Watch together"
|
||||
title="Watch together"
|
||||
aria-label="Смотреть вместе"
|
||||
title="Смотреть вместе"
|
||||
>
|
||||
<span className="material-symbols-rounded">groups</span>
|
||||
</IconButton>
|
||||
<IconButton
|
||||
onClick={(e) => setSettingsMenuRef(e.currentTarget)}
|
||||
aria-label="Player settings"
|
||||
title="Player settings"
|
||||
aria-label="Настройки плеера"
|
||||
title="Настройки плеера"
|
||||
>
|
||||
<span className="material-symbols-rounded">settings</span>
|
||||
</IconButton>
|
||||
@@ -372,10 +459,10 @@ const VideoPlayerControls = ({
|
||||
})}
|
||||
/>
|
||||
<Tooltip
|
||||
title={syncThisVideo ? "Stop device sync" : "Sync playback"}
|
||||
title={syncThisVideo ? "Остановить синхронизацию" : "Синхронизация воспроизведения"}
|
||||
>
|
||||
<IconButton
|
||||
aria-label="Sync playback"
|
||||
aria-label="Синхронизация воспроизведения"
|
||||
onClick={toggleSync}
|
||||
sx={
|
||||
syncThisVideo
|
||||
@@ -390,7 +477,9 @@ const VideoPlayerControls = ({
|
||||
|
||||
<ChaptersListButton />
|
||||
|
||||
<VideoFitButton mode={fitMode} onChange={onFitModeChange} />
|
||||
<CaptionsButton />
|
||||
<PictureInPictureButton />
|
||||
<FullscreenButton />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -156,7 +156,7 @@ const VideoPlayerSettingsMenu = ({
|
||||
>
|
||||
<TextField
|
||||
select
|
||||
label="Audio"
|
||||
label="Аудио"
|
||||
variant="outlined"
|
||||
value={mediaSource.audio?.track}
|
||||
onChange={handleAudioTrackChange}
|
||||
@@ -171,7 +171,7 @@ const VideoPlayerSettingsMenu = ({
|
||||
</TextField>
|
||||
<TextField
|
||||
select
|
||||
label="Subtitles"
|
||||
label="Субтитры"
|
||||
variant="outlined"
|
||||
value={mediaSource.subtitle?.track}
|
||||
onChange={handleSubtitleChange}
|
||||
@@ -179,7 +179,7 @@ const VideoPlayerSettingsMenu = ({
|
||||
disabled={mediaSource.subtitle?.track === -2 || subtitleIsChanging}
|
||||
>
|
||||
<MenuItem key={-1} value={-1}>
|
||||
No Subtitle
|
||||
Без субтитров
|
||||
</MenuItem>
|
||||
{mediaSource.subtitle?.allTracks?.map((sub) => (
|
||||
<MenuItem key={sub.Index} value={sub.Index}>
|
||||
@@ -194,7 +194,7 @@ const VideoPlayerSettingsMenu = ({
|
||||
flexGrow: 1,
|
||||
}}
|
||||
>
|
||||
Stats for Nerds
|
||||
Статистика
|
||||
</Typography>
|
||||
<Switch checked={showStatsForNerds} />
|
||||
</MenuItem>
|
||||
@@ -204,7 +204,7 @@ const VideoPlayerSettingsMenu = ({
|
||||
flexGrow: 1,
|
||||
}}
|
||||
>
|
||||
Sync playback
|
||||
Синхронизация воспроизведения
|
||||
</Typography>
|
||||
<Switch
|
||||
checked={syncForThisVideo}
|
||||
@@ -219,7 +219,7 @@ const VideoPlayerSettingsMenu = ({
|
||||
flexGrow: 1,
|
||||
}}
|
||||
>
|
||||
Auto-skip intro & recap
|
||||
Автопропуск заставок, рекапов, рекламы и превью
|
||||
</Typography>
|
||||
<Switch
|
||||
checked={autoSkip}
|
||||
|
||||
@@ -106,7 +106,7 @@ const UpNextFlyout = () => {
|
||||
quality: 90,
|
||||
fillWidth: 320,
|
||||
})}
|
||||
alt="next item thumbnail"
|
||||
alt="Миниатюра следующего элемента"
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
@@ -142,7 +142,7 @@ const UpNextFlyout = () => {
|
||||
letterSpacing: 1.2,
|
||||
}}
|
||||
>
|
||||
UP NEXT
|
||||
ДАЛЕЕ
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h6"
|
||||
@@ -192,7 +192,7 @@ const UpNextFlyout = () => {
|
||||
flex: 1,
|
||||
}}
|
||||
>
|
||||
Play Now
|
||||
Смотреть
|
||||
</Button>
|
||||
<IconButton
|
||||
onClick={() => setIsHidden(true)}
|
||||
|
||||
@@ -35,7 +35,7 @@ const QRCodeImage = ({
|
||||
return (
|
||||
<img
|
||||
src={src}
|
||||
alt="QR code"
|
||||
alt="QR-код"
|
||||
width={size}
|
||||
height={size}
|
||||
style={{ display: "block", borderRadius: 12 }}
|
||||
|
||||
@@ -14,14 +14,14 @@ export const getQueueItemText = (item: BaseItemDto) => {
|
||||
? `E${item.IndexNumber}-${item.IndexNumberEnd}`
|
||||
: `E${item.IndexNumber}`;
|
||||
return {
|
||||
title: item.Name ?? "Unknown episode",
|
||||
title: item.Name ?? "Неизвестная серия",
|
||||
subtitle: [item.SeriesName, `S${item.ParentIndexNumber}:${episode}`]
|
||||
.filter(Boolean)
|
||||
.join(" · "),
|
||||
};
|
||||
}
|
||||
return {
|
||||
title: item.Name ?? "Unknown track",
|
||||
title: item.Name ?? "Неизвестный трек",
|
||||
subtitle: item.Artists?.join(", ") || item.AlbumArtist || "",
|
||||
};
|
||||
};
|
||||
@@ -122,7 +122,7 @@ export const QueueRow = React.forwardRef<
|
||||
{item.RunTimeTicks ? getRuntimeMusic(item.RunTimeTicks) : ""}
|
||||
</span>
|
||||
{onRemove && (
|
||||
<Tooltip title="Remove from queue">
|
||||
<Tooltip title="Удалить из очереди">
|
||||
<IconButton
|
||||
size="small"
|
||||
className="queue-row-remove"
|
||||
|
||||
@@ -81,7 +81,7 @@ const QueueView = ({ variant, onClose }: QueueViewProps) => {
|
||||
const remove = (item: BaseItemDto, index: number) => {
|
||||
removeFromQueue(index);
|
||||
const { title } = getQueueItemText(item);
|
||||
enqueueSnackbar(`Removed "${title}"`, {
|
||||
enqueueSnackbar(`«${title}» удалён`, {
|
||||
variant: "default",
|
||||
action: (key) => (
|
||||
<Button
|
||||
@@ -92,7 +92,7 @@ const QueueView = ({ variant, onClose }: QueueViewProps) => {
|
||||
closeSnackbar(key);
|
||||
}}
|
||||
>
|
||||
Undo
|
||||
Отменить
|
||||
</Button>
|
||||
),
|
||||
});
|
||||
@@ -101,7 +101,7 @@ const QueueView = ({ variant, onClose }: QueueViewProps) => {
|
||||
const clearAll = () => {
|
||||
const removed = upcoming;
|
||||
clearUpcoming();
|
||||
enqueueSnackbar(`Cleared ${removed.length} tracks from up next`, {
|
||||
enqueueSnackbar(`Очищено треков из очереди: ${removed.length}`, {
|
||||
action: (key) => (
|
||||
<Button
|
||||
color="inherit"
|
||||
@@ -115,7 +115,7 @@ const QueueView = ({ variant, onClose }: QueueViewProps) => {
|
||||
closeSnackbar(key);
|
||||
}}
|
||||
>
|
||||
Undo
|
||||
Отменить
|
||||
</Button>
|
||||
),
|
||||
});
|
||||
@@ -135,35 +135,35 @@ const QueueView = ({ variant, onClose }: QueueViewProps) => {
|
||||
const summary =
|
||||
upcoming.length > 0
|
||||
? `${upcoming.length} ${upcoming.length === 1 ? "track" : "tracks"} · ${getRuntimeCompact(upcomingTicks)}`
|
||||
: "Nothing queued";
|
||||
: "Очередь пуста";
|
||||
|
||||
return (
|
||||
<div className={`queue queue-${variant}`}>
|
||||
<header className="queue-header">
|
||||
<div className="queue-header-text">
|
||||
<h2 className="queue-title">
|
||||
{variant === "drawer" ? "Queue" : "Up next"}
|
||||
{variant === "drawer" ? "Очередь" : "Далее"}
|
||||
</h2>
|
||||
<span className="queue-summary">{summary}</span>
|
||||
</div>
|
||||
<div className="queue-header-actions">
|
||||
<Tooltip title="Shuffle up next">
|
||||
<Tooltip title="Перемешать очередь">
|
||||
<span>
|
||||
<IconButton
|
||||
onClick={shuffleUpcoming}
|
||||
disabled={upcoming.length < 2}
|
||||
aria-label="Shuffle up next"
|
||||
aria-label="Перемешать очередь"
|
||||
>
|
||||
<span className="material-symbols-rounded">shuffle</span>
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Tooltip title="Clear up next">
|
||||
<Tooltip title="Очистить очередь">
|
||||
<span>
|
||||
<IconButton
|
||||
onClick={clearAll}
|
||||
disabled={upcoming.length === 0}
|
||||
aria-label="Clear up next"
|
||||
aria-label="Очистить очередь"
|
||||
>
|
||||
<span className="material-symbols-rounded">
|
||||
playlist_remove
|
||||
@@ -172,7 +172,7 @@ const QueueView = ({ variant, onClose }: QueueViewProps) => {
|
||||
</span>
|
||||
</Tooltip>
|
||||
{onClose && (
|
||||
<IconButton onClick={onClose} aria-label="Close queue">
|
||||
<IconButton onClick={onClose} aria-label="Закрыть очередь">
|
||||
<span className="material-symbols-rounded">close</span>
|
||||
</IconButton>
|
||||
)}
|
||||
@@ -182,14 +182,14 @@ const QueueView = ({ variant, onClose }: QueueViewProps) => {
|
||||
<div className="queue-body">
|
||||
{variant === "drawer" && current && (
|
||||
<section className="queue-section">
|
||||
<h3 className="queue-section-label">Now playing</h3>
|
||||
<h3 className="queue-section-label">Сейчас играет</h3>
|
||||
<QueueRow item={current} variant="current" />
|
||||
</section>
|
||||
)}
|
||||
|
||||
<section className="queue-section">
|
||||
{variant === "drawer" && (
|
||||
<h3 className="queue-section-label">Up next</h3>
|
||||
<h3 className="queue-section-label">Далее</h3>
|
||||
)}
|
||||
{upcoming.length > 0 ? (
|
||||
<>
|
||||
@@ -219,7 +219,7 @@ const QueueView = ({ variant, onClose }: QueueViewProps) => {
|
||||
</SortableContext>
|
||||
</DndContext>
|
||||
<p className="queue-hint">
|
||||
Click a track to play it now · drag to reorder
|
||||
Нажмите на трек, чтобы включить его, перетащите для сортировки
|
||||
</p>
|
||||
</>
|
||||
) : (
|
||||
@@ -227,9 +227,9 @@ const QueueView = ({ variant, onClose }: QueueViewProps) => {
|
||||
<span className="material-symbols-rounded queue-empty-icon">
|
||||
queue_music
|
||||
</span>
|
||||
<span className="queue-empty-title">Nothing up next</span>
|
||||
<span className="queue-empty-title">Очередь пуста</span>
|
||||
<span className="queue-empty-text">
|
||||
Play an album, playlist or artist to fill the queue.
|
||||
Включите альбом, плейлист или исполнителя, чтобы заполнить очередь.
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
@@ -244,7 +244,7 @@ const QueueView = ({ variant, onClose }: QueueViewProps) => {
|
||||
aria-expanded={showHistory}
|
||||
>
|
||||
<span className="queue-section-label">
|
||||
Previously played · {history.length}
|
||||
Ранее играло · {history.length}
|
||||
</span>
|
||||
<span className="material-symbols-rounded">
|
||||
{showHistory ? "expand_less" : "expand_more"}
|
||||
|
||||
@@ -41,12 +41,12 @@ const QuickConnectApprovalDialog = () => {
|
||||
|
||||
const approve = async () => {
|
||||
if (!api || !user?.Id) {
|
||||
setError("Sign in before approving another device");
|
||||
setError("Войдите, чтобы подтвердить другое устройство");
|
||||
return;
|
||||
}
|
||||
const trimmed = code.trim().toUpperCase();
|
||||
if (!trimmed) {
|
||||
setError("Enter the code shown on the other device");
|
||||
setError("Введите код, показанный на другом устройстве");
|
||||
return;
|
||||
}
|
||||
setBusy(true);
|
||||
@@ -59,14 +59,14 @@ const QuickConnectApprovalDialog = () => {
|
||||
if (result.data) {
|
||||
setApproved(true);
|
||||
setStoreCode("");
|
||||
enqueueSnackbar("Device approved", { variant: "success" });
|
||||
enqueueSnackbar("Устройство подтверждено", { variant: "success" });
|
||||
setTimeout(close, 1200);
|
||||
} else {
|
||||
setError("This code is invalid or has expired");
|
||||
setError("Код недействителен или истёк");
|
||||
}
|
||||
} catch (reason) {
|
||||
console.error("Quick Connect approval failed", reason);
|
||||
setError("This code is invalid or has expired");
|
||||
setError("Код недействителен или истёк");
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
@@ -82,18 +82,18 @@ const QuickConnectApprovalDialog = () => {
|
||||
paper: { className: "glass", sx: { borderRadius: "22px" } },
|
||||
}}
|
||||
>
|
||||
<DialogTitle>Approve TV login</DialogTitle>
|
||||
<DialogTitle>Подтвердить вход на ТВ</DialogTitle>
|
||||
<DialogContent>
|
||||
<Stack spacing={2}>
|
||||
<Typography variant="body2" sx={{ opacity: 0.75 }}>
|
||||
Enter the Quick Connect code shown on the TV or another device. This
|
||||
signs that device in as {user?.Name ?? "your account"} without
|
||||
typing a password on it.
|
||||
Введите код Quick Connect, показанный на ТВ или другом устройстве. Это
|
||||
выполнит вход в аккаунт {user?.Name ?? "ваш аккаунт"} без ввода пароля
|
||||
на этом устройстве.
|
||||
</Typography>
|
||||
<TextField
|
||||
autoFocus
|
||||
fullWidth
|
||||
label="Quick Connect code"
|
||||
label="Код Quick Connect"
|
||||
value={code}
|
||||
onChange={(event) =>
|
||||
setCode(event.target.value.replace(/\s/g, "").toUpperCase())
|
||||
@@ -113,17 +113,17 @@ const QuickConnectApprovalDialog = () => {
|
||||
}}
|
||||
/>
|
||||
{error && <Alert severity="error">{error}</Alert>}
|
||||
{approved && <Alert severity="success">Device approved</Alert>}
|
||||
{approved && <Alert severity="success">Устройство подтверждено</Alert>}
|
||||
</Stack>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={close}>Cancel</Button>
|
||||
<Button onClick={close}>Отмена</Button>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={approve}
|
||||
disabled={busy || approved || !code.trim()}
|
||||
>
|
||||
{busy ? "Approving…" : "Approve"}
|
||||
{busy ? "Подтверждение…" : "Подтвердить"}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
@@ -215,7 +215,7 @@ const RealtimeBridge = () => {
|
||||
case GeneralCommandType.DisplayMessage:
|
||||
enqueueSnackbar(
|
||||
[args?.Header, args?.Text].filter(Boolean).join(": ") ||
|
||||
"Message from the server",
|
||||
"Сообщение с сервера",
|
||||
{
|
||||
variant: "info",
|
||||
autoHideDuration: Number(args?.TimeoutMs) || 5000,
|
||||
@@ -266,7 +266,7 @@ const RealtimeBridge = () => {
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Remote play failed", error);
|
||||
enqueueSnackbar("Could not start remote playback", {
|
||||
enqueueSnackbar("Не удалось запустить удалённое воспроизведение", {
|
||||
variant: "error",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -46,7 +46,7 @@ const formatTime = (ticks: number | null | undefined) => {
|
||||
};
|
||||
|
||||
const sessionLabel = (session: SessionInfoDto) =>
|
||||
session.DeviceName || session.Client || session.DeviceId || "Unknown device";
|
||||
session.DeviceName || session.Client || session.DeviceId || "Неизвестное устройство";
|
||||
|
||||
const RemoteControlDialog = () => {
|
||||
const { open, transfer, closeDialog } = useRemoteControlStore();
|
||||
@@ -87,7 +87,7 @@ const RemoteControlDialog = () => {
|
||||
});
|
||||
},
|
||||
onError: () =>
|
||||
enqueueSnackbar("Command failed", { variant: "error" }),
|
||||
enqueueSnackbar("Команда не выполнена", { variant: "error" }),
|
||||
onSettled: () => sessions.refetch(),
|
||||
});
|
||||
|
||||
@@ -105,8 +105,8 @@ const RemoteControlDialog = () => {
|
||||
onSuccess: async (_data, session) => {
|
||||
enqueueSnackbar(
|
||||
transfer?.kind === "audio" || transfer?.kind === "video"
|
||||
? `Playback transferred to ${sessionLabel(session)}`
|
||||
: `Playing on ${sessionLabel(session)}`,
|
||||
? `Воспроизведение перенесено на ${sessionLabel(session)}`
|
||||
: `Воспроизведение на ${sessionLabel(session)}`,
|
||||
{ variant: "success" },
|
||||
);
|
||||
if (transfer?.kind === "audio") {
|
||||
@@ -144,7 +144,7 @@ const RemoteControlDialog = () => {
|
||||
closeDialog();
|
||||
},
|
||||
onError: () =>
|
||||
enqueueSnackbar("Could not start playback on the device", {
|
||||
enqueueSnackbar("Не удалось запустить воспроизведение на устройстве", {
|
||||
variant: "error",
|
||||
}),
|
||||
});
|
||||
@@ -184,16 +184,16 @@ const RemoteControlDialog = () => {
|
||||
<DialogTitle sx={{ display: "flex", alignItems: "center", gap: 1 }}>
|
||||
<span className="material-symbols-rounded">cast</span>
|
||||
<span style={{ flex: 1 }}>
|
||||
{item ? `Play "${item.Name}" on…` : "Remote control"}
|
||||
{item ? `Воспроизвести «${item.Name}» на…` : "Удалённое управление"}
|
||||
</span>
|
||||
<IconButton onClick={closeDialog} aria-label="Close">
|
||||
<IconButton onClick={closeDialog} aria-label="Закрыть">
|
||||
<span className="material-symbols-rounded">close</span>
|
||||
</IconButton>
|
||||
</DialogTitle>
|
||||
<DialogContent sx={{ pb: 2 }}>
|
||||
{item && (
|
||||
<Typography variant="body2" sx={{ opacity: 0.7, mb: 1 }}>
|
||||
Choose a device to start playback on it.
|
||||
Выберите устройство для запуска воспроизведения.
|
||||
</Typography>
|
||||
)}
|
||||
{sessions.isPending ? (
|
||||
@@ -202,8 +202,8 @@ const RemoteControlDialog = () => {
|
||||
</div>
|
||||
) : remoteSessions.length === 0 ? (
|
||||
<Typography sx={{ opacity: 0.7, py: 2 }}>
|
||||
No other controllable devices are online. Open a Jellyfin client
|
||||
(e.g. on your TV) and make sure remote control is allowed.
|
||||
Нет доступных устройств. Откройте клиент Jellyfin (например, на ТВ)
|
||||
и разрешите удалённое управление.
|
||||
</Typography>
|
||||
) : (
|
||||
<List disablePadding>
|
||||
@@ -252,8 +252,8 @@ const RemoteControlDialog = () => {
|
||||
color="warning.main"
|
||||
sx={{ display: "block" }}
|
||||
>
|
||||
No active control channel (WebSocket) — check the
|
||||
reverse proxy.
|
||||
Нет канала управления (WebSocket) — проверьте
|
||||
обратный прокси.
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
@@ -264,7 +264,7 @@ const RemoteControlDialog = () => {
|
||||
disabled={playOn.isPending || !item.Id}
|
||||
onClick={() => playOn.mutate(session)}
|
||||
>
|
||||
Play here
|
||||
Смотреть здесь
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
@@ -300,10 +300,10 @@ const RemoteControlDialog = () => {
|
||||
>
|
||||
<Typography variant="caption" sx={{ opacity: 0.6 }}>
|
||||
{formatTime(position)} / {formatTime(duration)}
|
||||
{playState?.IsPaused ? " · paused" : ""}
|
||||
{playState?.IsPaused ? " · пауза" : ""}
|
||||
</Typography>
|
||||
<div style={{ display: "flex" }}>
|
||||
<Tooltip title="Back 10s">
|
||||
<Tooltip title="Назад на 10 с">
|
||||
<span>
|
||||
<IconButton
|
||||
size="small"
|
||||
@@ -316,7 +316,7 @@ const RemoteControlDialog = () => {
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Tooltip title="Previous">
|
||||
<Tooltip title="Предыдущий">
|
||||
<span>
|
||||
<IconButton
|
||||
size="small"
|
||||
@@ -335,7 +335,7 @@ const RemoteControlDialog = () => {
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
title={playState?.IsPaused ? "Play" : "Pause"}
|
||||
title={playState?.IsPaused ? "Смотреть" : "Пауза"}
|
||||
>
|
||||
<span>
|
||||
<IconButton
|
||||
@@ -356,7 +356,7 @@ const RemoteControlDialog = () => {
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Tooltip title="Next">
|
||||
<Tooltip title="Следующий">
|
||||
<span>
|
||||
<IconButton
|
||||
size="small"
|
||||
@@ -374,7 +374,7 @@ const RemoteControlDialog = () => {
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Tooltip title="Forward 10s">
|
||||
<Tooltip title="Вперёд на 10 с">
|
||||
<span>
|
||||
<IconButton
|
||||
size="small"
|
||||
@@ -387,7 +387,7 @@ const RemoteControlDialog = () => {
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Tooltip title="Stop">
|
||||
<Tooltip title="Остановить">
|
||||
<span>
|
||||
<IconButton
|
||||
size="small"
|
||||
@@ -410,7 +410,7 @@ const RemoteControlDialog = () => {
|
||||
</>
|
||||
) : (
|
||||
<Typography variant="caption" sx={{ opacity: 0.6 }}>
|
||||
Idle
|
||||
Свободно
|
||||
</Typography>
|
||||
)}
|
||||
</ListItem>
|
||||
|
||||
@@ -193,7 +193,7 @@ const Search = () => {
|
||||
</span>
|
||||
<InputBase
|
||||
inputRef={inputRef}
|
||||
placeholder="Search movies, shows, and more..."
|
||||
placeholder="Поиск фильмов, сериалов и другого..."
|
||||
onChange={handleSearchChange}
|
||||
value={searchTerm}
|
||||
fullWidth
|
||||
@@ -291,13 +291,13 @@ const Search = () => {
|
||||
display: "block",
|
||||
}}
|
||||
>
|
||||
Results
|
||||
Результаты
|
||||
</Typography>
|
||||
<Stack spacing={0.5} sx={{ px: 1 }}>
|
||||
{searchResults.data.SearchHints.map((item) => (
|
||||
<SearchItem
|
||||
key={item.Id}
|
||||
itemName={item.Name || "Untitled"}
|
||||
itemName={item.Name || "Без названия"}
|
||||
imageUrl={
|
||||
api &&
|
||||
item.PrimaryImageTag &&
|
||||
@@ -334,13 +334,13 @@ const Search = () => {
|
||||
display: "block",
|
||||
}}
|
||||
>
|
||||
Suggestions
|
||||
Подсказки
|
||||
</Typography>
|
||||
<Stack spacing={0.5} sx={{ px: 1 }}>
|
||||
{suggestions.data?.Items?.map((item) => (
|
||||
<SearchItem
|
||||
key={item.Id}
|
||||
itemName={item.Name || "Untitled"}
|
||||
itemName={item.Name || "Без названия"}
|
||||
imageUrl={
|
||||
api &&
|
||||
item.ImageTags?.Primary &&
|
||||
@@ -381,7 +381,7 @@ const Search = () => {
|
||||
search_off
|
||||
</span>
|
||||
<Typography variant="body1">
|
||||
No results found for "{debouncedSearchTerm}"
|
||||
Ничего не найдено по запросу «{debouncedSearchTerm}»
|
||||
</Typography>
|
||||
</Stack>
|
||||
)}
|
||||
@@ -420,7 +420,7 @@ const Search = () => {
|
||||
},
|
||||
}}
|
||||
>
|
||||
Advanced Search
|
||||
Расширенный поиск
|
||||
</Button>
|
||||
</Stack>
|
||||
</Dialog>
|
||||
|
||||
@@ -15,6 +15,23 @@ type SearchItemProps = {
|
||||
itemId: string;
|
||||
};
|
||||
|
||||
const typeLabels: Record<string, string> = {
|
||||
Movie: "Фильм",
|
||||
Series: "Сериал",
|
||||
Episode: "Серия",
|
||||
Audio: "Трек",
|
||||
AudioBook: "Аудиокнига",
|
||||
MusicAlbum: "Альбом",
|
||||
MusicArtist: "Исполнитель",
|
||||
Person: "Человек",
|
||||
Book: "Книга",
|
||||
Photo: "Фото",
|
||||
PhotoAlbum: "Фотоальбом",
|
||||
Playlist: "Плейлист",
|
||||
Video: "Видео",
|
||||
BoxSet: "Коллекция",
|
||||
};
|
||||
|
||||
const SearchItem = (props: SearchItemProps) => {
|
||||
const { itemName, imageUrl, itemYear, itemType, itemId } = props;
|
||||
const toggleSearchDialog = useSearchStore(
|
||||
@@ -123,7 +140,7 @@ const SearchItem = (props: SearchItemProps) => {
|
||||
color: "text.secondary",
|
||||
}}
|
||||
>
|
||||
{itemType}
|
||||
{typeLabels[itemType] ?? itemType}
|
||||
</Typography>
|
||||
)}
|
||||
</Stack>
|
||||
|
||||
@@ -25,7 +25,7 @@ const SettingOptionSelect = ({
|
||||
control={
|
||||
<TextField select onChange={(e) => setValue(e.target.value)}>
|
||||
<MenuItem key={"anyLanguage"} value={"anyLanguage"}>
|
||||
Any Language
|
||||
Любой язык
|
||||
</MenuItem>
|
||||
{options.map((option) => (
|
||||
<MenuItem
|
||||
|
||||
@@ -29,7 +29,7 @@ const ShareDialog = () => {
|
||||
|
||||
const copy = async () => {
|
||||
await writeText(link);
|
||||
enqueueSnackbar("Link copied", { variant: "success" });
|
||||
enqueueSnackbar("Ссылка скопирована", { variant: "success" });
|
||||
};
|
||||
|
||||
const openHere = async () => {
|
||||
@@ -38,7 +38,7 @@ const ShareDialog = () => {
|
||||
close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
enqueueSnackbar("Could not open the link", { variant: "error" });
|
||||
enqueueSnackbar("Не удалось открыть ссылку", { variant: "error" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ const ShareDialog = () => {
|
||||
paper: { className: "glass", sx: { borderRadius: "22px" } },
|
||||
}}
|
||||
>
|
||||
<DialogTitle>{title || "Share"}</DialogTitle>
|
||||
<DialogTitle>{title || "Поделиться"}</DialogTitle>
|
||||
<DialogContent>
|
||||
<Box
|
||||
sx={{
|
||||
@@ -69,8 +69,8 @@ const ShareDialog = () => {
|
||||
variant="body2"
|
||||
sx={{ opacity: 0.7, textAlign: "center" }}
|
||||
>
|
||||
Scan with Blink on a phone or TV, or copy the link to open it on
|
||||
another device.
|
||||
Отсканируйте код в Blink на телефоне или ТВ либо скопируйте ссылку,
|
||||
чтобы открыть её на другом устройстве.
|
||||
</Typography>
|
||||
<Box
|
||||
sx={{
|
||||
@@ -90,11 +90,11 @@ const ShareDialog = () => {
|
||||
</Box>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={openHere}>Open here</Button>
|
||||
<Button onClick={openHere}>Открыть здесь</Button>
|
||||
<Button variant="contained" onClick={copy}>
|
||||
Copy link
|
||||
Копировать ссылку
|
||||
</Button>
|
||||
<Button onClick={close}>Close</Button>
|
||||
<Button onClick={close}>Закрыть</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
@@ -62,7 +62,7 @@ const ShowMoreText = ({
|
||||
onClick={() => setDisplayFull((state) => !state)}
|
||||
// key={displayFull}
|
||||
>
|
||||
{displayFull ? "Show less" : "Show more"}
|
||||
{displayFull ? "Свернуть" : "Показать больше"}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -40,13 +40,13 @@ import useSyncPlayStore from "@/utils/store/syncPlay";
|
||||
const stateLabel = (state?: string) => {
|
||||
switch (state) {
|
||||
case "Waiting":
|
||||
return "Waiting for everyone";
|
||||
return "Ожидание устройств";
|
||||
case "Paused":
|
||||
return "Paused";
|
||||
return "Пауза";
|
||||
case "Playing":
|
||||
return "Playing";
|
||||
return "Идёт";
|
||||
default:
|
||||
return "Idle";
|
||||
return "Ожидание";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -149,7 +149,7 @@ const SyncPlayDialog = () => {
|
||||
>
|
||||
<DialogTitle sx={{ display: "flex", alignItems: "center", gap: 1 }}>
|
||||
<span className="material-symbols-rounded">groups</span>
|
||||
Watch together
|
||||
Смотреть вместе
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
{error && (
|
||||
@@ -161,7 +161,7 @@ const SyncPlayDialog = () => {
|
||||
<Stack spacing={2}>
|
||||
<Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>
|
||||
<Typography variant="h6" sx={{ flex: 1 }} noWrap>
|
||||
{group.GroupName || "SyncPlay group"}
|
||||
{group.GroupName || "Группа SyncPlay"}
|
||||
</Typography>
|
||||
<Chip
|
||||
size="small"
|
||||
@@ -175,7 +175,7 @@ const SyncPlayDialog = () => {
|
||||
? `${group.Participants.length} device${
|
||||
group.Participants.length === 1 ? "" : "s"
|
||||
} connected: ${group.Participants.join(", ")}`
|
||||
: "This is the first device in the group."}
|
||||
: "Это первое устройство в группе."}
|
||||
</Typography>
|
||||
<Divider />
|
||||
<Box sx={{ display: "flex", gap: 2, alignItems: "center" }}>
|
||||
@@ -209,20 +209,20 @@ const SyncPlayDialog = () => {
|
||||
)}
|
||||
<Box sx={{ minWidth: 0 }}>
|
||||
<Typography variant="overline" sx={{ opacity: 0.6 }}>
|
||||
Group queue
|
||||
Очередь группы
|
||||
</Typography>
|
||||
<Typography variant="subtitle1" noWrap>
|
||||
{currentItem.data?.Name ??
|
||||
(queueItemIds.length
|
||||
? "Loading item…"
|
||||
: "Nothing queued yet")}
|
||||
? "Загрузка…"
|
||||
: "Очередь пока пуста")}
|
||||
</Typography>
|
||||
<Typography variant="caption" sx={{ opacity: 0.65 }}>
|
||||
{queueItemIds.length
|
||||
? `${queueItemIds.length} item${
|
||||
queueItemIds.length === 1 ? "" : "s"
|
||||
} · item ${currentQueueIndex + 1}`
|
||||
: "Start a queue on the device that should lead."}
|
||||
: "Запустите очередь на устройстве, которое будет ведущим."}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
@@ -234,8 +234,8 @@ const SyncPlayDialog = () => {
|
||||
onClick={() => api && startSyncPlayQueue(api)}
|
||||
>
|
||||
{queueItemIds.length
|
||||
? "Replace with my queue"
|
||||
: "Share my queue"}
|
||||
? "Заменить моей очередью"
|
||||
: "Поделиться моей очередью"}
|
||||
</Button>
|
||||
{queueItemIds.length > 0 && user?.Id && (
|
||||
<Button
|
||||
@@ -247,7 +247,7 @@ const SyncPlayDialog = () => {
|
||||
}
|
||||
}}
|
||||
>
|
||||
Watch here
|
||||
Смотреть здесь
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
@@ -260,14 +260,14 @@ const SyncPlayDialog = () => {
|
||||
: resumeSyncPlayGroup(api))
|
||||
}
|
||||
>
|
||||
{group.State === "Playing" ? "Pause everyone" : "Play everyone"}
|
||||
{group.State === "Playing" ? "Пауза у всех" : "Воспроизвести у всех"}
|
||||
</Button>
|
||||
<Button
|
||||
color="error"
|
||||
disabled={loading}
|
||||
onClick={() => api && leaveSyncPlayGroup(api)}
|
||||
>
|
||||
Leave group
|
||||
Покинуть группу
|
||||
</Button>
|
||||
</Box>
|
||||
{loading && <CircularProgress size={20} />}
|
||||
@@ -275,16 +275,16 @@ const SyncPlayDialog = () => {
|
||||
) : (
|
||||
<Stack spacing={2}>
|
||||
<Typography variant="body2" sx={{ opacity: 0.75 }}>
|
||||
Create a group and start the current queue, or join a group
|
||||
created on another device. Every device that joins follows the
|
||||
same timeline.
|
||||
Создайте группу и запустите текущую очередь или войдите в
|
||||
группу, созданную на другом устройстве. Все устройства следуют
|
||||
одному таймлайну.
|
||||
</Typography>
|
||||
<Stack direction="row" spacing={1}>
|
||||
<TextField
|
||||
size="small"
|
||||
fullWidth
|
||||
label="Group name"
|
||||
placeholder="Movie night"
|
||||
label="Название группы"
|
||||
placeholder="Киновечер"
|
||||
value={groupName}
|
||||
onChange={(event) => setGroupName(event.target.value)}
|
||||
onKeyDown={(event) => {
|
||||
@@ -297,18 +297,18 @@ const SyncPlayDialog = () => {
|
||||
onClick={handleCreate}
|
||||
sx={{ flex: "0 0 auto" }}
|
||||
>
|
||||
Create
|
||||
Создать
|
||||
</Button>
|
||||
</Stack>
|
||||
<Divider />
|
||||
<Typography variant="overline" sx={{ opacity: 0.65 }}>
|
||||
Available groups
|
||||
Доступные группы
|
||||
</Typography>
|
||||
{groupsQuery.isPending ? (
|
||||
<CircularProgress size={20} />
|
||||
) : groups.length === 0 ? (
|
||||
<Typography variant="body2" sx={{ opacity: 0.6 }}>
|
||||
No groups yet. Create one above.
|
||||
Групп пока нет. Создайте выше.
|
||||
</Typography>
|
||||
) : (
|
||||
<List dense disablePadding>
|
||||
@@ -327,12 +327,12 @@ const SyncPlayDialog = () => {
|
||||
}
|
||||
}}
|
||||
>
|
||||
Join
|
||||
Войти
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
<ListItemText
|
||||
primary={entry.GroupName || "Watch together"}
|
||||
primary={entry.GroupName || "Смотреть вместе"}
|
||||
secondary={`${stateLabel(entry.State)} · ${
|
||||
entry.Participants?.length ?? 0
|
||||
} device${(entry.Participants?.length ?? 0) === 1 ? "" : "s"}`}
|
||||
@@ -345,7 +345,7 @@ const SyncPlayDialog = () => {
|
||||
)}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={handleClose}>Close</Button>
|
||||
<Button onClick={handleClose}>Закрыть</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
@@ -57,7 +57,7 @@ export default function Updater() {
|
||||
}
|
||||
});
|
||||
enqueueSnackbar(
|
||||
"Update has been installed! You need to relaunch Blink.",
|
||||
"Обновление установлено. Перезапустите Blink.",
|
||||
{
|
||||
variant: "success",
|
||||
},
|
||||
@@ -65,7 +65,7 @@ export default function Updater() {
|
||||
await relaunch();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
enqueueSnackbar(`Failed to update Blink. ${error}`, { variant: "error" });
|
||||
enqueueSnackbar(`Не удалось обновить Blink. ${error}`, { variant: "error" });
|
||||
}
|
||||
setUpdateDialogButton(false);
|
||||
}, [enqueueSnackbar, updateInfo, downloadSize]);
|
||||
@@ -160,7 +160,7 @@ export default function Updater() {
|
||||
color: "transparent",
|
||||
}}
|
||||
>
|
||||
Update Available
|
||||
Доступно обновление
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="body2"
|
||||
@@ -169,7 +169,7 @@ export default function Updater() {
|
||||
maxWidth: "25ch",
|
||||
}}
|
||||
>
|
||||
A new version of Blink is ready for you.
|
||||
Новая версия Blink готова к установке.
|
||||
</Typography>
|
||||
</Stack>
|
||||
|
||||
@@ -193,7 +193,7 @@ export default function Updater() {
|
||||
mb: 0.5,
|
||||
}}
|
||||
>
|
||||
Current
|
||||
Текущая
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
@@ -239,7 +239,7 @@ export default function Updater() {
|
||||
mb: 0.5,
|
||||
}}
|
||||
>
|
||||
New Version
|
||||
Новая версия
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
@@ -280,7 +280,7 @@ export default function Updater() {
|
||||
</span>
|
||||
}
|
||||
>
|
||||
See what's new
|
||||
Что нового
|
||||
</Button>
|
||||
</Stack>
|
||||
</DialogContent>
|
||||
@@ -308,7 +308,7 @@ export default function Updater() {
|
||||
},
|
||||
}}
|
||||
>
|
||||
Later
|
||||
Позже
|
||||
</Button>
|
||||
<Button
|
||||
size="large"
|
||||
@@ -340,7 +340,7 @@ export default function Updater() {
|
||||
},
|
||||
}}
|
||||
>
|
||||
Update
|
||||
Обновить
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
@@ -65,8 +65,8 @@ export const UserAvatarMenu = () => {
|
||||
<IconButton
|
||||
sx={menuButtonSx}
|
||||
onClick={handleMenuOpen}
|
||||
aria-label="Account menu"
|
||||
title="Account menu"
|
||||
aria-label="Меню аккаунта"
|
||||
title="Меню аккаунта"
|
||||
>
|
||||
{!!user?.Id &&
|
||||
(user?.PrimaryImageTag === undefined ? (
|
||||
@@ -104,7 +104,7 @@ export const UserAvatarMenu = () => {
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">logout</span>
|
||||
</ListItemIcon>
|
||||
Logout
|
||||
Выйти
|
||||
</MenuItem>
|
||||
<Divider />
|
||||
<MenuItem
|
||||
@@ -118,7 +118,7 @@ export const UserAvatarMenu = () => {
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">qr_code_2</span>
|
||||
</ListItemIcon>
|
||||
Approve device login
|
||||
Подтвердить вход на устройство
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
@@ -129,7 +129,7 @@ export const UserAvatarMenu = () => {
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">tune</span>
|
||||
</ListItemIcon>
|
||||
Preferences
|
||||
Настройки
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
@@ -140,7 +140,7 @@ export const UserAvatarMenu = () => {
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">info</span>
|
||||
</ListItemIcon>
|
||||
About
|
||||
О приложении
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</div>
|
||||
|
||||
@@ -35,16 +35,16 @@ const WindowsControls = () => {
|
||||
<div className="window-controls">
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Minimize"
|
||||
title="Minimize"
|
||||
aria-label="Свернуть"
|
||||
title="Свернуть"
|
||||
onClick={() => getCurrentWindow().minimize()}
|
||||
>
|
||||
<span className="material-symbols-rounded">remove</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
aria-label={maximized ? "Restore" : "Maximize"}
|
||||
title={maximized ? "Restore" : "Maximize"}
|
||||
aria-label={maximized ? "Восстановить" : "Развернуть"}
|
||||
title={maximized ? "Восстановить" : "Развернуть"}
|
||||
onClick={() => getCurrentWindow().toggleMaximize()}
|
||||
>
|
||||
<span className="material-symbols-rounded">
|
||||
@@ -54,8 +54,8 @@ const WindowsControls = () => {
|
||||
<button
|
||||
type="button"
|
||||
className="window-controls-close"
|
||||
aria-label="Close"
|
||||
title="Close"
|
||||
aria-label="Закрыть"
|
||||
title="Закрыть"
|
||||
onClick={() => getCurrentWindow().close()}
|
||||
>
|
||||
<span className="material-symbols-rounded">close</span>
|
||||
|
||||
@@ -152,7 +152,7 @@ function FavoritePage() {
|
||||
const sections = [
|
||||
{
|
||||
id: "movies",
|
||||
title: "Movies",
|
||||
title: "Фильмы",
|
||||
query: movies,
|
||||
renderCard: (item: BaseItemDto) => (
|
||||
<Card
|
||||
@@ -169,7 +169,7 @@ function FavoritePage() {
|
||||
},
|
||||
{
|
||||
id: "series",
|
||||
title: "TV Shows",
|
||||
title: "Сериалы",
|
||||
query: series,
|
||||
renderCard: (item: BaseItemDto) => (
|
||||
<Card
|
||||
@@ -177,7 +177,7 @@ function FavoritePage() {
|
||||
item={item}
|
||||
cardTitle={item.Name}
|
||||
imageType={"Primary"}
|
||||
cardCaption={`${item.ProductionYear} - ${item.EndDate ? new Date(item.EndDate).getFullYear() : "Present"}`}
|
||||
cardCaption={`${item.ProductionYear} - ${item.EndDate ? new Date(item.EndDate).getFullYear() : "н.в."}`}
|
||||
cardType="portrait"
|
||||
queryKey={["favorite", "series"]}
|
||||
userId={user?.Id}
|
||||
@@ -186,7 +186,7 @@ function FavoritePage() {
|
||||
},
|
||||
{
|
||||
id: "albums",
|
||||
title: "Albums",
|
||||
title: "Альбомы",
|
||||
query: musicAlbum,
|
||||
renderCard: (item: BaseItemDto) => (
|
||||
<Card
|
||||
@@ -204,7 +204,7 @@ function FavoritePage() {
|
||||
},
|
||||
{
|
||||
id: "artists",
|
||||
title: "Artists",
|
||||
title: "Исполнители",
|
||||
query: musicArtists,
|
||||
renderCard: (item: BaseItemDto) => (
|
||||
<Card
|
||||
@@ -221,7 +221,7 @@ function FavoritePage() {
|
||||
},
|
||||
{
|
||||
id: "audio",
|
||||
title: "Songs",
|
||||
title: "Песни",
|
||||
query: audio,
|
||||
renderCard: (item: BaseItemDto) => (
|
||||
<Card
|
||||
@@ -238,7 +238,7 @@ function FavoritePage() {
|
||||
},
|
||||
{
|
||||
id: "books",
|
||||
title: "Books",
|
||||
title: "Книги",
|
||||
query: book,
|
||||
renderCard: (item: BaseItemDto) => (
|
||||
<Card
|
||||
@@ -256,7 +256,7 @@ function FavoritePage() {
|
||||
},
|
||||
{
|
||||
id: "person",
|
||||
title: "People",
|
||||
title: "Люди",
|
||||
query: person,
|
||||
renderCard: (item: BaseItemDto) => (
|
||||
<Card
|
||||
@@ -282,7 +282,7 @@ function FavoritePage() {
|
||||
<div className="favorite-header">
|
||||
<div className="header-content">
|
||||
<Typography variant="h1" component="h1">
|
||||
Your Favorites
|
||||
Ваше избранное
|
||||
</Typography>
|
||||
</div>
|
||||
<Tabs
|
||||
@@ -290,9 +290,9 @@ function FavoritePage() {
|
||||
onChange={handleTabChange}
|
||||
variant="scrollable"
|
||||
scrollButtons="auto"
|
||||
aria-label="favorite sections"
|
||||
aria-label="разделы избранного"
|
||||
>
|
||||
<Tab label="Overview" value="overview" />
|
||||
<Tab label="Обзор" value="overview" />
|
||||
{availableSections.map((section) => (
|
||||
<Tab key={section.id} label={section.title} value={section.id} />
|
||||
))}
|
||||
@@ -315,9 +315,9 @@ function FavoritePage() {
|
||||
))}
|
||||
{availableSections.length === 0 && (
|
||||
<div className="empty-state">
|
||||
<Typography variant="h5">No favorites yet</Typography>
|
||||
<Typography variant="h5">В избранном пока пусто</Typography>
|
||||
<Typography variant="body1">
|
||||
Mark items as favorite to see them here.
|
||||
Добавляйте элементы в избранное, чтобы видеть их здесь.
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -50,8 +50,10 @@ body.has-player-bar .home-cinema {
|
||||
}
|
||||
|
||||
// Keep the menu clear of the macOS traffic lights now that the frame
|
||||
// reaches the window edges.
|
||||
// reaches the window edges, and align it vertically with them.
|
||||
html.is-macos & {
|
||||
padding-top: 0.6rem;
|
||||
|
||||
&-left {
|
||||
padding-left: 64px;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ const HomeHeader = ({ libraries, onNewAndPopular }: HomeHeaderProps) => {
|
||||
<header className="home-header" data-tauri-drag-region>
|
||||
<div className="home-header-left" data-tauri-drag-region>
|
||||
<IconButton
|
||||
aria-label="Open navigation"
|
||||
aria-label="Открыть меню"
|
||||
onClick={() => setDrawerOpen(true)}
|
||||
>
|
||||
<span className="material-symbols-rounded">menu</span>
|
||||
@@ -53,7 +53,7 @@ const HomeHeader = ({ libraries, onNewAndPopular }: HomeHeaderProps) => {
|
||||
className="home-nav-link"
|
||||
onClick={openMovies}
|
||||
>
|
||||
Movies
|
||||
Фильмы
|
||||
</button>
|
||||
)}
|
||||
{showsLibrary?.Id && (
|
||||
@@ -62,7 +62,7 @@ const HomeHeader = ({ libraries, onNewAndPopular }: HomeHeaderProps) => {
|
||||
className="home-nav-link"
|
||||
onClick={openShows}
|
||||
>
|
||||
Shows
|
||||
Сериалы
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
@@ -70,7 +70,7 @@ const HomeHeader = ({ libraries, onNewAndPopular }: HomeHeaderProps) => {
|
||||
className="home-nav-link"
|
||||
onClick={onNewAndPopular}
|
||||
>
|
||||
New & Popular
|
||||
Новинки
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -104,18 +104,18 @@ const HomeHeader = ({ libraries, onNewAndPopular }: HomeHeaderProps) => {
|
||||
|
||||
<div className="home-header-right">
|
||||
<IconButton
|
||||
aria-label="Watch together"
|
||||
title="Watch together"
|
||||
aria-label="Смотреть вместе"
|
||||
title="Смотреть вместе"
|
||||
onClick={openSyncPlayDialog}
|
||||
>
|
||||
<span className="material-symbols-rounded">groups</span>
|
||||
</IconButton>
|
||||
<IconButton aria-label="Search" onClick={toggleSearchDialog}>
|
||||
<IconButton aria-label="Поиск" onClick={toggleSearchDialog}>
|
||||
<span className="material-symbols-rounded">search</span>
|
||||
</IconButton>
|
||||
<CastButton />
|
||||
<IconButton
|
||||
aria-label="Favorites"
|
||||
aria-label="Избранное"
|
||||
onClick={() => navigate({ to: "/favorite" })}
|
||||
>
|
||||
<span className="material-symbols-rounded">favorite</span>
|
||||
|
||||
@@ -195,7 +195,7 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
<section
|
||||
className="home-skeleton"
|
||||
aria-busy="true"
|
||||
aria-label="Loading home"
|
||||
aria-label="Загрузка главной"
|
||||
>
|
||||
<div className="home-skeleton-copy">
|
||||
<span className="home-skeleton-pill" />
|
||||
@@ -235,11 +235,11 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
<ErrorBoundary
|
||||
fallback={
|
||||
<div className="error">
|
||||
<Typography>Error with Carousel</Typography>
|
||||
<Typography>Ошибка карусели</Typography>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<CardScroller displayCards={4} title="Libraries">
|
||||
<CardScroller displayCards={4} title="Библиотеки">
|
||||
{libraries.data?.Items?.map((item) => {
|
||||
return (
|
||||
<Card
|
||||
@@ -263,12 +263,12 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
<ErrorBoundary
|
||||
fallback={
|
||||
<div className="error">
|
||||
<Typography>Error with Libraries</Typography>
|
||||
<Typography>Ошибка библиотек</Typography>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
{upNextItems.isSuccess && upNextItems.data?.TotalRecordCount && (
|
||||
<CardScroller displayCards={4} title="Up Next">
|
||||
<CardScroller displayCards={4} title="Далее">
|
||||
{upNextItems.data?.Items?.map((item) => {
|
||||
return (
|
||||
<Card
|
||||
@@ -296,10 +296,10 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
: item.Type === BaseItemKind.Series
|
||||
? `${item.ProductionYear} - ${
|
||||
item.EndDate
|
||||
? new Date(item.EndDate).toLocaleString([], {
|
||||
? new Date(item.EndDate).toLocaleString("ru-RU", {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
: "н.в."
|
||||
}`
|
||||
: item.ProductionYear
|
||||
}
|
||||
@@ -315,7 +315,7 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
<ErrorBoundary
|
||||
fallback={
|
||||
<div className="error">
|
||||
<Typography>Error with resumeItemsVideo</Typography>
|
||||
<Typography>Ошибка продолжения просмотра</Typography>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
@@ -323,7 +323,7 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
!resumeItemsVideo.data?.TotalRecordCount ? (
|
||||
<></>
|
||||
) : (
|
||||
<CardScroller displayCards={4} title="Continue Watching">
|
||||
<CardScroller displayCards={4} title="Продолжить просмотр">
|
||||
{resumeItemsVideo.data?.Items?.map((item) => {
|
||||
return (
|
||||
<Card
|
||||
@@ -347,10 +347,10 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
: item.Type === BaseItemKind.Series
|
||||
? `${item.ProductionYear} - ${
|
||||
item.EndDate
|
||||
? new Date(item.EndDate).toLocaleString([], {
|
||||
? new Date(item.EndDate).toLocaleString("ru-RU", {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
: "н.в."
|
||||
}`
|
||||
: item.ProductionYear
|
||||
}
|
||||
@@ -366,7 +366,7 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
<ErrorBoundary
|
||||
fallback={
|
||||
<div className="error">
|
||||
<Typography>Error with resumeItemsAudio</Typography>
|
||||
<Typography>Ошибка продолжения прослушивания</Typography>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
@@ -374,7 +374,7 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
!resumeItemsAudio.data?.TotalRecordCount ? (
|
||||
<></>
|
||||
) : (
|
||||
<CardScroller displayCards={4} title="Continue Listening">
|
||||
<CardScroller displayCards={4} title="Продолжить прослушивание">
|
||||
{resumeItemsAudio.data?.Items?.map((item) => {
|
||||
return (
|
||||
<Card
|
||||
@@ -395,7 +395,7 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
|
||||
<ErrorBoundary
|
||||
fallback={
|
||||
<div className="error">
|
||||
<Typography>Error with LatestMediaSections</Typography>
|
||||
<Typography>Ошибка новых материалов</Typography>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
|
||||
@@ -87,7 +87,7 @@ function Library() {
|
||||
);
|
||||
// Derive top app title from Zustand slice (library name)
|
||||
useEffect(() => {
|
||||
const title = storeLibraryName ?? "Library";
|
||||
const title = storeLibraryName ?? "Библиотека";
|
||||
setPageTitle(title);
|
||||
return () => setPageTitle(null);
|
||||
}, [storeLibraryName, setPageTitle]);
|
||||
|
||||
@@ -46,10 +46,10 @@ function LoginUser() {
|
||||
const handleLogin = useMutation({
|
||||
mutationKey: ["login", "authenticate"],
|
||||
mutationFn: async () => {
|
||||
if (!api) throw new Error("API not initialized");
|
||||
if (!api) throw new Error("API не инициализировано");
|
||||
const authenticate = await api.authenticateUserByName(userName, password);
|
||||
if (!authenticate.data.AccessToken) {
|
||||
throw new Error("No access token received");
|
||||
throw new Error("Не удалось получить токен доступа");
|
||||
}
|
||||
createApi(api.basePath, authenticate.data.AccessToken);
|
||||
if (authenticate.data.SessionInfo?.UserId && rememberMe) {
|
||||
@@ -69,8 +69,8 @@ function LoginUser() {
|
||||
console.error(err);
|
||||
setError(
|
||||
needsPassword
|
||||
? "Incorrect password. Please try again."
|
||||
: "Couldn't sign in. Please try again.",
|
||||
? "Неверный пароль. Попробуйте ещё раз."
|
||||
: "Не удалось войти. Попробуйте ещё раз.",
|
||||
);
|
||||
setPassword("");
|
||||
},
|
||||
@@ -84,16 +84,16 @@ function LoginUser() {
|
||||
|
||||
return (
|
||||
<LoginShell
|
||||
title={`Welcome back, ${userName}`}
|
||||
title={`С возвращением, ${userName}`}
|
||||
subtitle={
|
||||
needsPassword
|
||||
? "Enter your password to continue"
|
||||
: "This profile doesn't need a password"
|
||||
? "Введите пароль, чтобы продолжить"
|
||||
: "Этот профиль не требует пароля"
|
||||
}
|
||||
footer={
|
||||
<Link to="/login/list" className="login-link">
|
||||
<span className="material-symbols-rounded">switch_account</span>
|
||||
Not you? Switch user
|
||||
Не вы? Сменить пользователя
|
||||
</Link>
|
||||
}
|
||||
>
|
||||
@@ -110,7 +110,7 @@ function LoginUser() {
|
||||
<TextField
|
||||
fullWidth
|
||||
autoFocus
|
||||
label="Password"
|
||||
label="Пароль"
|
||||
variant="outlined"
|
||||
type={showPassword ? "text" : "password"}
|
||||
autoComplete="current-password"
|
||||
@@ -129,7 +129,7 @@ function LoginUser() {
|
||||
onClick={() => setShowPassword((show) => !show)}
|
||||
edge="end"
|
||||
aria-label={
|
||||
showPassword ? "Hide password" : "Show password"
|
||||
showPassword ? "Скрыть пароль" : "Показать пароль"
|
||||
}
|
||||
>
|
||||
<span className="material-symbols-rounded">
|
||||
@@ -156,7 +156,7 @@ function LoginUser() {
|
||||
onChange={(_, checked) => setRememberMe(checked)}
|
||||
/>
|
||||
}
|
||||
label="Keep me signed in"
|
||||
label="Запомнить меня"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -168,7 +168,7 @@ function LoginUser() {
|
||||
fullWidth
|
||||
loading={handleLogin.isPending || handleLogin.isSuccess}
|
||||
>
|
||||
Sign in
|
||||
Войти
|
||||
</Button>
|
||||
</form>
|
||||
</LoginShell>
|
||||
|
||||
@@ -21,8 +21,8 @@ function LoginPublicUsersList() {
|
||||
return (
|
||||
<LoginShell
|
||||
width="wide"
|
||||
title="Who's watching?"
|
||||
subtitle="Choose your profile to sign in"
|
||||
title="Кто смотрит?"
|
||||
subtitle="Выберите профиль для входа"
|
||||
>
|
||||
<div className="profile-grid">
|
||||
{users.isPending &&
|
||||
@@ -39,7 +39,7 @@ function LoginPublicUsersList() {
|
||||
className="profile"
|
||||
to="/login/$userId/$userName"
|
||||
params={{ userId: user.Id ?? "", userName: user.Name ?? "" }}
|
||||
aria-label={`Sign in as ${user.Name}`}
|
||||
aria-label={`Войти как ${user.Name}`}
|
||||
>
|
||||
<ProfileAvatar
|
||||
userId={user.Id ?? ""}
|
||||
@@ -55,20 +55,20 @@ function LoginPublicUsersList() {
|
||||
<Link
|
||||
className="profile"
|
||||
to="/login/manual"
|
||||
aria-label="Sign in with a username"
|
||||
aria-label="Войти по имени пользователя"
|
||||
>
|
||||
<span className="profile-avatar profile-avatar-add">
|
||||
<span className="material-symbols-rounded">person_add</span>
|
||||
</span>
|
||||
<span className="profile-name">Other user</span>
|
||||
<span className="profile-name">Другой пользователь</span>
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{users.isError && (
|
||||
<p className="login-shell-subtitle" style={{ textAlign: "center" }}>
|
||||
Couldn't load profiles from this server. Use "Other user" to sign in
|
||||
with your username.
|
||||
Не удалось загрузить профили с этого сервера. Используйте «Другой
|
||||
пользователь», чтобы войти по имени и паролю.
|
||||
</p>
|
||||
)}
|
||||
</LoginShell>
|
||||
|
||||
@@ -39,13 +39,13 @@ function UserLoginManual() {
|
||||
const handleLogin = useMutation({
|
||||
mutationKey: ["login", "authenticate"],
|
||||
mutationFn: async () => {
|
||||
if (!api) throw new Error("Api is not available");
|
||||
if (!api) throw new Error("API недоступно");
|
||||
const authenticate = await api.authenticateUserByName(
|
||||
username.trim(),
|
||||
password,
|
||||
);
|
||||
if (!authenticate.data?.AccessToken) {
|
||||
throw new Error("Access token not available");
|
||||
throw new Error("Не удалось получить токен доступа");
|
||||
}
|
||||
createApi(api.basePath, authenticate.data.AccessToken);
|
||||
if (rememberMe) {
|
||||
@@ -63,7 +63,7 @@ function UserLoginManual() {
|
||||
},
|
||||
onError: (err) => {
|
||||
console.error(err);
|
||||
setError("Incorrect username or password.");
|
||||
setError("Неверное имя пользователя или пароль.");
|
||||
setPassword("");
|
||||
},
|
||||
});
|
||||
@@ -71,7 +71,7 @@ function UserLoginManual() {
|
||||
const handleSubmit = (event: FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
if (!username.trim()) {
|
||||
setError("Enter your username.");
|
||||
setError("Введите имя пользователя.");
|
||||
return;
|
||||
}
|
||||
setError(null);
|
||||
@@ -80,12 +80,12 @@ function UserLoginManual() {
|
||||
|
||||
return (
|
||||
<LoginShell
|
||||
title="Sign in"
|
||||
subtitle="Use your username and password"
|
||||
title="Войти"
|
||||
subtitle="Введите имя пользователя и пароль"
|
||||
footer={
|
||||
<Link to="/login/list" className="login-link">
|
||||
<span className="material-symbols-rounded">group</span>
|
||||
Choose a profile instead
|
||||
Выбрать профиль
|
||||
</Link>
|
||||
}
|
||||
>
|
||||
@@ -93,7 +93,7 @@ function UserLoginManual() {
|
||||
<TextField
|
||||
fullWidth
|
||||
autoFocus
|
||||
label="Username"
|
||||
label="Имя пользователя"
|
||||
variant="outlined"
|
||||
autoComplete="username"
|
||||
value={username}
|
||||
@@ -105,7 +105,7 @@ function UserLoginManual() {
|
||||
/>
|
||||
<TextField
|
||||
fullWidth
|
||||
label="Password"
|
||||
label="Пароль"
|
||||
variant="outlined"
|
||||
type={showPassword ? "text" : "password"}
|
||||
autoComplete="current-password"
|
||||
@@ -115,7 +115,7 @@ function UserLoginManual() {
|
||||
setError(null);
|
||||
}}
|
||||
error={Boolean(error) && Boolean(username.trim())}
|
||||
helperText={error ?? "Leave blank if your account has no password"}
|
||||
helperText={error ?? "Оставьте пустым, если у аккаунта нет пароля"}
|
||||
slotProps={{
|
||||
input: {
|
||||
endAdornment: (
|
||||
@@ -124,7 +124,7 @@ function UserLoginManual() {
|
||||
onClick={() => setShowPassword((show) => !show)}
|
||||
edge="end"
|
||||
aria-label={
|
||||
showPassword ? "Hide password" : "Show password"
|
||||
showPassword ? "Скрыть пароль" : "Показать пароль"
|
||||
}
|
||||
>
|
||||
<span className="material-symbols-rounded">
|
||||
@@ -145,7 +145,7 @@ function UserLoginManual() {
|
||||
onChange={(_, checked) => setRememberMe(checked)}
|
||||
/>
|
||||
}
|
||||
label="Keep me signed in"
|
||||
label="Запомнить меня"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -157,7 +157,7 @@ function UserLoginManual() {
|
||||
fullWidth
|
||||
loading={handleLogin.isPending || handleLogin.isSuccess}
|
||||
>
|
||||
Sign in
|
||||
Войти
|
||||
</Button>
|
||||
</form>
|
||||
</LoginShell>
|
||||
|
||||
@@ -173,8 +173,8 @@ function MusicAlbumTitlePage() {
|
||||
</Typography>
|
||||
<Typography className="opacity-07">
|
||||
{(musicTracks.data?.TotalRecordCount ?? 0) > 1
|
||||
? `${musicTracks.data?.TotalRecordCount} songs`
|
||||
: "Single"}
|
||||
? `${musicTracks.data?.TotalRecordCount} песен`
|
||||
: "Сингл"}
|
||||
</Typography>
|
||||
<Typography className="opacity-07">
|
||||
{getRuntimeCompact(item.data.CumulativeRunTimeTicks ?? 0)}
|
||||
@@ -210,12 +210,12 @@ function MusicAlbumTitlePage() {
|
||||
>
|
||||
album
|
||||
</span>
|
||||
<Typography variant="h5">Disc {disc}</Typography>
|
||||
<Typography variant="h5">Диск {disc}</Typography>
|
||||
</div>
|
||||
<div className="item-info-track header">
|
||||
<span className="material-symbols-rounded index">tag</span>
|
||||
<Typography variant="subtitle1">Title</Typography>
|
||||
<Typography variant="subtitle1">Duration</Typography>
|
||||
<Typography variant="subtitle1">Название</Typography>
|
||||
<Typography variant="subtitle1">Длительность</Typography>
|
||||
</div>
|
||||
{musicTracks.data?.Items?.map(
|
||||
(track, index) =>
|
||||
@@ -234,8 +234,8 @@ function MusicAlbumTitlePage() {
|
||||
<div>
|
||||
<div className="item-info-track header">
|
||||
<span className="material-symbols-rounded index">tag</span>
|
||||
<Typography variant="subtitle1">Title</Typography>
|
||||
<Typography variant="subtitle1">Duration</Typography>
|
||||
<Typography variant="subtitle1">Название</Typography>
|
||||
<Typography variant="subtitle1">Длительность</Typography>
|
||||
</div>
|
||||
{musicTracks.data?.Items?.map((track, index) => (
|
||||
<AlbumMusicTrack
|
||||
@@ -293,7 +293,7 @@ function MusicAlbumTitlePage() {
|
||||
)}
|
||||
{(similarItems.data?.TotalRecordCount ?? 0) > 0 && (
|
||||
<CardScroller
|
||||
title="You might also like"
|
||||
title="Вам может понравиться"
|
||||
displayCards={5}
|
||||
disableDecoration
|
||||
>
|
||||
@@ -315,10 +315,10 @@ function MusicAlbumTitlePage() {
|
||||
: similar.Type === BaseItemKind.Series
|
||||
? `${similar.ProductionYear} - ${
|
||||
similar.EndDate
|
||||
? new Date(similar.EndDate).toLocaleString([], {
|
||||
? new Date(similar.EndDate).toLocaleString("ru-RU", {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
: "н.в."
|
||||
}`
|
||||
: similar.ProductionYear
|
||||
}
|
||||
|
||||
@@ -158,9 +158,9 @@ function ArtistTitlePage() {
|
||||
});
|
||||
|
||||
const artistTabs = [
|
||||
{ title: "Discography", data: artistDiscography },
|
||||
{ title: "Songs", data: artistSongs },
|
||||
{ title: "Appearances", data: artistAppearances },
|
||||
{ title: "Дискография", data: artistDiscography },
|
||||
{ title: "Песни", data: artistSongs },
|
||||
{ title: "Участие", data: artistAppearances },
|
||||
];
|
||||
const [activeArtistTab, setActiveArtistTab] = useState(0);
|
||||
|
||||
@@ -260,10 +260,10 @@ function ArtistTitlePage() {
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
<Tooltip title="Shuffle">
|
||||
<Tooltip title="Перемешать">
|
||||
<span>
|
||||
<IconButton
|
||||
aria-label="Shuffle"
|
||||
aria-label="Перемешать"
|
||||
disabled={!artistSongs.data?.Items?.length}
|
||||
onClick={() =>
|
||||
shuffleAndPlay(
|
||||
@@ -323,9 +323,9 @@ function ArtistTitlePage() {
|
||||
>
|
||||
{item.data.PremiereDate && (
|
||||
<div>
|
||||
<Typography variant="h5">Born</Typography>
|
||||
<Typography variant="h5">Дата рождения</Typography>
|
||||
<Typography sx={{ opacity: 0.8 }}>
|
||||
{new Date(item.data.PremiereDate).toDateString()}
|
||||
{new Date(item.data.PremiereDate).toLocaleDateString("ru-RU")}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
@@ -337,10 +337,10 @@ function ArtistTitlePage() {
|
||||
mt: 2,
|
||||
}}
|
||||
>
|
||||
Death
|
||||
Дата смерти
|
||||
</Typography>
|
||||
<Typography sx={{ opacity: 0.8 }}>
|
||||
{new Date(item.data.EndDate).toDateString()}
|
||||
{new Date(item.data.EndDate).toLocaleDateString("ru-RU")}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -117,8 +117,8 @@ function PlaylistTitlePage() {
|
||||
<div className="flex flex-align-center item-info-playlist-info">
|
||||
<Typography className="opacity-07">
|
||||
{(musicTracks.data?.TotalRecordCount ?? 0) > 1
|
||||
? `${musicTracks.data?.TotalRecordCount} songs`
|
||||
: "Single"}
|
||||
? `${musicTracks.data?.TotalRecordCount} песен`
|
||||
: "Сингл"}
|
||||
</Typography>
|
||||
<Typography className="opacity-07">
|
||||
{getRuntimeCompact(item.data.CumulativeRunTimeTicks ?? 0)}
|
||||
@@ -143,8 +143,8 @@ function PlaylistTitlePage() {
|
||||
<div>
|
||||
<div className="item-info-track header">
|
||||
<span className="material-symbols-rounded index">tag</span>
|
||||
<Typography variant="subtitle1">Title</Typography>
|
||||
<Typography variant="subtitle1">Duration</Typography>
|
||||
<Typography variant="subtitle1">Название</Typography>
|
||||
<Typography variant="subtitle1">Длительность</Typography>
|
||||
</div>
|
||||
{musicTracks.data?.Items?.map((track, index) => (
|
||||
<AlbumMusicTrack
|
||||
@@ -201,7 +201,7 @@ function PlaylistTitlePage() {
|
||||
)}
|
||||
{(similarItems.data?.TotalRecordCount ?? 0) > 0 && (
|
||||
<CardScroller
|
||||
title="You might also like"
|
||||
title="Вам может понравиться"
|
||||
displayCards={5}
|
||||
disableDecoration
|
||||
>
|
||||
@@ -223,10 +223,10 @@ function PlaylistTitlePage() {
|
||||
: similar.Type === BaseItemKind.Series
|
||||
? `${similar.ProductionYear} - ${
|
||||
similar.EndDate
|
||||
? new Date(similar.EndDate).toLocaleString([], {
|
||||
? new Date(similar.EndDate).toLocaleString("ru-RU", {
|
||||
year: "numeric",
|
||||
})
|
||||
: "Present"
|
||||
: "н.в."
|
||||
}`
|
||||
: similar.ProductionYear
|
||||
}
|
||||
|
||||
@@ -47,9 +47,9 @@ export const Route = createFileRoute("/_api/player/audio")({
|
||||
});
|
||||
|
||||
const repeatLabels: Record<RepeatMode, string> = {
|
||||
off: "Repeat off",
|
||||
all: "Repeat all",
|
||||
one: "Repeat one",
|
||||
off: "Повтор выкл.",
|
||||
all: "Повтор всех",
|
||||
one: "Повтор одного",
|
||||
};
|
||||
|
||||
/** Artists (linked) and album (linked) for the current track. */
|
||||
@@ -186,7 +186,7 @@ function AudioPlayerRoute() {
|
||||
<section className="audio-now-playing" key={item?.Id}>
|
||||
<div className="audio-now-playing-art">
|
||||
{imageUrl ? (
|
||||
<img alt={item?.Name ?? "Album art"} src={imageUrl} />
|
||||
<img alt={item?.Name ?? "Обложка"} src={imageUrl} />
|
||||
) : (
|
||||
<span className="material-symbols-rounded">music_note</span>
|
||||
)}
|
||||
@@ -234,12 +234,12 @@ function AudioPlayerRoute() {
|
||||
/>
|
||||
|
||||
<div className="audio-now-playing-transport">
|
||||
<Tooltip title="Shuffle upcoming">
|
||||
<Tooltip title="Перемешать следующие">
|
||||
<span>
|
||||
<IconButton
|
||||
onClick={shuffleUpcoming}
|
||||
disabled={!hasUpcoming}
|
||||
aria-label="Shuffle upcoming"
|
||||
aria-label="Перемешать следующие"
|
||||
>
|
||||
<span className="material-symbols-rounded">shuffle</span>
|
||||
</IconButton>
|
||||
@@ -274,7 +274,7 @@ function AudioPlayerRoute() {
|
||||
</div>
|
||||
<IconButton
|
||||
onClick={(e) => setMenuAnchor(e.currentTarget)}
|
||||
aria-label="More options"
|
||||
aria-label="Ещё"
|
||||
>
|
||||
<span className="material-symbols-rounded">more_horiz</span>
|
||||
</IconButton>
|
||||
@@ -300,7 +300,7 @@ function AudioPlayerRoute() {
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">album</span>
|
||||
</ListItemIcon>
|
||||
Go to album
|
||||
Перейти к альбому
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
disabled={!artistId}
|
||||
@@ -317,7 +317,7 @@ function AudioPlayerRoute() {
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">person</span>
|
||||
</ListItemIcon>
|
||||
Go to artist
|
||||
Перейти к исполнителю
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
@@ -328,7 +328,7 @@ function AudioPlayerRoute() {
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">query_stats</span>
|
||||
</ListItemIcon>
|
||||
Stats for nerds
|
||||
Статистика
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</div>
|
||||
@@ -336,7 +336,7 @@ function AudioPlayerRoute() {
|
||||
|
||||
<aside
|
||||
className={`audio-side ${hasLyrics ? "has-lyrics" : ""}`}
|
||||
aria-label="Lyrics and queue"
|
||||
aria-label="Текст и очередь"
|
||||
>
|
||||
{hasLyrics && (
|
||||
<div className="audio-side-lyrics">
|
||||
@@ -360,7 +360,7 @@ function AudioPlayerRoute() {
|
||||
maxWidth="sm"
|
||||
fullWidth
|
||||
>
|
||||
<DialogTitle>Stats for nerds</DialogTitle>
|
||||
<DialogTitle>Статистика</DialogTitle>
|
||||
<DialogContent>
|
||||
<StatsPanel item={item} audioRef={audioPlayerRef} />
|
||||
</DialogContent>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getSessionApi } from "@jellyfin/sdk/lib/utils/api/session-api";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import { WebviewWindow as appWindow } from "@tauri-apps/api/webviewWindow";
|
||||
import React, { useCallback, useEffect, useRef } from "react";
|
||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
||||
import ReactPlayer from "react-player";
|
||||
import { secToTicks, ticksToSec } from "@/utils/date/time";
|
||||
import { playItemFromQueue, usePlaybackStore } from "@/utils/store/playback";
|
||||
@@ -27,7 +27,12 @@ import StatsForNerds from "@/components/playback/videoPlayer/StatsForNerds";
|
||||
import UpNextFlyout from "@/components/playback/videoPlayer/upNextFlyout";
|
||||
import VolumeChangeOverlay from "@/components/playback/videoPlayer/VolumeChangeOverlay";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { getAutoSkipSegments } from "@/utils/storage/player";
|
||||
import {
|
||||
getAutoSkipSegments,
|
||||
getVideoFitMode,
|
||||
setVideoFitMode,
|
||||
} from "@/utils/storage/player";
|
||||
import type { VideoFitMode } from "@/utils/types/videoFitMode";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import {
|
||||
@@ -71,7 +76,7 @@ function addSubtitleTrackToReactPlayer(
|
||||
track.src = `${baseUrl}${subtitleTracks.url}${urlParams}`;
|
||||
track.kind = "subtitles";
|
||||
track.srclang = reqSubTrack.Language ?? "en";
|
||||
track.label = reqSubTrack.DisplayTitle ?? "Subtitle";
|
||||
track.label = reqSubTrack.DisplayTitle ?? "Субтитры";
|
||||
track.default = true;
|
||||
track.id = subtitleTracks.url;
|
||||
|
||||
@@ -184,8 +189,31 @@ export function VideoPlayer() {
|
||||
]);
|
||||
|
||||
const [error, setError] = React.useState<any>(null);
|
||||
const [fitMode, setFitMode] = useState<VideoFitMode>("fit");
|
||||
const autoSkippedSegmentRef = useRef<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
getVideoFitMode().then(setFitMode);
|
||||
}, []);
|
||||
|
||||
const handleFitModeChange = useCallback((mode: VideoFitMode) => {
|
||||
setFitMode(mode);
|
||||
void setVideoFitMode(mode);
|
||||
}, []);
|
||||
|
||||
const cycleFitMode = useCallback(() => {
|
||||
setFitMode((current) => {
|
||||
const next =
|
||||
current === "fit"
|
||||
? "fill"
|
||||
: current === "fill"
|
||||
? "stretch"
|
||||
: "fit";
|
||||
void setVideoFitMode(next);
|
||||
return next;
|
||||
});
|
||||
}, []);
|
||||
|
||||
// Deep links, transfers and resume all set a start position. Do not rely
|
||||
// on a single `onReady` callback (HLS wrappers can fire it late or reset
|
||||
// the media afterwards), keep enforcing it until the player settles.
|
||||
@@ -537,6 +565,10 @@ export function VideoPlayer() {
|
||||
case "m":
|
||||
toggleIsPlayerMuted();
|
||||
break;
|
||||
case "Z":
|
||||
case "z":
|
||||
cycleFitMode();
|
||||
break;
|
||||
case "F7":
|
||||
playItemFromQueue("previous", user?.Id, api);
|
||||
break;
|
||||
@@ -547,7 +579,7 @@ export function VideoPlayer() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
}, [cycleFitMode]);
|
||||
|
||||
useEffect(() => {
|
||||
// attach the event listener
|
||||
@@ -732,10 +764,11 @@ export function VideoPlayer() {
|
||||
|
||||
return (
|
||||
<div
|
||||
className="video-player"
|
||||
className={`video-player video-fit-${fitMode}`}
|
||||
onMouseMove={handleMouseMove}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
>
|
||||
<div className="video-player-drag-region" data-tauri-drag-region />
|
||||
<LoadingIndicator />
|
||||
<ErrorDisplay
|
||||
error={error}
|
||||
@@ -755,6 +788,8 @@ export function VideoPlayer() {
|
||||
// isVisible={areControlsVisible}
|
||||
onHover={handleMouseMove}
|
||||
onLeave={handleMouseLeave}
|
||||
fitMode={fitMode}
|
||||
onFitModeChange={handleFitModeChange}
|
||||
/>
|
||||
<SkipSegmentButton />
|
||||
<VolumeChangeOverlay />
|
||||
|
||||
@@ -63,7 +63,7 @@ function PhotosPlayer() {
|
||||
height: "100%",
|
||||
borderRadius: "2px",
|
||||
}}
|
||||
alt="Item"
|
||||
alt="Изображение"
|
||||
/>
|
||||
</div>
|
||||
)),
|
||||
@@ -108,7 +108,7 @@ function PhotosPlayer() {
|
||||
`${api?.basePath}/Items/${currentPhoto?.Id}/Download?ApiKey=${api?.accessToken}`,
|
||||
pathToSave,
|
||||
);
|
||||
enqueueSnackbar("Image download queued.", { variant: "info" });
|
||||
enqueueSnackbar("Загрузка изображения добавлена в очередь.", { variant: "info" });
|
||||
}
|
||||
}, [currentIndex]);
|
||||
|
||||
@@ -125,7 +125,7 @@ function PhotosPlayer() {
|
||||
? `${api?.basePath}/Items/${currentPhoto.Id}/Download?ApiKey=${api?.accessToken}`
|
||||
: brokenImage
|
||||
}
|
||||
alt="Item"
|
||||
alt="Изображение"
|
||||
transition={{ duration: 0.1 }}
|
||||
className="photos-currentPhoto"
|
||||
/>
|
||||
@@ -152,7 +152,7 @@ function PhotosPlayer() {
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">download</span>
|
||||
</ListItemIcon>
|
||||
<ListItemText>Download</ListItemText>
|
||||
<ListItemText>Скачать</ListItemText>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
<div className="photos-overlay">
|
||||
|
||||
@@ -41,13 +41,13 @@ export const Route = createFileRoute("/_api/search/")({
|
||||
});
|
||||
|
||||
const CATEGORIES = [
|
||||
{ label: "Movies", value: "Movie", kind: BaseItemKind.Movie },
|
||||
{ label: "TV Shows", value: "Series", kind: BaseItemKind.Series },
|
||||
{ label: "Episodes", value: "Episode", kind: "Episode" },
|
||||
{ label: "Music", value: "MusicAlbum", kind: BaseItemKind.MusicAlbum },
|
||||
{ label: "Artists", value: "MusicArtist", kind: BaseItemKind.MusicArtist },
|
||||
{ label: "People", value: "Person", kind: "Person" },
|
||||
{ label: "Books", value: "Book", kind: BaseItemKind.Book },
|
||||
{ label: "Фильмы", value: "Movie", kind: BaseItemKind.Movie },
|
||||
{ label: "Сериалы", value: "Series", kind: BaseItemKind.Series },
|
||||
{ label: "Серии", value: "Episode", kind: "Episode" },
|
||||
{ label: "Музыка", value: "MusicAlbum", kind: BaseItemKind.MusicAlbum },
|
||||
{ label: "Исполнители", value: "MusicArtist", kind: BaseItemKind.MusicArtist },
|
||||
{ label: "Люди", value: "Person", kind: "Person" },
|
||||
{ label: "Книги", value: "Book", kind: BaseItemKind.Book },
|
||||
];
|
||||
|
||||
function SearchPage() {
|
||||
@@ -137,10 +137,10 @@ function SearchPage() {
|
||||
fontWeight: 600,
|
||||
}}
|
||||
>
|
||||
Explore your library
|
||||
Исследуйте библиотеку
|
||||
</Typography>
|
||||
<Typography variant="body1" sx={{ opacity: 0.6, maxWidth: 400 }}>
|
||||
Search for movies, tv shows, music, people and more.
|
||||
Ищите фильмы, сериалы, музыку, людей и многое другое.
|
||||
</Typography>
|
||||
</Box>
|
||||
</Fade>
|
||||
@@ -199,16 +199,16 @@ function SearchAppBar({
|
||||
<div className="flex flex-row" style={{ gap: "0.6em" }}>
|
||||
<IconButton
|
||||
onClick={() => setShowDrawer(true)}
|
||||
aria-label="Open navigation"
|
||||
title="Open navigation"
|
||||
aria-label="Открыть меню"
|
||||
title="Открыть меню"
|
||||
>
|
||||
<div className="material-symbols-rounded">menu</div>
|
||||
</IconButton>
|
||||
<BackButton />
|
||||
<IconButton
|
||||
onClick={handleNavigateToHome}
|
||||
aria-label="Home"
|
||||
title="Home"
|
||||
aria-label="Главная"
|
||||
title="Главная"
|
||||
>
|
||||
<div
|
||||
className={
|
||||
@@ -229,7 +229,7 @@ function SearchAppBar({
|
||||
<span className="material-symbols-rounded search-icon">search</span>
|
||||
<InputBase
|
||||
className="search-input"
|
||||
placeholder="Search library..."
|
||||
placeholder="Поиск в библиотеке..."
|
||||
fullWidth
|
||||
autoFocus
|
||||
value={searchTerm}
|
||||
@@ -301,7 +301,7 @@ function SearchAppBar({
|
||||
color="textSecondary"
|
||||
sx={{ opacity: 0.7 }}
|
||||
>
|
||||
Types
|
||||
Типы
|
||||
</Typography>
|
||||
);
|
||||
return (
|
||||
@@ -340,7 +340,7 @@ function SearchAppBar({
|
||||
>
|
||||
<MenuItem disabled value="">
|
||||
<Typography variant="overline" color="textSecondary">
|
||||
Filter by Type
|
||||
Фильтр по типу
|
||||
</Typography>
|
||||
</MenuItem>
|
||||
{CATEGORIES.map((cat) => (
|
||||
@@ -355,8 +355,8 @@ function SearchAppBar({
|
||||
<div className="flex flex-row" style={{ gap: "0.6em" }}>
|
||||
<IconButton
|
||||
onClick={handleNavigateToFavorite}
|
||||
aria-label="Favorites"
|
||||
title="Favorites"
|
||||
aria-label="Избранное"
|
||||
title="Избранное"
|
||||
>
|
||||
<div className="material-symbols-rounded">favorite</div>
|
||||
</IconButton>
|
||||
@@ -436,9 +436,9 @@ function NoResultsDetector({ categories, resultsStatus }: any) {
|
||||
return (
|
||||
<Fade in>
|
||||
<Box className="search-no-results">
|
||||
<Typography variant="h6">No results found</Typography>
|
||||
<Typography variant="h6">Ничего не найдено</Typography>
|
||||
<Typography variant="body2" sx={{ opacity: 0.6 }}>
|
||||
Try adjusting your search or filters.
|
||||
Попробуйте изменить запрос или фильтры.
|
||||
</Typography>
|
||||
</Box>
|
||||
</Fade>
|
||||
|
||||
@@ -32,8 +32,8 @@ function SettingsRoute() {
|
||||
<BackButton />
|
||||
<IconButton
|
||||
onClick={handleNavigateHome}
|
||||
aria-label="Home"
|
||||
title="Home"
|
||||
aria-label="Главная"
|
||||
title="Главная"
|
||||
sx={{
|
||||
background: "rgba(255, 255, 255, 0.05)",
|
||||
"&:hover": { background: "rgba(255, 255, 255, 0.1)" },
|
||||
@@ -47,7 +47,7 @@ function SettingsRoute() {
|
||||
<img
|
||||
className="settings-sidebar-header-image"
|
||||
src={`${api?.basePath}/Users/${user?.Id}/Images/Primary`}
|
||||
alt="user"
|
||||
alt="Пользователь"
|
||||
/>
|
||||
<div className="flex flex-column">
|
||||
<Typography
|
||||
@@ -59,14 +59,14 @@ function SettingsRoute() {
|
||||
{user?.Name}
|
||||
</Typography>
|
||||
<Typography variant="body2" sx={{ opacity: 0.5 }}>
|
||||
{user?.Policy?.IsAdministrator ? "Administrator" : "User"}
|
||||
{user?.Policy?.IsAdministrator ? "Администратор" : "Пользователь"}
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<List
|
||||
component="nav"
|
||||
aria-label="settings navigation"
|
||||
aria-label="навигация по настройкам"
|
||||
className="settings-sidebar-list"
|
||||
sx={{
|
||||
width: "100%",
|
||||
@@ -83,18 +83,18 @@ function SettingsRoute() {
|
||||
letterSpacing: "0.1em",
|
||||
}}
|
||||
>
|
||||
General
|
||||
Общие
|
||||
</Typography>
|
||||
<ListItemLink
|
||||
to="/settings/preferences"
|
||||
icon="tune"
|
||||
primary="Preferences"
|
||||
primary="Настройки"
|
||||
className="settings-sidebar-list-item"
|
||||
/>
|
||||
<ListItemLink
|
||||
to="/settings/changeServer"
|
||||
icon="dns"
|
||||
primary="Servers"
|
||||
primary="Серверы"
|
||||
className="settings-sidebar-list-item"
|
||||
/>
|
||||
|
||||
@@ -109,12 +109,12 @@ function SettingsRoute() {
|
||||
letterSpacing: "0.1em",
|
||||
}}
|
||||
>
|
||||
System
|
||||
Система
|
||||
</Typography>
|
||||
<ListItemLink
|
||||
to="/settings/about"
|
||||
icon="info"
|
||||
primary="About"
|
||||
primary="О приложении"
|
||||
className="settings-sidebar-list-item"
|
||||
/>
|
||||
</List>
|
||||
|
||||
@@ -35,27 +35,27 @@ function RouteComponent() {
|
||||
</div>
|
||||
<div className="settings-about-table">
|
||||
<div className="settings-about-table-row">
|
||||
<Typography variant="subtitle1">Server Name</Typography>
|
||||
<Typography variant="subtitle1">Имя сервера</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
{systemInfo.data.ServerName}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="settings-about-table-row">
|
||||
<Typography variant="subtitle1">Jellyfin Version</Typography>
|
||||
<Typography variant="subtitle1">Версия Jellyfin</Typography>
|
||||
<Typography variant="subtitle1">{systemInfo.data.Version}</Typography>
|
||||
</div>
|
||||
<div className="settings-about-table-row">
|
||||
<Typography variant="subtitle1">Update</Typography>
|
||||
<Typography variant="subtitle1">Обновление</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
{updateInfo.data
|
||||
? `v${updateInfo.data.version}`
|
||||
: "No update available."}
|
||||
: "Обновлений нет."}
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
<div className="settings-about-links">
|
||||
<Typography variant="h6" style={{ marginBottom: "0.5em" }}>
|
||||
Links
|
||||
Ссылки
|
||||
</Typography>
|
||||
<Link href="https://github.com/prayag17/Blink">
|
||||
https://github.com/prayag17/Blink
|
||||
@@ -82,7 +82,7 @@ function RouteComponent() {
|
||||
>
|
||||
volunteer_activism
|
||||
</span>
|
||||
Support
|
||||
Поддержать
|
||||
</Fab>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -62,8 +62,8 @@ function ChangeServerRoute() {
|
||||
// Reload the page to reset API context and states
|
||||
window.location.href = "/";
|
||||
} catch (error) {
|
||||
console.error("Failed to switch server", error);
|
||||
enqueueSnackbar("Failed to switch server", { variant: "error" });
|
||||
console.error("Не удалось сменить сервер", error);
|
||||
enqueueSnackbar("Не удалось сменить сервер", { variant: "error" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -71,10 +71,10 @@ function ChangeServerRoute() {
|
||||
try {
|
||||
await delServer(serverId);
|
||||
queryClient.invalidateQueries({ queryKey: ["servers"] });
|
||||
enqueueSnackbar("Server removed", { variant: "success" });
|
||||
enqueueSnackbar("Сервер удалён", { variant: "success" });
|
||||
} catch (error) {
|
||||
console.error("Failed to delete server", error);
|
||||
enqueueSnackbar("Failed to delete server", { variant: "error" });
|
||||
console.error("Не удалось удалить сервер", error);
|
||||
enqueueSnackbar("Не удалось удалить сервер", { variant: "error" });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -89,7 +89,7 @@ function ChangeServerRoute() {
|
||||
marginBottom: "2em",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h4">Servers</Typography>
|
||||
<Typography variant="h4">Серверы</Typography>
|
||||
</div>
|
||||
|
||||
<Grid container spacing={3}>
|
||||
@@ -142,7 +142,7 @@ function ChangeServerRoute() {
|
||||
}}
|
||||
>
|
||||
<img
|
||||
alt={server.systemInfo?.ServerName || "Unknown Server"}
|
||||
alt={server.systemInfo?.ServerName || "Неизвестный сервер"}
|
||||
src={spalshUrl}
|
||||
style={{
|
||||
height: "100%",
|
||||
@@ -154,7 +154,7 @@ function ChangeServerRoute() {
|
||||
|
||||
{isActive && (
|
||||
<Chip
|
||||
label="Active"
|
||||
label="Активный"
|
||||
size="small"
|
||||
color="primary"
|
||||
sx={{
|
||||
@@ -214,14 +214,14 @@ function ChangeServerRoute() {
|
||||
variant="h5"
|
||||
component="div"
|
||||
noWrap
|
||||
title={server.systemInfo?.ServerName || "Unknown Server"}
|
||||
title={server.systemInfo?.ServerName || "Неизвестный сервер"}
|
||||
sx={{
|
||||
fontWeight: "bold",
|
||||
mb: 0.5,
|
||||
letterSpacing: "-0.02em",
|
||||
}}
|
||||
>
|
||||
{server.systemInfo?.ServerName || "Unknown Server"}
|
||||
{server.systemInfo?.ServerName || "Неизвестный сервер"}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="body2"
|
||||
@@ -279,7 +279,7 @@ function ChangeServerRoute() {
|
||||
px: 3,
|
||||
}}
|
||||
>
|
||||
Connect
|
||||
Подключиться
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
@@ -298,7 +298,7 @@ function ChangeServerRoute() {
|
||||
},
|
||||
}}
|
||||
>
|
||||
Connected
|
||||
Подключено
|
||||
</Button>
|
||||
)}
|
||||
</CardActions>
|
||||
@@ -363,7 +363,7 @@ function ChangeServerRoute() {
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
Add Server
|
||||
Добавить сервер
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="body2"
|
||||
@@ -372,7 +372,7 @@ function ChangeServerRoute() {
|
||||
mt: 1,
|
||||
}}
|
||||
>
|
||||
Connect to a new Jellyfin server
|
||||
Подключиться к новому серверу Jellyfin
|
||||
</Typography>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
@@ -72,7 +72,7 @@ function RouteComponent() {
|
||||
// },
|
||||
// },
|
||||
// });
|
||||
enqueueSnackbar("Settings saved", {
|
||||
enqueueSnackbar("Настройки сохранены", {
|
||||
variant: "success",
|
||||
});
|
||||
},
|
||||
@@ -80,7 +80,7 @@ function RouteComponent() {
|
||||
|
||||
return (
|
||||
<div className="settings-page-scrollY">
|
||||
<Typography variant="h4">Preferences</Typography>
|
||||
<Typography variant="h4">Настройки</Typography>
|
||||
{/* <form.Pro */}
|
||||
<form
|
||||
onSubmit={(e) => {
|
||||
@@ -89,7 +89,7 @@ function RouteComponent() {
|
||||
form.handleSubmit();
|
||||
}}
|
||||
onError={() =>
|
||||
enqueueSnackbar("Error saving settings", { variant: "error" })
|
||||
enqueueSnackbar("Не удалось сохранить настройки", { variant: "error" })
|
||||
}
|
||||
className="settings-form"
|
||||
>
|
||||
@@ -113,7 +113,7 @@ function RouteComponent() {
|
||||
}}
|
||||
>
|
||||
<MenuItem key={"anyLanguage"} value={"anyLanguage"}>
|
||||
Any Language
|
||||
Любой язык
|
||||
</MenuItem>
|
||||
{cultures.data?.map((option) => (
|
||||
<MenuItem
|
||||
@@ -133,13 +133,13 @@ function RouteComponent() {
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
Preferred Audio Language
|
||||
Предпочитаемый язык аудио
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
className="settings-option-info-caption"
|
||||
>
|
||||
Choose your preferred audio language.
|
||||
Выберите предпочитаемый язык аудио.
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
@@ -171,14 +171,14 @@ function RouteComponent() {
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
Play default audio track regardless of language
|
||||
Воспроизводить аудиодорожку по умолчанию независимо от языка
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
className="settings-option-info-caption"
|
||||
>
|
||||
Play the default audio track of the media item, even if it
|
||||
does not match your preferred audio language.
|
||||
Воспроизводить аудиодорожку по умолчанию, даже если она
|
||||
не совпадает с предпочитаемым языком.
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
@@ -208,7 +208,7 @@ function RouteComponent() {
|
||||
}}
|
||||
>
|
||||
<MenuItem key={"anyLanguage"} value={"anyLanguage"}>
|
||||
Any Language
|
||||
Любой язык
|
||||
</MenuItem>
|
||||
{cultures.data?.map((option) => (
|
||||
<MenuItem
|
||||
@@ -228,13 +228,13 @@ function RouteComponent() {
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
Preferred Subtitle Language
|
||||
Предпочитаемый язык субтитров
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
className="settings-option-info-caption"
|
||||
>
|
||||
Choose your preferred subtitle language.
|
||||
Выберите предпочитаемый язык субтитров.
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
@@ -266,14 +266,14 @@ function RouteComponent() {
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
Set subtitle track based on previous item
|
||||
Выбирать субтитры по предыдущему элементу
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
className="settings-option-info-caption"
|
||||
>
|
||||
Try to set the subtitle track to the closest match to the
|
||||
last video.
|
||||
Пытаться выбрать субтитры, наиболее подходящие к
|
||||
предыдущему видео.
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
@@ -284,7 +284,7 @@ function RouteComponent() {
|
||||
}}
|
||||
</form.Field>
|
||||
<Button type="submit" size="large" variant="contained">
|
||||
Save
|
||||
Сохранить
|
||||
</Button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -28,10 +28,10 @@ function ErrorRoute() {
|
||||
fontWeight: 500,
|
||||
}}
|
||||
>
|
||||
Error connecting server.
|
||||
Не удалось подключиться к серверу.
|
||||
</Typography>
|
||||
<Typography variant="subtitle2" style={{ opacity: 0.6 }}>
|
||||
Check your internet connection or contact your server administrator
|
||||
Проверьте подключение к интернету или обратитесь к администратору сервера
|
||||
</Typography>
|
||||
<div
|
||||
className="flex flex-center"
|
||||
@@ -42,16 +42,16 @@ function ErrorRoute() {
|
||||
to="/setup/server/list"
|
||||
variant="contained"
|
||||
>
|
||||
Change Server
|
||||
Сменить сервер
|
||||
</Button>
|
||||
<Button variant="contained" onClick={async () => await relaunch()}>
|
||||
Restart Blink
|
||||
Перезапустить Blink
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
default:
|
||||
return <div>Error</div>;
|
||||
return <div>Ошибка</div>;
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ function ServerSetup() {
|
||||
setDefaultServer(bestServer.systemInfo?.Id);
|
||||
setServer(bestServer.systemInfo?.Id, bestServer);
|
||||
|
||||
enqueueSnackbar("Client added successfully", {
|
||||
enqueueSnackbar("Сервер добавлен", {
|
||||
variant: "success",
|
||||
});
|
||||
|
||||
@@ -51,12 +51,12 @@ function ServerSetup() {
|
||||
onError: (err) => {
|
||||
console.error(err);
|
||||
enqueueSnackbar(`${JSON.stringify(err)}`, { variant: "error" });
|
||||
enqueueSnackbar("Something went wrong", { variant: "error" });
|
||||
enqueueSnackbar("Что-то пошло не так", { variant: "error" });
|
||||
},
|
||||
onSettled: (bestServer) => {
|
||||
console.log(bestServer);
|
||||
if (!bestServer) {
|
||||
enqueueSnackbar("Provided server address is not a Jellyfin server.", {
|
||||
enqueueSnackbar("Указанный адрес не является сервером Jellyfin.", {
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
@@ -106,7 +106,7 @@ function ServerSetup() {
|
||||
lineHeight: 1.5,
|
||||
}}
|
||||
>
|
||||
Enter your Jellyfin server address to get started
|
||||
Введите адрес сервера Jellyfin, чтобы начать
|
||||
</Typography>
|
||||
|
||||
<form
|
||||
@@ -143,7 +143,7 @@ function ServerSetup() {
|
||||
loading={checkServer.isPending}
|
||||
type="submit"
|
||||
>
|
||||
Connect
|
||||
Подключиться
|
||||
</LoadingButton>
|
||||
</form>
|
||||
</Stack>
|
||||
@@ -166,7 +166,7 @@ function ServerSetup() {
|
||||
info
|
||||
</span>
|
||||
<Typography variant="subtitle1">
|
||||
Example: https://demo.jellyfin.org/stable
|
||||
Пример: https://demo.jellyfin.org/stable
|
||||
</Typography>
|
||||
</Stack>
|
||||
</div>
|
||||
|
||||
@@ -13,20 +13,20 @@ export const Route = createFileRoute("/setup/server/error")({
|
||||
<span className="material-symbols-rounded fill gradient-text">
|
||||
report
|
||||
</span>
|
||||
<Typography variant="h4">Unable to connect to server!</Typography>
|
||||
<Typography variant="h4">Не удалось подключиться к серверу!</Typography>
|
||||
<div className="flex flex-align-center" style={{ gap: "1em" }}>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => navigate({ to: "/setup/server/list" })}
|
||||
>
|
||||
Change Server
|
||||
Сменить сервер
|
||||
</Button>
|
||||
<Button
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
onClick={async () => await relaunch()}
|
||||
>
|
||||
Restart Blink
|
||||
Перезапустить Blink
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -62,7 +62,7 @@ function ServerList() {
|
||||
},
|
||||
onError: (error) => {
|
||||
console.error(error);
|
||||
enqueueSnackbar("Error changing the server", {
|
||||
enqueueSnackbar("Не удалось сменить сервер", {
|
||||
variant: "error",
|
||||
});
|
||||
},
|
||||
@@ -87,7 +87,7 @@ function ServerList() {
|
||||
queryClient.removeQueries();
|
||||
navigate({ to: "/" });
|
||||
}
|
||||
enqueueSnackbar("Server deleted successfully!", { variant: "success" });
|
||||
enqueueSnackbar("Сервер удалён.", { variant: "success" });
|
||||
|
||||
await servers.refetch();
|
||||
await defaultServer.refetch();
|
||||
@@ -137,7 +137,7 @@ function ServerList() {
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
Servers
|
||||
Серверы
|
||||
</Typography>
|
||||
<IconButton
|
||||
onClick={() => setAddServerDialog(true)}
|
||||
@@ -185,7 +185,7 @@ function ServerList() {
|
||||
{server.systemInfo?.ServerName}
|
||||
{server.id === defaultServer.data && (
|
||||
<Chip
|
||||
label="Current"
|
||||
label="Текущий"
|
||||
color="primary"
|
||||
size="small"
|
||||
sx={{ height: 20, fontSize: "0.7rem", fontWeight: 700 }}
|
||||
|
||||
@@ -10,32 +10,32 @@ export const AVAILABLE_VIEWS: Array<{
|
||||
compatibleCollectionTypes: CollectionType[];
|
||||
}> = [
|
||||
{
|
||||
title: "Movies",
|
||||
title: "Фильмы",
|
||||
value: BaseItemKind.Movie,
|
||||
compatibleCollectionTypes: [CollectionType.Movies],
|
||||
},
|
||||
{
|
||||
title: "Shows",
|
||||
title: "Сериалы",
|
||||
value: BaseItemKind.Series,
|
||||
compatibleCollectionTypes: [CollectionType.Tvshows],
|
||||
},
|
||||
{
|
||||
title: "Albums",
|
||||
title: "Альбомы",
|
||||
value: BaseItemKind.MusicAlbum,
|
||||
compatibleCollectionTypes: [CollectionType.Music],
|
||||
},
|
||||
{
|
||||
title: "Collections",
|
||||
title: "Коллекции",
|
||||
value: BaseItemKind.CollectionFolder,
|
||||
compatibleCollectionTypes: [CollectionType.Movies, CollectionType.Boxsets],
|
||||
},
|
||||
{
|
||||
title: "Books",
|
||||
title: "Книги",
|
||||
value: BaseItemKind.Book,
|
||||
compatibleCollectionTypes: [CollectionType.Books],
|
||||
},
|
||||
{
|
||||
title: "Genres",
|
||||
title: "Жанры",
|
||||
compatibleCollectionTypes: [
|
||||
CollectionType.Movies,
|
||||
CollectionType.Tvshows,
|
||||
@@ -44,32 +44,32 @@ export const AVAILABLE_VIEWS: Array<{
|
||||
value: BaseItemKind.Genre,
|
||||
},
|
||||
{
|
||||
title: "Trailers",
|
||||
title: "Трейлеры",
|
||||
value: BaseItemKind.Trailer,
|
||||
compatibleCollectionTypes: [CollectionType.Movies],
|
||||
},
|
||||
{
|
||||
title: "TV Networks",
|
||||
title: "Телеканалы",
|
||||
value: BaseItemKind.Studio,
|
||||
compatibleCollectionTypes: [CollectionType.Tvshows],
|
||||
},
|
||||
{
|
||||
title: "Album Artist",
|
||||
title: "Исполнитель альбома",
|
||||
value: BaseItemKind.MusicArtist,
|
||||
compatibleCollectionTypes: [CollectionType.Music],
|
||||
},
|
||||
{
|
||||
title: "Artist",
|
||||
title: "Исполнитель",
|
||||
value: "Artist",
|
||||
compatibleCollectionTypes: [CollectionType.Music],
|
||||
},
|
||||
{
|
||||
title: "Playlist",
|
||||
title: "Плейлист",
|
||||
value: BaseItemKind.Playlist,
|
||||
compatibleCollectionTypes: [CollectionType.Music, CollectionType.Playlists],
|
||||
},
|
||||
{
|
||||
title: "Songs",
|
||||
title: "Песни",
|
||||
value: BaseItemKind.Audio,
|
||||
compatibleCollectionTypes: [CollectionType.Music],
|
||||
},
|
||||
@@ -82,7 +82,7 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
compatibleViewTypes?: BaseItemKind[];
|
||||
}> = [
|
||||
{
|
||||
title: "Name",
|
||||
title: "Название",
|
||||
value: ItemSortBy.SortName,
|
||||
compatibleCollectionTypes: [
|
||||
CollectionType.Movies,
|
||||
@@ -92,7 +92,7 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Track Name",
|
||||
title: "Название трека",
|
||||
value: ItemSortBy.Name,
|
||||
compatibleViewTypes: [
|
||||
BaseItemKind.Audio,
|
||||
@@ -101,22 +101,22 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Album",
|
||||
title: "Альбом",
|
||||
value: ItemSortBy.Album,
|
||||
compatibleViewTypes: [BaseItemKind.Audio],
|
||||
},
|
||||
{
|
||||
title: "Album Artist",
|
||||
title: "Исполнитель альбома",
|
||||
value: ItemSortBy.AlbumArtist,
|
||||
compatibleViewTypes: [BaseItemKind.Audio, BaseItemKind.MusicAlbum],
|
||||
},
|
||||
{
|
||||
title: "Artist",
|
||||
title: "Исполнитель",
|
||||
value: ItemSortBy.Artist,
|
||||
compatibleViewTypes: [BaseItemKind.Audio],
|
||||
},
|
||||
{
|
||||
title: "Date Added",
|
||||
title: "Дата добавления",
|
||||
value: ItemSortBy.DateCreated,
|
||||
compatibleViewTypes: [
|
||||
BaseItemKind.MusicAlbum,
|
||||
@@ -130,7 +130,7 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Date Played",
|
||||
title: "Дата просмотра",
|
||||
value: ItemSortBy.DatePlayed,
|
||||
compatibleViewTypes: [BaseItemKind.Audio, BaseItemKind.Playlist],
|
||||
compatibleCollectionTypes: [
|
||||
@@ -140,13 +140,13 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Play Count",
|
||||
title: "Количество просмотров",
|
||||
value: ItemSortBy.PlayCount,
|
||||
compatibleViewTypes: [BaseItemKind.Audio, BaseItemKind.Playlist],
|
||||
compatibleCollectionTypes: [CollectionType.Movies, CollectionType.Boxsets],
|
||||
},
|
||||
{
|
||||
title: "Release Date",
|
||||
title: "Дата выхода",
|
||||
value: ItemSortBy.PremiereDate,
|
||||
compatibleViewTypes: [
|
||||
BaseItemKind.MusicAlbum,
|
||||
@@ -160,7 +160,7 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Runtime",
|
||||
title: "Длительность",
|
||||
value: ItemSortBy.Runtime,
|
||||
compatibleViewTypes: [
|
||||
BaseItemKind.MusicAlbum,
|
||||
@@ -170,7 +170,7 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
compatibleCollectionTypes: [CollectionType.Movies, CollectionType.Boxsets],
|
||||
},
|
||||
{
|
||||
title: "Random",
|
||||
title: "Случайно",
|
||||
value: ItemSortBy.Random,
|
||||
compatibleViewTypes: [
|
||||
// BaseItemKind.MusicAlbum,
|
||||
@@ -184,7 +184,7 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Community Rating",
|
||||
title: "Рейтинг сообщества",
|
||||
value: ItemSortBy.CommunityRating,
|
||||
compatibleViewTypes: [
|
||||
BaseItemKind.MusicAlbum,
|
||||
@@ -198,7 +198,7 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Critics Rating",
|
||||
title: "Рейтинг критиков",
|
||||
value: ItemSortBy.CriticRating,
|
||||
compatibleViewTypes: [
|
||||
BaseItemKind.MusicAlbum,
|
||||
@@ -208,12 +208,12 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
compatibleCollectionTypes: [CollectionType.Movies, CollectionType.Boxsets],
|
||||
},
|
||||
{
|
||||
title: "Folder",
|
||||
title: "Папка",
|
||||
value: [ItemSortBy.IsFolder, ItemSortBy.SortName],
|
||||
compatibleViewTypes: [BaseItemKind.Playlist],
|
||||
},
|
||||
{
|
||||
title: "Parental Rating",
|
||||
title: "Возрастной рейтинг",
|
||||
value: ItemSortBy.OfficialRating,
|
||||
compatibleViewTypes: [BaseItemKind.Playlist],
|
||||
compatibleCollectionTypes: [
|
||||
@@ -223,7 +223,7 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Release Date",
|
||||
title: "Дата выхода",
|
||||
value: [
|
||||
ItemSortBy.ProductionYear,
|
||||
ItemSortBy.PremiereDate,
|
||||
@@ -236,7 +236,7 @@ export const SORT_BY_OPTIONS: Array<{
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Date Episode Added",
|
||||
title: "Дата добавления серии",
|
||||
value: ItemSortBy.DateLastContentAdded,
|
||||
compatibleCollectionTypes: [CollectionType.Tvshows],
|
||||
},
|
||||
|
||||
+11
-11
@@ -39,9 +39,9 @@ export const getRuntime = (ticks: number) => {
|
||||
if (timeMin > 60) {
|
||||
const timeHr = Math.floor(timeMin / 60);
|
||||
timeMin -= timeHr * 60;
|
||||
formatedTime = `${timeHr}hr ${timeMin}min`;
|
||||
formatedTime = `${timeHr} ч ${timeMin} мин`;
|
||||
} else {
|
||||
formatedTime = `${timeMin}min`;
|
||||
formatedTime = `${timeMin} мин`;
|
||||
}
|
||||
return formatedTime;
|
||||
};
|
||||
@@ -61,15 +61,15 @@ export const getRuntimeMusic = (ticks: number) => {
|
||||
if (timeMin > 60) {
|
||||
const timeHr = Math.floor(timeMin / 60);
|
||||
timeMin -= timeHr * 60;
|
||||
formatedTime = `${timeHr}:${timeMin.toLocaleString([], {
|
||||
formatedTime = `${timeHr}:${timeMin.toLocaleString("ru-RU", {
|
||||
minimumIntegerDigits: 2,
|
||||
useGrouping: false,
|
||||
})}:${timeSec.toLocaleString([], {
|
||||
})}:${timeSec.toLocaleString("ru-RU", {
|
||||
minimumIntegerDigits: 2,
|
||||
useGrouping: false,
|
||||
})}`;
|
||||
} else {
|
||||
formatedTime = `${timeMin}:${timeSec.toLocaleString([], {
|
||||
formatedTime = `${timeMin}:${timeSec.toLocaleString("ru-RU", {
|
||||
minimumIntegerDigits: 2,
|
||||
useGrouping: false,
|
||||
})}`;
|
||||
@@ -91,9 +91,9 @@ export const getRuntimeFull = (ticks: number) => {
|
||||
if (timeMin > 60) {
|
||||
const timeHr = Math.floor(timeMin / 60);
|
||||
timeMin -= timeHr * 60;
|
||||
formatedTime = `${timeHr} hour ${timeMin} minutes`;
|
||||
formatedTime = `${timeHr} ч ${timeMin} мин`;
|
||||
} else {
|
||||
formatedTime = `${timeMin} minutes`;
|
||||
formatedTime = `${timeMin} мин`;
|
||||
}
|
||||
return formatedTime;
|
||||
};
|
||||
@@ -112,9 +112,9 @@ export const getRuntimeCompact = (ticks: number) => {
|
||||
if (timeMin > 60) {
|
||||
const timeHr = Math.floor(timeMin / 60);
|
||||
timeMin -= timeHr * 60;
|
||||
formatedTime = `${timeHr}h ${timeMin}m`;
|
||||
formatedTime = `${timeHr} ч ${timeMin} мин`;
|
||||
} else {
|
||||
formatedTime = `${timeMin}m`;
|
||||
formatedTime = `${timeMin} мин`;
|
||||
}
|
||||
return formatedTime;
|
||||
};
|
||||
@@ -129,11 +129,11 @@ export const endsAt = (ticks: number) => {
|
||||
const currentTime = current.getTime();
|
||||
const time = ticksToMs(ticks);
|
||||
const calculatedTime = currentTime + time;
|
||||
const formated = new Date(calculatedTime).toLocaleString([], {
|
||||
const formated = new Date(calculatedTime).toLocaleString("ru-RU", {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
});
|
||||
// let formated = `${hr - 12}:${min}`;
|
||||
// return `Ends at ${formated.getHours()}:${formated.getMinutes()}`;
|
||||
return `Ends at ${formated}`;
|
||||
return `Конец в ${formated}`;
|
||||
};
|
||||
@@ -0,0 +1,116 @@
|
||||
import type {
|
||||
BaseItemDto,
|
||||
MediaSegmentDto,
|
||||
MediaSegmentDtoQueryResult,
|
||||
MediaSegmentType,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
|
||||
const SEGMENT_MATCHERS: Array<{
|
||||
type: MediaSegmentType;
|
||||
pattern: RegExp;
|
||||
}> = [
|
||||
{
|
||||
type: "Intro",
|
||||
pattern:
|
||||
/(intro|opening|title sequence|main title|заставк|опенинг|вступлен|начальн[а-яё]* титр)/i,
|
||||
},
|
||||
{
|
||||
type: "Recap",
|
||||
pattern:
|
||||
/(recap|previously on|previously|ранее|в предыдущ|напоминание|краткое содержание)/i,
|
||||
},
|
||||
{
|
||||
type: "Outro",
|
||||
pattern:
|
||||
/(outro|end credits|closing credits|end titles|closing titles|credits|ending|титр|концовк|финальн|завершен)/i,
|
||||
},
|
||||
{
|
||||
type: "Preview",
|
||||
pattern:
|
||||
/(preview|next episode|next time|on the next|анонс|следующ[а-яё]* сери|превью)/i,
|
||||
},
|
||||
{
|
||||
type: "Commercial",
|
||||
pattern: /(commercial|ad break|реклам)/i,
|
||||
},
|
||||
];
|
||||
|
||||
const detectSegmentType = (name?: string | null) => {
|
||||
if (!name) return null;
|
||||
for (const matcher of SEGMENT_MATCHERS) {
|
||||
if (matcher.pattern.test(name)) return matcher.type;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const overlaps = (a: MediaSegmentDto, b: MediaSegmentDto) => {
|
||||
const aStart = a.StartTicks ?? 0;
|
||||
const aEnd = a.EndTicks ?? aStart;
|
||||
const bStart = b.StartTicks ?? 0;
|
||||
const bEnd = b.EndTicks ?? bStart;
|
||||
return aStart < bEnd && bStart < aEnd;
|
||||
};
|
||||
|
||||
/**
|
||||
* Jellyfin's MediaSegments API needs a server-side segment provider. Many
|
||||
* libraries only have chapter markers, so derive the standard segment types
|
||||
* from well-known chapter names (Recap, Opening Credits, End Credits, ...).
|
||||
* Existing API segments win; chapters only fill in the gaps.
|
||||
*/
|
||||
export const addSegmentsFromChapters = (
|
||||
item: BaseItemDto | undefined,
|
||||
mediaSegments: MediaSegmentDtoQueryResult | undefined,
|
||||
runtimeTicks?: number | null,
|
||||
): MediaSegmentDtoQueryResult | undefined => {
|
||||
const chapters = (item?.Chapters ?? [])
|
||||
.filter((chapter) => typeof chapter.StartPositionTicks === "number")
|
||||
.sort((a, b) => (a.StartPositionTicks ?? 0) - (b.StartPositionTicks ?? 0));
|
||||
if (chapters.length === 0) return mediaSegments;
|
||||
|
||||
const derived: MediaSegmentDto[] = [];
|
||||
const seen = new Set<string>();
|
||||
|
||||
for (let index = 0; index < chapters.length; index++) {
|
||||
const chapter = chapters[index];
|
||||
const type = detectSegmentType(chapter.Name);
|
||||
if (!type) continue;
|
||||
|
||||
const start = chapter.StartPositionTicks ?? 0;
|
||||
let end =
|
||||
chapters
|
||||
.slice(index + 1)
|
||||
.find((next) => (next.StartPositionTicks ?? 0) > start)
|
||||
?.StartPositionTicks ?? undefined;
|
||||
end ??= runtimeTicks ?? item?.RunTimeTicks ?? undefined;
|
||||
if (!end || end <= start) continue;
|
||||
|
||||
const key = `${type}:${start}`;
|
||||
if (seen.has(key)) continue;
|
||||
seen.add(key);
|
||||
|
||||
derived.push({
|
||||
Id: `chapter-${type.toLowerCase()}-${start}`,
|
||||
ItemId: item?.Id,
|
||||
Type: type,
|
||||
StartTicks: start,
|
||||
EndTicks: end,
|
||||
});
|
||||
}
|
||||
|
||||
if (derived.length === 0) return mediaSegments;
|
||||
|
||||
const merged: MediaSegmentDto[] = [...(mediaSegments?.Items ?? [])];
|
||||
for (const segment of derived) {
|
||||
if (merged.some((existing) => overlaps(existing, segment))) continue;
|
||||
merged.push(segment);
|
||||
}
|
||||
if (merged.length === 0) return mediaSegments;
|
||||
|
||||
merged.sort((a, b) => (a.StartTicks ?? 0) - (b.StartTicks ?? 0));
|
||||
return {
|
||||
...mediaSegments,
|
||||
Items: merged,
|
||||
TotalRecordCount: merged.length,
|
||||
StartIndex: 0,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,102 @@
|
||||
type WebKitPresentationMode = "inline" | "fullscreen" | "picture-in-picture";
|
||||
|
||||
type WebKitVideoElement = HTMLVideoElement & {
|
||||
webkitPresentationMode?: WebKitPresentationMode;
|
||||
webkitSupportsPresentationMode?: (mode: WebKitPresentationMode) => boolean;
|
||||
webkitSetPresentationMode?: (mode: WebKitPresentationMode) => void;
|
||||
};
|
||||
|
||||
const asWebKitVideo = (video: HTMLVideoElement) => video as WebKitVideoElement;
|
||||
|
||||
const isVideoElement = (
|
||||
element: Element | null | undefined,
|
||||
): element is HTMLVideoElement => element?.tagName === "VIDEO";
|
||||
|
||||
/**
|
||||
* ReactPlayer may render HLS video inside the shadow DOM of `<hls-video>`.
|
||||
* Fall back to a regular video element for direct play and other containers.
|
||||
*/
|
||||
export const getPlayerVideoElement = (): HTMLVideoElement | null => {
|
||||
if (typeof document === "undefined") return null;
|
||||
|
||||
const shadowVideo = document
|
||||
.querySelector("hls-video")
|
||||
?.shadowRoot?.querySelector("video");
|
||||
if (isVideoElement(shadowVideo)) return shadowVideo;
|
||||
|
||||
const video =
|
||||
document.querySelector(".video-player video") ??
|
||||
document.querySelector("video");
|
||||
return isVideoElement(video) ? video : null;
|
||||
};
|
||||
|
||||
export const supportsPictureInPicture = (
|
||||
video?: HTMLVideoElement | null,
|
||||
): boolean => {
|
||||
if (typeof document === "undefined") return false;
|
||||
if (document.pictureInPictureEnabled) return true;
|
||||
|
||||
const candidate =
|
||||
video ?? (document.createElement("video") as WebKitVideoElement);
|
||||
try {
|
||||
return Boolean(
|
||||
asWebKitVideo(candidate).webkitSupportsPresentationMode?.(
|
||||
"picture-in-picture",
|
||||
),
|
||||
);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const isPictureInPictureElement = (
|
||||
element: Element | null,
|
||||
video: HTMLVideoElement,
|
||||
): boolean => {
|
||||
if (!element) return false;
|
||||
if (element === video) return true;
|
||||
const root = video.getRootNode();
|
||||
return root instanceof ShadowRoot && root.host === element;
|
||||
};
|
||||
|
||||
export const isPictureInPictureActive = (video: HTMLVideoElement): boolean => {
|
||||
if (typeof document === "undefined") return false;
|
||||
if (isPictureInPictureElement(document.pictureInPictureElement, video)) {
|
||||
return true;
|
||||
}
|
||||
return asWebKitVideo(video).webkitPresentationMode === "picture-in-picture";
|
||||
};
|
||||
|
||||
export const togglePictureInPicture = async (
|
||||
video: HTMLVideoElement,
|
||||
): Promise<void> => {
|
||||
if (isPictureInPictureActive(video)) {
|
||||
if (isPictureInPictureElement(document.pictureInPictureElement, video)) {
|
||||
await document.exitPictureInPicture();
|
||||
return;
|
||||
}
|
||||
|
||||
const webkitVideo = asWebKitVideo(video);
|
||||
if (webkitVideo.webkitSetPresentationMode) {
|
||||
webkitVideo.webkitSetPresentationMode("inline");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
document.pictureInPictureEnabled &&
|
||||
typeof video.requestPictureInPicture === "function"
|
||||
) {
|
||||
await video.requestPictureInPicture();
|
||||
return;
|
||||
}
|
||||
|
||||
const webkitVideo = asWebKitVideo(video);
|
||||
if (webkitVideo.webkitSupportsPresentationMode?.("picture-in-picture")) {
|
||||
webkitVideo.webkitSetPresentationMode?.("picture-in-picture");
|
||||
return;
|
||||
}
|
||||
|
||||
throw new Error("Picture-in-picture is not supported");
|
||||
};
|
||||
@@ -99,7 +99,7 @@ export const startPlaybackFromIds = async (
|
||||
});
|
||||
|
||||
if (!playback.mediaSource?.MediaSources?.[0]?.Id) {
|
||||
throw new Error("No playable media source found");
|
||||
throw new Error("Не найден источник для воспроизведения");
|
||||
}
|
||||
|
||||
const playbackItems: BaseItemDto[] = playback.item?.Items ?? [];
|
||||
|
||||
@@ -83,7 +83,7 @@ export const createSyncPlayGroup = async (api: Api, name: string) => {
|
||||
try {
|
||||
const group = (
|
||||
await syncApi(api).syncPlayCreateGroup({
|
||||
newGroupRequestDto: { GroupName: name.trim() || "Watch together" },
|
||||
newGroupRequestDto: { GroupName: name.trim() || "Смотреть вместе" },
|
||||
})
|
||||
).data;
|
||||
if (group) {
|
||||
@@ -97,7 +97,7 @@ export const createSyncPlayGroup = async (api: Api, name: string) => {
|
||||
return group;
|
||||
} catch (error) {
|
||||
console.error("Could not create SyncPlay group", error);
|
||||
store.setError("Could not create a group");
|
||||
store.setError("Не удалось создать группу");
|
||||
return undefined;
|
||||
} finally {
|
||||
store.setLoading(false);
|
||||
@@ -122,7 +122,7 @@ export const joinSyncPlayGroup = async (api: Api, groupId: string) => {
|
||||
await refreshSyncPlayGroups(api);
|
||||
} catch (error) {
|
||||
console.error("Could not join SyncPlay group", error);
|
||||
store.setError("Could not join this group");
|
||||
store.setError("Не удалось войти в группу");
|
||||
} finally {
|
||||
store.setLoading(false);
|
||||
}
|
||||
@@ -151,7 +151,7 @@ export const startSyncPlayQueue = async (api: Api) => {
|
||||
.map((item) => item.Id)
|
||||
.filter((id): id is string => Boolean(id));
|
||||
if (ids.length === 0) {
|
||||
store.setError("Start something first, then share the queue");
|
||||
store.setError("Сначала включите что-нибудь, затем поделитесь очередью");
|
||||
return;
|
||||
}
|
||||
const position = getLocalPlayback();
|
||||
@@ -173,7 +173,7 @@ export const startSyncPlayQueue = async (api: Api) => {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Could not start SyncPlay queue", error);
|
||||
store.setError("Could not start the group queue");
|
||||
store.setError("Не удалось запустить очередь группы");
|
||||
} finally {
|
||||
store.setLoading(false);
|
||||
}
|
||||
@@ -205,7 +205,7 @@ export const watchSyncPlayQueueHere = async (api: Api, userId: string) => {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Could not start the group queue here", error);
|
||||
store.setError("Could not start playback");
|
||||
store.setError("Не удалось запустить воспроизведение");
|
||||
} finally {
|
||||
store.setLoading(false);
|
||||
}
|
||||
@@ -364,7 +364,7 @@ export const handleSyncPlayGroupUpdate = async (
|
||||
applyingRemoteUntil = 0;
|
||||
break;
|
||||
case "LibraryAccessDenied":
|
||||
useSyncPlayStore.getState().setError("No access to this group's library");
|
||||
useSyncPlayStore.getState().setError("Нет доступа к библиотеке группы");
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { load } from "@tauri-apps/plugin-store";
|
||||
import type { VideoFitMode } from "../types/videoFitMode";
|
||||
|
||||
const PlayerStore = await load(".player.dat", { autoSave: true });
|
||||
|
||||
@@ -31,3 +32,13 @@ export const getAutoSkipSegments = async () => {
|
||||
const value = await PlayerStore.get<boolean>("video.autoSkipSegments");
|
||||
return value ?? false;
|
||||
};
|
||||
|
||||
export const setVideoFitMode = async (mode: VideoFitMode) => {
|
||||
await PlayerStore.set("video.fitMode", mode);
|
||||
await PlayerStore.save();
|
||||
};
|
||||
|
||||
export const getVideoFitMode = async (): Promise<VideoFitMode> => {
|
||||
const value = await PlayerStore.get<VideoFitMode>("video.fitMode");
|
||||
return value === "fill" || value === "stretch" ? value : "fit";
|
||||
};
|
||||
@@ -23,9 +23,9 @@ export const allSettings = {
|
||||
general: [
|
||||
{
|
||||
key: "general.enable_skip_intro_outro",
|
||||
name: "Enable Intro-Skipper plugin",
|
||||
name: "Включить плагин Intro-Skipper",
|
||||
description:
|
||||
"Shows a skip button for Intros and End Credit scenes in an episode. Note: this requires jumoog/intro-skipper plugin to be installed on server",
|
||||
"Показывает кнопку пропуска интро и титров в сериях. Для этого на сервере должен быть установлен плагин jumoog/intro-skipper.",
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,11 +1,13 @@
|
||||
import type { Api } from "@jellyfin/sdk";
|
||||
import {
|
||||
type BaseItemDto,
|
||||
ItemFields,
|
||||
type MediaSegmentDtoQueryResult,
|
||||
type MediaStream,
|
||||
type PlaybackInfoResponse,
|
||||
PlayMethod,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getMediaInfoApi } from "@jellyfin/sdk/lib/utils/api/media-info-api";
|
||||
import { getMediaSegmentApi } from "@jellyfin/sdk/lib/utils/api/media-segment-api";
|
||||
import { getSessionApi } from "@jellyfin/sdk/lib/utils/api/session-api";
|
||||
@@ -17,6 +19,7 @@ import { shallow } from "zustand/shallow";
|
||||
import { createWithEqualityFn } from "zustand/traditional";
|
||||
import { secToTicks, ticksToSec } from "../date/time";
|
||||
import getSubtitle from "../methods/getSubtitles";
|
||||
import { addSegmentsFromChapters } from "../methods/mediaSegments";
|
||||
import playbackProfile from "../playback-profiles";
|
||||
import {
|
||||
getPlayerMuted,
|
||||
@@ -377,7 +380,7 @@ export const usePlaybackStore = create<
|
||||
const activeSegment = metadata.mediaSegments?.Items?.find(
|
||||
(s) => s.Id === activeSegmentId,
|
||||
);
|
||||
if (activeSegment && ticks > (activeSegment.EndTicks ?? ticks)) {
|
||||
if (activeSegment && ticks >= (activeSegment.EndTicks ?? ticks)) {
|
||||
// If the current time is past the active segment's end time, clear it.
|
||||
set((state) => {
|
||||
state.activeSegmentId = null;
|
||||
@@ -650,7 +653,7 @@ export const usePlaybackStore = create<
|
||||
}
|
||||
const segment = segments.find(
|
||||
(s) =>
|
||||
(s.StartTicks ?? ticks) <= ticks && (s.EndTicks ?? ticks) >= ticks,
|
||||
(s.StartTicks ?? ticks) <= ticks && (s.EndTicks ?? ticks) > ticks,
|
||||
);
|
||||
const nextIndex = segments.findIndex(
|
||||
(s) => (s.StartTicks ?? ticks) > ticks,
|
||||
@@ -735,6 +738,29 @@ export const initializePlayback = async (args: {
|
||||
const source = mediaSource.MediaSources[0];
|
||||
const currentUser = (await getUserApi(api).getCurrentUser()).data;
|
||||
|
||||
let chapters = item.Chapters;
|
||||
if (!Array.isArray(chapters) && !mediaSegments?.Items?.length && item.Id) {
|
||||
try {
|
||||
const fullItem = (
|
||||
await getLibraryApi(api).getItems({
|
||||
ids: [item.Id],
|
||||
userId,
|
||||
fields: [ItemFields.Chapters],
|
||||
})
|
||||
).data.Items?.[0];
|
||||
chapters = fullItem?.Chapters;
|
||||
} catch (error) {
|
||||
console.warn("Не удалось загрузить главы для сегментов", error);
|
||||
}
|
||||
}
|
||||
const segments = addSegmentsFromChapters(
|
||||
Array.isArray(chapters) && chapters !== item.Chapters
|
||||
? { ...item, Chapters: chapters }
|
||||
: item,
|
||||
mediaSegments,
|
||||
item.RunTimeTicks ?? source.RunTimeTicks,
|
||||
);
|
||||
|
||||
let itemName = item.Name;
|
||||
let episodeTitle = "";
|
||||
if (item.SeriesId && item.SeriesName) {
|
||||
@@ -819,7 +845,7 @@ export const initializePlayback = async (args: {
|
||||
isEpisode: !!item.SeriesId,
|
||||
itemDuration: item.RunTimeTicks ?? 0,
|
||||
item: item,
|
||||
mediaSegments: mediaSegments,
|
||||
mediaSegments: segments,
|
||||
userDataLastPlayedPositionTicks:
|
||||
startPositionTicks ?? item.UserData?.PlaybackPositionTicks ?? 0,
|
||||
},
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export type VideoFitMode = "fit" | "fill" | "stretch";
|
||||
Reference in new issue
Block a user