remove some unsed pkgs and display external urls #26

This commit is contained in:
prayag17 committed 2023-04-27 14:30:51 +05:30
1 parent 9022dc16ab
commit b1c0704bac
9 files changed
+117 -71

No files matched your search

+1 -46
View File
@@ -19,6 +19,7 @@
"@reduxjs/toolkit": "^1.9.3", "@reduxjs/toolkit": "^1.9.3",
"@tanstack/react-query": "^4.26.1", "@tanstack/react-query": "^4.26.1",
"@tanstack/react-query-devtools": "^4.29.3", "@tanstack/react-query-devtools": "^4.29.3",
"@tauri-apps/api": "^1.2.0",
"blurhash": "^2.0.5", "blurhash": "^2.0.5",
"events": "^3.3.0", "events": "^3.3.0",
"framer-motion": "^10.12.4", "framer-motion": "^10.12.4",
@@ -27,12 +28,10 @@
"notistack": "^3.0.1", "notistack": "^3.0.1",
"react": "^18.2.0", "react": "^18.2.0",
"react-blurhash": "^0.3.0", "react-blurhash": "^0.3.0",
"react-cookie": "^4.1.1",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-konami-code": "^2.3.0", "react-konami-code": "^2.3.0",
"react-material-ui-carousel": "^3.4.2", "react-material-ui-carousel": "^3.4.2",
"react-multi-carousel": "^2.8.3", "react-multi-carousel": "^2.8.3",
"react-parallax": "^3.5.1",
"react-redux": "^8.0.5", "react-redux": "^8.0.5",
"react-router-dom": "^6.10.0", "react-router-dom": "^6.10.0",
"redux": "^4.2.1", "redux": "^4.2.1",
@@ -1743,11 +1742,6 @@
"node": ">= 10" "node": ">= 10"
} }
}, },
"node_modules/@types/cookie": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.3.3.tgz",
"integrity": "sha512-LKVP3cgXBT9RYj+t+9FDKwS5tdI+rPBXaNSkma7hvqy35lc7mAokC2zsqWJH0LaqIt3B962nuYI77hsJoT1gow=="
},
"node_modules/@types/estree": { "node_modules/@types/estree": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz",
@@ -2072,14 +2066,6 @@
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
"integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="
}, },
"node_modules/cookie": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz",
"integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/copy-anything": { "node_modules/copy-anything": {
"version": "3.0.3", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-3.0.3.tgz", "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-3.0.3.tgz",
@@ -2839,19 +2825,6 @@
"react": ">=15" "react": ">=15"
} }
}, },
"node_modules/react-cookie": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-4.1.1.tgz",
"integrity": "sha512-ffn7Y7G4bXiFbnE+dKhHhbP+b8I34mH9jqnm8Llhj89zF4nPxPutxHT1suUqMeCEhLDBI7InYwf1tpaSoK5w8A==",
"dependencies": {
"@types/hoist-non-react-statics": "^3.0.1",
"hoist-non-react-statics": "^3.0.0",
"universal-cookie": "^4.0.0"
},
"peerDependencies": {
"react": ">= 16.3.0"
}
},
"node_modules/react-dom": { "node_modules/react-dom": {
"version": "18.2.0", "version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",
@@ -2945,15 +2918,6 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/react-parallax": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/react-parallax/-/react-parallax-3.5.1.tgz",
"integrity": "sha512-p5zPsPsqELlIOGaPS01O0IRx8R2bxcBAtrdF/RHf9nIxxk5hijbM2y89tk4rJQBcNH6ESSLe7J2NV4/ms7FLFw==",
"peerDependencies": {
"react": "16.x.x || 17.x.x || 18.x.x",
"react-dom": "16.x.x || 17.x.x || 18.x.x"
}
},
"node_modules/react-redux": { "node_modules/react-redux": {
"version": "8.0.5", "version": "8.0.5",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz",
@@ -3270,15 +3234,6 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
}, },
"node_modules/universal-cookie": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/universal-cookie/-/universal-cookie-4.0.4.tgz",
"integrity": "sha512-lbRVHoOMtItjWbM7TwDLdl8wug7izB0tq3/YVKhT/ahB4VDvWMyvnADfnJI8y6fSvsjh51Ix7lTGC6Tn4rMPhw==",
"dependencies": {
"@types/cookie": "^0.3.3",
"cookie": "^0.4.0"
}
},
"node_modules/update-browserslist-db": { "node_modules/update-browserslist-db": {
"version": "1.0.10", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz",
+1 -2
View File
@@ -20,6 +20,7 @@
"@reduxjs/toolkit": "^1.9.3", "@reduxjs/toolkit": "^1.9.3",
"@tanstack/react-query": "^4.26.1", "@tanstack/react-query": "^4.26.1",
"@tanstack/react-query-devtools": "^4.29.3", "@tanstack/react-query-devtools": "^4.29.3",
"@tauri-apps/api": "^1.2.0",
"blurhash": "^2.0.5", "blurhash": "^2.0.5",
"events": "^3.3.0", "events": "^3.3.0",
"framer-motion": "^10.12.4", "framer-motion": "^10.12.4",
@@ -28,12 +29,10 @@
"notistack": "^3.0.1", "notistack": "^3.0.1",
"react": "^18.2.0", "react": "^18.2.0",
"react-blurhash": "^0.3.0", "react-blurhash": "^0.3.0",
"react-cookie": "^4.1.1",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-konami-code": "^2.3.0", "react-konami-code": "^2.3.0",
"react-material-ui-carousel": "^3.4.2", "react-material-ui-carousel": "^3.4.2",
"react-multi-carousel": "^2.8.3", "react-multi-carousel": "^2.8.3",
"react-parallax": "^3.5.1",
"react-redux": "^8.0.5", "react-redux": "^8.0.5",
"react-router-dom": "^6.10.0", "react-router-dom": "^6.10.0",
"redux": "^4.2.1", "redux": "^4.2.1",
+1 -1
View File
@@ -17,7 +17,7 @@ tauri-build = { version = "1.2.1", features = [] }
[dependencies] [dependencies]
serde_json = "1.0" serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.2.2", features = ["process-exit", "process-relaunch"] } tauri = { version = "1.2.2", features = ["process-exit", "process-relaunch", "shell-all"] }
tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" } tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }
[features] [features]
+3
View File
@@ -18,6 +18,9 @@
"exit": true, "exit": true,
"relaunch": true, "relaunch": true,
"relaunchDangerousAllowSymlinkMacos": false "relaunchDangerousAllowSymlinkMacos": false
},
"shell": {
"all": true
} }
}, },
"bundle": { "bundle": {
+2 -1
View File
@@ -24,7 +24,7 @@ import { relaunch } from "@tauri-apps/api/process";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api"; import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
import { useQuery } from "@tanstack/react-query"; import { useQuery } from "@tanstack/react-query";
// import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
// Theming // Theming
import CssBaseline from "@mui/material/CssBaseline"; import CssBaseline from "@mui/material/CssBaseline";
@@ -400,6 +400,7 @@ function App() {
</Routes> </Routes>
</div> </div>
</AnimatePresence> </AnimatePresence>
<ReactQueryDevtools />
</ThemeProvider> </ThemeProvider>
</SnackbarProvider> </SnackbarProvider>
); );
+1 -3
View File
@@ -348,13 +348,11 @@ export const Card = ({
gutterBottom gutterBottom
variant="subtitle2" variant="subtitle2"
component="div" component="div"
color="gray"
textAlign="left" textAlign="left"
// textOverflow={}
// fontSize="0.85em"
width="fit-content" width="fit-content"
maxWidth="100%" maxWidth="100%"
noWrap noWrap
sx={{ opacity: 0.5 }}
> >
{subText} {subText}
</Typography> </Typography>
+1 -1
View File
@@ -346,7 +346,7 @@ export const EpisodeCard = ({
mr: "0.25em", mr: "0.25em",
}} }}
/>{" "} />{" "}
{itemRating} {Math.round(itemRating * 10) / 10}
</Typography> </Typography>
)} )}
{!!itemTicks && ( {!!itemTicks && (
+2 -1
View File
@@ -22,6 +22,7 @@ export const CardScroller = ({
title, title,
headingProps, headingProps,
disableDecoration = false, disableDecoration = false,
boxProps,
}) => { }) => {
const responsive = { const responsive = {
superLargeDesktop: { superLargeDesktop: {
@@ -50,7 +51,7 @@ export const CardScroller = ({
const [carouselRef, setCarouselRef] = useState(); const [carouselRef, setCarouselRef] = useState();
return ( return (
<Box className="card-scroller-container" sx={{ mb: 4 }}> <Box {...boxProps} className="card-scroller-container" sx={{ mb: 4 }}>
<Box <Box
sx={{ mb: 1 }} sx={{ mb: 1 }}
className={ className={
+105 -16
View File
@@ -23,6 +23,7 @@ import TableBody from "@mui/material/TableBody";
import TableCell from "@mui/material/TableCell"; import TableCell from "@mui/material/TableCell";
import TextField from "@mui/material/TextField"; import TextField from "@mui/material/TextField";
import MenuItem from "@mui/material/MenuItem"; import MenuItem from "@mui/material/MenuItem";
import Link from "@mui/material/Link";
import { green, pink } from "@mui/material/colors"; import { green, pink } from "@mui/material/colors";
import { AvatarImage } from "../../components/avatar/avatar"; import { AvatarImage } from "../../components/avatar/avatar";
@@ -502,9 +503,7 @@ const ItemDetail = () => {
className="item-detail-header" className="item-detail-header"
mb={2} mb={2}
paddingTop={ paddingTop={
item.data.Type == BaseItemKind.MusicAlbum item.data.Type.includes("Music") ? 10 : 0
? 10
: 0
} }
> >
<Box className="item-detail-header-backdrop"> <Box className="item-detail-header-backdrop">
@@ -682,7 +681,7 @@ const ItemDetail = () => {
.Logo ? ( .Logo ? (
<img <img
className="item-detail-title-logo" className="item-detail-title-logo"
src={`${window.api.basePath}/Items/${item.data.Id}/Images/Logo?quality=80&tag=${item.data.ImageTags.Logo}`} src={`${window.api.basePath}/Items/${item.data.Id}/Images/Logo?cropWhitespace=True&quality=80&tag=${item.data.ImageTags.Logo}`}
/> />
) : ( ) : (
item.data.Name item.data.Name
@@ -710,7 +709,8 @@ const ItemDetail = () => {
width: "100%", width: "100%",
}} }}
> >
{item.data.ProductionYear && ( {item.data.Type != "MusicArtist" &&
item.data.ProductionYear && (
<Typography <Typography
sx={{ flexGrow: 0 }} sx={{ flexGrow: 0 }}
variant="subtitle1" variant="subtitle1"
@@ -721,6 +721,8 @@ const ItemDetail = () => {
} }
</Typography> </Typography>
)} )}
{item.data.Type !=
"MusicArtist" && (
<Chip <Chip
variant="outlined" variant="outlined"
label={ label={
@@ -731,11 +733,15 @@ const ItemDetail = () => {
: "Not Rated" : "Not Rated"
} }
/> />
)}
{item.data.Type !=
"MusicArtist" && (
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",
gap: "0.25em", gap: "0.25em",
alignItems: "center", alignItems:
"center",
}} }}
className="item-detail-info-rating" className="item-detail-info-rating"
> >
@@ -745,7 +751,8 @@ const ItemDetail = () => {
<MdiStarHalfFull /> <MdiStarHalfFull />
<Typography variant="subtitle1"> <Typography variant="subtitle1">
{Math.round( {Math.round(
item.data item
.data
.CommunityRating * .CommunityRating *
10, 10,
) / 10} ) / 10}
@@ -753,10 +760,12 @@ const ItemDetail = () => {
</> </>
) : ( ) : (
<Typography variant="subtitle1"> <Typography variant="subtitle1">
No Community Rating No Community
Rating
</Typography> </Typography>
)} )}
</Box> </Box>
)}
{!!item.data.RunTimeTicks && ( {!!item.data.RunTimeTicks && (
<Typography variant="subtitle1"> <Typography variant="subtitle1">
{getRuntimeFull( {getRuntimeFull(
@@ -776,8 +785,9 @@ const ItemDetail = () => {
mr={2} mr={2}
> >
{item.data.Type != "Person" && {item.data.Type != "Person" &&
item.data.Type != !item.data.Type.includes(
"MusicArtist" && ( "Music",
) && (
<> <>
<Button <Button
variant="contained" variant="contained"
@@ -923,6 +933,68 @@ const ItemDetail = () => {
</TableRow> </TableRow>
)} )}
{item.data.ExternalUrls.length != 0 && (
<TableRow
sx={{
"& td, & th": {
border: 0,
},
}}
>
<TableCell
sx={{
paddingLeft: 0,
width: "5%",
}}
>
<Typography
className="item-detail-heading"
variant="h5"
mr={2}
>
Links
</Typography>
</TableCell>
<TableCell>
<Stack
direction="row"
gap={0.5}
divider={
<Typography variant="h6">
,
</Typography>
}
>
{item.data.ExternalUrls.map(
(
item,
index,
) => {
return (
<Link
key={
index
}
href={
item.Url
}
target="_blank"
color="inherit"
variant="h6"
underline="hover"
>
{
item.Name
}
</Link>
);
},
)}
</Stack>
</TableCell>
</TableRow>
)}
{item.data.Type == {item.data.Type ==
BaseItemKind.MusicAlbum && ( BaseItemKind.MusicAlbum && (
<TableRow <TableRow
@@ -1214,7 +1286,7 @@ const ItemDetail = () => {
<Typography <Typography
variant="body1" variant="body1"
sx={{ opacity: 0.8 }} sx={{ opacity: 0.8 }}
mb={5} mb={2}
> >
{item.data.Overview} {item.data.Overview}
</Typography> </Typography>
@@ -1985,6 +2057,10 @@ const ItemDetail = () => {
)} )}
{nextUpEpisode.isSuccess && ( {nextUpEpisode.isSuccess && (
<Box mt={0}>
<Typography variant="h5" mb={1}>
Next Up
</Typography>
<Grid2 <Grid2
container container
columns={{ columns={{
@@ -2003,7 +2079,9 @@ const ItemDetail = () => {
md={1} md={1}
> >
<EpisodeCard <EpisodeCard
itemId={mitem.Id} itemId={
mitem.Id
}
itemName={`${mitem.IndexNumber}. ${mitem.Name}`} itemName={`${mitem.IndexNumber}. ${mitem.Name}`}
imageTags={ imageTags={
!!mitem !!mitem
@@ -2011,15 +2089,18 @@ const ItemDetail = () => {
.Primary .Primary
} }
playedPercent={ playedPercent={
mitem.UserData mitem
.UserData
.PlayedPercentage .PlayedPercentage
} }
watchedStatus={ watchedStatus={
mitem.UserData mitem
.UserData
.Played .Played
} }
favourite={ favourite={
mitem.UserData mitem
.UserData
.IsFavorite .IsFavorite
} }
blurhash={ blurhash={
@@ -2052,6 +2133,7 @@ const ItemDetail = () => {
}, },
)} )}
</Grid2> </Grid2>
</Box>
)} )}
{seasons.isSuccess && ( {seasons.isSuccess && (
@@ -2063,7 +2145,11 @@ const ItemDetail = () => {
onChange={(e, newVal) => { onChange={(e, newVal) => {
setCurrentSeason(newVal); setCurrentSeason(newVal);
}} }}
sx={{ mb: 2 }} sx={{
borderBottom: 1,
borderColor: "divider",
mb: 2,
}}
selectionFollowsFocus selectionFollowsFocus
> >
{seasons.data.Items.map( {seasons.data.Items.map(
@@ -2197,6 +2283,9 @@ const ItemDetail = () => {
displayCards={8} displayCards={8}
title="Cast" title="Cast"
disableDecoration disableDecoration
boxProps={{
mt: 5,
}}
> >
{item.data.People.map((person, index) => { {item.data.People.map((person, index) => {
return ( return (