Addd ArtistTitlePage #160
This commit is contained in:
17 files changed
+1050
-234
No files matched your search
+6
-3
@@ -78,6 +78,7 @@ import PersonTitlePage from "./routes/person/index.jsx";
|
||||
import MusicAlbumTitlePage from "./routes/album/index.jsx";
|
||||
import AudioPlayer from "./components/playback/audioPlayer/index.jsx";
|
||||
import { useAudioPlayback } from "./utils/store/audioPlayback.js";
|
||||
import ArtistTitlePage from "./routes/artist/index.jsx";
|
||||
|
||||
const jellyfin = new Jellyfin({
|
||||
clientInfo: {
|
||||
@@ -281,7 +282,9 @@ function App() {
|
||||
});
|
||||
}
|
||||
|
||||
const [audioPlayerVisible] = useAudioPlayback((state) => [state.display]);
|
||||
const [audioPlayerVisible, currentAudioIndex] = useAudioPlayback(
|
||||
(state) => [state.display, state.currentTrack],
|
||||
);
|
||||
|
||||
const [backdropUrl, backdropId] = useBackdropStore((state) => [
|
||||
state.backdropUrl,
|
||||
@@ -428,7 +431,7 @@ function App() {
|
||||
<CssBaseline />
|
||||
<SideMenu />
|
||||
<AppBar />
|
||||
<AudioPlayer />
|
||||
<AudioPlayer key={audioPlayerVisible} />
|
||||
<Routes key={location.key} location={location}>
|
||||
<Route element={<AnimationWrapper />}>
|
||||
<Route
|
||||
@@ -475,7 +478,7 @@ function App() {
|
||||
<Route
|
||||
exact
|
||||
path="/artist/:id"
|
||||
element={<ItemDetail />}
|
||||
element={<ArtistTitlePage />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
|
||||
@@ -36,6 +36,7 @@ const PlayButton = ({
|
||||
buttonProps,
|
||||
iconOnly,
|
||||
audio = false,
|
||||
size = "large",
|
||||
}) => {
|
||||
const navigate = useNavigate();
|
||||
const [
|
||||
@@ -94,6 +95,19 @@ const PlayButton = ({
|
||||
sortOrder: SortOrder.Ascending,
|
||||
sortBy: "IndexNumber",
|
||||
});
|
||||
} else if (itemType == BaseItemKind.MusicArtist) {
|
||||
result = await getItemsApi(window.api).getItems({
|
||||
artistIds: [itemId],
|
||||
recursive: true,
|
||||
includeItemTypes: [BaseItemKind.Audio],
|
||||
userId: userId,
|
||||
fields: [
|
||||
ItemFields.MediaSources,
|
||||
ItemFields.MediaStreams,
|
||||
],
|
||||
sortOrder: SortOrder.Ascending,
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
});
|
||||
} else {
|
||||
result = await getItemsApi(window.api).getItems({
|
||||
ids: [itemId],
|
||||
@@ -109,6 +123,7 @@ const PlayButton = ({
|
||||
return result.data;
|
||||
},
|
||||
onSuccess: (item) => {
|
||||
console.log(item);
|
||||
if (audio) {
|
||||
setAudioTracks(item.Items);
|
||||
setAudioUrl(
|
||||
@@ -156,6 +171,7 @@ const PlayButton = ({
|
||||
className={className}
|
||||
onClick={handleClick}
|
||||
sx={sx}
|
||||
size={size}
|
||||
{...buttonProps}
|
||||
>
|
||||
<MdiPlayOutline {...iconProps} />
|
||||
@@ -173,6 +189,7 @@ const PlayButton = ({
|
||||
position: "relative",
|
||||
overflow: "hidden",
|
||||
}}
|
||||
size={size}
|
||||
>
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
|
||||
@@ -1,11 +1,29 @@
|
||||
/** @format */
|
||||
|
||||
.album {
|
||||
&-image-icon {
|
||||
fill: url(#clr-gradient-default) !important;
|
||||
&-image {
|
||||
aspect-ratio: 1;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
width: 12em;
|
||||
box-shadow: 0 0 10px rgb(0 0 0 /0.2);
|
||||
position: relative;
|
||||
height: 12em;
|
||||
&-icon {
|
||||
fill: url(#clr-gradient-default) !important;
|
||||
|
||||
&-container {
|
||||
background: $clr-gradient-dark;
|
||||
&-container {
|
||||
background: $clr-gradient-dark;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,9 @@ import { MdiHeartOutline } from "../../icons/mdiHeartOutline";
|
||||
import { MdiAlbum } from "../../icons/mdiAlbum";
|
||||
|
||||
import "./albumArtist.scss";
|
||||
import { useAudioPlayback } from "../../../utils/store/audioPlayback";
|
||||
import LikeButton from "../../buttons/likeButton";
|
||||
import { SortOrder } from "@jellyfin/sdk/lib/generated-client";
|
||||
|
||||
export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
const albumTracks = useQuery({
|
||||
@@ -37,9 +40,12 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
const result = await getItemsApi(window.api).getItems({
|
||||
userId: user.Id,
|
||||
parentId: album.Id,
|
||||
sortOrder: SortOrder.Ascending,
|
||||
sortBy: "IndexNumber",
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
@@ -61,22 +67,43 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
|
||||
const [imgLoaded, setImgLoaded] = useState(false);
|
||||
|
||||
const [
|
||||
currentTrackItem,
|
||||
setCurrentAudioTrack,
|
||||
setAudioUrl,
|
||||
setAudioDisplay,
|
||||
setAudioItem,
|
||||
setAudioTracks,
|
||||
] = useAudioPlayback((state) => [
|
||||
state.item,
|
||||
state.setCurrentTrack,
|
||||
state.setUrl,
|
||||
state.setDisplay,
|
||||
state.setItem,
|
||||
state.setTracks,
|
||||
]);
|
||||
const playTrack = (index) => {
|
||||
setAudioTracks(albumTracks.data.Items);
|
||||
setCurrentAudioTrack(index);
|
||||
setAudioUrl(
|
||||
`${window.api.basePath}/Audio/${albumTracks.data.Items[index].Id}/universal?deviceId=${window.api.deviceInfo.id}&userId=${user.Id}&api_key=${window.api.accessToken}`,
|
||||
);
|
||||
setAudioItem(albumTracks.data.Items[index]);
|
||||
setAudioDisplay(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<Box sx={{ mb: 6 }} {...boxProps}>
|
||||
<Stack direction="row" gap={3} mb={3}>
|
||||
<div style={{ marginBottom: "3em" }} {...boxProps}>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "row",
|
||||
gap: "1em",
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
>
|
||||
{!!album.ImageTags?.Primary && (
|
||||
<Box
|
||||
className="album-image"
|
||||
sx={{
|
||||
aspectRatio: 1,
|
||||
borderRadius: "10px",
|
||||
overflow: "hidden",
|
||||
width: "12em",
|
||||
boxShadow: "0 0 10px rgb(0 0 0 /0.2)",
|
||||
position: "relative",
|
||||
height: "12em",
|
||||
}}
|
||||
>
|
||||
<div className="album-image">
|
||||
<img
|
||||
src={`${window.api.basePath}/Items/${album.Id}/Images/Primary?fillHeight=532&fillWidth=532&quality=96`}
|
||||
style={{
|
||||
@@ -90,37 +117,24 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
}}
|
||||
onLoad={() => setImgLoaded(true)}
|
||||
/>
|
||||
<Box
|
||||
className="album-image-icon-container"
|
||||
sx={{
|
||||
position: "absolute",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
top: 0,
|
||||
left: 0,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
zIndex: 1,
|
||||
}}
|
||||
>
|
||||
<div className="album-image-icon-container">
|
||||
<MdiAlbum
|
||||
className="album-image-icon"
|
||||
sx={{ fontSize: "6em" }}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<Stack>
|
||||
<Typography
|
||||
variant="h5"
|
||||
sx={{ opacity: `0.7`, mb: 1 }}
|
||||
style={{ opacity: `0.6`, mb: 1 }}
|
||||
>
|
||||
{album.ProductionYear}
|
||||
</Typography>
|
||||
<MuiLink
|
||||
component={Link}
|
||||
to={`/item/${album.Id}`}
|
||||
to={`/musicalbum/${album.Id}`}
|
||||
variant="h3"
|
||||
color="inherit"
|
||||
underline="hover"
|
||||
@@ -128,110 +142,135 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||
{album.Name}
|
||||
</MuiLink>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</div>
|
||||
|
||||
<TableContainer
|
||||
component={Paper}
|
||||
sx={{ mb: 2, borderRadius: "15px" }}
|
||||
>
|
||||
<Table>
|
||||
<TableHead
|
||||
sx={{
|
||||
mb: 1,
|
||||
{albumTracks.isSuccess && (
|
||||
<Paper
|
||||
className="item-detail-album-tracks"
|
||||
style={{
|
||||
marginBottom: "1.2em",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
key={0}
|
||||
className="item-detail-album-track"
|
||||
style={{
|
||||
padding: "0.75em 0 ",
|
||||
background: "rgb(255 255 255 / 0.1)",
|
||||
boxShadow: "0 0 10px rgb(0 0 0 / 0.5)",
|
||||
}}
|
||||
>
|
||||
<TableRow>
|
||||
<TableCell
|
||||
sx={{
|
||||
maxWidth: 120,
|
||||
width: 20,
|
||||
}}
|
||||
<Typography
|
||||
variant="h6"
|
||||
fontWeight={400}
|
||||
style={{
|
||||
justifySelf: "end",
|
||||
}}
|
||||
>
|
||||
#
|
||||
</Typography>
|
||||
<div></div>
|
||||
<Typography
|
||||
variant="h6"
|
||||
style={{
|
||||
justifySelf: "start",
|
||||
}}
|
||||
fontWeight={400}
|
||||
onClick={() => {
|
||||
console.log("Hvnrjn");
|
||||
}}
|
||||
>
|
||||
Name
|
||||
</Typography>
|
||||
<MdiClockOutline />
|
||||
</div>
|
||||
{albumTracks.data.Items.map((track, index) => {
|
||||
return (
|
||||
<div
|
||||
key={track.Id}
|
||||
className={
|
||||
currentTrackItem.Id == track.Id &&
|
||||
currentTrackItem.ParentId ==
|
||||
track.ParentId
|
||||
? "item-detail-album-track playing"
|
||||
: "item-detail-album-track"
|
||||
}
|
||||
onClick={() => playTrack(index)}
|
||||
>
|
||||
<Typography variant="h6">#</Typography>
|
||||
</TableCell>
|
||||
<TableCell sx={{ width: 20 }}></TableCell>
|
||||
<TableCell>
|
||||
<Typography variant="h6">
|
||||
Name
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
style={{
|
||||
justifySelf: "end",
|
||||
}}
|
||||
>
|
||||
{!!track.IndexNumber
|
||||
? track.IndexNumber
|
||||
: "-"}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Typography variant="h6" align="right">
|
||||
<MdiClockOutline />
|
||||
</Typography>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{albumTracks.isSuccess &&
|
||||
albumTracks.data.Items.map(
|
||||
(mitem, mindex) => {
|
||||
return (
|
||||
<TableRow
|
||||
key={mindex}
|
||||
sx={{
|
||||
"&:last-child td, &:last-child th":
|
||||
{
|
||||
border: 0,
|
||||
},
|
||||
"&:hover": {
|
||||
background:
|
||||
"rgb(255 255 255 / 0.05)",
|
||||
},
|
||||
|
||||
<LikeButton
|
||||
itemId={track.Id}
|
||||
isFavorite={
|
||||
track.UserData?.IsFavorite
|
||||
}
|
||||
queryKey={[
|
||||
"artist",
|
||||
"album",
|
||||
album.Id,
|
||||
]}
|
||||
userId={user.Id}
|
||||
itemName={track.Name}
|
||||
color={
|
||||
currentTrackItem.Id ==
|
||||
track.Id &&
|
||||
currentTrackItem.ParentId ==
|
||||
track.ParentId
|
||||
? "hsl(337, 96%, 56%)"
|
||||
: "white"
|
||||
}
|
||||
/>
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
style={{
|
||||
justifySelf: "start",
|
||||
}}
|
||||
fontWeight={500}
|
||||
>
|
||||
{track.Name}
|
||||
</Typography>
|
||||
{track.AlbumArtist ==
|
||||
"Various Artists" && (
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
<TableCell
|
||||
sx={{
|
||||
maxWidth: 120,
|
||||
width: 20,
|
||||
}}
|
||||
>
|
||||
<Typography variant="body1">
|
||||
{
|
||||
mitem.IndexNumber
|
||||
}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
<TableCell
|
||||
sx={{
|
||||
width: 20,
|
||||
}}
|
||||
align="center"
|
||||
>
|
||||
<IconButton
|
||||
onClick={() =>
|
||||
handleLikingTrack(
|
||||
mitem,
|
||||
)
|
||||
}
|
||||
>
|
||||
{mitem.UserData
|
||||
.IsFavorite ? (
|
||||
<MdiHeart />
|
||||
) : (
|
||||
<MdiHeartOutline />
|
||||
)}
|
||||
</IconButton>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Typography variant="body1">
|
||||
{mitem.Name}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
<TableCell align="right">
|
||||
<Typography variant="body1">
|
||||
{getRuntimeMusic(
|
||||
mitem.RunTimeTicks,
|
||||
)}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
},
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Box>
|
||||
{track.ArtistItems.map(
|
||||
(artist) =>
|
||||
artist.Name,
|
||||
).join(", ")}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
<Typography variant="subtitle1">
|
||||
{getRuntimeMusic(
|
||||
track.RunTimeTicks,
|
||||
)}
|
||||
</Typography>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</Paper>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -84,6 +84,7 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||
]}
|
||||
userId={user.data.Id}
|
||||
imageBlurhash={
|
||||
!!item.ImageBlurHashes?.Primary &&
|
||||
item.ImageBlurHashes?.Primary[
|
||||
Object.keys(
|
||||
item.ImageBlurHashes.Primary,
|
||||
|
||||
@@ -205,15 +205,19 @@ const Hero = ({
|
||||
)}
|
||||
</Typography>
|
||||
{!!albumBy && (
|
||||
<Typography
|
||||
<TextLink
|
||||
text={`By ${albumBy.Name}`}
|
||||
variant="h6"
|
||||
fontWeight={400}
|
||||
style={{
|
||||
opacity: 0.8,
|
||||
location={`/artist/${albumBy.Id}`}
|
||||
otherProps={{
|
||||
fontWeight: 400,
|
||||
style: {
|
||||
opacity: 0.8,
|
||||
},
|
||||
}}
|
||||
>
|
||||
By {albumBy}
|
||||
</Typography>
|
||||
</TextLink>
|
||||
)}
|
||||
</div>
|
||||
{!disableInfoStrip && (
|
||||
@@ -550,22 +554,21 @@ const Hero = ({
|
||||
{writers.map((writer, index) => (
|
||||
<>
|
||||
<TextLink
|
||||
text={
|
||||
index ==
|
||||
writers.length
|
||||
? writer.Name
|
||||
: `${writer.Name}`
|
||||
}
|
||||
text={writer.Name}
|
||||
variant={"subtitle1"}
|
||||
location={`/person/${writer.Id}`}
|
||||
/>
|
||||
<span
|
||||
style={{
|
||||
whiteSpace: "pre",
|
||||
}}
|
||||
>
|
||||
,{" "}
|
||||
</span>
|
||||
{index !=
|
||||
writers.length - 1 && (
|
||||
<span
|
||||
style={{
|
||||
whiteSpace:
|
||||
"pre",
|
||||
}}
|
||||
>
|
||||
,{" "}
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
))}
|
||||
</div>
|
||||
@@ -595,13 +598,17 @@ const Hero = ({
|
||||
variant={"subtitle1"}
|
||||
location={`/person/${director.Id}`}
|
||||
/>
|
||||
<span
|
||||
style={{
|
||||
whiteSpace: "pre",
|
||||
}}
|
||||
>
|
||||
,{" "}
|
||||
</span>
|
||||
{index !=
|
||||
directors.length - 1 && (
|
||||
<span
|
||||
style={{
|
||||
whiteSpace:
|
||||
"pre",
|
||||
}}
|
||||
>
|
||||
,{" "}
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
))}
|
||||
</div>
|
||||
@@ -623,11 +630,28 @@ const Hero = ({
|
||||
>
|
||||
Artists
|
||||
</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
{artists
|
||||
.map((artist) => artist.Name)
|
||||
.join(", ")}
|
||||
</Typography>
|
||||
<div className="hero-text-container">
|
||||
{artists.map((artist, index) => (
|
||||
<>
|
||||
<TextLink
|
||||
text={artist.Name}
|
||||
variant={"subtitle1"}
|
||||
location={`/artist/${artist.Id}`}
|
||||
/>
|
||||
{index !=
|
||||
artists.length - 1 && (
|
||||
<span
|
||||
style={{
|
||||
whiteSpace:
|
||||
"pre",
|
||||
}}
|
||||
>
|
||||
,{" "}
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{studios.length > 0 && (
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
/** @format */
|
||||
import Typography from "@mui/material/Typography";
|
||||
import "./musicTrack.module.scss";
|
||||
import { getRuntimeMusic } from "../../utils/date/time";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import TextLink from "../textLink";
|
||||
import PlayButton from "../buttons/playButton";
|
||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||
|
||||
/**
|
||||
* @typedef {Object} Props
|
||||
* @property {import("@jellyfin/sdk/lib/generated-client/models").BaseItemDto} item
|
||||
* @property {Array} queryKey
|
||||
* @property {string} userId
|
||||
*/
|
||||
|
||||
/**
|
||||
* @description Music Track element displayed in ArtistTitlePage and Songs library
|
||||
* @param {Props}
|
||||
* @returns {React.Component}
|
||||
*/
|
||||
|
||||
const MusicTrack = ({ item, queryKey, userId }) => {
|
||||
const [currentTrackItem] = useAudioPlayback((state) => [state.item]);
|
||||
|
||||
return (
|
||||
<div className="music-track">
|
||||
<div className="music-track-image">
|
||||
<img
|
||||
src={window.api.getItemImageUrl(
|
||||
Object.keys(item.ImageTags).length == 0
|
||||
? item.AlbumId
|
||||
: item.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 85,
|
||||
fillHeight: 462,
|
||||
fillWidth: 462,
|
||||
},
|
||||
)}
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
objectFit: "cover",
|
||||
opacity: 0,
|
||||
}}
|
||||
onLoad={(e) => (e.target.style.opacity = 1)}
|
||||
/>
|
||||
<div className="music-track-image-overlay">
|
||||
<PlayButton
|
||||
itemId={item.Id}
|
||||
userId={userId}
|
||||
itemType={item.Type}
|
||||
size="small"
|
||||
iconOnly
|
||||
audio
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="music-track-info">
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
style={{
|
||||
color:
|
||||
item.Id == currentTrackItem.Id
|
||||
? "hsl(337, 96%, 56%)"
|
||||
: "white",
|
||||
}}
|
||||
>
|
||||
{item.Name}
|
||||
</Typography>
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
opacity: 0.8,
|
||||
}}
|
||||
>
|
||||
{item.ArtistItems.map((artist, index) => (
|
||||
<>
|
||||
<TextLink
|
||||
text={artist.Name}
|
||||
variant={"subtitle2"}
|
||||
location={`/artist/${artist.Id}`}
|
||||
otherProps={{
|
||||
fontWeight: 400,
|
||||
}}
|
||||
/>
|
||||
{index != item.ArtistItems.length - 1 && (
|
||||
<span
|
||||
style={{
|
||||
whiteSpace: "pre",
|
||||
}}
|
||||
>
|
||||
,{" "}
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
))}
|
||||
</div>
|
||||
{/* <Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{item.Name}
|
||||
</Typography> */}
|
||||
</div>
|
||||
<Typography variant="subtitl1">
|
||||
{getRuntimeMusic(item.RunTimeTicks)}
|
||||
</Typography>
|
||||
<LikeButton
|
||||
itemId={item.Id}
|
||||
isFavorite={item.UserData?.IsFavorite}
|
||||
queryKey={queryKey}
|
||||
userId={userId}
|
||||
itemName={item.Name}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default MusicTrack;
|
||||
@@ -0,0 +1,40 @@
|
||||
/** @format */
|
||||
|
||||
.music-track {
|
||||
display: grid;
|
||||
grid-template-columns: 4.5em 80% 1fr 1fr;
|
||||
gap: 0.5em;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
&-image {
|
||||
margin: 0.4em;
|
||||
border-radius: $border-radius-default;
|
||||
overflow: hidden;
|
||||
aspect-ratio: 1;
|
||||
position: relative;
|
||||
&-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
backdrop-filter: blur(10px);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-time-fast;
|
||||
}
|
||||
box-shadow: 0 0 10px rgb(0 0 0 / 0.2);
|
||||
transition: opacity $transition-time-fast;
|
||||
}
|
||||
&-info {
|
||||
justify-self: start;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.music-track-image-overlay {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
.audio-player {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: $clr-background-dark-opacity-0_8;
|
||||
z-index: 10;
|
||||
|
||||
@@ -6,6 +6,7 @@ import { motion } from "framer-motion";
|
||||
import Fab from "@mui/material/Fab";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
|
||||
import WaveSurfer from "wavesurfer.js";
|
||||
|
||||
@@ -21,10 +22,11 @@ import { MdiSkipNext } from "../../icons/mdiSkipNext";
|
||||
import { MdiSkipPrevious } from "../../icons/mdiSkipPrevious";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { Icon } from "@mui/material";
|
||||
import { MdiClose } from "../../icons/mdiClose";
|
||||
import { MdiMusic } from "../../icons/mdiMusic";
|
||||
|
||||
import { theme } from "../../../theme";
|
||||
|
||||
const AudioPlayer = () => {
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
@@ -37,7 +39,10 @@ const AudioPlayer = () => {
|
||||
|
||||
const waveSurferRef = useRef(null);
|
||||
const waveSurferContainerRef = useRef(null);
|
||||
const [playing, setPlaying] = useState(false);
|
||||
const [playerReady, setPlayerReady] = useState(false);
|
||||
const [playing, setPlaying] = useState(true);
|
||||
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
const [showWaveform, setShowWaveform] = useState(false);
|
||||
|
||||
@@ -73,17 +78,22 @@ const AudioPlayer = () => {
|
||||
if (display) {
|
||||
const waveSurfer = WaveSurfer.create({
|
||||
container: waveSurferContainerRef.current,
|
||||
autoplay: true,
|
||||
barHeight: 0.8,
|
||||
dragToSeek: true,
|
||||
height: 35,
|
||||
cursorColor: "#fb2376",
|
||||
progressColor: "#fb2376",
|
||||
waveColor: "#ffffff2f",
|
||||
normalize: true,
|
||||
});
|
||||
waveSurfer.load(url);
|
||||
waveSurfer.on("load", () => {
|
||||
setLoading(true);
|
||||
});
|
||||
waveSurfer.on("ready", () => {
|
||||
waveSurferRef.current = waveSurfer;
|
||||
waveSurfer.play();
|
||||
setLoading(false);
|
||||
});
|
||||
waveSurfer.on("timeupdate", (e) => {
|
||||
setCurrentTime(e);
|
||||
@@ -114,18 +124,27 @@ const AudioPlayer = () => {
|
||||
setShowWaveform(false);
|
||||
}
|
||||
});
|
||||
waveSurfer.on("destroy", () => {
|
||||
waveSurfer.unAll();
|
||||
setLoading(true);
|
||||
});
|
||||
|
||||
return () => {
|
||||
waveSurfer.destroy();
|
||||
};
|
||||
}
|
||||
}, [url]);
|
||||
}, [url, display, currentTrack]);
|
||||
|
||||
useEffect(() => {
|
||||
if (playerReady) waveSurferRef.current.play();
|
||||
}, [playerReady]);
|
||||
|
||||
const handlePlayPause = () => {
|
||||
waveSurferRef.current.playPause();
|
||||
};
|
||||
|
||||
const handleNext = () => {
|
||||
setPlaying(false);
|
||||
setCurrentTrack(currentTrack + 1);
|
||||
setAudioUrl(
|
||||
`${window.api.basePath}/Audio/${
|
||||
@@ -139,6 +158,7 @@ const AudioPlayer = () => {
|
||||
};
|
||||
|
||||
const handlePrevious = () => {
|
||||
setPlaying(false);
|
||||
setCurrentTrack(currentTrack - 1);
|
||||
setAudioUrl(
|
||||
`${window.api.basePath}/Audio/${
|
||||
@@ -159,6 +179,14 @@ const AudioPlayer = () => {
|
||||
transform: "translateY(100%)",
|
||||
}}
|
||||
animate={{ transform: "translateY(0)" }}
|
||||
exit={{
|
||||
transform: "translateY(100%)",
|
||||
}}
|
||||
style={{
|
||||
width: `calc(100vw - ${theme.spacing(
|
||||
13,
|
||||
)} - 10px)`,
|
||||
}}
|
||||
className="audio-player"
|
||||
>
|
||||
<motion.div
|
||||
@@ -178,7 +206,10 @@ const AudioPlayer = () => {
|
||||
<img
|
||||
className="audio-player-image"
|
||||
src={window.api.getItemImageUrl(
|
||||
item.Id,
|
||||
Object.keys(item.ImageTags)
|
||||
.length == 0
|
||||
? item.AlbumId
|
||||
: item.Id,
|
||||
"Primary",
|
||||
{
|
||||
quality: 85,
|
||||
@@ -197,7 +228,9 @@ const AudioPlayer = () => {
|
||||
}}
|
||||
fontWeight={500}
|
||||
>
|
||||
{item.IndexNumber}. {item.Name}
|
||||
{!!item.IndexNumber
|
||||
? `${item.IndexNumber}. ${item.Name}`
|
||||
: item.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
@@ -222,9 +255,34 @@ const AudioPlayer = () => {
|
||||
>
|
||||
<MdiSkipPrevious />
|
||||
</IconButton>
|
||||
<Fab size="small" onClick={handlePlayPause}>
|
||||
{playing ? <MdiPause /> : <MdiPlay />}
|
||||
</Fab>
|
||||
<div
|
||||
style={{
|
||||
display: "inline-flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
<CircularProgress
|
||||
size={48}
|
||||
style={{
|
||||
position: "absolute",
|
||||
zIndex: 1,
|
||||
opacity: loading ? 1 : 0,
|
||||
transition: "opacity 500ms",
|
||||
}}
|
||||
/>
|
||||
<Fab
|
||||
size="small"
|
||||
onClick={handlePlayPause}
|
||||
>
|
||||
{playing ? (
|
||||
<MdiPause />
|
||||
) : (
|
||||
<MdiPlay />
|
||||
)}
|
||||
</Fab>
|
||||
</div>
|
||||
<IconButton
|
||||
onClick={handleNext}
|
||||
disabled={
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useNavigate } from "react-router-dom";
|
||||
|
||||
import "./textLink.module.scss";
|
||||
|
||||
const TextLink = ({ text, location, variant }) => {
|
||||
const TextLink = ({ text, location, variant, otherProps }) => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
@@ -13,6 +13,7 @@ const TextLink = ({ text, location, variant }) => {
|
||||
variant={variant}
|
||||
className="link"
|
||||
onClick={() => navigate(location)}
|
||||
{...otherProps}
|
||||
>
|
||||
{text}
|
||||
</Typography>
|
||||
|
||||
@@ -122,29 +122,19 @@ const MusicAlbumTitlePage = () => {
|
||||
});
|
||||
|
||||
const [
|
||||
url,
|
||||
display,
|
||||
currentTrackItem,
|
||||
tracks,
|
||||
currentTrack,
|
||||
setCurrentAudioTrack,
|
||||
setAudioUrl,
|
||||
setAudioDisplay,
|
||||
setAudioItem,
|
||||
setAudioTracks,
|
||||
resetPlayer,
|
||||
] = useAudioPlayback((state) => [
|
||||
state.url,
|
||||
state.display,
|
||||
state.item,
|
||||
state.tracks,
|
||||
state.currentTrack,
|
||||
state.setCurrentTrack,
|
||||
state.setUrl,
|
||||
state.setDisplay,
|
||||
state.setItem,
|
||||
state.setTracks,
|
||||
state.reset,
|
||||
]);
|
||||
const playTrack = (index) => {
|
||||
setAudioTracks(musicTracks.data.Items);
|
||||
@@ -201,7 +191,7 @@ const MusicAlbumTitlePage = () => {
|
||||
userId={user.data.Id}
|
||||
queryKey={["item", id]}
|
||||
artists={item.data.ArtistItems}
|
||||
albumBy={item.data.AlbumArtist}
|
||||
albumBy={item.data.AlbumArtists[0]}
|
||||
disableMarkAsPlayedButton
|
||||
audioPlayButton
|
||||
/>
|
||||
@@ -274,7 +264,9 @@ const MusicAlbumTitlePage = () => {
|
||||
"end",
|
||||
}}
|
||||
>
|
||||
{track.IndexNumber}
|
||||
{!!track.IndexNumber
|
||||
? track.IndexNumber
|
||||
: "-"}
|
||||
</Typography>
|
||||
|
||||
<LikeButton
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/** @format */
|
||||
|
||||
.item-detail-artist {
|
||||
&-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
&-header {
|
||||
width: 100%;
|
||||
}
|
||||
&-cards {
|
||||
display: grid;
|
||||
align-items: start;
|
||||
}
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(8, minmax(0, 1fr));
|
||||
|
||||
align-items: start;
|
||||
}
|
||||
@@ -0,0 +1,497 @@
|
||||
/** @format */
|
||||
import { useState, useEffect } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Chip from "@mui/material/Chip";
|
||||
import Divider from "@mui/material/Divider";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Tabs from "@mui/material/Tabs";
|
||||
import Tab from "@mui/material/Tab";
|
||||
import Grid2 from "@mui/material/Unstable_Grid2";
|
||||
import Button from "@mui/material/Button";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import TableContainer from "@mui/material/TableContainer";
|
||||
import Table from "@mui/material/Table";
|
||||
import TableHead from "@mui/material/TableHead";
|
||||
import TableRow from "@mui/material/TableRow";
|
||||
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, yellow } from "@mui/material/colors";
|
||||
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
|
||||
import { Blurhash } from "react-blurhash";
|
||||
import { useParams, useNavigate, Link as RouterLink } from "react-router-dom";
|
||||
|
||||
import {
|
||||
BaseItemKind,
|
||||
ItemFields,
|
||||
LocationType,
|
||||
MediaStreamType,
|
||||
SortOrder,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { MdiPlayOutline } from "../../components/icons/mdiPlayOutline";
|
||||
import { MdiStar } from "../../components/icons/mdiStar";
|
||||
import { MdiCheck } from "../../components/icons/mdiCheck";
|
||||
import { MdiHeartOutline } from "../../components/icons/mdiHeartOutline";
|
||||
import { MdiHeart } from "../../components/icons/mdiHeart";
|
||||
import { MdiClockOutline } from "../../components/icons/mdiClockOutline";
|
||||
|
||||
import { getRuntimeMusic, getRuntimeFull, endsAt } from "../../utils/date/time";
|
||||
import { TypeIconCollectionCard } from "../../components/utils/iconsCollection";
|
||||
|
||||
import Hero from "../../components/layouts/item/hero";
|
||||
import { Card } from "../../components/card/card";
|
||||
import { EpisodeCard } from "../../components/card/episodeCard";
|
||||
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
||||
|
||||
import "./artist.module.scss";
|
||||
import { EpisodeCardsSkeleton } from "../../components/skeleton/episodeCards";
|
||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||
import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
|
||||
import { MdiMusic } from "../../components/icons/mdiMusic";
|
||||
import { usePlaybackStore } from "../../utils/store/playback";
|
||||
import { Tooltip } from "@mui/material";
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
import { ActorCard } from "../../components/card/actorCards";
|
||||
import MusicTrack from "../../components/musicTrack";
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
return (
|
||||
<div
|
||||
role="tabpanel"
|
||||
hidden={value !== index}
|
||||
id={`full-width-tabpanel-${index}`}
|
||||
aria-labelledby={`full-width-tab-${index}`}
|
||||
{...other}
|
||||
style={{ marginTop: "1em" }}
|
||||
>
|
||||
{value === index && <Box>{children}</Box>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
TabPanel.propTypes = {
|
||||
children: PropTypes.node,
|
||||
index: PropTypes.number.isRequired,
|
||||
value: PropTypes.number.isRequired,
|
||||
};
|
||||
|
||||
function a11yProps(index) {
|
||||
return {
|
||||
id: `full-width-tab-${index}`,
|
||||
"aria-controls": `full-width-tabpanel-${index}`,
|
||||
};
|
||||
}
|
||||
|
||||
const ArtistTitlePage = () => {
|
||||
const { id } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [primageImageLoaded, setPrimaryImageLoaded] = useState(false);
|
||||
const [backdropImageLoaded, setBackdropImageLoaded] = useState(false);
|
||||
|
||||
const user = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: async () => {
|
||||
let usr = await getUserApi(window.api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const item = useQuery({
|
||||
queryKey: ["item", id],
|
||||
queryFn: async () => {
|
||||
const result = await getUserLibraryApi(window.api).getItem({
|
||||
userId: user.data.Id,
|
||||
itemId: id,
|
||||
fields: [ItemFields.Crew],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: !!user.data,
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const similarItems = useQuery({
|
||||
queryKey: ["item", id, "similarItem"],
|
||||
queryFn: async () => {
|
||||
let result;
|
||||
if (item.data.Type == "Movie") {
|
||||
result = await getLibraryApi(window.api).getSimilarMovies({
|
||||
userId: user.data.Id,
|
||||
itemId: item.data.Id,
|
||||
});
|
||||
} else if (item.data.Type == "Series") {
|
||||
result = await getLibraryApi(window.api).getSimilarShows({
|
||||
userId: user.data.Id,
|
||||
itemId: item.data.Id,
|
||||
});
|
||||
} else if (item.data.Type == "MusicAlbum") {
|
||||
result = await getLibraryApi(window.api).getSimilarAlbums({
|
||||
userId: user.data.Id,
|
||||
itemId: item.data.Id,
|
||||
});
|
||||
} else if (item.data.Type == "MusicArtist") {
|
||||
result = await getLibraryApi(window.api).getSimilarArtists({
|
||||
userId: user.data.Id,
|
||||
itemId: item.data.Id,
|
||||
});
|
||||
} else {
|
||||
result = await getLibraryApi(window.api).getSimilarItems({
|
||||
userId: user.data.Id,
|
||||
itemId: item.data.Id,
|
||||
});
|
||||
}
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess,
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const artistDiscography = useQuery({
|
||||
queryKey: ["item", id, "artist", "discography"],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItems({
|
||||
albumArtistIds: [item.data.Id],
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
sortOrder: [SortOrder.Descending],
|
||||
recursive: true,
|
||||
includeItemTypes: [BaseItemKind.MusicAlbum],
|
||||
userId: user.data.Id,
|
||||
fields: [ItemFields.Overview],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess && item.data.Type == BaseItemKind.MusicArtist,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const artistSongs = useQuery({
|
||||
queryKey: ["item", id, "artist", "songs"],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItems({
|
||||
artistIds: [item.data.Id],
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
sortOrder: [SortOrder.Ascending],
|
||||
recursive: true,
|
||||
includeItemTypes: [BaseItemKind.Audio],
|
||||
userId: user.data.Id,
|
||||
fields: [ItemFields.Overview],
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess && item.data.Type == BaseItemKind.MusicArtist,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const artistAppearances = useQuery({
|
||||
queryKey: ["item", id, "artist", "appearences"],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(window.api).getItems({
|
||||
contributingArtistIds: [item.data.Id],
|
||||
excludeItemIds: [item.data.Id],
|
||||
sortBy: ["PremiereDate", "ProductionYear", "SortName"],
|
||||
sortOrder: [SortOrder.Descending],
|
||||
recursive: true,
|
||||
includeItemTypes: [BaseItemKind.MusicAlbum],
|
||||
userId: user.data.Id,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess && item.data.Type == BaseItemKind.MusicArtist,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
const artistTabs = [
|
||||
{ title: "Discography", data: artistDiscography },
|
||||
{ title: "Songs", data: artistSongs },
|
||||
{ title: "Appearances", data: artistAppearances },
|
||||
];
|
||||
const [activeArtistTab, setActiveArtistTab] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
artistDiscography.isSuccess &&
|
||||
artistSongs.isSuccess &&
|
||||
artistAppearances.isSuccess
|
||||
) {
|
||||
if (artistDiscography.data.TotalRecordCount != 0) {
|
||||
setActiveArtistTab(0);
|
||||
} else if (artistSongs.data.TotalRecordCount != 0) {
|
||||
setActiveArtistTab(1);
|
||||
} else if (artistAppearances.data.TotalRecordCount != 0) {
|
||||
setActiveArtistTab(2);
|
||||
}
|
||||
}
|
||||
}, [
|
||||
artistDiscography.isLoading,
|
||||
artistSongs.isLoading,
|
||||
artistAppearances.isLoading,
|
||||
]);
|
||||
|
||||
const [animationDirection, setAnimationDirection] = useState("forward");
|
||||
|
||||
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||
|
||||
useEffect(() => {
|
||||
if (item.isSuccess) {
|
||||
setAppBackdrop(
|
||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||
item.data.Type === BaseItemKind.Episode
|
||||
? `${window.api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop`
|
||||
: `${window.api.basePath}/Items/${item.data.Id}/Images/Backdrop`,
|
||||
item.data.Id,
|
||||
);
|
||||
}
|
||||
}, [item.isSuccess]);
|
||||
|
||||
if (item.isLoading || similarItems.isLoading) {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: "100%",
|
||||
height: "100vh",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
if (item.isSuccess && similarItems.isSuccess) {
|
||||
return (
|
||||
<div
|
||||
className="scrollY"
|
||||
style={{
|
||||
padding: "5em 2em 2em 1em",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: "0.5em",
|
||||
}}
|
||||
>
|
||||
<Hero
|
||||
item={item.data}
|
||||
userId={user.data.Id}
|
||||
queryKey={["item", id]}
|
||||
disableMarkAsPlayedButton
|
||||
audioPlayButton
|
||||
/>
|
||||
|
||||
<div className="item-detail-artist-container">
|
||||
<div className="item-detail-artist-header">
|
||||
<Tabs
|
||||
variant="scrollable"
|
||||
value={activeArtistTab}
|
||||
onChange={(e, newVal) => {
|
||||
if (newVal > activeArtistTab) {
|
||||
setAnimationDirection("forward");
|
||||
} else if (newVal < activeArtistTab) {
|
||||
setAnimationDirection("backwards");
|
||||
}
|
||||
setActiveArtistTab(newVal);
|
||||
}}
|
||||
>
|
||||
{artistTabs.map((tab, index) => {
|
||||
return (
|
||||
<Tab
|
||||
key={index}
|
||||
label={tab.title}
|
||||
disabled={
|
||||
tab.data.data
|
||||
?.TotalRecordCount ==
|
||||
0
|
||||
}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</Tabs>
|
||||
<Divider />
|
||||
</div>
|
||||
<AnimatePresence>
|
||||
<TabPanel value={activeArtistTab} index={0}>
|
||||
<motion.div
|
||||
key={activeArtistTab}
|
||||
initial={{
|
||||
opacity: 0,
|
||||
transform:
|
||||
animationDirection ==
|
||||
"forward"
|
||||
? "translate(30px)"
|
||||
: "translate(-30px)",
|
||||
}}
|
||||
animate={{
|
||||
opacity: 1,
|
||||
transform: "translate(0px)",
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2,
|
||||
ease: "anticipate",
|
||||
}}
|
||||
>
|
||||
{artistDiscography.isSuccess &&
|
||||
artistDiscography.data.Items.map(
|
||||
(tabitem, aindex) => {
|
||||
return (
|
||||
<ArtistAlbum
|
||||
key={aindex}
|
||||
user={
|
||||
user.data
|
||||
}
|
||||
album={tabitem}
|
||||
/>
|
||||
);
|
||||
},
|
||||
)}
|
||||
</motion.div>
|
||||
</TabPanel>
|
||||
<TabPanel value={activeArtistTab} index={1}>
|
||||
<motion.div
|
||||
key={activeArtistTab}
|
||||
initial={{
|
||||
opacity: 0,
|
||||
transform:
|
||||
animationDirection ==
|
||||
"forward"
|
||||
? "translate(30px)"
|
||||
: "translate(-30px)",
|
||||
}}
|
||||
animate={{
|
||||
opacity: 1,
|
||||
transform: "translate(0px)",
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2,
|
||||
ease: "anticipate",
|
||||
}}
|
||||
>
|
||||
{artistSongs.isSuccess &&
|
||||
artistSongs.data.Items.map(
|
||||
(tabitem, aindex) => {
|
||||
return (
|
||||
<MusicTrack
|
||||
item={tabitem}
|
||||
key={
|
||||
tabitem.Id
|
||||
}
|
||||
queryKey={[
|
||||
"item",
|
||||
id,
|
||||
"artist",
|
||||
"songs",
|
||||
]}
|
||||
userId={
|
||||
user.data
|
||||
.Id
|
||||
}
|
||||
/>
|
||||
);
|
||||
},
|
||||
)}
|
||||
</motion.div>
|
||||
</TabPanel>
|
||||
<TabPanel value={activeArtistTab} index={2}>
|
||||
<motion.div
|
||||
key={activeArtistTab}
|
||||
initial={{
|
||||
opacity: 0,
|
||||
transform:
|
||||
animationDirection ==
|
||||
"forward"
|
||||
? "translate(30px)"
|
||||
: "translate(-30px)",
|
||||
}}
|
||||
animate={{
|
||||
opacity: 1,
|
||||
transform: "translate(0px)",
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.2,
|
||||
ease: "anticipate",
|
||||
}}
|
||||
className="grid"
|
||||
>
|
||||
{artistAppearances.isSuccess &&
|
||||
artistAppearances.data.Items.map(
|
||||
(tabitem, aindex) => {
|
||||
return (
|
||||
<Card
|
||||
key={
|
||||
tabitem.Id
|
||||
}
|
||||
item={tabitem}
|
||||
cardTitle={
|
||||
tabitem.Name
|
||||
}
|
||||
imageType={
|
||||
"Primary"
|
||||
}
|
||||
cardCaption={
|
||||
tabitem.AlbumArtist
|
||||
}
|
||||
cardType={
|
||||
"square"
|
||||
}
|
||||
queryKey={[
|
||||
"item",
|
||||
id,
|
||||
"artist",
|
||||
"appearences",
|
||||
]}
|
||||
userId={
|
||||
user.data
|
||||
.Id
|
||||
}
|
||||
imageBlurhash={
|
||||
!!tabitem
|
||||
.ImageBlurHashes
|
||||
?.Primary &&
|
||||
tabitem
|
||||
.ImageBlurHashes
|
||||
?.Primary[
|
||||
Object.keys(
|
||||
tabitem
|
||||
.ImageBlurHashes
|
||||
.Primary,
|
||||
)[0]
|
||||
]
|
||||
}
|
||||
></Card>
|
||||
);
|
||||
},
|
||||
)}
|
||||
</motion.div>
|
||||
</TabPanel>
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (item.isError || similarItems.isError) {
|
||||
return <ErrorNotice />;
|
||||
}
|
||||
};
|
||||
|
||||
export default ArtistTitlePage;
|
||||
@@ -4,73 +4,30 @@ import PropTypes from "prop-types";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Chip from "@mui/material/Chip";
|
||||
import Divider from "@mui/material/Divider";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import Tabs from "@mui/material/Tabs";
|
||||
import Tab from "@mui/material/Tab";
|
||||
import Grid2 from "@mui/material/Unstable_Grid2";
|
||||
import Button from "@mui/material/Button";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import TableContainer from "@mui/material/TableContainer";
|
||||
import Table from "@mui/material/Table";
|
||||
import TableHead from "@mui/material/TableHead";
|
||||
import TableRow from "@mui/material/TableRow";
|
||||
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, yellow } from "@mui/material/colors";
|
||||
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
|
||||
import { Blurhash } from "react-blurhash";
|
||||
import { useParams, useNavigate, Link as RouterLink } from "react-router-dom";
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
import {
|
||||
BaseItemKind,
|
||||
ItemFields,
|
||||
LocationType,
|
||||
MediaStreamType,
|
||||
SortOrder,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getTvShowsApi } from "@jellyfin/sdk/lib/utils/api/tv-shows-api";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { MdiPlayOutline } from "../../components/icons/mdiPlayOutline";
|
||||
import { MdiStar } from "../../components/icons/mdiStar";
|
||||
import { MdiCheck } from "../../components/icons/mdiCheck";
|
||||
import { MdiHeartOutline } from "../../components/icons/mdiHeartOutline";
|
||||
import { MdiHeart } from "../../components/icons/mdiHeart";
|
||||
import { MdiClockOutline } from "../../components/icons/mdiClockOutline";
|
||||
|
||||
import { getRuntimeMusic, getRuntimeFull, endsAt } from "../../utils/date/time";
|
||||
import { TypeIconCollectionCard } from "../../components/utils/iconsCollection";
|
||||
|
||||
import Hero from "../../components/layouts/item/hero";
|
||||
import { Card } from "../../components/card/card";
|
||||
import { EpisodeCard } from "../../components/card/episodeCard";
|
||||
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
||||
|
||||
import "./person.module.scss";
|
||||
import { EpisodeCardsSkeleton } from "../../components/skeleton/episodeCards";
|
||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||
import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
|
||||
import { MdiMusic } from "../../components/icons/mdiMusic";
|
||||
import { usePlaybackStore } from "../../utils/store/playback";
|
||||
import { Tooltip } from "@mui/material";
|
||||
import { useBackdropStore } from "../../utils/store/backdrop";
|
||||
import { ActorCard } from "../../components/card/actorCards";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
Reference in new issue
Block a user