fix: subtitles not being rendered #401

This commit is contained in:
Prayag Prajapati committed 2024-11-15 19:53:40 +05:30
1 parent e91834ad6d
commit d641ddfc98
16 files changed
+591 -652

No files matched your search

+1 -1
View File
@@ -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
View File
@@ -4,7 +4,7 @@
"version": "0.0.6-dev",
"type": "module",
"scripts": {
"dev": "vite && tsr watch",
"dev": "vite --force && tsr watch",
"build": "vite build",
"preview": "vite preview",
"tauri": "tauri",
@@ -18,16 +18,16 @@
"@fontsource-variable/jetbrains-mono": "^5.1.1",
"@fontsource-variable/noto-sans": "^5.1.0",
"@jellyfin/sdk": "0.11.0",
"@million/lint": "^1.0.11",
"@million/lint": "^1.0.12",
"@mui/lab": "6.0.0-beta.14",
"@mui/material": "6.1.6",
"@react-spring/web": "^9.7.5",
"@tanem/react-nprogress": "^5.0.52",
"@tanstack/react-query": "^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",
"@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-dialog": "2.0.1",
"@tauri-apps/plugin-notification": "2.0.0",
@@ -39,9 +39,9 @@
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"axios": "^1.7.7",
"axios-tauri-api-adapter": "^2.0.2",
"axios-tauri-api-adapter": "^2.0.3",
"blurhash": "^2.0.5",
"framer-motion": "^11.11.11",
"framer-motion": "^11.11.13",
"immer": "^10.1.1",
"jassub": "^1.7.17",
"lodash": "^4.17.21",
@@ -68,14 +68,14 @@
"@babel/plugin-proposal-optional-chaining-assign": "^7.25.9",
"@biomejs/biome": "^1.9.4",
"@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",
"@tauri-apps/cli": "2.0.4",
"@tauri-apps/cli": "2.1.0",
"@types/lodash": "^4.17.13",
"@vitejs/plugin-react": "^4.3.3",
"prop-types": "^15.8.1",
"sass": "^1.80.6",
"vite": "^5.4.10"
"sass": "^1.80.7",
"vite": "^5.4.11"
},
"license": "GPL-3.0-only"
}
+406 -491
View File
File diff suppressed because it is too large. Load diff
+2 -9
View File
@@ -1,4 +1,3 @@
import useDebounce from "@/utils/hooks/useDebounce";
import React, {
type ReactNode,
useCallback,
@@ -11,12 +10,7 @@ import { useSpring } from "@react-spring/web";
import { debounce } from "lodash";
import "./style.scss";
import { Button, IconButton } from "@mui/material";
enum Direction {
RIGHT = 0,
LEFT = 1,
}
import { IconButton } from "@mui/material";
const Slider = ({
content,
@@ -148,13 +142,13 @@ const Slider = ({
className="slider-button left"
onClick={slideLeft}
disabled={scrollPos.isStart}
variant="contained"
>
<span className="material-symbols-rounded">chevron_left</span>
</IconButton>
<div className="slider-track" ref={containerRef} onScroll={onScroll}>
{content?.map((item, index) => (
<div
//biome-ignore lint/suspicious/noArrayIndexKey: item does not have a unique key
key={index}
className={
currentSlide === index
@@ -170,7 +164,6 @@ const Slider = ({
className="slider-button right"
onClick={slideRight}
disabled={scrollPos.isEnd}
variant="contained"
>
<span className="material-symbols-rounded">chevron_right</span>
</IconButton>
+1 -1
View File
@@ -76,7 +76,7 @@ const QueueButton = () => {
position: "relative",
}}
>
{queueItems[currentItemIndex].Id && (
{queueItems[currentItemIndex]?.Id && (
<>
<Typography px="1em" mb={2} variant="h5" fontWeight={300}>
Currently Playing:
+2 -2
View File
@@ -26,6 +26,8 @@
aspect-ratio: 1;
position: relative;
width: 4em;
box-shadow: 0 0 10px rgb(0 0 0 / 0.2);
transition: opacity $transition-time-default;
&-overlay {
position: absolute;
top: 0;
@@ -39,8 +41,6 @@
opacity: 0;
transition: opacity $transition-time-fast;
}
box-shadow: 0 0 10px rgb(0 0 0 / 0.2);
transition: opacity $transition-time-default;
}
&-info {
justify-self: start;
+7 -23
View File
@@ -10,21 +10,16 @@ import {
DialogContent,
DialogTitle,
Fab,
FormControlLabel,
IconButton,
LinearProgress,
Link,
Skeleton,
Switch,
Tab,
Tabs,
TextField,
Typography,
styled,
withStyles,
} from "@mui/material";
import { AnimatePresence, motion, transform } from "framer-motion";
import React, { useEffect, useState, useMemo, useCallback } from "react";
import { AnimatePresence, motion } from "framer-motion";
import React, { useState, useMemo, useCallback } from "react";
import logo from "@/assets/logo.png";
@@ -41,14 +36,14 @@ import {
setDefaultServer,
setServer,
} 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 type { RecommendedServerInfo } from "@jellyfin/sdk";
import { LoadingButton } from "@mui/lab";
import { red, yellow } from "@mui/material/colors";
import { useNavigate, useRouteContext } from "@tanstack/react-router";
import { red } from "@mui/material/colors";
import { useNavigate } from "@tanstack/react-router";
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 SettingOption from "../settingOption";
@@ -82,10 +77,7 @@ const Settings = () => {
const navigate = useNavigate();
const { enqueueSnackbar } = useSnackbar();
const [applicationVersion, serversOnDiskFn] = useCentralStore((state) => [
state.clientVersion,
state.allServersOnDisk,
]);
const [applicationVersion] = useCentralStore((state) => [state.clientVersion]);
const serversOnDisk = useQuery({
queryKey: ["settings", "serversOnDisk"],
@@ -524,14 +516,6 @@ const Settings = () => {
{systemInfo.data?.Version}
</Typography>
</div>
<div className="settings-info">
<Typography variant="subtitle2">
Operating System:
</Typography>
<Typography variant="subtitle2">
{systemInfo.data?.OperatingSystemDisplayName}
</Typography>
</div>
<div className="settings-info">
<Typography variant="subtitle2">
Server Architecture:
+26 -35
View File
@@ -1,28 +1,27 @@
.settings{
.settings {
display: grid !important;
grid-template-columns: 20% 1fr;
height: 60vh;
overflow: hidden !important;
.MuiTabs-flexContainerVertical{
.MuiTabs-flexContainerVertical {
height: 100%;
}
&-container{
&-container {
margin: 14px 0 14px 14px;
}
&-tab{
&-tab {
display: grid !important;
grid-template-columns: 2em 1fr;
align-items: center;
justify-items: start !important;
gap:1em;
& .material-symbols-rounded{
gap: 1em;
& .material-symbols-rounded {
justify-self: center !important;
}
}
&-scroll{
&-scroll {
overflow-y: auto;
scrollbar-gutter:stable ;
scrollbar-gutter: stable;
overscroll-behavior: contain;
// Magic scrollbar
&::-webkit-scrollbar {
@@ -37,14 +36,13 @@
}
}
}
// About page
&-grid{
&-grid {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap:1em;
gap: 1em;
}
&-logo{
&-logo {
width: 100%;
background: rgb(255 255 255 / 1);
padding: 0em;
@@ -53,7 +51,7 @@
border-radius: $border-radius-default;
object-fit: contain;
}
&-info{
&-info {
display: grid;
grid-template-columns: 40% 1fr;
gap: 1em;
@@ -61,13 +59,13 @@
align-items: center;
border-bottom: 1px solid rgb(255 255 255 / 0.1);
padding-bottom: 0.5em;
&-container{
&-container {
background: rgb(0 0 0 / 0.3);
padding: 1em;
border-radius: $border-radius-default;
display: flex;
flex-direction: column;
gap:0.6em;
gap: 0.6em;
width: 100%;
}
&:last-child {
@@ -78,9 +76,8 @@
opacity: 0.8;
}
}
//settings
&-option{
&-option {
display: flex;
align-items: center;
justify-content: space-between;
@@ -88,21 +85,12 @@
padding: 0 !important;
margin: 0 !important;
margin-bottom: 0.6em !important;
&-info-caption{
&-info-caption {
opacity: 0.6;
}
}
//serverList
&-server{
&-container{
display: flex;
flex-direction: column;
gap: 1em;
align-items: center;
padding-bottom: 4.6em;
}
&-server {
display: grid;
grid-template-columns: 3.4em 1fr auto;
justify-items: start;
@@ -112,7 +100,13 @@
padding: 1em;
width: 100%;
border-radius: $border-radius-default;
&-container {
display: flex;
flex-direction: column;
gap: 1em;
align-items: center;
padding-bottom: 4.6em;
}
&-icon {
font-size: 3.4em !important;
font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 10, "opsz" 40;
@@ -124,7 +118,7 @@
&-version {
display: flex;
align-items: center;
gap:0.4em;
gap: 0.4em;
}
}
&-buttons {
@@ -134,7 +128,6 @@
// width: 100%;
overflow: hidden;
}
&-fab-container {
display: flex;
position: absolute;
@@ -144,7 +137,6 @@
justify-content: center;
gap: 0.8em;
}
// Dialog
&-add {
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;
}
+2 -2
View File
@@ -3,12 +3,12 @@ $border-radius: 20px;
.item-info {
display: flex;
flex-direction: column;
&-container {
gap: 1.2em;
&-container {
grid-template-columns: 1fr 25%;
display: grid;
gap: 3em;
}
gap: 1.2em;
&-sidebar {
display: flex;
flex-direction: column;
+17 -7
View File
@@ -19,21 +19,19 @@ import TextField from "@mui/material/TextField";
import Typography from "@mui/material/Typography";
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 { getGenresApi } from "@jellyfin/sdk/lib/utils/api/genres-api";
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
import { getMusicGenresApi } from "@jellyfin/sdk/lib/utils/api/music-genres-api";
import { getPersonsApi } from "@jellyfin/sdk/lib/utils/api/persons-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 MusicTrack from "@/components/musicTrack";
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
import { setBackdrop } from "@/utils/store/backdrop";
import { useBackdropStore } from "@/utils/store/backdrop";
import {
type BaseItemDtoQueryResult,
BaseItemKind,
@@ -45,7 +43,13 @@ import {
} from "@jellyfin/sdk/lib/generated-client";
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 type { AxiosResponse } from "axios";
import "./library.scss";
@@ -599,7 +603,7 @@ function LibraryView() {
return result.data;
},
// enabled: false,
enabled: user?.Id && Boolean(currentViewType) && currentLib.isSuccess,
enabled: !!user?.Id && Boolean(currentViewType) && currentLib.isSuccess,
networkMode: "always",
// gcTime: 0,
});
@@ -686,6 +690,8 @@ function LibraryView() {
threshold: 20,
});
const setBackdrop = useBackdropStore((s) => s.setBackdrop);
const backdropItems = useMemo(() => {
if (items.isSuccess) {
const temp = items.data.Items?.filter(
@@ -724,6 +730,8 @@ function LibraryView() {
}
}, [backdropItems]);
const [test, setTest] = useState(1);
if (items.isError) {
console.error(items.error);
}
@@ -833,6 +841,7 @@ function LibraryView() {
size="small"
onChange={(e) => {
setSortBy(e.target.value as ItemSortBy);
console.info(e);
sessionStorage.setItem(
`library-${currentLib.data?.Id}-config_sort`,
JSON.stringify({
@@ -879,6 +888,7 @@ function LibraryView() {
</span>
}
size="large"
//@ts-ignore
color="white"
onClick={handleFilterDropdown}
>
+12 -15
View File
@@ -84,6 +84,9 @@
}
}
&-filter {
width: 100%;
justify-content: space-between;
margin: 0 0.5em !important;
&-container {
margin-top: 0.75em;
width: 22em;
@@ -92,12 +95,7 @@
border-radius: $border-radius-default;
backdrop-filter: blur(10px);
overflow-y: overlay;
}
width: 100%;
justify-content: space-between;
margin: 0 0.5em !important;
}
&-title {
justify-self: start;
}
@@ -131,6 +129,14 @@
}
// Layout css for dynamic virtual rows
&-virtual-item{
width: 14%;
flex-basis: 14%;
height: fit-content;
display: inline-flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 0.75em;
&-row{
display: flex;
flex-direction: row;
@@ -138,14 +144,5 @@
align-items: center;
flex-basis: 14%;
}
width: 14%;
flex-basis: 14%;
height: fit-content;
display: inline-flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 0.75em;
}
}
+99 -50
View File
@@ -1,5 +1,5 @@
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 CircularProgress from "@mui/material/CircularProgress";
@@ -34,7 +34,7 @@ import {
} from "@jellyfin/sdk/lib/generated-client";
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 JASSUB from "jassub";
@@ -48,14 +48,14 @@ import PlayPreviousButton from "@/components/buttons/playPreviousButtom";
import QueueButton from "@/components/buttons/queueButton";
import OutroCard from "@/components/outroCard";
import { useApiInContext } from "@/utils/store/api";
import { useCentralStore } from "@/utils/store/central";
import useQueue, { clearQueue } from "@/utils/store/queue";
import { createFileRoute, useRouter } from "@tanstack/react-router";
import { toNumber } from "lodash";
import type { OnProgressProps } from "react-player/base";
import type { TrackProps } from "react-player/file";
import { useQuery } from "@tanstack/react-query";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
import { useCentralStore } from "@/utils/store/central";
import font from "./Noto-Sans-Indosphere.ttf?url";
const ticksDisplay = (ticks: number) => {
const time = Math.round(ticks / 10000);
@@ -80,11 +80,50 @@ const ticksDisplay = (ticks: number) => {
};
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/")({
component: VideoPlayer,
});
function VideoPlayer() {
const api = useApiInContext((s) => s.api);
const { history } = useRouter();
@@ -137,6 +176,7 @@ function VideoPlayer() {
const [volume, setVolume] = useState(1);
const [muted, setMuted] = useState(false);
const setBackdrop = useBackdropStore((s) => s.setBackdrop);
useEffect(() => setBackdrop("", ""), []);
const [clickTimeout, setClickTimeout] = useState<NodeJS.Timeout>(null!);
@@ -255,7 +295,6 @@ function VideoPlayer() {
}
}
}, []);
useEffect(() => {
// attach the event listener
document.addEventListener("keydown", handleKeyPress);
@@ -266,6 +305,7 @@ function VideoPlayer() {
};
}, [handleKeyPress]);
// Volume control with mouse wheel
useEffect(() => {
const handleMouseWheel = (event: WheelEvent) => {
if (event.deltaY < 0) {
@@ -286,46 +326,47 @@ function VideoPlayer() {
};
}, []);
// Set playing state to true when a new item is loaded
useLayoutEffect(() => {
setPlaying(true);
setIsReady(false);
}, [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(() => {
console.log(mediaSource.subtitle);
if (player.current?.getInternalPlayer() && mediaSource.subtitle.enable) {
let jassubRenderer: JASSUB | undefined;
if (
mediaSource.subtitle.format === "ass" ||
mediaSource.subtitle.format === "ssa"
) {
const jassubRenderer = new JASSUB({
jassubRenderer = new JASSUB({
//@ts-ignore
video: player.current?.getInternalPlayer(),
workerUrl,
wasmUrl,
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,
@@ -530,13 +571,26 @@ function VideoPlayer() {
}, [volume]);
const handlePlaybackEnded = () => {
//check if next track item exists
if (queue[currentQueueItemIndex + 1].Id) {
playItemFromQueue("next", user?.Id, api);
} else {
handleExitPlayer(); // Exit player if playback has finished and the queue is empty
}
};
const [subtitleIsChanging, startSubtitleChange] = useTransition();
const handleSubtitleChange = (
e: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>,
) => {
startSubtitleChange(() => {
if (mediaSource.subtitle.allTracks) {
changeSubtitleTrack(
toNumber(e.target.value),
mediaSource.subtitle.allTracks,
);
}
});
};
return (
<div className="video-player">
@@ -672,16 +726,9 @@ function VideoPlayer() {
label="Subtitles"
variant="outlined"
value={mediaSource.subtitle.track}
onChange={(e) => {
if (mediaSource.subtitle.allTracks) {
changeSubtitleTrack(
toNumber(e.target.value),
mediaSource.subtitle.allTracks,
);
}
}}
onChange={handleSubtitleChange}
fullWidth
disabled={mediaSource.subtitle.track === -2}
disabled={mediaSource.subtitle.track === -2 || subtitleIsChanging}
>
<MenuItem key={-1} value={-1}>
No Subtitle
@@ -854,8 +901,10 @@ function VideoPlayer() {
</IconButton>
<QueueButton />
<IconButton
disabled={mediaSource.subtitle.track === -2}
onClick={toggleSubtitleTrack}
disabled={
mediaSource.subtitle.track === -2 || subtitleIsChanging
}
onClick={() => startSubtitleChange(toggleSubtitleTrack)}
>
<span className={"material-symbols-rounded"}>
{mediaSource.subtitle.enable
@@ -882,7 +931,7 @@ function VideoPlayer() {
)}
</motion.div>
<ReactPlayer
key={item?.Id}
key={`${item?.Id}${mediaSource.id}`}
playing={playing}
url={playbackStream}
ref={player}
@@ -900,18 +949,18 @@ function VideoPlayer() {
position: "fixed",
zIndex: 1,
}}
config={{
file: {
attributes: {
crossOrigin: "true",
},
tracks: reactPlayerCaptions,
},
}}
volume={muted ? 0 : volume}
onReady={handleReady}
onBuffer={() => setLoading(true)}
onBufferEnd={() => setLoading(false)}
config={{
file: {
attributes: {
crossOrigin: "anonymous",
},
tracks: [],
},
}}
/>
</div>
);
+1 -1
View File
@@ -49,7 +49,7 @@ function PhotosPlayer() {
<img
src={
item.Id
? getImageUrlsApi(api).getItemImageUrl(item.Id, "Primary", {
? getImageUrlsApi(api).getItemImageUrlById(item.Id, "Primary", {
// width: 250,
fillWidth: 250,
quality: 70,
+3 -3
View File
@@ -7,6 +7,7 @@
&-name {
display: flex;
flex-direction: column;
gap: 0.5em;
margin-left: 1.2em;
&-logo {
width: 16em;
@@ -15,7 +16,6 @@
object-position: left top;
filter: drop-shadow(0 0 10px black);
}
gap: 0.5em;
}
&-trick-bubble {
overflow: hidden;
@@ -97,12 +97,12 @@ video {
gap: 0.2em;
align-items: stretch;
justify-content: center;
&-text {
margin-bottom: 0.5em;
&-text {
display: flex;
align-items: stretch;
justify-content: space-between;
}
margin-bottom: 0.5em;
}
&-buttons {
display: flex;
+1 -1
View File
@@ -3,7 +3,7 @@ import { shallow } from "zustand/shallow";
import { createWithEqualityFn } from "zustand/traditional";
interface QueueStore {
tracks: BaseItemDto[];
tracks: BaseItemDto[] | undefined;
currentItemIndex: number;
}
+1 -1
View File
@@ -17,7 +17,7 @@ const plugins = [react({
}]
]
}
}), svgr(), TanStackRouterVite(), MillionLint.vite()];
}), svgr(), TanStackRouterVite()];
export default defineConfig({
plugins: plugins,
css: {