fix: subtitles not being rendered #401
This commit is contained in:
16 files changed
+568
-629
No files matched your search
+1
-1
@@ -1 +1 @@
|
|||||||
{"encodings":["src\\main.tsx","ProviderWrapper",[52,0,71,1],[53,39,57,3],[53,8,53,11],[53,13,53,22],[53,24,53,35],[58,34,61,3],[58,8,58,12],[58,14,58,30],[66,2,69,4],"src\\components\\notices\\errorNotice\\errorNotice.tsx","ErrorNotice",[6,27,54,1],[6,28,6,56],[9,2,52,8],[20,3,31,9],[32,3,34,16],[35,3,51,16],"src\\utils\\store\\api.tsx","ApiProvider",[50,27,67,1],[50,28,50,65],[51,17,65,2],[66,8,66,75],"useApiInContext",[69,7,75,1],[70,15,70,37],[74,8,74,57],"src\\utils\\store\\central.tsx","CentralProvider",[48,31,71,1],[48,32,48,69],[49,17,67,2],[69,2,69,77],"useCentralStore",[73,7,79,1],[74,15,74,41],[78,8,78,57],"src\\routes\\_api\\player\\index.tsx","VideoPlayer",[88,0,918,1],[89,13,89,42],[90,21,90,32],[90,9,90,16],[91,39,91,54],[92,16,92,48],[94,14,94,51],[106,5,116,3],[97,2,97,16],[98,2,98,6],[99,2,99,10],[100,2,100,14],[101,2,101,15],[102,2,102,14],[103,2,103,13],[104,2,104,15],[105,2,105,11],[117,40,120,3],[117,8,117,29],[117,31,117,36],[122,31,122,45],[123,41,125,2],[127,51,127,66],[130,31,130,46],[131,31,131,45],[132,35,132,50],[133,45,133,68],[134,33,134,56],[135,43,135,58],[137,29,137,40],[138,27,138,42],[140,1,140,41],[142,41,142,72],[219,24,257,7],[259,1,267,21],[267,5,267,19],[269,1,287,7],[289,1,292,15],[292,5,292,13],[294,41,311,62],[311,5,311,31],[311,33,311,60],[313,1,334,3],[331,2,331,28],[332,2,332,29],[333,2,333,37],[336,29,344,15],[344,5,344,13],[346,24,364,25],[364,5,364,13],[364,15,364,23],[366,25,370,15],[370,5,370,13],[372,49,372,64],[373,27,375,7],[376,1,376,56],[376,46,376,54],[378,22,384,21],[384,5,384,19],[464,5,481,11],[465,6,474,8],[475,6,477,19],[478,6,480,19],[485,4,499,10],[486,5,495,7],[496,5,498,18],[504,4,511,10],[505,5,507,18],[508,5,510,18],[515,3,519,9],[516,4,518,17],[523,51,523,66],[524,1,530,13],[530,5,530,11],[542,2,916,8],[543,3,566,21],[545,5,564,18],[563,6,563,52],[568,4,582,13],[585,4,585,55],[587,3,605,21],[589,5,603,18],[595,6,597,12],[598,6,602,8],[606,3,883,16],[642,4,696,10],[643,5,645,18],[644,6,644,66],[646,5,648,18],[647,6,647,64],[649,5,695,12],[670,6,694,18],[686,7,688,18],[690,8,692,19],[698,5,881,11],[699,6,706,19],[702,8,704,21],[707,6,880,12],[708,7,763,13],[709,8,756,10],[757,8,762,14],[758,9,760,22],[761,9,761,62],[764,7,879,13],[765,8,800,14],[766,9,766,31],[767,9,777,22],[774,10,776,17],[778,9,782,22],[779,10,781,17],[783,9,793,22],[790,10,792,17],[794,9,794,27],[795,9,799,22],[801,8,878,14],[802,9,840,22],[824,10,826,23],[827,10,839,12],[841,9,854,22],[847,10,853,17],[855,9,855,24],[856,9,865,22],[860,10,864,17],[866,9,877,22],[874,10,876,17],[884,3,915,5],"sliderDisplayFormat",[386,29,521,2],"src\\routes\\_api\\home\\index.tsx","Home",[40,0,400,1],[41,13,41,42],[42,14,42,51],[44,19,54,3],[56,21,80,3],[82,26,96,3],[98,26,111,3],[113,21,130,3],[132,47,134,6],[136,18,136,31],[138,21,138,59],[140,24,142,2],[144,1,157,26],[157,5,157,24],[161,3,397,10],[168,4,208,20],[170,6,170,26],[173,7,205,9],[210,4,245,20],[212,6,214,12],[213,7,213,51],[218,6,218,23],[220,6,243,21],[224,10,240,12],[246,4,301,20],[248,6,250,12],[249,7,249,52],[254,6,254,23],[258,6,299,21],[261,9,296,11],[302,4,354,20],[304,6,306,12],[305,7,305,59],[310,6,310,23],[315,6,352,21],[318,9,349,11],[355,4,385,20],[357,6,359,12],[358,7,358,59],[363,6,363,23],[368,6,383,21],[371,9,380,11],[386,4,396,20],[388,6,390,12],[389,7,389,62],[394,13,394,69],"src\\routes\\_api\\search\\index.jsx","SearchPage",[32,0,386,1],[33,13,33,36],[35,18,35,31],[36,19,36,36],[36,9,36,14],[38,37,38,49],[41,14,41,51],[45,16,58,3],[59,16,72,3],[73,20,86,3],[87,15,100,3],[101,14,114,3],[115,22,128,3],[129,16,140,3],[141,18,153,3],[155,23,155,71],[155,8,155,19],[157,1,160,7],[162,2,384,8],[172,3,203,9],[173,4,194,6],[195,4,202,10],[201,5,201,61],[204,3,358,9],[210,5,229,20],[212,7,227,9],[232,5,257,20],[234,7,255,9],[260,5,274,20],[263,8,271,10],[277,5,290,20],[279,7,288,9],[293,5,307,20],[295,7,305,9],[310,5,324,20],[312,7,322,9],[327,5,340,20],[329,7,338,9],[343,5,356,20],[345,7,354,9],[375,5,381,11],[380,6,380,68],[383,3,383,13],"src\\routes\\_api\\favorite\\index.tsx","FavoritePage",[21,0,297,1],[22,13,22,36],[23,23,23,71],[23,8,23,19],[25,14,25,51],[27,16,38,3],[40,16,51,3],[53,20,64,3],[66,15,77,3],[79,14,90,3],[92,22,103,3],[105,16,116,3],[118,1,120,3],[123,2,295,9],[134,4,153,19],[136,6,151,8],[156,4,181,19],[158,6,179,8],[184,4,203,19],[186,6,201,8],[206,4,226,19],[208,6,224,8],[229,4,249,19],[231,6,247,8],[252,4,271,19],[254,6,269,8],[274,4,293,19],[276,6,291,8],"src\\routes\\setup\\server.list.tsx","ServerList",[28,0,206,1],[29,18,29,31],[30,39,30,53],[31,29,31,42],[31,9,31,24],[33,19,33,54],[35,21,35,37],[37,17,40,3],[42,23,45,3],[47,28,65,3],[90,1,92,7],[95,2,204,8],[96,3,96,21],[97,3,117,9],[106,4,108,17],[109,4,116,17],[115,5,115,56],[118,3,203,11],[121,6,201,12],[122,7,124,13],[125,7,173,13],[126,8,154,21],[136,10,152,12],[138,12,144,25],[155,8,163,21],[164,8,172,21],[174,7,200,13],[175,8,186,21],[185,9,185,62],[187,8,199,21],[198,9,198,71],"src\\routes\\setup\\server.add.tsx","ServerSetup",Line truncated
|
{"encodings":["src\\main.tsx","ProviderWrapper",[52,0,71,1],[53,39,57,3],[53,8,53,11],[53,13,53,22],[53,24,53,35],[58,34,61,3],[58,8,58,12],[58,14,58,30],[66,2,69,4],"src\\components\\notices\\errorNotice\\errorNotice.tsx","ErrorNotice",[6,27,54,1],[6,28,6,56],[9,2,52,8],[20,3,31,9],[32,3,34,16],[35,3,51,16],"src\\utils\\store\\api.tsx","ApiProvider",[50,27,67,1],[50,28,50,65],[51,17,65,2],[66,8,66,75],"useApiInContext",[69,7,75,1],[70,15,70,37],[74,8,74,57],"src\\utils\\store\\central.tsx","CentralProvider",[48,31,71,1],[48,32,48,69],[49,17,67,2],[69,2,69,77],"useCentralStore",[73,7,79,1],[74,15,74,41],[78,8,78,57],"src\\routes\\_api\\player\\index.tsx","VideoPlayer",[88,0,918,1],[89,13,89,42],[90,21,90,32],[90,9,90,16],[91,39,91,54],[92,16,92,48],[94,14,94,51],[106,5,116,3],[97,2,97,16],[98,2,98,6],[99,2,99,10],[100,2,100,14],[101,2,101,15],[102,2,102,14],[103,2,103,13],[104,2,104,15],[105,2,105,11],[117,40,120,3],[117,8,117,29],[117,31,117,36],[122,31,122,45],[123,41,125,2],[127,51,127,66],[130,31,130,46],[131,31,131,45],[132,35,132,50],[133,45,133,68],[134,33,134,56],[135,43,135,58],[137,29,137,40],[138,27,138,42],[140,1,140,41],[142,41,142,72],[219,24,257,7],[259,1,267,21],[267,5,267,19],[269,1,287,7],[289,1,292,15],[292,5,292,13],[294,41,311,62],[311,5,311,31],[311,33,311,60],[313,1,334,3],[331,2,331,28],[332,2,332,29],[333,2,333,37],[336,29,344,15],[344,5,344,13],[346,24,364,25],[364,5,364,13],[364,15,364,23],[366,25,370,15],[370,5,370,13],[372,49,372,64],[373,27,375,7],[376,1,376,56],[376,46,376,54],[378,22,384,21],[384,5,384,19],[464,5,481,11],[465,6,474,8],[475,6,477,19],[478,6,480,19],[485,4,499,10],[486,5,495,7],[496,5,498,18],[504,4,511,10],[505,5,507,18],[508,5,510,18],[515,3,519,9],[516,4,518,17],[523,51,523,66],[524,1,530,13],[530,5,530,11],[542,2,916,8],[543,3,566,21],[545,5,564,18],[563,6,563,52],[568,4,582,13],[585,4,585,55],[587,3,605,21],[589,5,603,18],[595,6,597,12],[598,6,602,8],[606,3,883,16],[642,4,696,10],[643,5,645,18],[644,6,644,66],[646,5,648,18],[647,6,647,64],[649,5,695,12],[670,6,694,18],[686,7,688,18],[690,8,692,19],[698,5,881,11],[699,6,706,19],[702,8,704,21],[707,6,880,12],[708,7,763,13],[709,8,756,10],[757,8,762,14],[758,9,760,22],[761,9,761,62],[764,7,879,13],[765,8,800,14],[766,9,766,31],[767,9,777,22],[774,10,776,17],[778,9,782,22],[779,10,781,17],[783,9,793,22],[790,10,792,17],[794,9,794,27],[795,9,799,22],[801,8,878,14],[802,9,840,22],[824,10,826,23],[827,10,839,12],[841,9,854,22],[847,10,853,17],[855,9,855,24],[856,9,865,22],[860,10,864,17],[866,9,877,22],[874,10,876,17],[884,3,915,5],"sliderDisplayFormat",[386,29,521,2],"src\\routes\\_api\\home\\index.tsx","Home",[40,0,400,1],[41,13,41,42],[42,14,42,51],[44,19,54,3],[56,21,80,3],[82,26,96,3],[98,26,111,3],[113,21,130,3],[132,47,134,6],[136,18,136,31],[138,21,138,59],[140,24,142,2],[144,1,157,26],[157,5,157,24],[161,3,397,10],[168,4,208,20],[170,6,170,26],[173,7,205,9],[210,4,245,20],[212,6,214,12],[213,7,213,51],[218,6,218,23],[220,6,243,21],[224,10,240,12],[246,4,301,20],[248,6,250,12],[249,7,249,52],[254,6,254,23],[258,6,299,21],[261,9,296,11],[302,4,354,20],[304,6,306,12],[305,7,305,59],[310,6,310,23],[315,6,352,21],[318,9,349,11],[355,4,385,20],[357,6,359,12],[358,7,358,59],[363,6,363,23],[368,6,383,21],[371,9,380,11],[386,4,396,20],[388,6,390,12],[389,7,389,62],[394,13,394,69],"src\\routes\\_api\\search\\index.jsx","SearchPage",[32,0,386,1],[33,13,33,36],[35,18,35,31],[36,19,36,36],[36,9,36,14],[38,37,38,49],[41,14,41,51],[45,16,58,3],[59,16,72,3],[73,20,86,3],[87,15,100,3],[101,14,114,3],[115,22,128,3],[129,16,140,3],[141,18,153,3],[155,23,155,71],[155,8,155,19],[157,1,160,7],[162,2,384,8],[172,3,203,9],[173,4,194,6],[195,4,202,10],[201,5,201,61],[204,3,358,9],[210,5,229,20],[212,7,227,9],[232,5,257,20],[234,7,255,9],[260,5,274,20],[263,8,271,10],[277,5,290,20],[279,7,288,9],[293,5,307,20],[295,7,305,9],[310,5,324,20],[312,7,322,9],[327,5,340,20],[329,7,338,9],[343,5,356,20],[345,7,354,9],[375,5,381,11],[380,6,380,68],[383,3,383,13],"src\\routes\\_api\\favorite\\index.tsx","FavoritePage",[21,0,297,1],[22,13,22,36],[23,23,23,71],[23,8,23,19],[25,14,25,51],[27,16,38,3],[40,16,51,3],[53,20,64,3],[66,15,77,3],[79,14,90,3],[92,22,103,3],[105,16,116,3],[118,1,120,3],[123,2,295,9],[134,4,153,19],[136,6,151,8],[156,4,181,19],[158,6,179,8],[184,4,203,19],[186,6,201,8],[206,4,226,19],[208,6,224,8],[229,4,249,19],[231,6,247,8],[252,4,271,19],[254,6,269,8],[274,4,293,19],[276,6,291,8],"src\\routes\\setup\\server.list.tsx","ServerList",[28,0,206,1],[29,18,29,31],[30,39,30,53],[31,29,31,42],[31,9,31,24],[33,19,33,54],[35,21,35,37],[37,17,40,3],[42,23,45,3],[47,28,65,3],[90,1,92,7],[95,2,204,8],[96,3,96,21],[97,3,117,9],[106,4,108,17],[109,4,116,17],[115,5,115,56],[118,3,203,11],[121,6,201,12],[122,7,124,13],[125,7,173,13],[126,8,154,21],[136,10,152,12],[138,12,144,25],[155,8,163,21],[164,8,172,21],[174,7,200,13],[175,8,186,21],[185,9,185,62],[187,8,199,21],[198,9,198,71],"src\\routes\\setup\\server.add.tsx","ServerSetup",Line truncated
|
||||||
+10
-10
@@ -4,7 +4,7 @@
|
|||||||
"version": "0.0.6-dev",
|
"version": "0.0.6-dev",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite && tsr watch",
|
"dev": "vite --force && tsr watch",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"tauri": "tauri",
|
"tauri": "tauri",
|
||||||
@@ -18,16 +18,16 @@
|
|||||||
"@fontsource-variable/jetbrains-mono": "^5.1.1",
|
"@fontsource-variable/jetbrains-mono": "^5.1.1",
|
||||||
"@fontsource-variable/noto-sans": "^5.1.0",
|
"@fontsource-variable/noto-sans": "^5.1.0",
|
||||||
"@jellyfin/sdk": "0.11.0",
|
"@jellyfin/sdk": "0.11.0",
|
||||||
"@million/lint": "^1.0.11",
|
"@million/lint": "^1.0.12",
|
||||||
"@mui/lab": "6.0.0-beta.14",
|
"@mui/lab": "6.0.0-beta.14",
|
||||||
"@mui/material": "6.1.6",
|
"@mui/material": "6.1.6",
|
||||||
"@react-spring/web": "^9.7.5",
|
"@react-spring/web": "^9.7.5",
|
||||||
"@tanem/react-nprogress": "^5.0.52",
|
"@tanem/react-nprogress": "^5.0.52",
|
||||||
"@tanstack/react-query": "^5.59.20",
|
"@tanstack/react-query": "^5.59.20",
|
||||||
"@tanstack/react-query-devtools": "^5.59.20",
|
"@tanstack/react-query-devtools": "^5.59.20",
|
||||||
"@tanstack/react-router": "^1.79.0",
|
"@tanstack/react-router": "^1.81.4",
|
||||||
"@tanstack/react-virtual": "^3.10.9",
|
"@tanstack/react-virtual": "^3.10.9",
|
||||||
"@tauri-apps/api": "2.0.3",
|
"@tauri-apps/api": "2.1.1",
|
||||||
"@tauri-apps/plugin-clipboard-manager": "2.1.0-beta.6",
|
"@tauri-apps/plugin-clipboard-manager": "2.1.0-beta.6",
|
||||||
"@tauri-apps/plugin-dialog": "2.0.1",
|
"@tauri-apps/plugin-dialog": "2.0.1",
|
||||||
"@tauri-apps/plugin-notification": "2.0.0",
|
"@tauri-apps/plugin-notification": "2.0.0",
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
"@types/react": "^18.3.12",
|
"@types/react": "^18.3.12",
|
||||||
"@types/react-dom": "^18.3.1",
|
"@types/react-dom": "^18.3.1",
|
||||||
"axios": "^1.7.7",
|
"axios": "^1.7.7",
|
||||||
"axios-tauri-api-adapter": "^2.0.2",
|
"axios-tauri-api-adapter": "^2.0.3",
|
||||||
"blurhash": "^2.0.5",
|
"blurhash": "^2.0.5",
|
||||||
"framer-motion": "^11.11.11",
|
"framer-motion": "^11.11.13",
|
||||||
"immer": "^10.1.1",
|
"immer": "^10.1.1",
|
||||||
"jassub": "^1.7.17",
|
"jassub": "^1.7.17",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
@@ -68,14 +68,14 @@
|
|||||||
"@babel/plugin-proposal-optional-chaining-assign": "^7.25.9",
|
"@babel/plugin-proposal-optional-chaining-assign": "^7.25.9",
|
||||||
"@biomejs/biome": "^1.9.4",
|
"@biomejs/biome": "^1.9.4",
|
||||||
"@tanstack/router-cli": "^1.79.0",
|
"@tanstack/router-cli": "^1.79.0",
|
||||||
"@tanstack/router-devtools": "^1.79.0",
|
"@tanstack/router-devtools": "^1.81.4",
|
||||||
"@tanstack/router-vite-plugin": "^1.79.0",
|
"@tanstack/router-vite-plugin": "^1.79.0",
|
||||||
"@tauri-apps/cli": "2.0.4",
|
"@tauri-apps/cli": "2.1.0",
|
||||||
"@types/lodash": "^4.17.13",
|
"@types/lodash": "^4.17.13",
|
||||||
"@vitejs/plugin-react": "^4.3.3",
|
"@vitejs/plugin-react": "^4.3.3",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"sass": "^1.80.6",
|
"sass": "^1.80.7",
|
||||||
"vite": "^5.4.10"
|
"vite": "^5.4.11"
|
||||||
},
|
},
|
||||||
"license": "GPL-3.0-only"
|
"license": "GPL-3.0-only"
|
||||||
}
|
}
|
||||||
Generated
+406
-491
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,3 @@
|
|||||||
import useDebounce from "@/utils/hooks/useDebounce";
|
|
||||||
import React, {
|
import React, {
|
||||||
type ReactNode,
|
type ReactNode,
|
||||||
useCallback,
|
useCallback,
|
||||||
@@ -11,12 +10,7 @@ import { useSpring } from "@react-spring/web";
|
|||||||
import { debounce } from "lodash";
|
import { debounce } from "lodash";
|
||||||
|
|
||||||
import "./style.scss";
|
import "./style.scss";
|
||||||
import { Button, IconButton } from "@mui/material";
|
import { IconButton } from "@mui/material";
|
||||||
|
|
||||||
enum Direction {
|
|
||||||
RIGHT = 0,
|
|
||||||
LEFT = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
const Slider = ({
|
const Slider = ({
|
||||||
content,
|
content,
|
||||||
@@ -148,13 +142,13 @@ const Slider = ({
|
|||||||
className="slider-button left"
|
className="slider-button left"
|
||||||
onClick={slideLeft}
|
onClick={slideLeft}
|
||||||
disabled={scrollPos.isStart}
|
disabled={scrollPos.isStart}
|
||||||
variant="contained"
|
|
||||||
>
|
>
|
||||||
<span className="material-symbols-rounded">chevron_left</span>
|
<span className="material-symbols-rounded">chevron_left</span>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<div className="slider-track" ref={containerRef} onScroll={onScroll}>
|
<div className="slider-track" ref={containerRef} onScroll={onScroll}>
|
||||||
{content?.map((item, index) => (
|
{content?.map((item, index) => (
|
||||||
<div
|
<div
|
||||||
|
//biome-ignore lint/suspicious/noArrayIndexKey: item does not have a unique key
|
||||||
key={index}
|
key={index}
|
||||||
className={
|
className={
|
||||||
currentSlide === index
|
currentSlide === index
|
||||||
@@ -170,7 +164,6 @@ const Slider = ({
|
|||||||
className="slider-button right"
|
className="slider-button right"
|
||||||
onClick={slideRight}
|
onClick={slideRight}
|
||||||
disabled={scrollPos.isEnd}
|
disabled={scrollPos.isEnd}
|
||||||
variant="contained"
|
|
||||||
>
|
>
|
||||||
<span className="material-symbols-rounded">chevron_right</span>
|
<span className="material-symbols-rounded">chevron_right</span>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ const QueueButton = () => {
|
|||||||
position: "relative",
|
position: "relative",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{queueItems[currentItemIndex].Id && (
|
{queueItems[currentItemIndex]?.Id && (
|
||||||
<>
|
<>
|
||||||
<Typography px="1em" mb={2} variant="h5" fontWeight={300}>
|
<Typography px="1em" mb={2} variant="h5" fontWeight={300}>
|
||||||
Currently Playing:
|
Currently Playing:
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 4em;
|
width: 4em;
|
||||||
|
box-shadow: 0 0 10px rgb(0 0 0 / 0.2);
|
||||||
|
transition: opacity $transition-time-default;
|
||||||
&-overlay {
|
&-overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -39,8 +41,6 @@
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity $transition-time-fast;
|
transition: opacity $transition-time-fast;
|
||||||
}
|
}
|
||||||
box-shadow: 0 0 10px rgb(0 0 0 / 0.2);
|
|
||||||
transition: opacity $transition-time-default;
|
|
||||||
}
|
}
|
||||||
&-info {
|
&-info {
|
||||||
justify-self: start;
|
justify-self: start;
|
||||||
|
|||||||
@@ -10,21 +10,16 @@ import {
|
|||||||
DialogContent,
|
DialogContent,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
Fab,
|
Fab,
|
||||||
FormControlLabel,
|
|
||||||
IconButton,
|
IconButton,
|
||||||
LinearProgress,
|
|
||||||
Link,
|
Link,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
Switch,
|
|
||||||
Tab,
|
Tab,
|
||||||
Tabs,
|
Tabs,
|
||||||
TextField,
|
TextField,
|
||||||
Typography,
|
Typography,
|
||||||
styled,
|
|
||||||
withStyles,
|
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { AnimatePresence, motion, transform } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
import React, { useEffect, useState, useMemo, useCallback } from "react";
|
import React, { useState, useMemo, useCallback } from "react";
|
||||||
|
|
||||||
import logo from "@/assets/logo.png";
|
import logo from "@/assets/logo.png";
|
||||||
|
|
||||||
@@ -41,14 +36,14 @@ import {
|
|||||||
setDefaultServer,
|
setDefaultServer,
|
||||||
setServer,
|
setServer,
|
||||||
} from "@/utils/storage/servers";
|
} from "@/utils/storage/servers";
|
||||||
import { allSettings, getSetting, setSetting } from "@/utils/storage/settings";
|
import { allSettings } from "@/utils/storage/settings";
|
||||||
import { delUser } from "@/utils/storage/user";
|
import { delUser } from "@/utils/storage/user";
|
||||||
import type { RecommendedServerInfo } from "@jellyfin/sdk";
|
import type { RecommendedServerInfo } from "@jellyfin/sdk";
|
||||||
import { LoadingButton } from "@mui/lab";
|
import { LoadingButton } from "@mui/lab";
|
||||||
import { red, yellow } from "@mui/material/colors";
|
import { red } from "@mui/material/colors";
|
||||||
import { useNavigate, useRouteContext } from "@tanstack/react-router";
|
import { useNavigate } from "@tanstack/react-router";
|
||||||
import { relaunch } from "@tauri-apps/plugin-process";
|
import { relaunch } from "@tauri-apps/plugin-process";
|
||||||
import { type Update, check } from "@tauri-apps/plugin-updater";
|
import { check } from "@tauri-apps/plugin-updater";
|
||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
import SettingOption from "../settingOption";
|
import SettingOption from "../settingOption";
|
||||||
|
|
||||||
@@ -82,10 +77,7 @@ const Settings = () => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { enqueueSnackbar } = useSnackbar();
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
|
|
||||||
const [applicationVersion, serversOnDiskFn] = useCentralStore((state) => [
|
const [applicationVersion] = useCentralStore((state) => [state.clientVersion]);
|
||||||
state.clientVersion,
|
|
||||||
state.allServersOnDisk,
|
|
||||||
]);
|
|
||||||
|
|
||||||
const serversOnDisk = useQuery({
|
const serversOnDisk = useQuery({
|
||||||
queryKey: ["settings", "serversOnDisk"],
|
queryKey: ["settings", "serversOnDisk"],
|
||||||
@@ -524,14 +516,6 @@ const Settings = () => {
|
|||||||
{systemInfo.data?.Version}
|
{systemInfo.data?.Version}
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
<div className="settings-info">
|
|
||||||
<Typography variant="subtitle2">
|
|
||||||
Operating System:
|
|
||||||
</Typography>
|
|
||||||
<Typography variant="subtitle2">
|
|
||||||
{systemInfo.data?.OperatingSystemDisplayName}
|
|
||||||
</Typography>
|
|
||||||
</div>
|
|
||||||
<div className="settings-info">
|
<div className="settings-info">
|
||||||
<Typography variant="subtitle2">
|
<Typography variant="subtitle2">
|
||||||
Server Architecture:
|
Server Architecture:
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
& .material-symbols-rounded {
|
& .material-symbols-rounded {
|
||||||
justify-self: center !important;
|
justify-self: center !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
&-scroll {
|
&-scroll {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
@@ -37,7 +36,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// About page
|
// About page
|
||||||
&-grid {
|
&-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -78,7 +76,6 @@
|
|||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//settings
|
//settings
|
||||||
&-option {
|
&-option {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -92,17 +89,8 @@
|
|||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//serverList
|
//serverList
|
||||||
&-server {
|
&-server {
|
||||||
&-container{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 1em;
|
|
||||||
align-items: center;
|
|
||||||
padding-bottom: 4.6em;
|
|
||||||
}
|
|
||||||
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 3.4em 1fr auto;
|
grid-template-columns: 3.4em 1fr auto;
|
||||||
justify-items: start;
|
justify-items: start;
|
||||||
@@ -112,7 +100,13 @@
|
|||||||
padding: 1em;
|
padding: 1em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: $border-radius-default;
|
border-radius: $border-radius-default;
|
||||||
|
&-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1em;
|
||||||
|
align-items: center;
|
||||||
|
padding-bottom: 4.6em;
|
||||||
|
}
|
||||||
&-icon {
|
&-icon {
|
||||||
font-size: 3.4em !important;
|
font-size: 3.4em !important;
|
||||||
font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 10, "opsz" 40;
|
font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 10, "opsz" 40;
|
||||||
@@ -134,7 +128,6 @@
|
|||||||
// width: 100%;
|
// width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-fab-container {
|
&-fab-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -144,7 +137,6 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 0.8em;
|
gap: 0.8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dialog
|
// Dialog
|
||||||
&-add {
|
&-add {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -154,7 +146,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.Mui-selected .material-symbols-rounded {
|
.Mui-selected .material-symbols-rounded {
|
||||||
font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40;
|
font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40;
|
||||||
}
|
}
|
||||||
@@ -3,12 +3,12 @@ $border-radius: 20px;
|
|||||||
.item-info {
|
.item-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
gap: 1.2em;
|
||||||
&-container {
|
&-container {
|
||||||
grid-template-columns: 1fr 25%;
|
grid-template-columns: 1fr 25%;
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 3em;
|
gap: 3em;
|
||||||
}
|
}
|
||||||
gap: 1.2em;
|
|
||||||
&-sidebar {
|
&-sidebar {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -19,21 +19,19 @@ import TextField from "@mui/material/TextField";
|
|||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
|
import { Card } from "@/components/card/card";
|
||||||
|
import { EmptyNotice } from "@/components/notices/emptyNotice/emptyNotice";
|
||||||
import { getArtistsApi } from "@jellyfin/sdk/lib/utils/api/artists-api";
|
import { getArtistsApi } from "@jellyfin/sdk/lib/utils/api/artists-api";
|
||||||
import { getGenresApi } from "@jellyfin/sdk/lib/utils/api/genres-api";
|
import { getGenresApi } from "@jellyfin/sdk/lib/utils/api/genres-api";
|
||||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||||
import { getMusicGenresApi } from "@jellyfin/sdk/lib/utils/api/music-genres-api";
|
import { getMusicGenresApi } from "@jellyfin/sdk/lib/utils/api/music-genres-api";
|
||||||
import { getPersonsApi } from "@jellyfin/sdk/lib/utils/api/persons-api";
|
import { getPersonsApi } from "@jellyfin/sdk/lib/utils/api/persons-api";
|
||||||
import { getStudiosApi } from "@jellyfin/sdk/lib/utils/api/studios-api";
|
import { getStudiosApi } from "@jellyfin/sdk/lib/utils/api/studios-api";
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
|
||||||
|
|
||||||
import { Card } from "@/components/card/card";
|
|
||||||
import { EmptyNotice } from "@/components/notices/emptyNotice/emptyNotice";
|
|
||||||
|
|
||||||
import GenreView from "@/components/layouts/library/genreView";
|
import GenreView from "@/components/layouts/library/genreView";
|
||||||
import MusicTrack from "@/components/musicTrack";
|
import MusicTrack from "@/components/musicTrack";
|
||||||
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
|
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
|
||||||
import { setBackdrop } from "@/utils/store/backdrop";
|
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||||
import {
|
import {
|
||||||
type BaseItemDtoQueryResult,
|
type BaseItemDtoQueryResult,
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
@@ -45,7 +43,13 @@ import {
|
|||||||
} from "@jellyfin/sdk/lib/generated-client";
|
} from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
|
||||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||||
import { FormControl, Menu, Stack, useScrollTrigger } from "@mui/material";
|
import {
|
||||||
|
FormControl,
|
||||||
|
Menu,
|
||||||
|
Select,
|
||||||
|
Stack,
|
||||||
|
useScrollTrigger,
|
||||||
|
} from "@mui/material";
|
||||||
import { useWindowVirtualizer } from "@tanstack/react-virtual";
|
import { useWindowVirtualizer } from "@tanstack/react-virtual";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
import "./library.scss";
|
import "./library.scss";
|
||||||
@@ -599,7 +603,7 @@ function LibraryView() {
|
|||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
// enabled: false,
|
// enabled: false,
|
||||||
enabled: user?.Id && Boolean(currentViewType) && currentLib.isSuccess,
|
enabled: !!user?.Id && Boolean(currentViewType) && currentLib.isSuccess,
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
// gcTime: 0,
|
// gcTime: 0,
|
||||||
});
|
});
|
||||||
@@ -686,6 +690,8 @@ function LibraryView() {
|
|||||||
threshold: 20,
|
threshold: 20,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const setBackdrop = useBackdropStore((s) => s.setBackdrop);
|
||||||
|
|
||||||
const backdropItems = useMemo(() => {
|
const backdropItems = useMemo(() => {
|
||||||
if (items.isSuccess) {
|
if (items.isSuccess) {
|
||||||
const temp = items.data.Items?.filter(
|
const temp = items.data.Items?.filter(
|
||||||
@@ -724,6 +730,8 @@ function LibraryView() {
|
|||||||
}
|
}
|
||||||
}, [backdropItems]);
|
}, [backdropItems]);
|
||||||
|
|
||||||
|
const [test, setTest] = useState(1);
|
||||||
|
|
||||||
if (items.isError) {
|
if (items.isError) {
|
||||||
console.error(items.error);
|
console.error(items.error);
|
||||||
}
|
}
|
||||||
@@ -833,6 +841,7 @@ function LibraryView() {
|
|||||||
size="small"
|
size="small"
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setSortBy(e.target.value as ItemSortBy);
|
setSortBy(e.target.value as ItemSortBy);
|
||||||
|
console.info(e);
|
||||||
sessionStorage.setItem(
|
sessionStorage.setItem(
|
||||||
`library-${currentLib.data?.Id}-config_sort`,
|
`library-${currentLib.data?.Id}-config_sort`,
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@@ -879,6 +888,7 @@ function LibraryView() {
|
|||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
size="large"
|
size="large"
|
||||||
|
//@ts-ignore
|
||||||
color="white"
|
color="white"
|
||||||
onClick={handleFilterDropdown}
|
onClick={handleFilterDropdown}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -84,6 +84,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-filter {
|
&-filter {
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 0 0.5em !important;
|
||||||
&-container {
|
&-container {
|
||||||
margin-top: 0.75em;
|
margin-top: 0.75em;
|
||||||
width: 22em;
|
width: 22em;
|
||||||
@@ -93,11 +96,6 @@
|
|||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(10px);
|
||||||
overflow-y: overlay;
|
overflow-y: overlay;
|
||||||
}
|
}
|
||||||
|
|
||||||
width: 100%;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: 0 0.5em !important;
|
|
||||||
|
|
||||||
&-title {
|
&-title {
|
||||||
justify-self: start;
|
justify-self: start;
|
||||||
}
|
}
|
||||||
@@ -131,13 +129,6 @@
|
|||||||
}
|
}
|
||||||
// Layout css for dynamic virtual rows
|
// Layout css for dynamic virtual rows
|
||||||
&-virtual-item{
|
&-virtual-item{
|
||||||
&-row{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-basis: 14%;
|
|
||||||
}
|
|
||||||
width: 14%;
|
width: 14%;
|
||||||
flex-basis: 14%;
|
flex-basis: 14%;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
@@ -146,6 +137,12 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0.75em;
|
padding: 0.75em;
|
||||||
|
&-row{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-basis: 14%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { WebviewWindow as appWindow } from "@tauri-apps/api/webviewWindow";
|
import { WebviewWindow as appWindow } from "@tauri-apps/api/webviewWindow";
|
||||||
import React from "react";
|
import React, { type ChangeEventHandler, useTransition } from "react";
|
||||||
import { useLayoutEffect, useMemo } from "react";
|
import { useLayoutEffect, useMemo } from "react";
|
||||||
|
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
@@ -34,7 +34,7 @@ import {
|
|||||||
} from "@jellyfin/sdk/lib/generated-client";
|
} from "@jellyfin/sdk/lib/generated-client";
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
|
|
||||||
import { setBackdrop } from "@/utils/store/backdrop";
|
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||||
|
|
||||||
import { Button, LinearProgress, TextField } from "@mui/material";
|
import { Button, LinearProgress, TextField } from "@mui/material";
|
||||||
import JASSUB from "jassub";
|
import JASSUB from "jassub";
|
||||||
@@ -48,14 +48,14 @@ import PlayPreviousButton from "@/components/buttons/playPreviousButtom";
|
|||||||
import QueueButton from "@/components/buttons/queueButton";
|
import QueueButton from "@/components/buttons/queueButton";
|
||||||
import OutroCard from "@/components/outroCard";
|
import OutroCard from "@/components/outroCard";
|
||||||
import { useApiInContext } from "@/utils/store/api";
|
import { useApiInContext } from "@/utils/store/api";
|
||||||
|
import { useCentralStore } from "@/utils/store/central";
|
||||||
import useQueue, { clearQueue } from "@/utils/store/queue";
|
import useQueue, { clearQueue } from "@/utils/store/queue";
|
||||||
import { createFileRoute, useRouter } from "@tanstack/react-router";
|
import { createFileRoute, useRouter } from "@tanstack/react-router";
|
||||||
import { toNumber } from "lodash";
|
import { toNumber } from "lodash";
|
||||||
import type { OnProgressProps } from "react-player/base";
|
import type { OnProgressProps } from "react-player/base";
|
||||||
import type { TrackProps } from "react-player/file";
|
import type { TrackProps } from "react-player/file";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import font from "./Noto-Sans-Indosphere.ttf?url";
|
||||||
import { useCentralStore } from "@/utils/store/central";
|
|
||||||
|
|
||||||
const ticksDisplay = (ticks: number) => {
|
const ticksDisplay = (ticks: number) => {
|
||||||
const time = Math.round(ticks / 10000);
|
const time = Math.round(ticks / 10000);
|
||||||
@@ -80,11 +80,50 @@ const ticksDisplay = (ticks: number) => {
|
|||||||
};
|
};
|
||||||
const VOLUME_SCROLL_INTERVAL = 0.02;
|
const VOLUME_SCROLL_INTERVAL = 0.02;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function is used to add a subtitle track (.vtt and .srt) to the react player instance.
|
||||||
|
*/
|
||||||
|
function addSubtitleTrackToReactPlayer(
|
||||||
|
videoElem: HTMLMediaElement,
|
||||||
|
subtitleTracks,
|
||||||
|
baseUrl: string,
|
||||||
|
) {
|
||||||
|
if (subtitleTracks.url && subtitleTracks.allTracks) {
|
||||||
|
const reqSubTrack = subtitleTracks.allTracks.filter(
|
||||||
|
(val) => val.Index === subtitleTracks.track,
|
||||||
|
);
|
||||||
|
const track = document.createElement("track");
|
||||||
|
track.src = `${baseUrl}${subtitleTracks.url}`;
|
||||||
|
track.kind = "subtitles";
|
||||||
|
track.srclang = reqSubTrack[0].Language ?? "en";
|
||||||
|
track.label = reqSubTrack[0].DisplayTitle ?? "Subtitle";
|
||||||
|
track.default = true;
|
||||||
|
|
||||||
|
track.addEventListener("load", () => {
|
||||||
|
console.log("Track loaded");
|
||||||
|
const a = track.track;
|
||||||
|
a.mode = "showing";
|
||||||
|
});
|
||||||
|
track.addEventListener("error", (e) => {
|
||||||
|
console.error(e);
|
||||||
|
});
|
||||||
|
|
||||||
|
videoElem.appendChild(track);
|
||||||
|
|
||||||
|
for (const i of videoElem.textTracks) {
|
||||||
|
if (i.label === reqSubTrack[0].DisplayTitle) {
|
||||||
|
i.mode = "showing";
|
||||||
|
} else {
|
||||||
|
i.mode = "hidden";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const Route = createFileRoute("/_api/player/")({
|
export const Route = createFileRoute("/_api/player/")({
|
||||||
component: VideoPlayer,
|
component: VideoPlayer,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function VideoPlayer() {
|
function VideoPlayer() {
|
||||||
const api = useApiInContext((s) => s.api);
|
const api = useApiInContext((s) => s.api);
|
||||||
const { history } = useRouter();
|
const { history } = useRouter();
|
||||||
@@ -137,6 +176,7 @@ function VideoPlayer() {
|
|||||||
const [volume, setVolume] = useState(1);
|
const [volume, setVolume] = useState(1);
|
||||||
const [muted, setMuted] = useState(false);
|
const [muted, setMuted] = useState(false);
|
||||||
|
|
||||||
|
const setBackdrop = useBackdropStore((s) => s.setBackdrop);
|
||||||
useEffect(() => setBackdrop("", ""), []);
|
useEffect(() => setBackdrop("", ""), []);
|
||||||
|
|
||||||
const [clickTimeout, setClickTimeout] = useState<NodeJS.Timeout>(null!);
|
const [clickTimeout, setClickTimeout] = useState<NodeJS.Timeout>(null!);
|
||||||
@@ -255,7 +295,6 @@ function VideoPlayer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// attach the event listener
|
// attach the event listener
|
||||||
document.addEventListener("keydown", handleKeyPress);
|
document.addEventListener("keydown", handleKeyPress);
|
||||||
@@ -266,6 +305,7 @@ function VideoPlayer() {
|
|||||||
};
|
};
|
||||||
}, [handleKeyPress]);
|
}, [handleKeyPress]);
|
||||||
|
|
||||||
|
// Volume control with mouse wheel
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleMouseWheel = (event: WheelEvent) => {
|
const handleMouseWheel = (event: WheelEvent) => {
|
||||||
if (event.deltaY < 0) {
|
if (event.deltaY < 0) {
|
||||||
@@ -286,46 +326,47 @@ function VideoPlayer() {
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// Set playing state to true when a new item is loaded
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
setPlaying(true);
|
setPlaying(true);
|
||||||
setIsReady(false);
|
setIsReady(false);
|
||||||
}, [item?.Id]);
|
}, [item?.Id]);
|
||||||
|
|
||||||
const reactPlayerCaptions: TrackProps = useMemo(() => {
|
|
||||||
if (
|
|
||||||
(mediaSource.subtitle.format === "vtt" ||
|
|
||||||
mediaSource.subtitle.format === "subrip") &&
|
|
||||||
mediaSource.subtitle.enable
|
|
||||||
) {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
kind: "subtitles",
|
|
||||||
src: `${api.basePath}${mediaSource.subtitle.url}`,
|
|
||||||
srcLang: "en",
|
|
||||||
default: true,
|
|
||||||
label: mediaSource.subtitle.url,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
}, [mediaSource.subtitle.track, mediaSource.subtitle.enable]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log(mediaSource.subtitle);
|
|
||||||
if (player.current?.getInternalPlayer() && mediaSource.subtitle.enable) {
|
if (player.current?.getInternalPlayer() && mediaSource.subtitle.enable) {
|
||||||
|
let jassubRenderer: JASSUB | undefined;
|
||||||
if (
|
if (
|
||||||
mediaSource.subtitle.format === "ass" ||
|
mediaSource.subtitle.format === "ass" ||
|
||||||
mediaSource.subtitle.format === "ssa"
|
mediaSource.subtitle.format === "ssa"
|
||||||
) {
|
) {
|
||||||
const jassubRenderer = new JASSUB({
|
jassubRenderer = new JASSUB({
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
video: player.current?.getInternalPlayer(),
|
video: player.current?.getInternalPlayer(),
|
||||||
workerUrl,
|
workerUrl,
|
||||||
wasmUrl,
|
wasmUrl,
|
||||||
subUrl: `${api.basePath}${mediaSource.subtitle.url}`,
|
subUrl: `${api.basePath}${mediaSource.subtitle.url}`,
|
||||||
|
availableFonts: { "noto sans": font },
|
||||||
|
fallbackFont: "noto sans",
|
||||||
});
|
});
|
||||||
return () => jassubRenderer.destroy(); // Remove JASSUB renderer when track changes to fix duplicate renders
|
} else if (
|
||||||
|
mediaSource.subtitle.format === "subrip" ||
|
||||||
|
mediaSource.subtitle.format === "vtt"
|
||||||
|
) {
|
||||||
|
// @ts-ignore internalPlayer here provides the HTML video player element
|
||||||
|
const videoElem: HTMLMediaElement =
|
||||||
|
player.current.getInternalPlayer() as HTMLMediaElement;
|
||||||
|
addSubtitleTrackToReactPlayer(
|
||||||
|
player.current.getInternalPlayer() as HTMLMediaElement,
|
||||||
|
mediaSource.subtitle,
|
||||||
|
api.basePath,
|
||||||
|
);
|
||||||
|
console.log(videoElem.textTracks);
|
||||||
}
|
}
|
||||||
|
return () => {
|
||||||
|
if (jassubRenderer) {
|
||||||
|
jassubRenderer.destroy();
|
||||||
|
} // Remove JASSUB renderer when track changes to fix duplicate renders
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
mediaSource.subtitle.track,
|
mediaSource.subtitle.track,
|
||||||
@@ -530,7 +571,6 @@ function VideoPlayer() {
|
|||||||
}, [volume]);
|
}, [volume]);
|
||||||
|
|
||||||
const handlePlaybackEnded = () => {
|
const handlePlaybackEnded = () => {
|
||||||
//check if next track item exists
|
|
||||||
if (queue[currentQueueItemIndex + 1].Id) {
|
if (queue[currentQueueItemIndex + 1].Id) {
|
||||||
playItemFromQueue("next", user?.Id, api);
|
playItemFromQueue("next", user?.Id, api);
|
||||||
} else {
|
} else {
|
||||||
@@ -538,6 +578,20 @@ function VideoPlayer() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const [subtitleIsChanging, startSubtitleChange] = useTransition();
|
||||||
|
const handleSubtitleChange = (
|
||||||
|
e: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>,
|
||||||
|
) => {
|
||||||
|
startSubtitleChange(() => {
|
||||||
|
if (mediaSource.subtitle.allTracks) {
|
||||||
|
changeSubtitleTrack(
|
||||||
|
toNumber(e.target.value),
|
||||||
|
mediaSource.subtitle.allTracks,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="video-player">
|
<div className="video-player">
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
@@ -672,16 +726,9 @@ function VideoPlayer() {
|
|||||||
label="Subtitles"
|
label="Subtitles"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
value={mediaSource.subtitle.track}
|
value={mediaSource.subtitle.track}
|
||||||
onChange={(e) => {
|
onChange={handleSubtitleChange}
|
||||||
if (mediaSource.subtitle.allTracks) {
|
|
||||||
changeSubtitleTrack(
|
|
||||||
toNumber(e.target.value),
|
|
||||||
mediaSource.subtitle.allTracks,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
fullWidth
|
fullWidth
|
||||||
disabled={mediaSource.subtitle.track === -2}
|
disabled={mediaSource.subtitle.track === -2 || subtitleIsChanging}
|
||||||
>
|
>
|
||||||
<MenuItem key={-1} value={-1}>
|
<MenuItem key={-1} value={-1}>
|
||||||
No Subtitle
|
No Subtitle
|
||||||
@@ -854,8 +901,10 @@ function VideoPlayer() {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
<QueueButton />
|
<QueueButton />
|
||||||
<IconButton
|
<IconButton
|
||||||
disabled={mediaSource.subtitle.track === -2}
|
disabled={
|
||||||
onClick={toggleSubtitleTrack}
|
mediaSource.subtitle.track === -2 || subtitleIsChanging
|
||||||
|
}
|
||||||
|
onClick={() => startSubtitleChange(toggleSubtitleTrack)}
|
||||||
>
|
>
|
||||||
<span className={"material-symbols-rounded"}>
|
<span className={"material-symbols-rounded"}>
|
||||||
{mediaSource.subtitle.enable
|
{mediaSource.subtitle.enable
|
||||||
@@ -882,7 +931,7 @@ function VideoPlayer() {
|
|||||||
)}
|
)}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
<ReactPlayer
|
<ReactPlayer
|
||||||
key={item?.Id}
|
key={`${item?.Id}${mediaSource.id}`}
|
||||||
playing={playing}
|
playing={playing}
|
||||||
url={playbackStream}
|
url={playbackStream}
|
||||||
ref={player}
|
ref={player}
|
||||||
@@ -900,18 +949,18 @@ function VideoPlayer() {
|
|||||||
position: "fixed",
|
position: "fixed",
|
||||||
zIndex: 1,
|
zIndex: 1,
|
||||||
}}
|
}}
|
||||||
config={{
|
|
||||||
file: {
|
|
||||||
attributes: {
|
|
||||||
crossOrigin: "true",
|
|
||||||
},
|
|
||||||
tracks: reactPlayerCaptions,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
volume={muted ? 0 : volume}
|
volume={muted ? 0 : volume}
|
||||||
onReady={handleReady}
|
onReady={handleReady}
|
||||||
onBuffer={() => setLoading(true)}
|
onBuffer={() => setLoading(true)}
|
||||||
onBufferEnd={() => setLoading(false)}
|
onBufferEnd={() => setLoading(false)}
|
||||||
|
config={{
|
||||||
|
file: {
|
||||||
|
attributes: {
|
||||||
|
crossOrigin: "anonymous",
|
||||||
|
},
|
||||||
|
tracks: [],
|
||||||
|
},
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ function PhotosPlayer() {
|
|||||||
<img
|
<img
|
||||||
src={
|
src={
|
||||||
item.Id
|
item.Id
|
||||||
? getImageUrlsApi(api).getItemImageUrl(item.Id, "Primary", {
|
? getImageUrlsApi(api).getItemImageUrlById(item.Id, "Primary", {
|
||||||
// width: 250,
|
// width: 250,
|
||||||
fillWidth: 250,
|
fillWidth: 250,
|
||||||
quality: 70,
|
quality: 70,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
&-name {
|
&-name {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
gap: 0.5em;
|
||||||
margin-left: 1.2em;
|
margin-left: 1.2em;
|
||||||
&-logo {
|
&-logo {
|
||||||
width: 16em;
|
width: 16em;
|
||||||
@@ -15,7 +16,6 @@
|
|||||||
object-position: left top;
|
object-position: left top;
|
||||||
filter: drop-shadow(0 0 10px black);
|
filter: drop-shadow(0 0 10px black);
|
||||||
}
|
}
|
||||||
gap: 0.5em;
|
|
||||||
}
|
}
|
||||||
&-trick-bubble {
|
&-trick-bubble {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -97,12 +97,12 @@ video {
|
|||||||
gap: 0.2em;
|
gap: 0.2em;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
&-text {
|
&-text {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
margin-bottom: 0.5em;
|
|
||||||
}
|
}
|
||||||
&-buttons {
|
&-buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { shallow } from "zustand/shallow";
|
|||||||
import { createWithEqualityFn } from "zustand/traditional";
|
import { createWithEqualityFn } from "zustand/traditional";
|
||||||
|
|
||||||
interface QueueStore {
|
interface QueueStore {
|
||||||
tracks: BaseItemDto[];
|
tracks: BaseItemDto[] | undefined;
|
||||||
currentItemIndex: number;
|
currentItemIndex: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ const plugins = [react({
|
|||||||
}]
|
}]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}), svgr(), TanStackRouterVite(), MillionLint.vite()];
|
}), svgr(), TanStackRouterVite()];
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: plugins,
|
plugins: plugins,
|
||||||
css: {
|
css: {
|
||||||
|
|||||||
Reference in new issue
Block a user