diff --git a/src/components/card/card.module.scss b/src/components/card/card.module.scss
index 7acc166..4bf89b3 100644
--- a/src/components/card/card.module.scss
+++ b/src/components/card/card.module.scss
@@ -7,6 +7,7 @@
position: relative;
border-radius: $border-radius-default;
overflow: hidden;
+ box-shadow: 0 0 7px rgb(0 0 0 / 0.2);
}
&-overlay {
position: absolute;
diff --git a/src/components/card/episodeCard.jsx b/src/components/card/episodeCard.jsx
index e6d5da0..1efde09 100644
--- a/src/components/card/episodeCard.jsx
+++ b/src/components/card/episodeCard.jsx
@@ -128,9 +128,9 @@ export const EpisodeCard = ({
opacity: isWatched ? 1 : 0,
}}
/>
-
{imageTags && (
)}
-
+
{!!blurhash && (
(
-
-));
diff --git a/src/components/skeleton/episodeCards.jsx b/src/components/skeleton/episodeCards.jsx
new file mode 100644
index 0000000..de73b6a
--- /dev/null
+++ b/src/components/skeleton/episodeCards.jsx
@@ -0,0 +1,85 @@
+/** @format */
+
+import Card from "@mui/material/Card";
+import CardMedia from "@mui/material/CardMedia";
+import CardContent from "@mui/material/CardContent";
+import Grid from "@mui/material/Unstable_Grid2";
+import Box from "@mui/material/Box";
+import Typography from "@mui/material/Typography";
+import Skeleton from "@mui/material/Skeleton";
+
+import { borderRadiusDefault } from "../../palette.module.scss";
+
+export const EpisodeCardsSkeleton = () => {
+ return (
+
+ {Array.from(new Array(4)).map((a, index) => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ })}
+
+ );
+};
diff --git a/src/routes/item/root.jsx b/src/routes/item/root.jsx
index 48a37f1..579b4af 100644
--- a/src/routes/item/root.jsx
+++ b/src/routes/item/root.jsx
@@ -44,6 +44,7 @@ import "./item.module.scss";
import { MdiCheck } from "../../components/icons/mdiCheck";
import { MdiHeartOutline } from "../../components/icons/mdiHeartOutline";
import { MdiHeart } from "../../components/icons/mdiHeart";
+import { EpisodeCardsSkeleton } from "../../components/skeleton/episodeCards";
function TabPanel(props) {
const { children, value, index, ...other } = props;
@@ -111,6 +112,7 @@ const ItemDetail = () => {
},
enabled: !!user.data,
networkMode: "always",
+ refetchOnWindowFocus: true,
});
const similarItems = useQuery({
@@ -147,6 +149,7 @@ const ItemDetail = () => {
},
enabled: item.isSuccess,
networkMode: "always",
+ refetchOnWindowFocus: true,
});
const seasons = useQuery({
@@ -159,6 +162,7 @@ const ItemDetail = () => {
},
enabled: item.isSuccess && item.data.Type == "Series",
networkMode: "always",
+ refetchOnWindowFocus: true,
});
const [currentSeason, setCurrentSeason] = useState(0);
@@ -174,6 +178,7 @@ const ItemDetail = () => {
},
enabled: seasons.isSuccess,
networkMode: "always",
+ refetchOnWindowFocus: true,
});
const personShows = useQuery({
@@ -591,7 +596,14 @@ const ItemDetail = () => {
}}
disabled
>
- Play
+ {!!item.data
+ .UserData
+ .PlayedPercentage &&
+ item.data.UserData
+ .PlayedPercentage >
+ 0
+ ? "Resume"
+ : "Play"}
{!!item.data
.UserData
.PlayedPercentage && (
@@ -738,7 +750,9 @@ const ItemDetail = () => {
md: 4,
}}
>
- {episodes.isSuccess &&
+ {episodes.isLoading ? (
+
+ ) : (
episodes.data.Items.map(
(
mitem,
@@ -820,7 +834,8 @@ const ItemDetail = () => {
);
},
- )}
+ )
+ )}
);
diff --git a/src/utils/date/time.js b/src/utils/date/time.js
index e4b66d7..8a94fcd 100644
--- a/src/utils/date/time.js
+++ b/src/utils/date/time.js
@@ -55,14 +55,10 @@ export const getRuntimeFull = (ticks) => {
*/
export const endsAt = (ticks) => {
let current = new Date();
- let currentTime =
- current.getHours() * 3600000 + current.getMinutes() * 60000;
+ let currentTime = current.getTime();
let time = ticksToMs(ticks);
let calculatedTime = currentTime + time;
- let hr = Math.floor(calculatedTime / 3600000);
- calculatedTime -= hr * 3600000;
- let min = Math.floor(calculatedTime / 60000);
- let formated = new Date(calculatedTime).toLocaleTimeString([], {
+ let formated = new Date(calculatedTime).toLocaleString([], {
hour: "2-digit",
minute: "2-digit",
});