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
+219 -173

No files matched your search

+1 -46
View File
@@ -19,6 +19,7 @@
"@reduxjs/toolkit": "^1.9.3",
"@tanstack/react-query": "^4.26.1",
"@tanstack/react-query-devtools": "^4.29.3",
"@tauri-apps/api": "^1.2.0",
"blurhash": "^2.0.5",
"events": "^3.3.0",
"framer-motion": "^10.12.4",
@@ -27,12 +28,10 @@
"notistack": "^3.0.1",
"react": "^18.2.0",
"react-blurhash": "^0.3.0",
"react-cookie": "^4.1.1",
"react-dom": "^18.2.0",
"react-konami-code": "^2.3.0",
"react-material-ui-carousel": "^3.4.2",
"react-multi-carousel": "^2.8.3",
"react-parallax": "^3.5.1",
"react-redux": "^8.0.5",
"react-router-dom": "^6.10.0",
"redux": "^4.2.1",
@@ -1743,11 +1742,6 @@
"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": {
"version": "1.0.0",
"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",
"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": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-3.0.3.tgz",
@@ -2839,19 +2825,6 @@
"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": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",
@@ -2945,15 +2918,6 @@
"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": {
"version": "8.0.5",
"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",
"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": {
"version": "1.0.10",
"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",
"@tanstack/react-query": "^4.26.1",
"@tanstack/react-query-devtools": "^4.29.3",
"@tauri-apps/api": "^1.2.0",
"blurhash": "^2.0.5",
"events": "^3.3.0",
"framer-motion": "^10.12.4",
@@ -28,12 +29,10 @@
"notistack": "^3.0.1",
"react": "^18.2.0",
"react-blurhash": "^0.3.0",
"react-cookie": "^4.1.1",
"react-dom": "^18.2.0",
"react-konami-code": "^2.3.0",
"react-material-ui-carousel": "^3.4.2",
"react-multi-carousel": "^2.8.3",
"react-parallax": "^3.5.1",
"react-redux": "^8.0.5",
"react-router-dom": "^6.10.0",
"redux": "^4.2.1",
+1 -1
View File
@@ -17,7 +17,7 @@ tauri-build = { version = "1.2.1", features = [] }
[dependencies]
serde_json = "1.0"
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" }
[features]
+3
View File
@@ -18,6 +18,9 @@
"exit": true,
"relaunch": true,
"relaunchDangerousAllowSymlinkMacos": false
},
"shell": {
"all": true
}
},
"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 { useQuery } from "@tanstack/react-query";
// import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
// Theming
import CssBaseline from "@mui/material/CssBaseline";
@@ -400,6 +400,7 @@ function App() {
</Routes>
</div>
</AnimatePresence>
<ReactQueryDevtools />
</ThemeProvider>
</SnackbarProvider>
);
+1 -3
View File
@@ -348,13 +348,11 @@ export const Card = ({
gutterBottom
variant="subtitle2"
component="div"
color="gray"
textAlign="left"
// textOverflow={}
// fontSize="0.85em"
width="fit-content"
maxWidth="100%"
noWrap
sx={{ opacity: 0.5 }}
>
{subText}
</Typography>
+1 -1
View File
@@ -346,7 +346,7 @@ export const EpisodeCard = ({
mr: "0.25em",
}}
/>{" "}
{itemRating}
{Math.round(itemRating * 10) / 10}
</Typography>
)}
{!!itemTicks && (
+2 -1
View File
@@ -22,6 +22,7 @@ export const CardScroller = ({
title,
headingProps,
disableDecoration = false,
boxProps,
}) => {
const responsive = {
superLargeDesktop: {
@@ -50,7 +51,7 @@ export const CardScroller = ({
const [carouselRef, setCarouselRef] = useState();
return (
<Box className="card-scroller-container" sx={{ mb: 4 }}>
<Box {...boxProps} className="card-scroller-container" sx={{ mb: 4 }}>
<Box
sx={{ mb: 1 }}
className={
+207 -118
View File
@@ -23,6 +23,7 @@ import TableBody from "@mui/material/TableBody";
import TableCell from "@mui/material/TableCell";
import TextField from "@mui/material/TextField";
import MenuItem from "@mui/material/MenuItem";
import Link from "@mui/material/Link";
import { green, pink } from "@mui/material/colors";
import { AvatarImage } from "../../components/avatar/avatar";
@@ -502,9 +503,7 @@ const ItemDetail = () => {
className="item-detail-header"
mb={2}
paddingTop={
item.data.Type == BaseItemKind.MusicAlbum
? 10
: 0
item.data.Type.includes("Music") ? 10 : 0
}
>
<Box className="item-detail-header-backdrop">
@@ -682,7 +681,7 @@ const ItemDetail = () => {
.Logo ? (
<img
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
@@ -710,53 +709,63 @@ const ItemDetail = () => {
width: "100%",
}}
>
{item.data.ProductionYear && (
<Typography
sx={{ flexGrow: 0 }}
variant="subtitle1"
>
{
item.data
.ProductionYear
}
</Typography>
)}
<Chip
variant="outlined"
label={
!!item.data
.OfficialRating
? item.data
.OfficialRating
: "Not Rated"
}
/>
<Box
sx={{
display: "flex",
gap: "0.25em",
alignItems: "center",
}}
className="item-detail-info-rating"
>
{!!item.data
.CommunityRating ? (
<>
<MdiStarHalfFull />
<Typography variant="subtitle1">
{Math.round(
item.data
.CommunityRating *
10,
) / 10}
</Typography>
</>
) : (
<Typography variant="subtitle1">
No Community Rating
{item.data.Type != "MusicArtist" &&
item.data.ProductionYear && (
<Typography
sx={{ flexGrow: 0 }}
variant="subtitle1"
>
{
item.data
.ProductionYear
}
</Typography>
)}
</Box>
{item.data.Type !=
"MusicArtist" && (
<Chip
variant="outlined"
label={
!!item.data
.OfficialRating
? item.data
.OfficialRating
: "Not Rated"
}
/>
)}
{item.data.Type !=
"MusicArtist" && (
<Box
sx={{
display: "flex",
gap: "0.25em",
alignItems:
"center",
}}
className="item-detail-info-rating"
>
{!!item.data
.CommunityRating ? (
<>
<MdiStarHalfFull />
<Typography variant="subtitle1">
{Math.round(
item
.data
.CommunityRating *
10,
) / 10}
</Typography>
</>
) : (
<Typography variant="subtitle1">
No Community
Rating
</Typography>
)}
</Box>
)}
{!!item.data.RunTimeTicks && (
<Typography variant="subtitle1">
{getRuntimeFull(
@@ -776,8 +785,9 @@ const ItemDetail = () => {
mr={2}
>
{item.data.Type != "Person" &&
item.data.Type !=
"MusicArtist" && (
!item.data.Type.includes(
"Music",
) && (
<>
<Button
variant="contained"
@@ -923,6 +933,68 @@ const ItemDetail = () => {
</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 ==
BaseItemKind.MusicAlbum && (
<TableRow
@@ -1214,7 +1286,7 @@ const ItemDetail = () => {
<Typography
variant="body1"
sx={{ opacity: 0.8 }}
mb={5}
mb={2}
>
{item.data.Overview}
</Typography>
@@ -1985,73 +2057,83 @@ const ItemDetail = () => {
)}
{nextUpEpisode.isSuccess && (
<Grid2
container
columns={{
xs: 2,
sm: 3,
md: 4,
}}
>
{nextUpEpisode.data.Items.map(
(mitem, mindex) => {
return (
<Grid2
key={mindex}
xs={1}
sm={1}
md={1}
>
<EpisodeCard
itemId={mitem.Id}
itemName={`${mitem.IndexNumber}. ${mitem.Name}`}
imageTags={
!!mitem
.ImageTags
.Primary
}
playedPercent={
mitem.UserData
.PlayedPercentage
}
watchedStatus={
mitem.UserData
.Played
}
favourite={
mitem.UserData
.IsFavorite
}
blurhash={
mitem.ImageBlurHashes ==
{}
? ""
: !!mitem
.ImageTags
.Primary
? !!mitem
.ImageBlurHashes
.Primary
? mitem
<Box mt={0}>
<Typography variant="h5" mb={1}>
Next Up
</Typography>
<Grid2
container
columns={{
xs: 2,
sm: 3,
md: 4,
}}
>
{nextUpEpisode.data.Items.map(
(mitem, mindex) => {
return (
<Grid2
key={mindex}
xs={1}
sm={1}
md={1}
>
<EpisodeCard
itemId={
mitem.Id
}
itemName={`${mitem.IndexNumber}. ${mitem.Name}`}
imageTags={
!!mitem
.ImageTags
.Primary
}
playedPercent={
mitem
.UserData
.PlayedPercentage
}
watchedStatus={
mitem
.UserData
.Played
}
favourite={
mitem
.UserData
.IsFavorite
}
blurhash={
mitem.ImageBlurHashes ==
{}
? ""
: !!mitem
.ImageTags
.Primary
? !!mitem
.ImageBlurHashes
.Primary[
mitem
.ImageTags
.Primary
]
.Primary
? mitem
.ImageBlurHashes
.Primary[
mitem
.ImageTags
.Primary
]
: ""
: ""
: ""
}
currentUser={
user.data
}
centerAlignText
/>
</Grid2>
);
},
)}
</Grid2>
}
currentUser={
user.data
}
centerAlignText
/>
</Grid2>
);
},
)}
</Grid2>
</Box>
)}
{seasons.isSuccess && (
@@ -2063,7 +2145,11 @@ const ItemDetail = () => {
onChange={(e, newVal) => {
setCurrentSeason(newVal);
}}
sx={{ mb: 2 }}
sx={{
borderBottom: 1,
borderColor: "divider",
mb: 2,
}}
selectionFollowsFocus
>
{seasons.data.Items.map(
@@ -2197,6 +2283,9 @@ const ItemDetail = () => {
displayCards={8}
title="Cast"
disableDecoration
boxProps={{
mt: 5,
}}
>
{item.data.People.map((person, index) => {
return (