feat: add new album page
This commit is contained in:
13 files changed
+413
-354
No files matched your search
Vendored
+3
-2
@@ -2,8 +2,9 @@
|
||||
"recommendations": [
|
||||
"biomejs.biome",
|
||||
"github.vscode-github-actions",
|
||||
"esbenp.prettier-vscode",
|
||||
"swellaby.rust-pack",
|
||||
"1yib.rust-bundle"
|
||||
"1yib.rust-bundle",
|
||||
"sibiraj-s.vscode-scss-formatter",
|
||||
"tauri-apps.tauri-vscode"
|
||||
]
|
||||
}
|
||||
+2
-1
@@ -30,7 +30,8 @@
|
||||
"src/**/*.tsx",
|
||||
"src/**/*.jsx",
|
||||
"src/**/*.js",
|
||||
"*.json"
|
||||
"*.json",
|
||||
"*.scss"
|
||||
],
|
||||
"ignoreUnknown": true
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export const AppBar = () => {
|
||||
const usr = await getUserApi(api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
enabled: display && Boolean(api.accessToken),
|
||||
enabled: display && Boolean(api?.accessToken),
|
||||
throwOnError: true,
|
||||
});
|
||||
const libraries = useQuery({
|
||||
|
||||
@@ -400,7 +400,7 @@ const PlayButton = ({
|
||||
color="white"
|
||||
size={size}
|
||||
>
|
||||
{itemUserData.PlaybackPositionTicks
|
||||
{itemUserData?.PlaybackPositionTicks
|
||||
? "Continue Watching"
|
||||
: item?.Type === "MusicAlbum" ||
|
||||
item?.Type === "Audio" ||
|
||||
@@ -412,8 +412,8 @@ const PlayButton = ({
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={
|
||||
100 > itemUserData.PlayedPercentage > 0
|
||||
? itemUserData.PlayedPercentage
|
||||
100 > itemUserData?.PlayedPercentage > 0
|
||||
? itemUserData?.PlayedPercentage
|
||||
: 0
|
||||
}
|
||||
sx={{
|
||||
@@ -431,7 +431,7 @@ const PlayButton = ({
|
||||
color="white"
|
||||
/>
|
||||
</Button>
|
||||
{itemUserData.PlaybackPositionTicks > 0 && (
|
||||
{itemUserData?.PlaybackPositionTicks > 0 && (
|
||||
<Typography
|
||||
sx={{
|
||||
opacity: 0.8,
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Typography } from "@mui/material";
|
||||
import { Link, type LinkProps } from "@tanstack/react-router";
|
||||
import React from "react";
|
||||
|
||||
import "./tagChip.scss";
|
||||
|
||||
const TagChip = ({
|
||||
label,
|
||||
linkProps,
|
||||
}: { label: string; linkProps: LinkProps }) => {
|
||||
return (
|
||||
<Link className="tag" {...linkProps}>
|
||||
<Typography variant="subtitle2" fontWeight={300}>
|
||||
{label}
|
||||
</Typography>
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
||||
export default TagChip;
|
||||
@@ -0,0 +1,19 @@
|
||||
.tag {
|
||||
display: flex;
|
||||
padding: 0.4em 0.8em;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
gap: 0.2em;
|
||||
border: 1px solid rgb(255 255 255 / 0.3);
|
||||
border-radius: 4em;
|
||||
.MuiTypography-root {
|
||||
white-space: nowrap;
|
||||
transition: $transition-time-fast;
|
||||
}
|
||||
&:hover {
|
||||
border-color: rgb(255 255 255 / 0.8) !important;
|
||||
.MuiTypography-root {
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import React from "react";
|
||||
|
||||
export const getTypeIcon = (icon) => {
|
||||
export const getTypeIcon = (icon: BaseItemKind) => {
|
||||
switch (icon) {
|
||||
case "Home":
|
||||
return <div className="material-symbols-rounded">home</div>;
|
||||
+6
-3
@@ -47,13 +47,16 @@ export const Route = createFileRoute("/_api")({
|
||||
},
|
||||
});
|
||||
}
|
||||
return { api: apiTemp };
|
||||
// return { api: apiTemp };
|
||||
}
|
||||
context.createApi(currentServer?.address, userOnDisk.AccessToken);
|
||||
} else {
|
||||
const apiTemp = context.jellyfinSDK.createApi(currentServer?.address, null);
|
||||
const apiTemp = context.jellyfinSDK.createApi(
|
||||
currentServer?.address,
|
||||
null,
|
||||
);
|
||||
context.createApi(currentServer?.address, undefined); // Creates Api
|
||||
return { api: apiTemp };
|
||||
// return { api: apiTemp };
|
||||
}
|
||||
}
|
||||
} else if (context.api) {
|
||||
|
||||
+174
-269
@@ -11,7 +11,11 @@ import Typography from "@mui/material/Typography";
|
||||
import useParallax from "@/utils/hooks/useParallax";
|
||||
import { motion, useScroll } from "framer-motion";
|
||||
|
||||
import { BaseItemKind, SortOrder } from "@jellyfin/sdk/lib/generated-client";
|
||||
import {
|
||||
type BaseItemDto,
|
||||
BaseItemKind,
|
||||
SortOrder,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
|
||||
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
|
||||
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
|
||||
@@ -21,7 +25,11 @@ import { Blurhash } from "react-blurhash";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { getRuntime } from "@/utils/date/time";
|
||||
import {
|
||||
getRuntime,
|
||||
getRuntimeCompact,
|
||||
getRuntimeMusic,
|
||||
} from "@/utils/date/time";
|
||||
|
||||
import { Card } from "@/components/card/card";
|
||||
import { CardScroller } from "@/components/cardScroller/cardScroller";
|
||||
@@ -33,11 +41,16 @@ import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
|
||||
import ShowMoreText from "@/components/showMoreText";
|
||||
|
||||
import { getTypeIcon } from "@/components/utils/iconsCollection";
|
||||
import { useAudioPlayback } from "@/utils/store/audioPlayback";
|
||||
import {
|
||||
generateAudioStreamUrl,
|
||||
playAudio,
|
||||
useAudioPlayback,
|
||||
} from "@/utils/store/audioPlayback";
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import "./album.scss";
|
||||
|
||||
import IconLink from "@/components/iconLink";
|
||||
import TagChip from "@/components/tagChip";
|
||||
import { Link, createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
function TabPanel(props) {
|
||||
@@ -118,7 +131,7 @@ function MusicAlbumTitlePage() {
|
||||
});
|
||||
|
||||
const musicTracks = useQuery({
|
||||
queryKey: ["item", id, "musicTracks"],
|
||||
queryKey: ["item", "musicTracks", id],
|
||||
queryFn: async () => {
|
||||
const result = await getItemsApi(api).getItems({
|
||||
userId: user.data?.Id,
|
||||
@@ -132,31 +145,6 @@ function MusicAlbumTitlePage() {
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
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(musicTracks.data.Items);
|
||||
setCurrentAudioTrack(index);
|
||||
setAudioUrl(
|
||||
`${api.basePath}/Audio/${musicTracks.data.Items[index].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${user.data.Id}&api_key=${api.accessToken}`,
|
||||
);
|
||||
setAudioItem(musicTracks.data.Items[index]);
|
||||
setAudioDisplay(true);
|
||||
};
|
||||
|
||||
const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
@@ -175,6 +163,22 @@ function MusicAlbumTitlePage() {
|
||||
});
|
||||
const parallax = useParallax(scrollYProgress, 50);
|
||||
|
||||
const handlePlayback = (
|
||||
index: number,
|
||||
item: BaseItemDto,
|
||||
queue: BaseItemDto[],
|
||||
) => {
|
||||
const url = generateAudioStreamUrl(
|
||||
item.Id,
|
||||
user.data?.Id,
|
||||
api.deviceInfo.id,
|
||||
api.basePath,
|
||||
);
|
||||
playAudio(url, item, undefined, queue, index);
|
||||
};
|
||||
|
||||
const currentPlayingItem = useAudioPlayback((s) => s.item);
|
||||
|
||||
if (item.isPending || similarItems.isPending) {
|
||||
return (
|
||||
<Box
|
||||
@@ -192,266 +196,167 @@ function MusicAlbumTitlePage() {
|
||||
}
|
||||
if (item.isSuccess && similarItems.isSuccess) {
|
||||
return (
|
||||
<motion.div
|
||||
<div
|
||||
key={id}
|
||||
initial={{
|
||||
opacity: 0,
|
||||
}}
|
||||
animate={{
|
||||
opacity: 1,
|
||||
}}
|
||||
transition={{
|
||||
duration: 0.25,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
className="scrollY padded-top item item-album"
|
||||
ref={pageRef}
|
||||
>
|
||||
<div className="item-hero flex flex-row">
|
||||
<div className="item-hero-backdrop-container">
|
||||
{item.data.ParentBackdropImageTags?.length ? (
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(
|
||||
item.data.ParentBackdropItemId,
|
||||
"Backdrop",
|
||||
{
|
||||
tag: item.data.ParentBackdropImageTags[0],
|
||||
},
|
||||
)}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
<div className="item-info">
|
||||
<Typography className="item-info-name" variant="h3">
|
||||
{item.data.Name}
|
||||
</Typography>
|
||||
<div className="flex flex-align-center item-info-album-info">
|
||||
<div className="flex flex-align-center">
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
y: parallax,
|
||||
opacity: 0.7,
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<motion.img
|
||||
alt={item.data.Name}
|
||||
src={heroBg}
|
||||
className="item-hero-backdrop"
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
style={{
|
||||
y: parallax,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
>
|
||||
artist
|
||||
</span>
|
||||
<Typography ml={1}>{item.data.AlbumArtist}</Typography>
|
||||
</div>
|
||||
<Typography className="opacity-07">
|
||||
{item.data.ProductionYear}
|
||||
</Typography>
|
||||
<Typography className="opacity-07">
|
||||
{musicTracks.data?.TotalRecordCount > 1
|
||||
? `${musicTracks.data?.TotalRecordCount} songs`
|
||||
: `1 song`}
|
||||
</Typography>
|
||||
<Typography className="opacity-07">
|
||||
{getRuntimeCompact(item.data.CumulativeRunTimeTicks)}
|
||||
</Typography>
|
||||
</div>
|
||||
<div
|
||||
className="item-hero-image-container"
|
||||
style={{
|
||||
aspectRatio: item.data.PrimaryImageAspectRatio ?? 1,
|
||||
}}
|
||||
>
|
||||
{Object.keys(item.data.ImageTags).includes("Primary") ? (
|
||||
<>
|
||||
<Blurhash
|
||||
hash={
|
||||
item.data.ImageBlurHashes.Primary[
|
||||
item.data.ImageTags.Primary
|
||||
]
|
||||
}
|
||||
className="item-hero-image-blurhash"
|
||||
/>
|
||||
<img
|
||||
alt={item.data.Name}
|
||||
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||
quality: 90,
|
||||
tag: item.data.ImageTags.Primary,
|
||||
})}
|
||||
onLoad={(e) => {
|
||||
e.currentTarget.style.opacity = 1;
|
||||
}}
|
||||
className="item-hero-image"
|
||||
/>
|
||||
</>
|
||||
<div className="item-info-buttons">
|
||||
<PlayButton
|
||||
item={item}
|
||||
audio
|
||||
itemType={item.data.Type}
|
||||
userId={user.data?.Id}
|
||||
/>
|
||||
<LikeButton
|
||||
itemId={item.data.Id}
|
||||
isFavorite={item.data.UserData?.IsFavorite}
|
||||
queryKey={["item", "musicTracks"]}
|
||||
userId={user.data?.Id}
|
||||
itemName={item.data.Name}
|
||||
/>
|
||||
</div>
|
||||
<div className="item-info-track-container">
|
||||
<div className="item-info-track header">
|
||||
<span className="material-symbols-rounded index">tag</span>
|
||||
<Typography variant="subtitle1">Title</Typography>
|
||||
<Typography variant="subtitle1">Duration</Typography>
|
||||
</div>
|
||||
{musicTracks.data?.Items?.map((track) => (
|
||||
<div
|
||||
className={
|
||||
currentPlayingItem?.Id === track.Id
|
||||
? "item-info-track playing"
|
||||
: "item-info-track"
|
||||
}
|
||||
key={track.Id}
|
||||
onClick={() =>
|
||||
handlePlayback(
|
||||
track.IndexNumber,
|
||||
track,
|
||||
musicTracks.data.Items,
|
||||
)
|
||||
}
|
||||
>
|
||||
<div className="index-container">
|
||||
<span className="material-symbols-rounded fill ">
|
||||
play_arrow
|
||||
</span>
|
||||
<Typography className="index">
|
||||
{track.IndexNumber ?? "-"}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="item-info-track-info">
|
||||
<Typography className="item-info-track-info-name">
|
||||
{track.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.6,
|
||||
}}
|
||||
fontWeight={300}
|
||||
>
|
||||
{track.Artists?.join(", ")}
|
||||
</Typography>
|
||||
</div>
|
||||
<Typography>{getRuntimeMusic(track.RunTimeTicks)}</Typography>
|
||||
<div className="flex flex-align-center">
|
||||
<LikeButton
|
||||
itemId={track.Id}
|
||||
isFavorite={track.UserData?.IsFavorite}
|
||||
queryKey={["item", "musicTracks"]}
|
||||
userId={user.data?.Id}
|
||||
itemName={track.Name}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="item-info-sidebar">
|
||||
<div className="item-info-sidebar-image-container">
|
||||
{item.data.ImageTags?.Primary ? (
|
||||
<img
|
||||
className="item-info-sidebar-image"
|
||||
alt={item.data.Name ?? "Album"}
|
||||
src={api.getItemImageUrl(item.data.Id, "Primary", {
|
||||
tag: item.data.ImageTags.Primary,
|
||||
quality: 90,
|
||||
})}
|
||||
/>
|
||||
) : (
|
||||
<div className="item-hero-image-icon">
|
||||
{getTypeIcon(item.data.Type)}
|
||||
<div className="item-info-sidebar-icon">
|
||||
{getTypeIcon("MusicAlbum")}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="item-hero-detail flex flex-column">
|
||||
<Typography variant="h2" fontWeight={200} mb={2}>
|
||||
{item.data.Name}
|
||||
</Typography>
|
||||
|
||||
<Stack
|
||||
direction="row"
|
||||
gap={2}
|
||||
justifyItems="flex-start"
|
||||
alignItems="center"
|
||||
>
|
||||
<Chip
|
||||
size="small"
|
||||
label={item.data.AlbumArtist}
|
||||
icon={
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
padding: "0.2em",
|
||||
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
artist
|
||||
</span>
|
||||
}
|
||||
/>
|
||||
{item.data.PremiereDate && (
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle2">
|
||||
{item.data.ProductionYear ?? ""}
|
||||
</Typography>
|
||||
)}
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle2">
|
||||
{item.data.ChildCount > 1
|
||||
? `${item.data.ChildCount} Tracks`
|
||||
: `${item.data.ChildCount} Track`}
|
||||
</Typography>
|
||||
{item.data.RunTimeTicks && (
|
||||
<Typography style={{ opacity: "0.8" }} variant="subtitle2">
|
||||
{getRuntime(item.data.RunTimeTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
<Typography variant="subtitle2" style={{ opacity: 0.8 }}>
|
||||
{item.data.Genres?.slice(0, 4).join(" / ")}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</div>
|
||||
|
||||
<div className="item-hero-buttons-container">
|
||||
<div className="flex flex-row fullWidth">
|
||||
<PlayButton
|
||||
audio
|
||||
item={item.data}
|
||||
itemId={item.data.Id}
|
||||
itemType={item.data.Type}
|
||||
itemUserData={item.data.UserData}
|
||||
userId={user.data.Id}
|
||||
buttonProps={{
|
||||
fullWidth: true,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row" style={{ gap: "1em" }}>
|
||||
<LikeButton
|
||||
itemName={item.data.Name}
|
||||
itemId={item.data.Id}
|
||||
queryKey={["item", id]}
|
||||
isFavorite={item.data.UserData.IsFavorite}
|
||||
userId={user.data.Id}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className="item-detail"
|
||||
style={{
|
||||
marginBottom: "1em",
|
||||
}}
|
||||
>
|
||||
<div style={{ width: "100%" }}>
|
||||
<ShowMoreText
|
||||
content={item.data.Overview ?? ""}
|
||||
collapsedLines={4}
|
||||
/>
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: "0.6em",
|
||||
alignSelf: "start",
|
||||
marginTop: "0.2em",
|
||||
}}
|
||||
>
|
||||
{item.data.ExternalUrls.map((url) => (
|
||||
<IconLink url={url.Url} name={url.Name} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
}}
|
||||
className="flex flex-align-center"
|
||||
style={{ gap: "1em", flexWrap: "wrap" }}
|
||||
>
|
||||
<div className="item-detail-cast">
|
||||
{item.data.ArtistItems.length > 0 && (
|
||||
<div className="item-detail-cast-container">
|
||||
<Typography variant="h6" className="item-detail-cast-title">
|
||||
Artists
|
||||
</Typography>
|
||||
<div className="item-detail-cast-grid">
|
||||
{item.data.ArtistItems.map((artist) => (
|
||||
<Link
|
||||
className="item-detail-cast-card"
|
||||
key={artist.Id}
|
||||
to="/artist/$id"
|
||||
params={{
|
||||
id: artist.Id,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
width: "5em",
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
<img
|
||||
alt={artist.Name}
|
||||
src={api.getItemImageUrl(artist.Id, "Primary", {
|
||||
quality: 80,
|
||||
fillWidth: 200,
|
||||
fillHeight: 200,
|
||||
})}
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
}}
|
||||
className="item-detail-cast-card-image"
|
||||
/>
|
||||
|
||||
<div className="item-detail-cast-card-icon">
|
||||
{getTypeIcon("Person")}
|
||||
</div>
|
||||
</div>
|
||||
<div className="item-detail-cast-card-text">
|
||||
<Typography variant="subtitle1">
|
||||
{artist.Name}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
style={{
|
||||
opacity: 0.5,
|
||||
}}
|
||||
>
|
||||
{artist.Role}
|
||||
</Typography>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
{item.data.GenreItems?.map((genre) => (
|
||||
<TagChip label={genre.Name} key={genre.Id} />
|
||||
))}
|
||||
</div>
|
||||
<div className="flex flex-column item-info-sidebar-artist-container">
|
||||
{item.data.ArtistItems?.map((artist) => (
|
||||
<Link
|
||||
to="/artist/$id"
|
||||
params={{ id: artist.Id }}
|
||||
className="item-info-sidebar-artist"
|
||||
key={artist.Id}
|
||||
>
|
||||
<div className="item-info-sidebar-artist-image-container">
|
||||
<img
|
||||
className="item-info-sidebar-artist-image"
|
||||
alt={artist.Name ?? "Artist"}
|
||||
src={api.getItemImageUrl(artist.Id, "Primary", {
|
||||
quality: 90,
|
||||
})}
|
||||
/>
|
||||
<span className="material-symbols-rounded">artist</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<Typography>{artist.Name}</Typography>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
{musicTracks.isSuccess && musicTracks.data.TotalRecordCount > 0 && (
|
||||
<TrackList user={user.data.Id} tracks={musicTracks.data.Items} />
|
||||
)}
|
||||
|
||||
{similarItems.data.TotalRecordCount > 0 && (
|
||||
<CardScroller
|
||||
title="You might also like"
|
||||
displayCards={7}
|
||||
displayCards={5}
|
||||
disableDecoration
|
||||
>
|
||||
{similarItems.data.Items.map((similar, index) => {
|
||||
{similarItems.data.Items.map((similar) => {
|
||||
return (
|
||||
<Card
|
||||
key={similar.Id}
|
||||
@@ -495,7 +400,7 @@ function MusicAlbumTitlePage() {
|
||||
})}
|
||||
</CardScroller>
|
||||
)}
|
||||
</motion.div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (item.isError || similarItems.isError) {
|
||||
|
||||
@@ -1,64 +1,139 @@
|
||||
|
||||
$border-radius: 20px;
|
||||
|
||||
.item-album{
|
||||
.item-detail-cast {
|
||||
max-height: 50vh;
|
||||
overflow-y: auto;
|
||||
mask-image: linear-gradient(to top, transparent, black 1.2em);
|
||||
-webkit-mask-image: linear-gradient(to top, transparent, black 1.2em);
|
||||
&-title {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background: $clr-background-dark;
|
||||
padding: 0.35em;
|
||||
border-radius: 10px;
|
||||
z-index: 1;
|
||||
}
|
||||
&-container {
|
||||
.item-album {
|
||||
grid-template-columns: 1fr 25%;
|
||||
display: grid;
|
||||
gap: 3em;
|
||||
.item-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.2em;
|
||||
&-sidebar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
}
|
||||
&-grid {
|
||||
display: grid;
|
||||
gap: 1em;
|
||||
margin-bottom: 1em;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
|
||||
}
|
||||
&-card {
|
||||
display: grid;
|
||||
grid-template-columns: 6em 1fr;
|
||||
gap: 0.5em;
|
||||
align-items: center;
|
||||
color: white !important;
|
||||
text-decoration: none;
|
||||
padding: 0.5em;
|
||||
background: rgb(255 255 255 / 0);
|
||||
transition: background $transition-time-default;
|
||||
border-radius: $border-radius-default;
|
||||
&:hover {
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
}
|
||||
&-image,
|
||||
&-icon {
|
||||
width: 6em;
|
||||
height: 6em;
|
||||
position: sticky;
|
||||
max-height: 100vh;
|
||||
top: 0;
|
||||
&-image {
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: 100%;
|
||||
box-shadow: $shadow-card-image;
|
||||
border-radius: $border-radius-default;
|
||||
}
|
||||
&-icon {
|
||||
&-artist {
|
||||
display: flex;
|
||||
gap: 1em;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1em;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
.material-symbols-rounded {
|
||||
font-size: 3em;
|
||||
padding: 1em 0;
|
||||
color: rgb(255 255 255 / 0.7);
|
||||
transition: $transition-time-default;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
&:hover {
|
||||
color: rgb(255 255 255)
|
||||
}
|
||||
&-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
&-container {
|
||||
width: 3em;
|
||||
aspect-ratio: 1;
|
||||
border-radius: 100%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
.material-symbols-rounded {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgb(255 255 255 / 0.1);
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-container {
|
||||
// max-height: 20em;/
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-track {
|
||||
display: grid;
|
||||
grid-template-columns: 3em 60% 6em 1fr;
|
||||
gap: 1em;
|
||||
padding: 1em;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
border-radius: $border-radius-default;
|
||||
transition: background $transition-time-fast;
|
||||
&.header {
|
||||
border-bottom: 1px solid rgb(255 255 255 / 0.2);
|
||||
color: rgb(255 255 255 / 0.7);
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
.index-container {
|
||||
justify-self: center;
|
||||
position: relative;
|
||||
.material-symbols-rounded {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 2em !important;
|
||||
opacity: 0;
|
||||
transition: none !important;
|
||||
color: $clr-accent-default;
|
||||
}
|
||||
}
|
||||
&-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.1em
|
||||
}
|
||||
&:nth-last-of-type(even):not(.header) {
|
||||
background: rgb(0 0 0 / 0.2);
|
||||
}
|
||||
&:hover {
|
||||
background: rgb(255 255 255 / 0.1) !important;
|
||||
.index-container {
|
||||
// font-size: 0em;
|
||||
.index {
|
||||
opacity: 0;
|
||||
transition: opacity 0;
|
||||
}
|
||||
.material-symbols-rounded {
|
||||
opacity: 1;
|
||||
font-size: 2.2em !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.playing {
|
||||
background: rgb(0 0 0 / 0.4) !important;
|
||||
.item-info-track-info-name, .index {
|
||||
color: $clr-accent-default;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
&-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.4em
|
||||
}
|
||||
}
|
||||
&-album-info {
|
||||
gap: 1.2em;
|
||||
}
|
||||
&-buttons {
|
||||
display: flex;
|
||||
gap: 1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
.item-detail-album {
|
||||
@@ -73,18 +148,14 @@ $border-radius: 20px;
|
||||
background: rgb(0 0 0 / 0.4);
|
||||
transition: background $transition-time-default;
|
||||
backdrop-filter: blur(5px);
|
||||
|
||||
&:first-child {
|
||||
border-radius: $border-radius $border-radius 8px 8px;
|
||||
cursor: default !important;
|
||||
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-radius: 8px 8px $border-radius $border-radius;
|
||||
}
|
||||
border-radius: 8px;
|
||||
|
||||
&s {
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
@@ -92,22 +163,17 @@ $border-radius: 20px;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: rgb(0 0 0 / 0.5);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&.playing {
|
||||
color: $clr-accent-default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$cardWidth: 22%;
|
||||
|
||||
.item-album.item {
|
||||
gap: 1em;
|
||||
.item-hero {
|
||||
height: 50vh;
|
||||
gap: 2em;
|
||||
@@ -171,11 +237,9 @@ $cardWidth: 22%;
|
||||
height: calc(50vh + 4.4em);
|
||||
z-index: -1;
|
||||
mask-image: linear-gradient(to top, transparent, black);
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to top,
|
||||
transparent,
|
||||
black
|
||||
);
|
||||
-webkit-mask-image: linear-gradient(to top,
|
||||
transparent,
|
||||
black);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,7 +281,7 @@ $cardWidth: 22%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.material-symbols-rounded{
|
||||
.material-symbols-rounded {
|
||||
font-size: 4em;
|
||||
}
|
||||
}
|
||||
@@ -263,11 +327,9 @@ $cardWidth: 22%;
|
||||
height: calc(54vh + 4.4em);
|
||||
z-index: -1;
|
||||
mask-image: linear-gradient(to top, transparent, black);
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to top,
|
||||
transparent,
|
||||
black
|
||||
);
|
||||
-webkit-mask-image: linear-gradient(to top,
|
||||
transparent,
|
||||
black);
|
||||
}
|
||||
}
|
||||
& .play-button {
|
||||
@@ -280,7 +342,6 @@ $cardWidth: 22%;
|
||||
justify-items: center;
|
||||
align-items: start;
|
||||
gap: 3em;
|
||||
|
||||
&-cast {
|
||||
max-height: 50vh;
|
||||
overflow-y: auto;
|
||||
@@ -291,7 +352,7 @@ $cardWidth: 22%;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background: black;
|
||||
border:1px solid rgb(255 255 255 / 0.2) ;
|
||||
border: 1px solid rgb(255 255 255 / 0.2);
|
||||
padding: 0.35em;
|
||||
border-radius: 10px;
|
||||
z-index: 1;
|
||||
@@ -358,7 +419,6 @@ $cardWidth: 22%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1320px) {
|
||||
.item-album .item-detail {
|
||||
&-cast {
|
||||
|
||||
@@ -252,6 +252,38 @@ function LibraryView() {
|
||||
},
|
||||
];
|
||||
break;
|
||||
case BaseItemKind.MusicAlbum:
|
||||
result = [
|
||||
{
|
||||
title: "Name",
|
||||
value: ItemSortBy.SortName,
|
||||
},
|
||||
{
|
||||
title: "Album Artist",
|
||||
value: ItemSortBy.AlbumArtist,
|
||||
},
|
||||
{
|
||||
title: "Community Rating",
|
||||
value: ItemSortBy.CommunityRating,
|
||||
},
|
||||
{
|
||||
title: "Critcs Rating",
|
||||
value: ItemSortBy.CriticRating,
|
||||
},
|
||||
{
|
||||
title: "Date Added",
|
||||
value: ItemSortBy.DateCreated,
|
||||
},
|
||||
{
|
||||
title: "Release Date",
|
||||
value: ItemSortBy.PremiereDate,
|
||||
},
|
||||
{
|
||||
title: "Random",
|
||||
value: ItemSortBy.Random,
|
||||
},
|
||||
];
|
||||
break;
|
||||
default:
|
||||
result = [];
|
||||
break;
|
||||
|
||||
@@ -294,4 +294,8 @@ h1 {
|
||||
.glass {
|
||||
background: rgb(0 0 0 / 0.3) !important;
|
||||
backdrop-filter: blur(40px);
|
||||
}
|
||||
|
||||
.opacity-07{
|
||||
opacity: 0.7;
|
||||
}
|
||||
@@ -30,3 +30,17 @@ export const playAudio = (
|
||||
});
|
||||
setQueue(queue, queueItemIndex);
|
||||
};
|
||||
|
||||
export const generateAudioStreamUrl = (
|
||||
itemId: string,
|
||||
userId: string,
|
||||
deviceId: string,
|
||||
basePath: string,
|
||||
) => {
|
||||
const urlOptions = {
|
||||
userId,
|
||||
deviceId,
|
||||
};
|
||||
const urlParams = new URLSearchParams(urlOptions).toString();
|
||||
return `${basePath}/Audio/${itemId}/universal?${urlParams}`;
|
||||
};
|
||||
Reference in new issue
Block a user