Addd ArtistTitlePage #160
This commit is contained in:
17 files changed
+1050
-234
No files matched your search
@@ -34,6 +34,7 @@
|
|||||||
"react-player": "^2.12.0",
|
"react-player": "^2.12.0",
|
||||||
"react-router-dom": "^6.14.0",
|
"react-router-dom": "^6.14.0",
|
||||||
"react-use-konami": "^1.1.0",
|
"react-use-konami": "^1.1.0",
|
||||||
|
"react-virtualized": "^9.22.5",
|
||||||
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1",
|
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1",
|
||||||
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
|
||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.0",
|
||||||
|
|||||||
Generated
+23
@@ -74,6 +74,9 @@ dependencies:
|
|||||||
react-use-konami:
|
react-use-konami:
|
||||||
specifier: ^1.1.0
|
specifier: ^1.1.0
|
||||||
version: 1.1.0(react-dom@18.2.0)(react@18.2.0)
|
version: 1.1.0(react-dom@18.2.0)(react@18.2.0)
|
||||||
|
react-virtualized:
|
||||||
|
specifier: ^9.22.5
|
||||||
|
version: 9.22.5(react-dom@18.2.0)(react@18.2.0)
|
||||||
tauri-plugin-log-api:
|
tauri-plugin-log-api:
|
||||||
specifier: github:tauri-apps/tauri-plugin-log#v1
|
specifier: github:tauri-apps/tauri-plugin-log#v1
|
||||||
version: github.com/tauri-apps/tauri-plugin-log/9075595196d5a66f8f3265d2aaf7e2ffeb4cb2ab
|
version: github.com/tauri-apps/tauri-plugin-log/9075595196d5a66f8f3265d2aaf7e2ffeb4cb2ab
|
||||||
@@ -1823,6 +1826,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==}
|
resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/react-lifecycles-compat@3.0.4:
|
||||||
|
resolution: {integrity: sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/react-multi-carousel@2.8.4:
|
/react-multi-carousel@2.8.4:
|
||||||
resolution: {integrity: sha512-7Is5Wr+m2ebkR+oq2Su2tjUdBwpVtB2O6Tjb74KDNfxWe/FrsTQwezTJTk/r9cKCrRp9Li308v822/5bZm7XKg==}
|
resolution: {integrity: sha512-7Is5Wr+m2ebkR+oq2Su2tjUdBwpVtB2O6Tjb74KDNfxWe/FrsTQwezTJTk/r9cKCrRp9Li308v822/5bZm7XKg==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
@@ -1893,6 +1900,22 @@ packages:
|
|||||||
react-dom: 18.2.0(react@18.2.0)
|
react-dom: 18.2.0(react@18.2.0)
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/react-virtualized@9.22.5(react-dom@18.2.0)(react@18.2.0):
|
||||||
|
resolution: {integrity: sha512-YqQMRzlVANBv1L/7r63OHa2b0ZsAaDp1UhVNEdUaXI8A5u6hTpA5NYtUueLH2rFuY/27mTGIBl7ZhqFKzw18YQ==}
|
||||||
|
peerDependencies:
|
||||||
|
react: ^15.3.0 || ^16.0.0-alpha || ^17.0.0 || ^18.0.0
|
||||||
|
react-dom: ^15.3.0 || ^16.0.0-alpha || ^17.0.0 || ^18.0.0
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.22.15
|
||||||
|
clsx: 1.2.1
|
||||||
|
dom-helpers: 5.2.1
|
||||||
|
loose-envify: 1.4.0
|
||||||
|
prop-types: 15.8.1
|
||||||
|
react: 18.2.0
|
||||||
|
react-dom: 18.2.0(react@18.2.0)
|
||||||
|
react-lifecycles-compat: 3.0.4
|
||||||
|
dev: false
|
||||||
|
|
||||||
/react@18.2.0:
|
/react@18.2.0:
|
||||||
resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==}
|
resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
|
|||||||
+6
-3
@@ -78,6 +78,7 @@ import PersonTitlePage from "./routes/person/index.jsx";
|
|||||||
import MusicAlbumTitlePage from "./routes/album/index.jsx";
|
import MusicAlbumTitlePage from "./routes/album/index.jsx";
|
||||||
import AudioPlayer from "./components/playback/audioPlayer/index.jsx";
|
import AudioPlayer from "./components/playback/audioPlayer/index.jsx";
|
||||||
import { useAudioPlayback } from "./utils/store/audioPlayback.js";
|
import { useAudioPlayback } from "./utils/store/audioPlayback.js";
|
||||||
|
import ArtistTitlePage from "./routes/artist/index.jsx";
|
||||||
|
|
||||||
const jellyfin = new Jellyfin({
|
const jellyfin = new Jellyfin({
|
||||||
clientInfo: {
|
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) => [
|
const [backdropUrl, backdropId] = useBackdropStore((state) => [
|
||||||
state.backdropUrl,
|
state.backdropUrl,
|
||||||
@@ -428,7 +431,7 @@ function App() {
|
|||||||
<CssBaseline />
|
<CssBaseline />
|
||||||
<SideMenu />
|
<SideMenu />
|
||||||
<AppBar />
|
<AppBar />
|
||||||
<AudioPlayer />
|
<AudioPlayer key={audioPlayerVisible} />
|
||||||
<Routes key={location.key} location={location}>
|
<Routes key={location.key} location={location}>
|
||||||
<Route element={<AnimationWrapper />}>
|
<Route element={<AnimationWrapper />}>
|
||||||
<Route
|
<Route
|
||||||
@@ -475,7 +478,7 @@ function App() {
|
|||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
path="/artist/:id"
|
path="/artist/:id"
|
||||||
element={<ItemDetail />}
|
element={<ArtistTitlePage />}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ const PlayButton = ({
|
|||||||
buttonProps,
|
buttonProps,
|
||||||
iconOnly,
|
iconOnly,
|
||||||
audio = false,
|
audio = false,
|
||||||
|
size = "large",
|
||||||
}) => {
|
}) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [
|
const [
|
||||||
@@ -94,6 +95,19 @@ const PlayButton = ({
|
|||||||
sortOrder: SortOrder.Ascending,
|
sortOrder: SortOrder.Ascending,
|
||||||
sortBy: "IndexNumber",
|
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 {
|
} else {
|
||||||
result = await getItemsApi(window.api).getItems({
|
result = await getItemsApi(window.api).getItems({
|
||||||
ids: [itemId],
|
ids: [itemId],
|
||||||
@@ -109,6 +123,7 @@ const PlayButton = ({
|
|||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
onSuccess: (item) => {
|
onSuccess: (item) => {
|
||||||
|
console.log(item);
|
||||||
if (audio) {
|
if (audio) {
|
||||||
setAudioTracks(item.Items);
|
setAudioTracks(item.Items);
|
||||||
setAudioUrl(
|
setAudioUrl(
|
||||||
@@ -156,6 +171,7 @@ const PlayButton = ({
|
|||||||
className={className}
|
className={className}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
sx={sx}
|
sx={sx}
|
||||||
|
size={size}
|
||||||
{...buttonProps}
|
{...buttonProps}
|
||||||
>
|
>
|
||||||
<MdiPlayOutline {...iconProps} />
|
<MdiPlayOutline {...iconProps} />
|
||||||
@@ -173,6 +189,7 @@ const PlayButton = ({
|
|||||||
position: "relative",
|
position: "relative",
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
}}
|
}}
|
||||||
|
size={size}
|
||||||
>
|
>
|
||||||
<LinearProgress
|
<LinearProgress
|
||||||
variant="determinate"
|
variant="determinate"
|
||||||
|
|||||||
@@ -1,11 +1,29 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
|
|
||||||
.album {
|
.album {
|
||||||
&-image-icon {
|
&-image {
|
||||||
fill: url(#clr-gradient-default) !important;
|
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 {
|
&-container {
|
||||||
background: $clr-gradient-dark;
|
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 { MdiAlbum } from "../../icons/mdiAlbum";
|
||||||
|
|
||||||
import "./albumArtist.scss";
|
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 }) => {
|
export const ArtistAlbum = ({ user, album, boxProps }) => {
|
||||||
const albumTracks = useQuery({
|
const albumTracks = useQuery({
|
||||||
@@ -37,9 +40,12 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
|||||||
const result = await getItemsApi(window.api).getItems({
|
const result = await getItemsApi(window.api).getItems({
|
||||||
userId: user.Id,
|
userId: user.Id,
|
||||||
parentId: album.Id,
|
parentId: album.Id,
|
||||||
|
sortOrder: SortOrder.Ascending,
|
||||||
|
sortBy: "IndexNumber",
|
||||||
});
|
});
|
||||||
return result.data;
|
return result.data;
|
||||||
},
|
},
|
||||||
|
|
||||||
networkMode: "always",
|
networkMode: "always",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -61,22 +67,43 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
|||||||
|
|
||||||
const [imgLoaded, setImgLoaded] = useState(false);
|
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 (
|
return (
|
||||||
<Box sx={{ mb: 6 }} {...boxProps}>
|
<div style={{ marginBottom: "3em" }} {...boxProps}>
|
||||||
<Stack direction="row" gap={3} mb={3}>
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "row",
|
||||||
|
gap: "1em",
|
||||||
|
marginBottom: "1em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
{!!album.ImageTags?.Primary && (
|
{!!album.ImageTags?.Primary && (
|
||||||
<Box
|
<div className="album-image">
|
||||||
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",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<img
|
<img
|
||||||
src={`${window.api.basePath}/Items/${album.Id}/Images/Primary?fillHeight=532&fillWidth=532&quality=96`}
|
src={`${window.api.basePath}/Items/${album.Id}/Images/Primary?fillHeight=532&fillWidth=532&quality=96`}
|
||||||
style={{
|
style={{
|
||||||
@@ -90,37 +117,24 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
|||||||
}}
|
}}
|
||||||
onLoad={() => setImgLoaded(true)}
|
onLoad={() => setImgLoaded(true)}
|
||||||
/>
|
/>
|
||||||
<Box
|
<div className="album-image-icon-container">
|
||||||
className="album-image-icon-container"
|
|
||||||
sx={{
|
|
||||||
position: "absolute",
|
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
display: "flex",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
zIndex: 1,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<MdiAlbum
|
<MdiAlbum
|
||||||
className="album-image-icon"
|
className="album-image-icon"
|
||||||
sx={{ fontSize: "6em" }}
|
sx={{ fontSize: "6em" }}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</div>
|
||||||
</Box>
|
</div>
|
||||||
)}
|
)}
|
||||||
<Stack>
|
<Stack>
|
||||||
<Typography
|
<Typography
|
||||||
variant="h5"
|
variant="h5"
|
||||||
sx={{ opacity: `0.7`, mb: 1 }}
|
style={{ opacity: `0.6`, mb: 1 }}
|
||||||
>
|
>
|
||||||
{album.ProductionYear}
|
{album.ProductionYear}
|
||||||
</Typography>
|
</Typography>
|
||||||
<MuiLink
|
<MuiLink
|
||||||
component={Link}
|
component={Link}
|
||||||
to={`/item/${album.Id}`}
|
to={`/musicalbum/${album.Id}`}
|
||||||
variant="h3"
|
variant="h3"
|
||||||
color="inherit"
|
color="inherit"
|
||||||
underline="hover"
|
underline="hover"
|
||||||
@@ -128,110 +142,135 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
|
|||||||
{album.Name}
|
{album.Name}
|
||||||
</MuiLink>
|
</MuiLink>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</div>
|
||||||
|
|
||||||
<TableContainer
|
{albumTracks.isSuccess && (
|
||||||
component={Paper}
|
<Paper
|
||||||
sx={{ mb: 2, borderRadius: "15px" }}
|
className="item-detail-album-tracks"
|
||||||
>
|
style={{
|
||||||
<Table>
|
marginBottom: "1.2em",
|
||||||
<TableHead
|
}}
|
||||||
sx={{
|
>
|
||||||
mb: 1,
|
<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>
|
<Typography
|
||||||
<TableCell
|
variant="h6"
|
||||||
sx={{
|
fontWeight={400}
|
||||||
maxWidth: 120,
|
style={{
|
||||||
width: 20,
|
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>
|
<Typography
|
||||||
</TableCell>
|
variant="subtitle1"
|
||||||
<TableCell sx={{ width: 20 }}></TableCell>
|
style={{
|
||||||
<TableCell>
|
justifySelf: "end",
|
||||||
<Typography variant="h6">
|
}}
|
||||||
Name
|
>
|
||||||
|
{!!track.IndexNumber
|
||||||
|
? track.IndexNumber
|
||||||
|
: "-"}
|
||||||
</Typography>
|
</Typography>
|
||||||
</TableCell>
|
|
||||||
<TableCell>
|
<LikeButton
|
||||||
<Typography variant="h6" align="right">
|
itemId={track.Id}
|
||||||
<MdiClockOutline />
|
isFavorite={
|
||||||
</Typography>
|
track.UserData?.IsFavorite
|
||||||
</TableCell>
|
}
|
||||||
</TableRow>
|
queryKey={[
|
||||||
</TableHead>
|
"artist",
|
||||||
<TableBody>
|
"album",
|
||||||
{albumTracks.isSuccess &&
|
album.Id,
|
||||||
albumTracks.data.Items.map(
|
]}
|
||||||
(mitem, mindex) => {
|
userId={user.Id}
|
||||||
return (
|
itemName={track.Name}
|
||||||
<TableRow
|
color={
|
||||||
key={mindex}
|
currentTrackItem.Id ==
|
||||||
sx={{
|
track.Id &&
|
||||||
"&:last-child td, &:last-child th":
|
currentTrackItem.ParentId ==
|
||||||
{
|
track.ParentId
|
||||||
border: 0,
|
? "hsl(337, 96%, 56%)"
|
||||||
},
|
: "white"
|
||||||
"&:hover": {
|
}
|
||||||
background:
|
/>
|
||||||
"rgb(255 255 255 / 0.05)",
|
|
||||||
},
|
<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
|
{track.ArtistItems.map(
|
||||||
sx={{
|
(artist) =>
|
||||||
maxWidth: 120,
|
artist.Name,
|
||||||
width: 20,
|
).join(", ")}
|
||||||
}}
|
</Typography>
|
||||||
>
|
)}
|
||||||
<Typography variant="body1">
|
</div>
|
||||||
{
|
<Typography variant="subtitle1">
|
||||||
mitem.IndexNumber
|
{getRuntimeMusic(
|
||||||
}
|
track.RunTimeTicks,
|
||||||
</Typography>
|
)}
|
||||||
</TableCell>
|
</Typography>
|
||||||
<TableCell
|
</div>
|
||||||
sx={{
|
);
|
||||||
width: 20,
|
})}
|
||||||
}}
|
</Paper>
|
||||||
align="center"
|
)}
|
||||||
>
|
</div>
|
||||||
<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>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -84,6 +84,7 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
|||||||
]}
|
]}
|
||||||
userId={user.data.Id}
|
userId={user.data.Id}
|
||||||
imageBlurhash={
|
imageBlurhash={
|
||||||
|
!!item.ImageBlurHashes?.Primary &&
|
||||||
item.ImageBlurHashes?.Primary[
|
item.ImageBlurHashes?.Primary[
|
||||||
Object.keys(
|
Object.keys(
|
||||||
item.ImageBlurHashes.Primary,
|
item.ImageBlurHashes.Primary,
|
||||||
|
|||||||
@@ -205,15 +205,19 @@ const Hero = ({
|
|||||||
)}
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
{!!albumBy && (
|
{!!albumBy && (
|
||||||
<Typography
|
<TextLink
|
||||||
|
text={`By ${albumBy.Name}`}
|
||||||
variant="h6"
|
variant="h6"
|
||||||
fontWeight={400}
|
location={`/artist/${albumBy.Id}`}
|
||||||
style={{
|
otherProps={{
|
||||||
opacity: 0.8,
|
fontWeight: 400,
|
||||||
|
style: {
|
||||||
|
opacity: 0.8,
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
By {albumBy}
|
By {albumBy}
|
||||||
</Typography>
|
</TextLink>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{!disableInfoStrip && (
|
{!disableInfoStrip && (
|
||||||
@@ -550,22 +554,21 @@ const Hero = ({
|
|||||||
{writers.map((writer, index) => (
|
{writers.map((writer, index) => (
|
||||||
<>
|
<>
|
||||||
<TextLink
|
<TextLink
|
||||||
text={
|
text={writer.Name}
|
||||||
index ==
|
|
||||||
writers.length
|
|
||||||
? writer.Name
|
|
||||||
: `${writer.Name}`
|
|
||||||
}
|
|
||||||
variant={"subtitle1"}
|
variant={"subtitle1"}
|
||||||
location={`/person/${writer.Id}`}
|
location={`/person/${writer.Id}`}
|
||||||
/>
|
/>
|
||||||
<span
|
{index !=
|
||||||
style={{
|
writers.length - 1 && (
|
||||||
whiteSpace: "pre",
|
<span
|
||||||
}}
|
style={{
|
||||||
>
|
whiteSpace:
|
||||||
,{" "}
|
"pre",
|
||||||
</span>
|
}}
|
||||||
|
>
|
||||||
|
,{" "}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -595,13 +598,17 @@ const Hero = ({
|
|||||||
variant={"subtitle1"}
|
variant={"subtitle1"}
|
||||||
location={`/person/${director.Id}`}
|
location={`/person/${director.Id}`}
|
||||||
/>
|
/>
|
||||||
<span
|
{index !=
|
||||||
style={{
|
directors.length - 1 && (
|
||||||
whiteSpace: "pre",
|
<span
|
||||||
}}
|
style={{
|
||||||
>
|
whiteSpace:
|
||||||
,{" "}
|
"pre",
|
||||||
</span>
|
}}
|
||||||
|
>
|
||||||
|
,{" "}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -623,11 +630,28 @@ const Hero = ({
|
|||||||
>
|
>
|
||||||
Artists
|
Artists
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="subtitle1">
|
<div className="hero-text-container">
|
||||||
{artists
|
{artists.map((artist, index) => (
|
||||||
.map((artist) => artist.Name)
|
<>
|
||||||
.join(", ")}
|
<TextLink
|
||||||
</Typography>
|
text={artist.Name}
|
||||||
|
variant={"subtitle1"}
|
||||||
|
location={`/artist/${artist.Id}`}
|
||||||
|
/>
|
||||||
|
{index !=
|
||||||
|
artists.length - 1 && (
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
whiteSpace:
|
||||||
|
"pre",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
,{" "}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{studios.length > 0 && (
|
{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 {
|
.audio-player {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
|
||||||
right: 0;
|
right: 0;
|
||||||
background: $clr-background-dark-opacity-0_8;
|
background: $clr-background-dark-opacity-0_8;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { motion } from "framer-motion";
|
|||||||
import Fab from "@mui/material/Fab";
|
import Fab from "@mui/material/Fab";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
|
import CircularProgress from "@mui/material/CircularProgress";
|
||||||
|
|
||||||
import WaveSurfer from "wavesurfer.js";
|
import WaveSurfer from "wavesurfer.js";
|
||||||
|
|
||||||
@@ -21,10 +22,11 @@ import { MdiSkipNext } from "../../icons/mdiSkipNext";
|
|||||||
import { MdiSkipPrevious } from "../../icons/mdiSkipPrevious";
|
import { MdiSkipPrevious } from "../../icons/mdiSkipPrevious";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { Icon } from "@mui/material";
|
|
||||||
import { MdiClose } from "../../icons/mdiClose";
|
import { MdiClose } from "../../icons/mdiClose";
|
||||||
import { MdiMusic } from "../../icons/mdiMusic";
|
import { MdiMusic } from "../../icons/mdiMusic";
|
||||||
|
|
||||||
|
import { theme } from "../../../theme";
|
||||||
|
|
||||||
const AudioPlayer = () => {
|
const AudioPlayer = () => {
|
||||||
const user = useQuery({
|
const user = useQuery({
|
||||||
queryKey: ["user"],
|
queryKey: ["user"],
|
||||||
@@ -37,7 +39,10 @@ const AudioPlayer = () => {
|
|||||||
|
|
||||||
const waveSurferRef = useRef(null);
|
const waveSurferRef = useRef(null);
|
||||||
const waveSurferContainerRef = 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);
|
const [showWaveform, setShowWaveform] = useState(false);
|
||||||
|
|
||||||
@@ -73,17 +78,22 @@ const AudioPlayer = () => {
|
|||||||
if (display) {
|
if (display) {
|
||||||
const waveSurfer = WaveSurfer.create({
|
const waveSurfer = WaveSurfer.create({
|
||||||
container: waveSurferContainerRef.current,
|
container: waveSurferContainerRef.current,
|
||||||
autoplay: true,
|
|
||||||
barHeight: 0.8,
|
barHeight: 0.8,
|
||||||
dragToSeek: true,
|
dragToSeek: true,
|
||||||
height: 35,
|
height: 35,
|
||||||
cursorColor: "#fb2376",
|
cursorColor: "#fb2376",
|
||||||
progressColor: "#fb2376",
|
progressColor: "#fb2376",
|
||||||
|
waveColor: "#ffffff2f",
|
||||||
normalize: true,
|
normalize: true,
|
||||||
});
|
});
|
||||||
waveSurfer.load(url);
|
waveSurfer.load(url);
|
||||||
|
waveSurfer.on("load", () => {
|
||||||
|
setLoading(true);
|
||||||
|
});
|
||||||
waveSurfer.on("ready", () => {
|
waveSurfer.on("ready", () => {
|
||||||
waveSurferRef.current = waveSurfer;
|
waveSurferRef.current = waveSurfer;
|
||||||
|
waveSurfer.play();
|
||||||
|
setLoading(false);
|
||||||
});
|
});
|
||||||
waveSurfer.on("timeupdate", (e) => {
|
waveSurfer.on("timeupdate", (e) => {
|
||||||
setCurrentTime(e);
|
setCurrentTime(e);
|
||||||
@@ -114,18 +124,27 @@ const AudioPlayer = () => {
|
|||||||
setShowWaveform(false);
|
setShowWaveform(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
waveSurfer.on("destroy", () => {
|
||||||
|
waveSurfer.unAll();
|
||||||
|
setLoading(true);
|
||||||
|
});
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
waveSurfer.destroy();
|
waveSurfer.destroy();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}, [url]);
|
}, [url, display, currentTrack]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (playerReady) waveSurferRef.current.play();
|
||||||
|
}, [playerReady]);
|
||||||
|
|
||||||
const handlePlayPause = () => {
|
const handlePlayPause = () => {
|
||||||
waveSurferRef.current.playPause();
|
waveSurferRef.current.playPause();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleNext = () => {
|
const handleNext = () => {
|
||||||
|
setPlaying(false);
|
||||||
setCurrentTrack(currentTrack + 1);
|
setCurrentTrack(currentTrack + 1);
|
||||||
setAudioUrl(
|
setAudioUrl(
|
||||||
`${window.api.basePath}/Audio/${
|
`${window.api.basePath}/Audio/${
|
||||||
@@ -139,6 +158,7 @@ const AudioPlayer = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handlePrevious = () => {
|
const handlePrevious = () => {
|
||||||
|
setPlaying(false);
|
||||||
setCurrentTrack(currentTrack - 1);
|
setCurrentTrack(currentTrack - 1);
|
||||||
setAudioUrl(
|
setAudioUrl(
|
||||||
`${window.api.basePath}/Audio/${
|
`${window.api.basePath}/Audio/${
|
||||||
@@ -159,6 +179,14 @@ const AudioPlayer = () => {
|
|||||||
transform: "translateY(100%)",
|
transform: "translateY(100%)",
|
||||||
}}
|
}}
|
||||||
animate={{ transform: "translateY(0)" }}
|
animate={{ transform: "translateY(0)" }}
|
||||||
|
exit={{
|
||||||
|
transform: "translateY(100%)",
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
width: `calc(100vw - ${theme.spacing(
|
||||||
|
13,
|
||||||
|
)} - 10px)`,
|
||||||
|
}}
|
||||||
className="audio-player"
|
className="audio-player"
|
||||||
>
|
>
|
||||||
<motion.div
|
<motion.div
|
||||||
@@ -178,7 +206,10 @@ const AudioPlayer = () => {
|
|||||||
<img
|
<img
|
||||||
className="audio-player-image"
|
className="audio-player-image"
|
||||||
src={window.api.getItemImageUrl(
|
src={window.api.getItemImageUrl(
|
||||||
item.Id,
|
Object.keys(item.ImageTags)
|
||||||
|
.length == 0
|
||||||
|
? item.AlbumId
|
||||||
|
: item.Id,
|
||||||
"Primary",
|
"Primary",
|
||||||
{
|
{
|
||||||
quality: 85,
|
quality: 85,
|
||||||
@@ -197,7 +228,9 @@ const AudioPlayer = () => {
|
|||||||
}}
|
}}
|
||||||
fontWeight={500}
|
fontWeight={500}
|
||||||
>
|
>
|
||||||
{item.IndexNumber}. {item.Name}
|
{!!item.IndexNumber
|
||||||
|
? `${item.IndexNumber}. ${item.Name}`
|
||||||
|
: item.Name}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
variant="subtitle2"
|
variant="subtitle2"
|
||||||
@@ -222,9 +255,34 @@ const AudioPlayer = () => {
|
|||||||
>
|
>
|
||||||
<MdiSkipPrevious />
|
<MdiSkipPrevious />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Fab size="small" onClick={handlePlayPause}>
|
<div
|
||||||
{playing ? <MdiPause /> : <MdiPlay />}
|
style={{
|
||||||
</Fab>
|
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
|
<IconButton
|
||||||
onClick={handleNext}
|
onClick={handleNext}
|
||||||
disabled={
|
disabled={
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useNavigate } from "react-router-dom";
|
|||||||
|
|
||||||
import "./textLink.module.scss";
|
import "./textLink.module.scss";
|
||||||
|
|
||||||
const TextLink = ({ text, location, variant }) => {
|
const TextLink = ({ text, location, variant, otherProps }) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -13,6 +13,7 @@ const TextLink = ({ text, location, variant }) => {
|
|||||||
variant={variant}
|
variant={variant}
|
||||||
className="link"
|
className="link"
|
||||||
onClick={() => navigate(location)}
|
onClick={() => navigate(location)}
|
||||||
|
{...otherProps}
|
||||||
>
|
>
|
||||||
{text}
|
{text}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -122,29 +122,19 @@ const MusicAlbumTitlePage = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [
|
const [
|
||||||
url,
|
|
||||||
display,
|
|
||||||
currentTrackItem,
|
currentTrackItem,
|
||||||
tracks,
|
|
||||||
currentTrack,
|
|
||||||
setCurrentAudioTrack,
|
setCurrentAudioTrack,
|
||||||
setAudioUrl,
|
setAudioUrl,
|
||||||
setAudioDisplay,
|
setAudioDisplay,
|
||||||
setAudioItem,
|
setAudioItem,
|
||||||
setAudioTracks,
|
setAudioTracks,
|
||||||
resetPlayer,
|
|
||||||
] = useAudioPlayback((state) => [
|
] = useAudioPlayback((state) => [
|
||||||
state.url,
|
|
||||||
state.display,
|
|
||||||
state.item,
|
state.item,
|
||||||
state.tracks,
|
|
||||||
state.currentTrack,
|
|
||||||
state.setCurrentTrack,
|
state.setCurrentTrack,
|
||||||
state.setUrl,
|
state.setUrl,
|
||||||
state.setDisplay,
|
state.setDisplay,
|
||||||
state.setItem,
|
state.setItem,
|
||||||
state.setTracks,
|
state.setTracks,
|
||||||
state.reset,
|
|
||||||
]);
|
]);
|
||||||
const playTrack = (index) => {
|
const playTrack = (index) => {
|
||||||
setAudioTracks(musicTracks.data.Items);
|
setAudioTracks(musicTracks.data.Items);
|
||||||
@@ -201,7 +191,7 @@ const MusicAlbumTitlePage = () => {
|
|||||||
userId={user.data.Id}
|
userId={user.data.Id}
|
||||||
queryKey={["item", id]}
|
queryKey={["item", id]}
|
||||||
artists={item.data.ArtistItems}
|
artists={item.data.ArtistItems}
|
||||||
albumBy={item.data.AlbumArtist}
|
albumBy={item.data.AlbumArtists[0]}
|
||||||
disableMarkAsPlayedButton
|
disableMarkAsPlayedButton
|
||||||
audioPlayButton
|
audioPlayButton
|
||||||
/>
|
/>
|
||||||
@@ -274,7 +264,9 @@ const MusicAlbumTitlePage = () => {
|
|||||||
"end",
|
"end",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{track.IndexNumber}
|
{!!track.IndexNumber
|
||||||
|
? track.IndexNumber
|
||||||
|
: "-"}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<LikeButton
|
<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 Box from "@mui/material/Box";
|
||||||
import CircularProgress from "@mui/material/CircularProgress";
|
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 Divider from "@mui/material/Divider";
|
||||||
import LinearProgress from "@mui/material/LinearProgress";
|
|
||||||
import Tabs from "@mui/material/Tabs";
|
import Tabs from "@mui/material/Tabs";
|
||||||
import Tab from "@mui/material/Tab";
|
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 { AnimatePresence, motion } from "framer-motion";
|
||||||
|
|
||||||
import { Blurhash } from "react-blurhash";
|
import { useParams } from "react-router-dom";
|
||||||
import { useParams, useNavigate, Link as RouterLink } from "react-router-dom";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BaseItemKind,
|
BaseItemKind,
|
||||||
ItemFields,
|
ItemFields,
|
||||||
LocationType,
|
LocationType,
|
||||||
MediaStreamType,
|
|
||||||
SortOrder,
|
|
||||||
} from "@jellyfin/sdk/lib/generated-client";
|
} from "@jellyfin/sdk/lib/generated-client";
|
||||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||||
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-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 { 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 { 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 Hero from "../../components/layouts/item/hero";
|
||||||
import { Card } from "../../components/card/card";
|
import { Card } from "../../components/card/card";
|
||||||
import { EpisodeCard } from "../../components/card/episodeCard";
|
|
||||||
import { CardScroller } from "../../components/cardScroller/cardScroller";
|
|
||||||
|
|
||||||
import "./person.module.scss";
|
import "./person.module.scss";
|
||||||
import { EpisodeCardsSkeleton } from "../../components/skeleton/episodeCards";
|
|
||||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
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 { useBackdropStore } from "../../utils/store/backdrop";
|
||||||
import { ActorCard } from "../../components/card/actorCards";
|
|
||||||
|
|
||||||
function TabPanel(props) {
|
function TabPanel(props) {
|
||||||
const { children, value, index, ...other } = props;
|
const { children, value, index, ...other } = props;
|
||||||
|
|||||||
Reference in new issue
Block a user