feat: added new music player and fix some UI issues
This commit is contained in:
26 files changed
+1862
-1491
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { playItemFromQueue } from "@/utils/store/playback";
|
||||
import useQueue from "@/utils/store/queue";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { IconButton } from "@mui/material";
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import React from "react";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { playItemFromQueue } from "@/utils/store/playback";
|
||||
import useQueue, { getNextTrackIndex } from "@/utils/store/queue";
|
||||
|
||||
const PlayNextButton = () => {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
@@ -19,21 +19,21 @@ const PlayNextButton = () => {
|
||||
});
|
||||
const handlePlayNext = useMutation({
|
||||
mutationKey: ["playNextButton"],
|
||||
mutationFn: () => playItemFromQueue("next", user.data?.Id, api),
|
||||
mutationFn: async () => {
|
||||
const nextIndex = getNextTrackIndex();
|
||||
if (nextIndex === undefined) return;
|
||||
return playItemFromQueue(nextIndex, user.data?.Id, api);
|
||||
},
|
||||
onError: (error) => console.error(error),
|
||||
});
|
||||
const [queueItems, currentItemIndex] = useQueue((state) => [
|
||||
state.tracks,
|
||||
state.currentItemIndex,
|
||||
]);
|
||||
// Re-render when the queue position or repeat mode changes.
|
||||
useQueue((state) => [state.tracks, state.currentItemIndex, state.repeatMode]);
|
||||
const hasNext = getNextTrackIndex() !== undefined;
|
||||
return (
|
||||
<IconButton
|
||||
disabled={queueItems?.length === currentItemIndex + 1}
|
||||
onClick={() => handlePlayNext.mutate()}
|
||||
>
|
||||
<IconButton disabled={!hasNext} onClick={() => handlePlayNext.mutate()}>
|
||||
<span className="material-symbols-rounded">skip_next</span>
|
||||
</IconButton>
|
||||
);
|
||||
};
|
||||
|
||||
export default PlayNextButton;
|
||||
export default PlayNextButton;
|
||||
@@ -1,390 +1,31 @@
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import {
|
||||
Box,
|
||||
Drawer,
|
||||
IconButton,
|
||||
List,
|
||||
Tooltip,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import React, { useMemo, useState } from "react";
|
||||
import { playItemFromQueue } from "@/utils/store/playback";
|
||||
import useQueue, {
|
||||
clearUpcoming,
|
||||
removeFromQueue,
|
||||
reorderQueue,
|
||||
shuffleUpcoming,
|
||||
} from "@/utils/store/queue";
|
||||
import "./queueButton.scss";
|
||||
import {
|
||||
closestCenter,
|
||||
DndContext,
|
||||
type DragEndEvent,
|
||||
KeyboardSensor,
|
||||
PointerSensor,
|
||||
useSensor,
|
||||
useSensors,
|
||||
} from "@dnd-kit/core";
|
||||
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
||||
import {
|
||||
arrayMove,
|
||||
SortableContext,
|
||||
sortableKeyboardCoordinates,
|
||||
useSortable,
|
||||
verticalListSortingStrategy,
|
||||
} from "@dnd-kit/sortable";
|
||||
import { CSS } from "@dnd-kit/utilities";
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import QueueListItem from "../queueListItem";
|
||||
|
||||
function SortableQueueItem({
|
||||
item,
|
||||
onDelete,
|
||||
onPlay,
|
||||
index,
|
||||
}: {
|
||||
item: BaseItemDto;
|
||||
onDelete: () => void;
|
||||
onPlay: () => void;
|
||||
index: number;
|
||||
}) {
|
||||
const {
|
||||
attributes,
|
||||
listeners,
|
||||
setNodeRef,
|
||||
transform,
|
||||
transition,
|
||||
isDragging,
|
||||
} = useSortable({ id: item.Id || "" });
|
||||
|
||||
const style = {
|
||||
transform: CSS.Transform.toString(transform),
|
||||
transition,
|
||||
opacity: isDragging ? 0.5 : 1,
|
||||
position: "relative" as const,
|
||||
zIndex: isDragging ? 2 : 1,
|
||||
};
|
||||
|
||||
return (
|
||||
<div ref={setNodeRef} style={style}>
|
||||
<QueueListItem
|
||||
queueItem={item}
|
||||
onDelete={onDelete}
|
||||
onPlay={onPlay}
|
||||
dragHandleProps={{ ...attributes, ...listeners }}
|
||||
isEpisode={item.Type === "Episode"}
|
||||
index={index}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
import Drawer from "@mui/material/Drawer";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import React, { useState } from "react";
|
||||
import QueueView from "@/components/queue/queueView";
|
||||
|
||||
/** Opens the play queue in a side drawer. */
|
||||
const QueueButton = () => {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
|
||||
const [queueItems, currentItemIndex] = useQueue((state) => [
|
||||
state.tracks,
|
||||
state.currentItemIndex,
|
||||
]);
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
const user = useQuery({
|
||||
queryKey: ["currentUser"],
|
||||
queryFn: async () => {
|
||||
if (!api) throw new Error("API not available");
|
||||
return (await getUserApi(api).getCurrentUser()).data;
|
||||
},
|
||||
enabled: !!api,
|
||||
});
|
||||
|
||||
const sensors = useSensors(
|
||||
useSensor(PointerSensor),
|
||||
useSensor(KeyboardSensor, {
|
||||
coordinateGetter: sortableKeyboardCoordinates,
|
||||
}),
|
||||
);
|
||||
|
||||
const upcomingItems = useMemo(() => {
|
||||
return queueItems ? queueItems.slice(currentItemIndex + 1) : [];
|
||||
}, [queueItems, currentItemIndex]);
|
||||
|
||||
const upcomingIds = useMemo(() => {
|
||||
return upcomingItems.map((item) => item.Id || "");
|
||||
}, [upcomingItems]);
|
||||
|
||||
const handleDragEnd = (event: DragEndEvent) => {
|
||||
const { active, over } = event;
|
||||
|
||||
if (active.id !== over?.id && queueItems) {
|
||||
const oldIndex = upcomingItems.findIndex((item) => item.Id === active.id);
|
||||
const newIndex = upcomingItems.findIndex((item) => item.Id === over?.id);
|
||||
|
||||
if (oldIndex !== -1 && newIndex !== -1) {
|
||||
const newUpcoming = arrayMove(upcomingItems, oldIndex, newIndex);
|
||||
const newQueue = [
|
||||
...queueItems.slice(0, currentItemIndex + 1),
|
||||
...newUpcoming,
|
||||
];
|
||||
reorderQueue(newQueue);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const handleDelete = (index: number) => {
|
||||
removeFromQueue(index);
|
||||
};
|
||||
|
||||
const handlePlay = (index: number) => {
|
||||
playItemFromQueue(index, user.data?.Id, api);
|
||||
};
|
||||
|
||||
const handleClear = () => {
|
||||
clearUpcoming();
|
||||
};
|
||||
|
||||
const handleShuffle = () => {
|
||||
shuffleUpcoming();
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="Queue">
|
||||
<IconButton onClick={() => setOpen(true)} aria-label="Open queue">
|
||||
<span className="material-symbols-rounded">queue_music</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Drawer
|
||||
anchor="right"
|
||||
open={open}
|
||||
onClose={() => setOpen(false)}
|
||||
slotProps={{
|
||||
backdrop: {
|
||||
sx: {
|
||||
backgroundColor: "rgba(0, 0, 0, 0.2)",
|
||||
backdropFilter: "blur(4px)",
|
||||
},
|
||||
},
|
||||
paper: {
|
||||
className: "glass",
|
||||
sx: {
|
||||
width: 450,
|
||||
maxWidth: "100%",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
borderLeft: "1px solid rgba(255, 255, 255, 0.08)",
|
||||
},
|
||||
},
|
||||
backdrop: { sx: { backgroundColor: "rgb(0 0 0 / 0.3)" } },
|
||||
paper: { className: "queue-drawer-paper" },
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
p: 3,
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
position: "sticky",
|
||||
top: 0,
|
||||
zIndex: 20,
|
||||
borderBottom: "1px solid",
|
||||
borderColor: "rgba(255, 255, 255, 0.08)",
|
||||
backgroundColor: "rgba(20, 20, 30, 0.4)",
|
||||
backdropFilter: "blur(12px)",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: 1,
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
variant="h5"
|
||||
sx={{
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
Play Queue
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
sx={{
|
||||
color: "text.secondary",
|
||||
ml: 1,
|
||||
fontWeight: 600,
|
||||
bgcolor: "rgba(255, 255, 255, 0.08)",
|
||||
px: 1,
|
||||
py: 0.5,
|
||||
borderRadius: 2,
|
||||
}}
|
||||
>
|
||||
{queueItems?.length || 0}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
gap: 0.5,
|
||||
}}
|
||||
>
|
||||
<Tooltip title="Shuffle Upcoming">
|
||||
<span>
|
||||
<IconButton
|
||||
onClick={handleShuffle}
|
||||
size="small"
|
||||
disabled={upcomingItems.length < 2}
|
||||
>
|
||||
<span className="material-symbols-rounded">shuffle</span>
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Tooltip title="Clear Upcoming">
|
||||
<span>
|
||||
<IconButton
|
||||
onClick={handleClear}
|
||||
size="small"
|
||||
disabled={upcomingItems.length === 0}
|
||||
>
|
||||
<span className="material-symbols-rounded">clear_all</span>
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
<IconButton onClick={() => setOpen(false)} size="small">
|
||||
<span className="material-symbols-rounded">close</span>
|
||||
</IconButton>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
overflowY: "auto",
|
||||
flex: 1,
|
||||
p: 2,
|
||||
"&::-webkit-scrollbar": { width: 8 },
|
||||
"&::-webkit-scrollbar-track": { background: "transparent" },
|
||||
"&::-webkit-scrollbar-thumb": {
|
||||
background: "rgba(128,128,128,0.2)",
|
||||
borderRadius: 4,
|
||||
},
|
||||
"&::-webkit-scrollbar-thumb:hover": {
|
||||
background: "rgba(128,128,128,0.3)",
|
||||
},
|
||||
}}
|
||||
>
|
||||
{queueItems && queueItems.length > 0 ? (
|
||||
<List disablePadding>
|
||||
{/* Current Item */}
|
||||
{queueItems[currentItemIndex] && (
|
||||
<Box sx={{ mb: 4 }}>
|
||||
<Typography
|
||||
variant="overline"
|
||||
sx={{
|
||||
display: "block",
|
||||
opacity: 0.6,
|
||||
mb: 1,
|
||||
fontWeight: 600,
|
||||
letterSpacing: 1.2,
|
||||
}}
|
||||
>
|
||||
NOW PLAYING
|
||||
</Typography>
|
||||
<Box
|
||||
sx={{
|
||||
bgcolor: "background.paper",
|
||||
borderRadius: 3,
|
||||
overflow: "hidden",
|
||||
boxShadow: 4,
|
||||
border: "1px solid",
|
||||
borderColor: "divider",
|
||||
}}
|
||||
>
|
||||
<QueueListItem
|
||||
queueItem={queueItems[currentItemIndex]}
|
||||
active={true}
|
||||
isEpisode={
|
||||
queueItems[currentItemIndex].Type === "Episode"
|
||||
}
|
||||
index={currentItemIndex + 1}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{/* Upcoming Items */}
|
||||
{upcomingItems.length > 0 && (
|
||||
<>
|
||||
<Typography
|
||||
variant="overline"
|
||||
sx={{
|
||||
display: "block",
|
||||
opacity: 0.6,
|
||||
mb: 1,
|
||||
fontWeight: 600,
|
||||
letterSpacing: 1.2,
|
||||
}}
|
||||
>
|
||||
NEXT UP
|
||||
</Typography>
|
||||
<DndContext
|
||||
sensors={sensors}
|
||||
collisionDetection={closestCenter}
|
||||
onDragEnd={handleDragEnd}
|
||||
modifiers={[restrictToVerticalAxis]}
|
||||
>
|
||||
<SortableContext
|
||||
items={upcomingIds}
|
||||
strategy={verticalListSortingStrategy}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: 1,
|
||||
}}
|
||||
>
|
||||
{upcomingItems.map((item, index) => (
|
||||
<SortableQueueItem
|
||||
key={item.Id || index}
|
||||
item={item}
|
||||
onDelete={() =>
|
||||
handleDelete(currentItemIndex + 1 + index)
|
||||
}
|
||||
onPlay={() =>
|
||||
handlePlay(currentItemIndex + 1 + index)
|
||||
}
|
||||
index={currentItemIndex + 1 + index + 1}
|
||||
/>
|
||||
))}
|
||||
</Box>
|
||||
</SortableContext>
|
||||
</DndContext>
|
||||
</>
|
||||
)}
|
||||
</List>
|
||||
) : (
|
||||
<Box
|
||||
sx={{
|
||||
p: 4,
|
||||
textAlign: "center",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
gap: 2,
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ fontSize: 48 }}
|
||||
>
|
||||
queue_music
|
||||
</span>
|
||||
<Typography>Your queue is empty</Typography>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
<QueueView variant="drawer" onClose={() => setOpen(false)} />
|
||||
</Drawer>
|
||||
<IconButton onClick={() => setOpen(true)}>
|
||||
<span className="material-symbols-rounded">playlist_play</span>
|
||||
</IconButton>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -47,6 +47,8 @@ const ItemHeader = ({
|
||||
backdropSrc,
|
||||
}: ItemHeaderProps) => {
|
||||
const isEpisode = item.Type === "Episode";
|
||||
// A runtime / "ends at" is meaningless for people and artists (it sums their whole catalogue)
|
||||
const showRuntime = item.Type !== "MusicArtist" && item.Type !== "Person";
|
||||
const backdropTag =
|
||||
isEpisode && item.ParentBackdropImageTags?.length
|
||||
? item.ParentBackdropImageTags[0]
|
||||
@@ -294,12 +296,12 @@ const ItemHeader = ({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{item.RunTimeTicks && (
|
||||
{showRuntime && item.RunTimeTicks && (
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle2">
|
||||
{getRuntime(item.RunTimeTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
{item.RunTimeTicks && (
|
||||
{showRuntime && item.RunTimeTicks && (
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle2">
|
||||
{endsAt(
|
||||
item.RunTimeTicks - (item.UserData?.PlaybackPositionTicks ?? 0),
|
||||
|
||||
@@ -1,140 +1,228 @@
|
||||
$image-size: 4em;
|
||||
$art-size: 48px;
|
||||
|
||||
.audio-player {
|
||||
position: fixed;
|
||||
bottom: 1rem;
|
||||
bottom: 0.75rem;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 95%;
|
||||
max-width: 1200px;
|
||||
width: min(1100px, calc(100% - 1.5rem));
|
||||
height: 80px;
|
||||
box-sizing: border-box;
|
||||
z-index: 100;
|
||||
|
||||
display: grid;
|
||||
padding: 0.75em 1.5em;
|
||||
gap: 1.5em;
|
||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
|
||||
grid-template-columns: 25% 1fr 25%;
|
||||
@include glass-effect($blur: 12px, $bg-color: rgba(18, 18, 18, 0.85));
|
||||
// background: rgba(18, 18, 18, 0.85) !important;
|
||||
// backdrop-filter: blur(12px);
|
||||
// -webkit-backdrop-filter: blur(12px);
|
||||
// border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 1rem;
|
||||
// Equal side columns keep the transport truly centred
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 540px) minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: 1.5rem;
|
||||
padding: 0 0.75rem 0 1rem;
|
||||
|
||||
@media (max-width: 900px) {
|
||||
grid-template-columns: 1fr auto;
|
||||
padding: 0.5em 1em;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
border-radius: 0;
|
||||
border-bottom: none;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
|
||||
.audio-player-controls {
|
||||
display: none; // Hide controls on mobile for now or adjust
|
||||
}
|
||||
}
|
||||
color: white;
|
||||
background: rgb(18 18 24 / 0.92);
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
border: 1px solid rgb(255 255 255 / 0.08);
|
||||
border-radius: 14px;
|
||||
box-shadow: 0 12px 40px rgb(0 0 0 / 0.45);
|
||||
|
||||
#waveform {
|
||||
width: 100%;
|
||||
transform: scaleY(0);
|
||||
transition: transform $transition-time-default;
|
||||
&[data-show="true"] {
|
||||
transform: scaleY(1) !important;
|
||||
}
|
||||
}
|
||||
&-controls {
|
||||
&-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5em;
|
||||
padding: 0.5em 0;
|
||||
flex-flow: column;
|
||||
}
|
||||
&-info {
|
||||
display: grid;
|
||||
gap: 1em;
|
||||
grid-template-columns: minmax(0, $image-size) minmax(0, 1fr);
|
||||
width: fit-content;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
gap: 0.75rem;
|
||||
min-width: 0;
|
||||
|
||||
> .MuiIconButton-root {
|
||||
flex-shrink: 0;
|
||||
color: rgb(255 255 255 / 0.75);
|
||||
.material-symbols-rounded {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
&-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&-title {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
font-weight: 600 !important;
|
||||
line-height: 1.25 !important;
|
||||
// Wrap long titles onto a second line before truncating
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
overflow-wrap: anywhere;
|
||||
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
&-artist {
|
||||
opacity: 0.6;
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-image {
|
||||
width: $image-size;
|
||||
aspect-ratio: 1;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
z-index: 1;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 1;
|
||||
|
||||
position: relative;
|
||||
|
||||
&-container {
|
||||
border-radius: $border-radius_04;
|
||||
all: unset;
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
width: $art-size;
|
||||
height: $art-size;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
height: fit-content;
|
||||
aspect-ratio: 1;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
cursor: pointer;
|
||||
background: rgb(255 255 255 / 0.08);
|
||||
|
||||
&:hover .audio-player-image-expand,
|
||||
&:focus-visible .audio-player-image-expand {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
&-icon {
|
||||
|
||||
&-icon,
|
||||
&-expand {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 2em !important;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
&-icon {
|
||||
font-size: 1.5rem !important;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
// "Open player" affordance shown over the art on hover
|
||||
&-expand {
|
||||
z-index: 2;
|
||||
inset: 0;
|
||||
transform: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgb(0 0 0 / 0.5);
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
}
|
||||
&-track {
|
||||
grid-template-columns: $image-size 60% 0.5fr 0.5fr !important;
|
||||
}
|
||||
&-playlist{
|
||||
background: $clr-background-dark !important;
|
||||
border: 1.2px solid rgb(255 255 255 / 0.2);
|
||||
|
||||
// Transport on top, compact seek row underneath
|
||||
&-center {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
// Magic scrollbar
|
||||
&::-webkit-scrollbar {
|
||||
&-thumb {
|
||||
height: 150px;
|
||||
max-height: 33%;
|
||||
}
|
||||
&-track {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
background: transparent !important;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
|
||||
.player-controls {
|
||||
gap: 0.5rem !important;
|
||||
|
||||
.MuiFab-root {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
min-height: 36px;
|
||||
box-shadow: none;
|
||||
|
||||
.material-symbols-rounded {
|
||||
font-size: 1.6rem !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-track{
|
||||
display: grid;
|
||||
gap: 1em;
|
||||
grid-template-columns: 4em 1fr 4em;
|
||||
cursor: pointer;
|
||||
&.active{
|
||||
color: $clr-accent-default;
|
||||
}
|
||||
&-image{
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
border: 1.2px solid rgb(255 255 255 / 0.1);
|
||||
overflow: hidden;
|
||||
border-radius:5px;
|
||||
width: 100%;
|
||||
aspect-ratio: 1;
|
||||
height: 4em;
|
||||
}
|
||||
|
||||
&-progress {
|
||||
gap: 0.6rem !important;
|
||||
|
||||
.MuiTypography-root {
|
||||
min-width: 2.75em !important;
|
||||
font-size: 0.7rem;
|
||||
opacity: 0.6 !important;
|
||||
}
|
||||
|
||||
.MuiSlider-root {
|
||||
padding: 8px 0;
|
||||
}
|
||||
.MuiSlider-thumb {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
&:hover .MuiSlider-thumb,
|
||||
.MuiSlider-root.Mui-active .MuiSlider-thumb {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 0.25rem;
|
||||
min-width: 0;
|
||||
|
||||
.MuiIconButton-root {
|
||||
color: rgb(255 255 255 / 0.75);
|
||||
&:hover {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&-volume {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
|
||||
// Secondary control: neutral and compact
|
||||
.MuiSlider-root {
|
||||
width: 5.5rem !important;
|
||||
color: rgb(255 255 255 / 0.85);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.audio-player-volume,
|
||||
.audio-player-progress .MuiTypography-root {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
grid-template-columns: minmax(0, 1fr) auto auto;
|
||||
gap: 0.5rem;
|
||||
bottom: 0.5rem;
|
||||
width: calc(100% - 1rem);
|
||||
height: 64px;
|
||||
|
||||
.audio-player-center .player-controls > :not(:has(.MuiFab-root)),
|
||||
.audio-player-progress {
|
||||
display: none;
|
||||
}
|
||||
.audio-player-actions > :not(:last-child) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,20 +2,15 @@ import type { Api } from "@jellyfin/sdk";
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getLyricApi } from "@jellyfin/sdk/lib/utils/api/lyric-api";
|
||||
import { Typography } from "@mui/material";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { queryOptions, useQuery } from "@tanstack/react-query";
|
||||
import React, { useEffect, useRef } from "react";
|
||||
import { secToTicks } from "@/utils/date/time";
|
||||
|
||||
interface LyricsPanelProps {
|
||||
item: BaseItemDto | undefined | null;
|
||||
api: Api | undefined;
|
||||
currentTime: number;
|
||||
}
|
||||
|
||||
const LyricsPanel = ({ item, api, currentTime }: LyricsPanelProps) => {
|
||||
const lyricsContainer = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
const lyrics = useQuery({
|
||||
export const getLyricsQueryOptions = (
|
||||
item: BaseItemDto | undefined | null,
|
||||
api: Api | undefined,
|
||||
) =>
|
||||
queryOptions({
|
||||
queryKey: ["player", "audio", item?.Id, "lyrics"],
|
||||
queryFn: async () => {
|
||||
if (!item?.Id || !api) {
|
||||
@@ -23,17 +18,30 @@ const LyricsPanel = ({ item, api, currentTime }: LyricsPanelProps) => {
|
||||
}
|
||||
try {
|
||||
const response = await getLyricApi(api).getLyrics({
|
||||
itemId: item?.Id,
|
||||
itemId: item.Id,
|
||||
});
|
||||
return response.data;
|
||||
} catch (e) {
|
||||
console.error("Failed to fetch lyrics", e);
|
||||
} catch {
|
||||
// Items without lyrics return 404
|
||||
return null;
|
||||
}
|
||||
},
|
||||
enabled: Boolean(item?.Id) && Boolean(api),
|
||||
});
|
||||
|
||||
interface LyricsPanelProps {
|
||||
item: BaseItemDto | undefined | null;
|
||||
api: Api | undefined;
|
||||
currentTime: number;
|
||||
/** Seeks playback to a position in ticks; enables clicking synced lines. */
|
||||
onSeek?: (ticks: number) => void;
|
||||
}
|
||||
|
||||
const LyricsPanel = ({ item, api, currentTime, onSeek }: LyricsPanelProps) => {
|
||||
const lyricsContainer = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
const lyrics = useQuery(getLyricsQueryOptions(item, api));
|
||||
|
||||
useEffect(() => {
|
||||
if (lyrics.data && lyricsContainer.current) {
|
||||
const currentLyric = lyricsContainer.current.querySelector(
|
||||
@@ -78,6 +86,11 @@ const LyricsPanel = ({ item, api, currentTime }: LyricsPanelProps) => {
|
||||
(lyrics.data?.Lyrics?.[index + 1]?.Start ??
|
||||
Number.POSITIVE_INFINITY);
|
||||
|
||||
const canSeek = hasSyncedLyrics && onSeek && lyric.Start != null;
|
||||
const seek = () => {
|
||||
if (canSeek) onSeek(lyric.Start ?? 0);
|
||||
};
|
||||
|
||||
return (
|
||||
<Typography
|
||||
variant="body1"
|
||||
@@ -85,6 +98,18 @@ const LyricsPanel = ({ item, api, currentTime }: LyricsPanelProps) => {
|
||||
className={`audio-lyrics-line ${isActive ? "active" : ""}`}
|
||||
key={`${lyric.Text}-${index}`}
|
||||
data-active-lyric={isActive}
|
||||
{...(canSeek && {
|
||||
role: "button",
|
||||
tabIndex: 0,
|
||||
"data-seekable": true,
|
||||
onClick: seek,
|
||||
onKeyDown: (e: React.KeyboardEvent) => {
|
||||
if (e.key === "Enter" || e.key === " ") {
|
||||
e.preventDefault();
|
||||
seek();
|
||||
}
|
||||
},
|
||||
})}
|
||||
>
|
||||
{lyric.Text}
|
||||
</Typography>
|
||||
|
||||
@@ -1,35 +1,31 @@
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import type { ReactNode } from "react";
|
||||
import React from "react";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import React, { type ReactNode } from "react";
|
||||
import QueueButton from "@/components/buttons/queueButton";
|
||||
|
||||
interface PlayerActionsProps {
|
||||
onNavigate: () => void;
|
||||
/** Opens the full-screen player. */
|
||||
onExpand: () => void;
|
||||
onClose: () => void;
|
||||
/** Volume control, rendered between the queue and expand buttons. */
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
const PlayerActions = ({
|
||||
onNavigate,
|
||||
onClose,
|
||||
children,
|
||||
}: PlayerActionsProps) => {
|
||||
const PlayerActions = ({ onExpand, onClose, children }: PlayerActionsProps) => {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-end",
|
||||
}}
|
||||
>
|
||||
<IconButton onClick={onNavigate}>
|
||||
<span className="material-symbols-rounded">info</span>
|
||||
</IconButton>
|
||||
<div className="audio-player-actions">
|
||||
<QueueButton />
|
||||
{children}
|
||||
<IconButton onClick={onClose}>
|
||||
<div className="material-symbols-rounded">close</div>
|
||||
</IconButton>
|
||||
<div className="audio-player-volume">{children}</div>
|
||||
<Tooltip title="Open player">
|
||||
<IconButton onClick={onExpand} aria-label="Open player">
|
||||
<span className="material-symbols-rounded">open_in_full</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Tooltip title="Stop and close">
|
||||
<IconButton onClick={onClose} aria-label="Stop and close">
|
||||
<span className="material-symbols-rounded">close</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -20,7 +20,10 @@ const PlayerControls = ({
|
||||
onForward,
|
||||
}: PlayerControlsProps) => {
|
||||
return (
|
||||
<div style={{ display: "flex", gap: "1em", alignItems: "center" }}>
|
||||
<div
|
||||
className="player-controls"
|
||||
style={{ display: "flex", gap: "1em", alignItems: "center" }}
|
||||
>
|
||||
<PlayPreviousButton />
|
||||
{onRewind && (
|
||||
<IconButton onClick={onRewind}>
|
||||
|
||||
@@ -1,58 +1,97 @@
|
||||
import type { Api } from "@jellyfin/sdk";
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import React from "react";
|
||||
import LikeButton from "@/components/buttons/likeButton";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { getItemQueryOptions } from "@/utils/queries/items";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
|
||||
interface PlayerInfoProps {
|
||||
item: BaseItemDto | undefined | null;
|
||||
api: Api | undefined;
|
||||
trackName?: string;
|
||||
/** Opens the full-screen player. */
|
||||
onOpen: () => void;
|
||||
}
|
||||
|
||||
const PlayerInfo = ({ item, api, trackName }: PlayerInfoProps) => {
|
||||
const PlayerInfo = ({ item, api, onOpen }: PlayerInfoProps) => {
|
||||
const user = useCentralStore((s) => s.currentUser);
|
||||
// Fresh user data so the like button reflects changes immediately.
|
||||
const itemDetails = useQuery({
|
||||
...getItemQueryOptions(item?.Id ?? "", api, user?.Id),
|
||||
enabled: Boolean(item?.Id && api && user?.Id),
|
||||
});
|
||||
|
||||
if (!api || !item) return null;
|
||||
|
||||
const artists = item.ArtistItems?.length
|
||||
? item.ArtistItems
|
||||
: (item.AlbumArtists ?? []);
|
||||
|
||||
return (
|
||||
<div className="audio-player-info">
|
||||
<div className="audio-player-image-container">
|
||||
<img
|
||||
alt={trackName ?? "track"}
|
||||
className="audio-player-image"
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
(!item?.ImageTags?.Primary ? item?.AlbumId : item.Id) ?? "",
|
||||
"Primary",
|
||||
{
|
||||
quality: 85,
|
||||
fillHeight: 462,
|
||||
fillWidth: 462,
|
||||
},
|
||||
)}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
className="audio-player-image-container"
|
||||
onClick={onOpen}
|
||||
aria-label="Open player"
|
||||
>
|
||||
<span className="material-symbols-rounded audio-player-image-icon">
|
||||
music_note
|
||||
</span>
|
||||
</div>
|
||||
<img
|
||||
alt=""
|
||||
className="audio-player-image"
|
||||
src={getImageUrlsApi(api).getItemImageUrlById(
|
||||
(!item.ImageTags?.Primary ? item.AlbumId : item.Id) ?? "",
|
||||
"Primary",
|
||||
{ quality: 85, fillHeight: 120, fillWidth: 120 },
|
||||
)}
|
||||
/>
|
||||
<span className="material-symbols-rounded audio-player-image-expand">
|
||||
expand_less
|
||||
</span>
|
||||
</button>
|
||||
<div className="audio-player-info-text">
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
noWrap
|
||||
component="button"
|
||||
className="audio-player-info-title"
|
||||
title={item.Name ?? undefined}
|
||||
onClick={onOpen}
|
||||
>
|
||||
{item?.Name}
|
||||
{item.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
noWrap
|
||||
className="audio-player-info-artist"
|
||||
>
|
||||
by {item?.Artists?.map((artist) => artist).join(",")}
|
||||
{artists.map((artist, index) => (
|
||||
<React.Fragment key={artist.Id ?? artist.Name}>
|
||||
{index > 0 && ", "}
|
||||
{artist.Id ? (
|
||||
<Link to="/music/artist/$id" params={{ id: artist.Id }}>
|
||||
{artist.Name}
|
||||
</Link>
|
||||
) : (
|
||||
artist.Name
|
||||
)}
|
||||
</React.Fragment>
|
||||
))}
|
||||
</Typography>
|
||||
</div>
|
||||
<LikeButton
|
||||
itemId={item.Id ?? undefined}
|
||||
itemName={item.Name}
|
||||
isFavorite={
|
||||
itemDetails.data?.UserData?.IsFavorite ?? item.UserData?.IsFavorite
|
||||
}
|
||||
queryKey={["item", item.Id ?? ""]}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -8,6 +8,12 @@ interface PlayerProgressProps {
|
||||
duration: number;
|
||||
onSeek?: (value: number) => void;
|
||||
onSeekCommit: (value: number) => void;
|
||||
/**
|
||||
* "inline" puts the times beside the bar, "stacked" puts them underneath,
|
||||
* "bare" renders only the slider.
|
||||
*/
|
||||
layout?: "inline" | "stacked" | "bare";
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const PlayerProgress = ({
|
||||
@@ -15,6 +21,8 @@ const PlayerProgress = ({
|
||||
duration,
|
||||
onSeek,
|
||||
onSeekCommit,
|
||||
layout = "inline",
|
||||
className,
|
||||
}: PlayerProgressProps) => {
|
||||
const [isScrubbing, setIsScrubbing] = useState(false);
|
||||
const [sliderValue, setSliderValue] = useState(progress);
|
||||
@@ -38,8 +46,44 @@ const PlayerProgress = ({
|
||||
onSeekCommit(newValue);
|
||||
};
|
||||
|
||||
if (layout === "bare") {
|
||||
return (
|
||||
<Slider
|
||||
className={className}
|
||||
value={sliderValue}
|
||||
step={1}
|
||||
size="small"
|
||||
max={duration}
|
||||
onChange={handleChange}
|
||||
onChangeCommitted={handleChangeCommitted}
|
||||
aria-label="Seek"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (layout === "stacked") {
|
||||
return (
|
||||
<div className="player-progress-stacked">
|
||||
<Slider
|
||||
value={sliderValue}
|
||||
step={1}
|
||||
size="small"
|
||||
max={duration}
|
||||
onChange={handleChange}
|
||||
onChangeCommitted={handleChangeCommitted}
|
||||
aria-label="Seek"
|
||||
/>
|
||||
<div className="player-progress-stacked-times">
|
||||
<span>{getRuntimeMusic(sliderValue)}</span>
|
||||
<span>-{getRuntimeMusic(Math.max(duration - sliderValue, 0))}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={className}
|
||||
style={{
|
||||
width: "100%",
|
||||
display: "flex",
|
||||
|
||||
@@ -45,20 +45,25 @@ const PlayerVolume = ({
|
||||
ml: 1,
|
||||
width: "10em",
|
||||
"& .MuiSlider-valueLabel": {
|
||||
// Compact pill hugging the thumb; above the play FAB (zIndex.fab)
|
||||
zIndex: (theme) => theme.zIndex.tooltip,
|
||||
lineHeight: 1.2,
|
||||
fontSize: 24,
|
||||
background: "rgb(0 0 0 / 0.5)",
|
||||
backdropFilter: "blur(5px)",
|
||||
padding: 1,
|
||||
borderRadius: "10px",
|
||||
fontSize: "0.75rem",
|
||||
fontWeight: 600,
|
||||
fontVariantNumeric: "tabular-nums",
|
||||
minWidth: "2.25em",
|
||||
background: "rgb(0 0 0 / 0.75)",
|
||||
padding: "2px 6px",
|
||||
borderRadius: "6px",
|
||||
border: "1px solid rgb(255 255 255 / 0.15)",
|
||||
boxShadow: "0 0 10px rgb(0 0 0 / 0.4) ",
|
||||
transform: "translatey(-120%) scale(0)",
|
||||
boxShadow: "0 2px 8px rgb(0 0 0 / 0.4)",
|
||||
top: -6,
|
||||
transform: "translatey(-100%) scale(0)",
|
||||
"&:before": {
|
||||
display: "none",
|
||||
},
|
||||
"&.MuiSlider-valueLabelOpen": {
|
||||
transform: "translateY(-120%) scale(1)",
|
||||
transform: "translateY(-100%) scale(1)",
|
||||
},
|
||||
"& > *": {
|
||||
transform: "rotate(0deg)",
|
||||
|
||||
@@ -1,302 +0,0 @@
|
||||
import {
|
||||
closestCenter,
|
||||
DndContext,
|
||||
type DragEndEvent,
|
||||
DragOverlay,
|
||||
type DragStartEvent,
|
||||
type DropAnimation,
|
||||
defaultDropAnimationSideEffects,
|
||||
KeyboardSensor,
|
||||
PointerSensor,
|
||||
useSensor,
|
||||
useSensors,
|
||||
} from "@dnd-kit/core";
|
||||
import {
|
||||
restrictToVerticalAxis,
|
||||
restrictToWindowEdges,
|
||||
} from "@dnd-kit/modifiers";
|
||||
import {
|
||||
arrayMove,
|
||||
SortableContext,
|
||||
sortableKeyboardCoordinates,
|
||||
useSortable,
|
||||
verticalListSortingStrategy,
|
||||
} from "@dnd-kit/sortable";
|
||||
import { CSS } from "@dnd-kit/utilities";
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import {
|
||||
Box,
|
||||
IconButton,
|
||||
Menu,
|
||||
MenuItem,
|
||||
Tooltip,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import React, { useMemo, useState } from "react";
|
||||
import QueueListItem from "@/components/queueListItem";
|
||||
import { stopPlayback } from "@/utils/store/audioPlayback";
|
||||
import useQueue, {
|
||||
clearQueue,
|
||||
removeFromQueue,
|
||||
setQueue,
|
||||
shuffleUpcoming,
|
||||
} from "@/utils/store/queue";
|
||||
|
||||
interface QueuePanelProps {
|
||||
queue: BaseItemDto[];
|
||||
currentTrackIndex: number;
|
||||
}
|
||||
|
||||
const dropAnimation: DropAnimation = {
|
||||
sideEffects: defaultDropAnimationSideEffects({
|
||||
styles: {
|
||||
active: {
|
||||
opacity: "0.5",
|
||||
},
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
function SortableQueueItem({
|
||||
item,
|
||||
onDelete,
|
||||
index,
|
||||
isActive,
|
||||
}: {
|
||||
item: BaseItemDto;
|
||||
onDelete: () => void;
|
||||
index: number;
|
||||
isActive: boolean;
|
||||
}) {
|
||||
const {
|
||||
attributes,
|
||||
listeners,
|
||||
setNodeRef,
|
||||
transform,
|
||||
transition,
|
||||
isDragging,
|
||||
} = useSortable({ id: item.Id || "" });
|
||||
|
||||
const style = {
|
||||
transform: CSS.Translate.toString(transform),
|
||||
transition,
|
||||
opacity: isDragging ? 0.3 : 1,
|
||||
position: "relative" as const,
|
||||
zIndex: isDragging ? 999 : "auto",
|
||||
};
|
||||
|
||||
return (
|
||||
<div ref={setNodeRef} style={style} className="sortable-queue-item">
|
||||
<QueueListItem
|
||||
queueItem={item}
|
||||
onDelete={onDelete}
|
||||
dragHandleProps={{ ...attributes, ...listeners }}
|
||||
isEpisode={item.Type === "Episode"}
|
||||
index={index}
|
||||
className={isActive ? "active" : ""}
|
||||
sx={{
|
||||
bgcolor: isActive
|
||||
? "rgba(255, 255, 255, 0.1) !important"
|
||||
: "transparent",
|
||||
borderRadius: 2,
|
||||
mb: 1,
|
||||
transition: "background-color 0.2s",
|
||||
"&:hover": {
|
||||
bgcolor: "rgba(255, 255, 255, 0.05)",
|
||||
},
|
||||
".MuiListItemText-primary": {
|
||||
color: isActive ? "var(--primary-color, #90caf9)" : "inherit",
|
||||
fontWeight: isActive ? 600 : 500,
|
||||
fontSize: "1rem",
|
||||
},
|
||||
".MuiListItemText-secondary": {
|
||||
fontSize: "0.85rem",
|
||||
opacity: 0.7,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const QueuePanel = ({ queue, currentTrackIndex }: QueuePanelProps) => {
|
||||
const [activeId, setActiveId] = useState<string | null>(null);
|
||||
|
||||
const sensors = useSensors(
|
||||
useSensor(PointerSensor, {
|
||||
activationConstraint: {
|
||||
distance: 8,
|
||||
},
|
||||
}),
|
||||
useSensor(KeyboardSensor, {
|
||||
coordinateGetter: sortableKeyboardCoordinates,
|
||||
}),
|
||||
);
|
||||
|
||||
const activeItem = useMemo(
|
||||
() => queue.find((item) => item.Id === activeId),
|
||||
[queue, activeId],
|
||||
);
|
||||
|
||||
const handleDragStart = (event: DragStartEvent) => {
|
||||
setActiveId(String(event.active.id));
|
||||
};
|
||||
|
||||
const handleDragEnd = (event: DragEndEvent) => {
|
||||
const { active, over } = event;
|
||||
setActiveId(null);
|
||||
|
||||
if (active.id !== over?.id) {
|
||||
const oldIndex = queue.map((item) => item.Id).indexOf(String(active.id));
|
||||
const newIndex = queue.map((item) => item.Id).indexOf(String(over?.id));
|
||||
|
||||
if (oldIndex !== -1 && newIndex !== -1) {
|
||||
const newQueue = arrayMove(queue, oldIndex, newIndex);
|
||||
const currentTrackId = queue[currentTrackIndex]?.Id;
|
||||
const newCurrentTrackIndex = newQueue.findIndex(
|
||||
(item) => item.Id === currentTrackId,
|
||||
);
|
||||
|
||||
setQueue(
|
||||
newQueue,
|
||||
newCurrentTrackIndex !== -1 ? newCurrentTrackIndex : 0,
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
||||
const open = Boolean(anchorEl);
|
||||
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
};
|
||||
const handleClose = () => {
|
||||
setAnchorEl(null);
|
||||
};
|
||||
|
||||
const handleClearQueue = () => {
|
||||
stopPlayback();
|
||||
clearQueue();
|
||||
handleClose();
|
||||
};
|
||||
|
||||
return (
|
||||
<DndContext
|
||||
sensors={sensors}
|
||||
collisionDetection={closestCenter}
|
||||
onDragStart={handleDragStart}
|
||||
onDragEnd={handleDragEnd}
|
||||
modifiers={[restrictToVerticalAxis, restrictToWindowEdges]}
|
||||
>
|
||||
<div
|
||||
className="audio-queue-container"
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
mb: 2,
|
||||
px: 1,
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
variant="h6"
|
||||
sx={{
|
||||
fontWeight: 700,
|
||||
}}
|
||||
>
|
||||
Queue
|
||||
</Typography>
|
||||
<Box sx={{ display: "flex", gap: 1 }}>
|
||||
<Tooltip title="Shuffle Upcoming">
|
||||
<IconButton onClick={() => shuffleUpcoming()} size="small">
|
||||
<span className="material-symbols-rounded">shuffle</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<IconButton onClick={handleClick} size="small">
|
||||
<span className="material-symbols-rounded">more_vert</span>
|
||||
</IconButton>
|
||||
</Box>
|
||||
<Menu
|
||||
anchorEl={anchorEl}
|
||||
open={open}
|
||||
onClose={handleClose}
|
||||
transformOrigin={{ horizontal: "right", vertical: "top" }}
|
||||
anchorOrigin={{ horizontal: "right", vertical: "bottom" }}
|
||||
>
|
||||
<MenuItem onClick={handleClearQueue}>
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ marginRight: "0.5em", fontSize: "1.2em" }}
|
||||
>
|
||||
clear_all
|
||||
</span>
|
||||
Clear Queue
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</Box>
|
||||
|
||||
<SortableContext
|
||||
items={queue.map((track) => track.Id ?? "")}
|
||||
strategy={verticalListSortingStrategy}
|
||||
>
|
||||
<div
|
||||
className="audio-queue"
|
||||
style={{ display: "flex", flexDirection: "column", gap: "0px" }}
|
||||
>
|
||||
{queue.map((track, index) => (
|
||||
<SortableQueueItem
|
||||
key={track.Id}
|
||||
item={track}
|
||||
index={index}
|
||||
onDelete={() => removeFromQueue(index)}
|
||||
isActive={currentTrackIndex === index}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</SortableContext>
|
||||
|
||||
<DragOverlay
|
||||
dropAnimation={dropAnimation}
|
||||
style={{
|
||||
left: "1.5rem",
|
||||
}}
|
||||
>
|
||||
{activeItem ? (
|
||||
<QueueListItem
|
||||
queueItem={activeItem}
|
||||
isEpisode={activeItem.Type === "Episode"}
|
||||
dragHandleProps={{}} // Pass empty object to render handle
|
||||
onDelete={() => {}} // Pass empty function to render delete button space
|
||||
sx={{
|
||||
bgcolor: "rgba(40, 40, 40, 0.9)",
|
||||
backdropFilter: "blur(10px)",
|
||||
borderRadius: 2,
|
||||
boxShadow: "0 8px 32px rgba(0,0,0,0.5)",
|
||||
outline: "1px solid rgba(255, 255, 255, 0.1)",
|
||||
mb: 1,
|
||||
".MuiListItemText-primary": {
|
||||
fontWeight: 500,
|
||||
fontSize: "1rem",
|
||||
},
|
||||
".MuiListItemText-secondary": {
|
||||
fontSize: "0.85rem",
|
||||
opacity: 0.7,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
</DragOverlay>
|
||||
</div>
|
||||
</DndContext>
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(QueuePanel);
|
||||
@@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react";
|
||||
|
||||
interface StatsPanelProps {
|
||||
item: BaseItemDto | undefined | null;
|
||||
audioRef: React.RefObject<HTMLAudioElement> | null;
|
||||
audioRef: React.RefObject<HTMLAudioElement | null> | null;
|
||||
}
|
||||
|
||||
const StatRow = ({
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
} from "@/utils/store/audioPlayback";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { playItemFromQueue } from "@/utils/store/playback";
|
||||
import useQueue from "@/utils/store/queue";
|
||||
import useQueue, { getNextTrackIndex } from "@/utils/store/queue";
|
||||
import PlayerActions from "./components/PlayerActions";
|
||||
import PlayerControls from "./components/PlayerControls";
|
||||
import PlayerInfo from "./components/PlayerInfo";
|
||||
@@ -26,7 +26,7 @@ const AudioPlayer = () => {
|
||||
const user = useCentralStore((s) => s.currentUser);
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
|
||||
|
||||
const audioRef = useRef<HTMLAudioElement | null>(null);
|
||||
const [url, display, item, volume, isMuted] = useAudioPlayback((state) => [
|
||||
state.url,
|
||||
@@ -35,15 +35,15 @@ const AudioPlayer = () => {
|
||||
state.player.volume,
|
||||
state.player.isMuted,
|
||||
]);
|
||||
|
||||
|
||||
const [tracks, currentTrack] = useQueue((state) => [
|
||||
state.tracks,
|
||||
state.currentItemIndex,
|
||||
]);
|
||||
|
||||
|
||||
const [playing, setPlaying] = useState(false);
|
||||
const [progress, setProgress] = useState(0);
|
||||
|
||||
|
||||
// Sync volume and ref
|
||||
useEffect(() => {
|
||||
if (display) {
|
||||
@@ -54,14 +54,14 @@ const AudioPlayer = () => {
|
||||
}
|
||||
}
|
||||
}, [display, url, tracks?.[currentTrack]?.Id]);
|
||||
|
||||
|
||||
// Update volume when state changes
|
||||
useEffect(() => {
|
||||
if (audioRef.current) {
|
||||
audioRef.current.volume = isMuted ? 0 : volume;
|
||||
}
|
||||
}, [volume, isMuted]);
|
||||
|
||||
|
||||
// Media Session Metadata
|
||||
useEffect(() => {
|
||||
if ("mediaSession" in navigator && item) {
|
||||
@@ -88,7 +88,7 @@ const AudioPlayer = () => {
|
||||
});
|
||||
}
|
||||
}, [item, api]);
|
||||
|
||||
|
||||
// Media Session Action Handlers
|
||||
useEffect(() => {
|
||||
if ("mediaSession" in navigator) {
|
||||
@@ -104,8 +104,9 @@ const AudioPlayer = () => {
|
||||
}
|
||||
});
|
||||
navigator.mediaSession.setActionHandler("nexttrack", () => {
|
||||
if (user?.Id && api) {
|
||||
playItemFromQueue("next", user.Id, api);
|
||||
const nextIndex = getNextTrackIndex();
|
||||
if (nextIndex !== undefined && user?.Id && api) {
|
||||
playItemFromQueue(nextIndex, user.Id, api);
|
||||
}
|
||||
});
|
||||
navigator.mediaSession.setActionHandler("seekto", (details) => {
|
||||
@@ -115,7 +116,7 @@ const AudioPlayer = () => {
|
||||
});
|
||||
}
|
||||
}, [api, user?.Id]);
|
||||
|
||||
|
||||
const updatePositionState = () => {
|
||||
if (
|
||||
"mediaSession" in navigator &&
|
||||
@@ -133,7 +134,7 @@ const AudioPlayer = () => {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const handlePlayPause = () => {
|
||||
if (audioRef.current) {
|
||||
if (audioRef.current.paused) {
|
||||
@@ -145,41 +146,47 @@ const AudioPlayer = () => {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const handleTimeUpdate = (e: SyntheticEvent<HTMLAudioElement>) => {
|
||||
setProgress(secToTicks(e.currentTarget.currentTime));
|
||||
};
|
||||
|
||||
|
||||
const handleEnded = () => {
|
||||
if (useQueue.getState().repeatMode === "one" && audioRef.current) {
|
||||
audioRef.current.currentTime = 0;
|
||||
audioRef.current.play();
|
||||
return;
|
||||
}
|
||||
setPlaying(false);
|
||||
if (tracks?.[currentTrack + 1]?.Id && api && user?.Id) {
|
||||
playItemFromQueue("next", user.Id, api);
|
||||
const nextIndex = getNextTrackIndex();
|
||||
if (nextIndex !== undefined && api && user?.Id) {
|
||||
playItemFromQueue(nextIndex, user.Id, api);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const handleSeekCommit = (value: number) => {
|
||||
if (audioRef.current) {
|
||||
audioRef.current.currentTime = ticksToSec(value);
|
||||
setProgress(value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const handleVolumeChange = (newVolume: number) => {
|
||||
setVolume(newVolume);
|
||||
};
|
||||
|
||||
|
||||
const handleMuteToggle = () => {
|
||||
setIsMuted(!isMuted);
|
||||
};
|
||||
|
||||
|
||||
const handleClose = () => {
|
||||
useAudioPlayback.setState(useAudioPlayback.getInitialState());
|
||||
};
|
||||
|
||||
|
||||
const handleNavigate = () => {
|
||||
navigate({ to: "/player/audio" });
|
||||
};
|
||||
|
||||
|
||||
// Listen to play/pause events directly from audio element to keep state in sync
|
||||
// (e.g. if paused by media keys)
|
||||
const onPlay = () => {
|
||||
@@ -196,7 +203,7 @@ const AudioPlayer = () => {
|
||||
navigator.mediaSession.playbackState = "paused";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<AnimatePresence mode="sync">
|
||||
{display && (
|
||||
@@ -210,13 +217,9 @@ const AudioPlayer = () => {
|
||||
}}
|
||||
exit={{ transform: "translate(-50%, 150%)" }}
|
||||
transition={{ duration: 0.3, ease: "circOut" }}
|
||||
className="audio-player glass"
|
||||
className="audio-player"
|
||||
>
|
||||
<PlayerInfo
|
||||
item={item}
|
||||
api={api}
|
||||
trackName={tracks?.[currentTrack]?.Name ?? "Unknown Track"}
|
||||
/>
|
||||
<PlayerInfo item={item} api={api} onOpen={handleNavigate} />
|
||||
|
||||
<audio
|
||||
autoPlay
|
||||
@@ -232,16 +235,17 @@ const AudioPlayer = () => {
|
||||
id="audio-player"
|
||||
/>
|
||||
|
||||
<div className="audio-player-controls">
|
||||
<div className="audio-player-center">
|
||||
<PlayerControls playing={playing} onPlayPause={handlePlayPause} />
|
||||
<PlayerProgress
|
||||
className="audio-player-progress"
|
||||
progress={progress}
|
||||
duration={item?.RunTimeTicks ?? 1}
|
||||
onSeekCommit={handleSeekCommit}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<PlayerActions onNavigate={handleNavigate} onClose={handleClose}>
|
||||
<PlayerActions onExpand={handleNavigate} onClose={handleClose}>
|
||||
<PlayerVolume
|
||||
volume={volume}
|
||||
isMuted={isMuted}
|
||||
|
||||
@@ -0,0 +1,325 @@
|
||||
.queue {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
height: 100%;
|
||||
color: white;
|
||||
|
||||
&-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding-bottom: 0.75rem;
|
||||
|
||||
&-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.125rem;
|
||||
flex-shrink: 0;
|
||||
|
||||
.MuiIconButton-root {
|
||||
color: rgb(255 255 255 / 0.75);
|
||||
&:hover {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-title {
|
||||
margin: 0;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
&-summary {
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
&-body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.25rem;
|
||||
// Room so focus rings and the dragged row aren't clipped
|
||||
padding: 2px 2px 1rem;
|
||||
margin: 0 -2px;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: rgb(255 255 255 / 0.2);
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
&-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
|
||||
&-label {
|
||||
margin: 0;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
&-toggle {
|
||||
all: unset;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
padding: 0.25rem 0.5rem;
|
||||
margin: 0 -0.5rem;
|
||||
border-radius: 0.5rem;
|
||||
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
background: rgb(255 255 255 / 0.05);
|
||||
}
|
||||
.material-symbols-rounded {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
&-hint {
|
||||
margin: 0.25rem 0 0;
|
||||
font-size: 0.75rem;
|
||||
opacity: 0.4;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&-empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
padding: 2rem 1rem;
|
||||
text-align: center;
|
||||
border: 1px dashed rgb(255 255 255 / 0.12);
|
||||
border-radius: 0.75rem;
|
||||
|
||||
&-icon {
|
||||
font-size: 2.25rem;
|
||||
opacity: 0.4;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
&-title {
|
||||
font-weight: 600;
|
||||
}
|
||||
&-text {
|
||||
font-size: 0.85rem;
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.queue-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 0.4rem 0.5rem;
|
||||
border-radius: 0.6rem;
|
||||
outline: none;
|
||||
background: transparent;
|
||||
transition: background-color 0.15s ease;
|
||||
|
||||
&[role="button"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus-visible,
|
||||
&.is-dragging {
|
||||
background: rgb(255 255 255 / 0.07);
|
||||
}
|
||||
&:focus-visible {
|
||||
box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.4);
|
||||
}
|
||||
&.is-dragging {
|
||||
box-shadow: 0 8px 24px rgb(0 0 0 / 0.45);
|
||||
background: rgb(40 40 50 / 0.95);
|
||||
}
|
||||
|
||||
&-current {
|
||||
background: rgb(255 255 255 / 0.08);
|
||||
|
||||
.queue-row-title {
|
||||
color: $clr-accent-default;
|
||||
}
|
||||
}
|
||||
|
||||
&-history {
|
||||
opacity: 0.6;
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&-handle {
|
||||
all: unset;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1.25rem;
|
||||
margin-right: -0.25rem;
|
||||
cursor: grab;
|
||||
touch-action: none;
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease;
|
||||
|
||||
.material-symbols-rounded {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
&:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
&:focus-visible {
|
||||
opacity: 1;
|
||||
outline: 2px solid rgb(255 255 255 / 0.4);
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
&-art {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
background: rgb(255 255 255 / 0.08);
|
||||
|
||||
img {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
&-fallback,
|
||||
&-overlay,
|
||||
&-play {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
&-fallback {
|
||||
opacity: 0.4;
|
||||
font-size: 1.25rem !important;
|
||||
}
|
||||
&-overlay,
|
||||
&-play {
|
||||
background: rgb(0 0 0 / 0.55);
|
||||
z-index: 1;
|
||||
}
|
||||
&-overlay {
|
||||
color: $clr-accent-default;
|
||||
}
|
||||
&-play {
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
}
|
||||
|
||||
&-text {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
}
|
||||
|
||||
&-title {
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
&-subtitle {
|
||||
font-size: 0.78rem;
|
||||
opacity: 0.6;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
&-duration {
|
||||
flex-shrink: 0;
|
||||
font-size: 0.78rem;
|
||||
opacity: 0.55;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
&-remove.MuiIconButton-root {
|
||||
flex-shrink: 0;
|
||||
color: rgb(255 255 255 / 0.7);
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s ease;
|
||||
|
||||
.material-symbols-rounded {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
// Reveal row controls on hover / keyboard focus; always shown on touch screens
|
||||
&:hover,
|
||||
&:focus-within {
|
||||
.queue-row-handle,
|
||||
.queue-row-remove {
|
||||
opacity: 1;
|
||||
}
|
||||
.queue-row-art-play {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@media (hover: none) {
|
||||
.queue-row-handle,
|
||||
.queue-row-remove {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Queue drawer (mini player / video player)
|
||||
.queue-drawer-paper.MuiPaper-root {
|
||||
width: 420px;
|
||||
max-width: 100%;
|
||||
padding: 1.25rem 1rem 0 1.25rem;
|
||||
box-sizing: border-box;
|
||||
background: rgb(18 18 24 / 0.97);
|
||||
border-left: 1px solid rgb(255 255 255 / 0.08);
|
||||
background-image: none;
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
import { useSortable } from "@dnd-kit/sortable";
|
||||
import { CSS } from "@dnd-kit/utilities";
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import React from "react";
|
||||
import { getRuntimeMusic } from "@/utils/date/time";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
|
||||
export const getQueueItemText = (item: BaseItemDto) => {
|
||||
if (item.Type === "Episode") {
|
||||
const episode = item.IndexNumberEnd
|
||||
? `E${item.IndexNumber}-${item.IndexNumberEnd}`
|
||||
: `E${item.IndexNumber}`;
|
||||
return {
|
||||
title: item.Name ?? "Unknown episode",
|
||||
subtitle: [item.SeriesName, `S${item.ParentIndexNumber}:${episode}`]
|
||||
.filter(Boolean)
|
||||
.join(" · "),
|
||||
};
|
||||
}
|
||||
return {
|
||||
title: item.Name ?? "Unknown track",
|
||||
subtitle: item.Artists?.join(", ") || item.AlbumArtist || "",
|
||||
};
|
||||
};
|
||||
|
||||
const useQueueItemImage = (item: BaseItemDto) => {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
if (!api || !item.Id) return undefined;
|
||||
const size = { fillWidth: 96, fillHeight: 96, quality: 85 };
|
||||
if (item.ImageTags?.Primary) {
|
||||
return getImageUrlsApi(api).getItemImageUrlById(item.Id, "Primary", {
|
||||
...size,
|
||||
tag: item.ImageTags.Primary,
|
||||
});
|
||||
}
|
||||
if (item.AlbumId && item.AlbumPrimaryImageTag) {
|
||||
return getImageUrlsApi(api).getItemImageUrlById(item.AlbumId, "Primary", {
|
||||
...size,
|
||||
tag: item.AlbumPrimaryImageTag,
|
||||
});
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
type QueueRowProps = {
|
||||
item: BaseItemDto;
|
||||
variant: "current" | "upcoming" | "history";
|
||||
onPlay?: () => void;
|
||||
onRemove?: () => void;
|
||||
/** Drag handle props from useSortable (upcoming rows only). */
|
||||
dragHandle?: React.HTMLAttributes<HTMLButtonElement>;
|
||||
isDragging?: boolean;
|
||||
};
|
||||
|
||||
export const QueueRow = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
QueueRowProps & { style?: React.CSSProperties }
|
||||
>(({ item, variant, onPlay, onRemove, dragHandle, isDragging, style }, ref) => {
|
||||
const imageUrl = useQueueItemImage(item);
|
||||
const { title, subtitle } = getQueueItemText(item);
|
||||
const isCurrent = variant === "current";
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={ref}
|
||||
style={style}
|
||||
className={`queue-row queue-row-${variant} ${isDragging ? "is-dragging" : ""}`}
|
||||
{...(onPlay && {
|
||||
role: "button",
|
||||
tabIndex: 0,
|
||||
"aria-label": `Play ${title}`,
|
||||
})}
|
||||
onClick={onPlay}
|
||||
onKeyDown={(e) => {
|
||||
if (e.target !== e.currentTarget) return;
|
||||
if (onPlay && (e.key === "Enter" || e.key === " ")) {
|
||||
e.preventDefault();
|
||||
onPlay();
|
||||
} else if (onRemove && (e.key === "Delete" || e.key === "Backspace")) {
|
||||
e.preventDefault();
|
||||
onRemove();
|
||||
}
|
||||
}}
|
||||
>
|
||||
{dragHandle && (
|
||||
<button
|
||||
type="button"
|
||||
className="queue-row-handle"
|
||||
aria-label={`Reorder ${title}`}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
{...dragHandle}
|
||||
>
|
||||
<span className="material-symbols-rounded">drag_indicator</span>
|
||||
</button>
|
||||
)}
|
||||
<div className="queue-row-art">
|
||||
<span className="material-symbols-rounded queue-row-art-fallback">
|
||||
{item.Type === "Episode" ? "tv_gen" : "music_note"}
|
||||
</span>
|
||||
{imageUrl && <img src={imageUrl} alt="" loading="lazy" />}
|
||||
{isCurrent && (
|
||||
<span className="queue-row-art-overlay material-symbols-rounded">
|
||||
graphic_eq
|
||||
</span>
|
||||
)}
|
||||
{onPlay && (
|
||||
<span className="queue-row-art-play material-symbols-rounded">
|
||||
play_arrow
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="queue-row-text">
|
||||
<span className="queue-row-title" title={title}>
|
||||
{title}
|
||||
</span>
|
||||
{subtitle && <span className="queue-row-subtitle">{subtitle}</span>}
|
||||
</div>
|
||||
<span className="queue-row-duration">
|
||||
{item.RunTimeTicks ? getRuntimeMusic(item.RunTimeTicks) : ""}
|
||||
</span>
|
||||
{onRemove && (
|
||||
<Tooltip title="Remove from queue">
|
||||
<IconButton
|
||||
size="small"
|
||||
className="queue-row-remove"
|
||||
aria-label={`Remove ${title} from queue`}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onRemove();
|
||||
}}
|
||||
>
|
||||
<span className="material-symbols-rounded">close</span>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
/** An upcoming row that can be dragged to reorder. */
|
||||
export const SortableQueueRow = (
|
||||
props: Omit<QueueRowProps, "dragHandle" | "isDragging" | "variant">,
|
||||
) => {
|
||||
const {
|
||||
attributes,
|
||||
listeners,
|
||||
setNodeRef,
|
||||
setActivatorNodeRef,
|
||||
transform,
|
||||
transition,
|
||||
isDragging,
|
||||
} = useSortable({ id: props.item.Id ?? "" });
|
||||
|
||||
return (
|
||||
<QueueRow
|
||||
{...props}
|
||||
ref={setNodeRef}
|
||||
variant="upcoming"
|
||||
isDragging={isDragging}
|
||||
style={{
|
||||
transform: CSS.Translate.toString(transform),
|
||||
transition,
|
||||
zIndex: isDragging ? 2 : undefined,
|
||||
position: "relative",
|
||||
}}
|
||||
dragHandle={
|
||||
{
|
||||
...attributes,
|
||||
...listeners,
|
||||
ref: setActivatorNodeRef,
|
||||
} as React.HTMLAttributes<HTMLButtonElement>
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,273 @@
|
||||
import {
|
||||
closestCenter,
|
||||
DndContext,
|
||||
type DragEndEvent,
|
||||
KeyboardSensor,
|
||||
PointerSensor,
|
||||
useSensor,
|
||||
useSensors,
|
||||
} from "@dnd-kit/core";
|
||||
import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
|
||||
import {
|
||||
arrayMove,
|
||||
SortableContext,
|
||||
sortableKeyboardCoordinates,
|
||||
verticalListSortingStrategy,
|
||||
} from "@dnd-kit/sortable";
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import Button from "@mui/material/Button";
|
||||
import Collapse from "@mui/material/Collapse";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import { useSnackbar } from "notistack";
|
||||
import React, { useMemo, useState } from "react";
|
||||
import { getRuntimeCompact } from "@/utils/date/time";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { playItemFromQueue } from "@/utils/store/playback";
|
||||
import useQueue, {
|
||||
clearUpcoming,
|
||||
insertIntoQueue,
|
||||
removeFromQueue,
|
||||
reorderQueue,
|
||||
shuffleUpcoming,
|
||||
} from "@/utils/store/queue";
|
||||
import { getQueueItemText, QueueRow, SortableQueueRow } from "./queueRow";
|
||||
|
||||
import "./queue.scss";
|
||||
|
||||
type QueueViewProps = {
|
||||
/**
|
||||
* "drawer": standalone queue with the now playing row and a close button.
|
||||
* "panel": embedded next to a full player that already shows the current track.
|
||||
*/
|
||||
variant: "drawer" | "panel";
|
||||
onClose?: () => void;
|
||||
};
|
||||
|
||||
const QueueView = ({ variant, onClose }: QueueViewProps) => {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const userId = useCentralStore((s) => s.currentUser?.Id ?? undefined);
|
||||
const { enqueueSnackbar, closeSnackbar } = useSnackbar();
|
||||
const [tracks, currentIndex] = useQueue((s) => [
|
||||
s.tracks,
|
||||
s.currentItemIndex,
|
||||
]);
|
||||
const [showHistory, setShowHistory] = useState(false);
|
||||
|
||||
const queue = tracks ?? [];
|
||||
const current = queue[currentIndex];
|
||||
const history = queue.slice(0, currentIndex);
|
||||
const upcoming = useMemo(
|
||||
() => queue.slice(currentIndex + 1),
|
||||
[queue, currentIndex],
|
||||
);
|
||||
const upcomingTicks = upcoming.reduce(
|
||||
(total, item) => total + (item.RunTimeTicks ?? 0),
|
||||
0,
|
||||
);
|
||||
|
||||
const sensors = useSensors(
|
||||
useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),
|
||||
useSensor(KeyboardSensor, {
|
||||
coordinateGetter: sortableKeyboardCoordinates,
|
||||
}),
|
||||
);
|
||||
|
||||
const play = (index: number) => {
|
||||
playItemFromQueue(index, userId, api);
|
||||
};
|
||||
|
||||
const remove = (item: BaseItemDto, index: number) => {
|
||||
removeFromQueue(index);
|
||||
const { title } = getQueueItemText(item);
|
||||
enqueueSnackbar(`Removed "${title}"`, {
|
||||
variant: "default",
|
||||
action: (key) => (
|
||||
<Button
|
||||
color="inherit"
|
||||
size="small"
|
||||
onClick={() => {
|
||||
insertIntoQueue(item, index);
|
||||
closeSnackbar(key);
|
||||
}}
|
||||
>
|
||||
Undo
|
||||
</Button>
|
||||
),
|
||||
});
|
||||
};
|
||||
|
||||
const clearAll = () => {
|
||||
const removed = upcoming;
|
||||
clearUpcoming();
|
||||
enqueueSnackbar(`Cleared ${removed.length} tracks from up next`, {
|
||||
action: (key) => (
|
||||
<Button
|
||||
color="inherit"
|
||||
size="small"
|
||||
onClick={() => {
|
||||
const state = useQueue.getState();
|
||||
reorderQueue([
|
||||
...(state.tracks ?? []).slice(0, state.currentItemIndex + 1),
|
||||
...removed,
|
||||
]);
|
||||
closeSnackbar(key);
|
||||
}}
|
||||
>
|
||||
Undo
|
||||
</Button>
|
||||
),
|
||||
});
|
||||
};
|
||||
|
||||
const handleDragEnd = ({ active, over }: DragEndEvent) => {
|
||||
if (!over || active.id === over.id) return;
|
||||
const from = upcoming.findIndex((item) => item.Id === active.id);
|
||||
const to = upcoming.findIndex((item) => item.Id === over.id);
|
||||
if (from === -1 || to === -1) return;
|
||||
reorderQueue([
|
||||
...queue.slice(0, currentIndex + 1),
|
||||
...arrayMove(upcoming, from, to),
|
||||
]);
|
||||
};
|
||||
|
||||
const summary =
|
||||
upcoming.length > 0
|
||||
? `${upcoming.length} ${upcoming.length === 1 ? "track" : "tracks"} · ${getRuntimeCompact(upcomingTicks)}`
|
||||
: "Nothing queued";
|
||||
|
||||
return (
|
||||
<div className={`queue queue-${variant}`}>
|
||||
<header className="queue-header">
|
||||
<div className="queue-header-text">
|
||||
<h2 className="queue-title">
|
||||
{variant === "drawer" ? "Queue" : "Up next"}
|
||||
</h2>
|
||||
<span className="queue-summary">{summary}</span>
|
||||
</div>
|
||||
<div className="queue-header-actions">
|
||||
<Tooltip title="Shuffle up next">
|
||||
<span>
|
||||
<IconButton
|
||||
onClick={shuffleUpcoming}
|
||||
disabled={upcoming.length < 2}
|
||||
aria-label="Shuffle up next"
|
||||
>
|
||||
<span className="material-symbols-rounded">shuffle</span>
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Tooltip title="Clear up next">
|
||||
<span>
|
||||
<IconButton
|
||||
onClick={clearAll}
|
||||
disabled={upcoming.length === 0}
|
||||
aria-label="Clear up next"
|
||||
>
|
||||
<span className="material-symbols-rounded">
|
||||
playlist_remove
|
||||
</span>
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
{onClose && (
|
||||
<IconButton onClick={onClose} aria-label="Close queue">
|
||||
<span className="material-symbols-rounded">close</span>
|
||||
</IconButton>
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div className="queue-body">
|
||||
{variant === "drawer" && current && (
|
||||
<section className="queue-section">
|
||||
<h3 className="queue-section-label">Now playing</h3>
|
||||
<QueueRow item={current} variant="current" />
|
||||
</section>
|
||||
)}
|
||||
|
||||
<section className="queue-section">
|
||||
{variant === "drawer" && (
|
||||
<h3 className="queue-section-label">Up next</h3>
|
||||
)}
|
||||
{upcoming.length > 0 ? (
|
||||
<>
|
||||
<DndContext
|
||||
sensors={sensors}
|
||||
collisionDetection={closestCenter}
|
||||
onDragEnd={handleDragEnd}
|
||||
modifiers={[restrictToVerticalAxis]}
|
||||
>
|
||||
<SortableContext
|
||||
items={upcoming.map((item) => item.Id ?? "")}
|
||||
strategy={verticalListSortingStrategy}
|
||||
>
|
||||
<div className="queue-list">
|
||||
{upcoming.map((item, offset) => {
|
||||
const index = currentIndex + 1 + offset;
|
||||
return (
|
||||
<SortableQueueRow
|
||||
key={item.Id ?? index}
|
||||
item={item}
|
||||
onPlay={() => play(index)}
|
||||
onRemove={() => remove(item, index)}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</SortableContext>
|
||||
</DndContext>
|
||||
<p className="queue-hint">
|
||||
Click a track to play it now · drag to reorder
|
||||
</p>
|
||||
</>
|
||||
) : (
|
||||
<div className="queue-empty">
|
||||
<span className="material-symbols-rounded queue-empty-icon">
|
||||
queue_music
|
||||
</span>
|
||||
<span className="queue-empty-title">Nothing up next</span>
|
||||
<span className="queue-empty-text">
|
||||
Play an album, playlist or artist to fill the queue.
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
|
||||
{history.length > 0 && (
|
||||
<section className="queue-section">
|
||||
<button
|
||||
type="button"
|
||||
className="queue-section-toggle"
|
||||
onClick={() => setShowHistory((open) => !open)}
|
||||
aria-expanded={showHistory}
|
||||
>
|
||||
<span className="queue-section-label">
|
||||
Previously played · {history.length}
|
||||
</span>
|
||||
<span className="material-symbols-rounded">
|
||||
{showHistory ? "expand_less" : "expand_more"}
|
||||
</span>
|
||||
</button>
|
||||
<Collapse in={showHistory} unmountOnExit>
|
||||
<div className="queue-list">
|
||||
{history.map((item, index) => (
|
||||
<QueueRow
|
||||
key={item.Id ?? index}
|
||||
item={item}
|
||||
variant="history"
|
||||
onPlay={() => play(index)}
|
||||
onRemove={() => remove(item, index)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</Collapse>
|
||||
</section>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default QueueView;
|
||||
@@ -1,236 +0,0 @@
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import {
|
||||
Box,
|
||||
IconButton,
|
||||
ListItem,
|
||||
ListItemAvatar,
|
||||
ListItemText,
|
||||
} from "@mui/material";
|
||||
import React from "react";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
|
||||
type QueueListItemProps = {
|
||||
queueItem: BaseItemDto;
|
||||
active?: boolean;
|
||||
onDelete?: () => void;
|
||||
onPlay?: () => void;
|
||||
dragHandleProps?: any;
|
||||
isEpisode?: boolean;
|
||||
index?: number;
|
||||
className?: string;
|
||||
sx?: any;
|
||||
};
|
||||
|
||||
const QueueListItem = ({
|
||||
queueItem,
|
||||
active,
|
||||
onDelete,
|
||||
onPlay,
|
||||
dragHandleProps,
|
||||
isEpisode,
|
||||
className,
|
||||
sx,
|
||||
}: QueueListItemProps) => {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
|
||||
const imageUrl =
|
||||
api &&
|
||||
queueItem.Id &&
|
||||
(queueItem.ImageTags?.Primary
|
||||
? getImageUrlsApi(api).getItemImageUrlById(queueItem.Id, "Primary", {
|
||||
tag: queueItem.ImageTags.Primary,
|
||||
})
|
||||
: queueItem.AlbumPrimaryImageTag?.[0]
|
||||
? getImageUrlsApi(api).getItemImageUrlById(
|
||||
queueItem.AlbumId || "",
|
||||
"Primary",
|
||||
{ tag: queueItem.AlbumPrimaryImageTag[0] },
|
||||
)
|
||||
: null);
|
||||
|
||||
const primaryText = queueItem.SeriesName || queueItem.Name;
|
||||
|
||||
let secondaryText = "";
|
||||
if (isEpisode) {
|
||||
const season = queueItem.ParentIndexNumber;
|
||||
const episode = queueItem.IndexNumber;
|
||||
const episodeEnd = queueItem.IndexNumberEnd;
|
||||
const episodeString = episodeEnd
|
||||
? `S${season}:E${episode}-${episodeEnd}`
|
||||
: `S${season}:E${episode}`;
|
||||
|
||||
secondaryText = `${episodeString} - ${queueItem.Name}`;
|
||||
} else {
|
||||
secondaryText = queueItem.Artists?.join(", ") || "";
|
||||
}
|
||||
|
||||
return (
|
||||
<ListItem
|
||||
component="div"
|
||||
className={className}
|
||||
secondaryAction={
|
||||
onDelete && (
|
||||
<IconButton
|
||||
edge="end"
|
||||
aria-label="delete"
|
||||
onClick={onDelete}
|
||||
size="small"
|
||||
sx={{
|
||||
opacity: 0,
|
||||
transition: "opacity 0.2s",
|
||||
".MuiListItem-root:hover &": { opacity: 0.7 },
|
||||
"&:hover": { opacity: "1 !important", bgcolor: "action.hover" },
|
||||
}}
|
||||
>
|
||||
<span className="material-symbols-rounded" style={{ fontSize: 20 }}>
|
||||
close
|
||||
</span>
|
||||
</IconButton>
|
||||
)
|
||||
}
|
||||
sx={{
|
||||
opacity: active ? 1 : 1,
|
||||
bgcolor: active ? "rgba(255, 255, 255, 0.1)" : "rgba(0,0,0,0.2)",
|
||||
borderRadius: 3,
|
||||
mb: 0,
|
||||
transition: "all 0.2s ease",
|
||||
border: "1px solid",
|
||||
borderColor: active
|
||||
? "rgba(255, 255, 255, 0.2)"
|
||||
: "rgba(255,255,255,0.05)",
|
||||
"&:hover": {
|
||||
bgcolor: active
|
||||
? "rgba(255, 255, 255, 0.15)"
|
||||
: "rgba(255,255,255,0.05)",
|
||||
transform: active ? "none" : "translateY(-2px)",
|
||||
borderColor: active
|
||||
? "rgba(255, 255, 255, 0.3)"
|
||||
: "rgba(255,255,255,0.2)",
|
||||
boxShadow: active ? "none" : "0 4px 12px rgba(0,0,0,0.2)",
|
||||
},
|
||||
pr: onDelete ? 6 : 2,
|
||||
...sx,
|
||||
}}
|
||||
>
|
||||
{dragHandleProps && (
|
||||
<div
|
||||
{...dragHandleProps}
|
||||
style={{
|
||||
cursor: "grab",
|
||||
marginRight: 12,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
opacity: 0.5,
|
||||
transition: "opacity 0.2s",
|
||||
}}
|
||||
className="drag-handle"
|
||||
>
|
||||
<span className="material-symbols-rounded">drag_indicator</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<ListItemAvatar sx={{ minWidth: 64 }}>
|
||||
<Box
|
||||
onClick={onPlay}
|
||||
sx={{
|
||||
width: 48,
|
||||
height: 48,
|
||||
borderRadius: 2,
|
||||
overflow: "hidden",
|
||||
position: "relative",
|
||||
boxShadow: "0 2px 8px rgba(0,0,0,0.2)",
|
||||
cursor: onPlay ? "pointer" : "default",
|
||||
"&:hover .play-overlay": {
|
||||
opacity: 1,
|
||||
},
|
||||
}}
|
||||
>
|
||||
{imageUrl ? (
|
||||
<img
|
||||
src={imageUrl}
|
||||
alt={queueItem.Name || ""}
|
||||
style={{ width: "100%", height: "100%", objectFit: "cover" }}
|
||||
/>
|
||||
) : (
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
background: "#2a2a2a",
|
||||
}}
|
||||
>
|
||||
{queueItem.Type && getTypeIcon(queueItem.Type)}
|
||||
</div>
|
||||
)}
|
||||
{active && (
|
||||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
inset: 0,
|
||||
background: "rgba(0,0,0,0.4)",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
backdropFilter: "blur(2px)",
|
||||
}}
|
||||
>
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ fontSize: "1.5rem", color: "white" }}
|
||||
>
|
||||
equalizer
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{!active && onPlay && (
|
||||
<Box
|
||||
className="play-overlay"
|
||||
sx={{
|
||||
position: "absolute",
|
||||
inset: 0,
|
||||
background: "rgba(0,0,0,0.4)",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
opacity: 0,
|
||||
transition: "opacity 0.2s",
|
||||
backdropFilter: "blur(1px)",
|
||||
}}
|
||||
>
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{ fontSize: "2rem", color: "white" }}
|
||||
>
|
||||
play_arrow
|
||||
</span>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
</ListItemAvatar>
|
||||
|
||||
<ListItemText
|
||||
primary={primaryText}
|
||||
secondary={secondaryText}
|
||||
slotProps={{
|
||||
primary: {
|
||||
noWrap: true,
|
||||
variant: "body2",
|
||||
sx: { mb: 0.5, fontWeight: active ? 700 : 500 },
|
||||
},
|
||||
secondary: {
|
||||
noWrap: true,
|
||||
variant: "caption",
|
||||
sx: { opacity: 0.7 },
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</ListItem>
|
||||
);
|
||||
};
|
||||
|
||||
export default QueueListItem;
|
||||
Reference in new issue
Block a user