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

+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 (