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