diff --git a/package.json b/package.json
index e3b0314..4fd8022 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "blink",
"private": true,
- "version": "0.0.6-dev",
+ "version": "0.0.7-dev",
"type": "module",
"scripts": {
"dev": "vite --force && tsr watch",
diff --git a/src/components/outroCard/index.tsx b/src/components/outroCard/index.tsx
index af043df..d0b1921 100644
--- a/src/components/outroCard/index.tsx
+++ b/src/components/outroCard/index.tsx
@@ -1,5 +1,5 @@
import { useApiInContext } from "@/utils/store/api";
-import { playItemFromQueue, usePlaybackStore } from "@/utils/store/playback";
+import { playItemFromQueue } from "@/utils/store/playback";
import useQueue from "@/utils/store/queue";
import { Button, Typography } from "@mui/material";
import React from "react";
@@ -7,8 +7,8 @@ import { getTypeIcon } from "../utils/iconsCollection";
import "./outroCard.scss";
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
-import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
-import { useMutation, useQuery } from "@tanstack/react-query";
+import { useCentralStore } from "@/utils/store/central";
+import { useMutation } from "@tanstack/react-query";
const OutroCard = (props: { handleShowCredits: () => void }) => {
const api = useApiInContext((s) => s.api);
@@ -16,19 +16,14 @@ const OutroCard = (props: { handleShowCredits: () => void }) => {
s.currentItemIndex,
s.tracks,
]);
- const item = queueItems[nextItemIndex + 1];
- const user = useQuery({
- queryKey: ["user"],
- queryFn: async () => {
- const result = await getUserApi(api).getCurrentUser();
- return result.data;
- },
- });
+ const item = queueItems?.[nextItemIndex + 1];
+ const user = useCentralStore((s) => s.currentUser);
const handlePlayNext = useMutation({
mutationKey: ["playNextButton"],
- mutationFn: () => playItemFromQueue("next", user.data?.Id, api),
+ mutationFn: () => playItemFromQueue("next", user?.Id, api),
onError: (error) => [console.error(error)],
});
+ if (!item || !item.Type) return null;
return (
Up Next
@@ -37,14 +32,21 @@ const OutroCard = (props: { handleShowCredits: () => void }) => {
.getItemImageUrlById(item.Id,)
) : (
- {getTypeIcon(item?.Type)}
+ {getTypeIcon(item.Type)}
)}
@@ -56,6 +58,7 @@ const OutroCard = (props: { handleShowCredits: () => void }) => {
);
};
diff --git a/src/components/skeleton/episode.tsx b/src/components/skeleton/episode.tsx
index 75045a3..df7762a 100644
--- a/src/components/skeleton/episode.tsx
+++ b/src/components/skeleton/episode.tsx
@@ -2,66 +2,96 @@ import { Divider, Skeleton, Typography } from "@mui/material";
import React from "react";
const EpisodeSkeleton = () => {
- return Array.from(new Array(8)).map((a, index) => {
- return <>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {index !== 7 && }
-
- >
- })
+ return Array.from(new Array(8)).map((_, index) => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {index !== 7 &&
}
+
+ );
+ });
}
export default EpisodeSkeleton
\ No newline at end of file
diff --git a/src/components/skeleton/episodeCards.jsx b/src/components/skeleton/episodeCards.jsx
deleted file mode 100644
index e95e058..0000000
--- a/src/components/skeleton/episodeCards.jsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import Card from "@mui/material/Card";
-import CardContent from "@mui/material/CardContent";
-import CardMedia from "@mui/material/CardMedia";
-import Skeleton from "@mui/material/Skeleton";
-import Typography from "@mui/material/Typography";
-import Grid from "@mui/material/Unstable_Grid2";
-
-export const EpisodeCardsSkeleton = () => {
- return (
-
- {Array.from(new Array(4)).map((a) => {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- })}
-
- );
-};
diff --git a/src/components/skeleton/seasonSelector.jsx b/src/components/skeleton/seasonSelector.tsx
similarity index 89%
rename from src/components/skeleton/seasonSelector.jsx
rename to src/components/skeleton/seasonSelector.tsx
index e66ee07..0f066a3 100644
--- a/src/components/skeleton/seasonSelector.jsx
+++ b/src/components/skeleton/seasonSelector.tsx
@@ -1,12 +1,13 @@
import Divider from "@mui/material/Divider";
-import Grid from "@mui/material/Grid2";
+import Grid2 from "@mui/material/Grid2";
import Skeleton from "@mui/material/Skeleton";
import Typography from "@mui/material/Typography";
+import React from "react";
import EpisodeSkeleton from "./episode";
export const SeasonSelectorSkeleton = () => {
return (
- {
}}
/>
-
+
-
+
);
};
diff --git a/src/routes/_api/player/audio.tsx b/src/routes/_api/player/audio.tsx
index 6086e21..48a3e54 100644
--- a/src/routes/_api/player/audio.tsx
+++ b/src/routes/_api/player/audio.tsx
@@ -370,24 +370,24 @@ function AudioPlayerRoute() {
- {currentDraggingIndex && currentDraggingIndex >= 0 && (
+ {(currentDraggingIndex ?? -1) >= 0 && (
drag_handle
- {queue[currentDraggingIndex].Name}
+ {queue[currentDraggingIndex ?? 0].Name}
- {queue[currentDraggingIndex].Artists?.join(", ")}
+ {queue[currentDraggingIndex ?? 0].Artists?.join(", ")}
{getRuntimeMusic(
- queue[currentDraggingIndex].RunTimeTicks ?? 0,
+ queue[currentDraggingIndex ?? 0].RunTimeTicks ?? 0,
)}