diff --git a/public/assetsStatic/SocialMediaBanner.png b/public/assetsStatic/SocialMediaBanner.png index 1fdb320..ef7a79a 100644 Binary files a/public/assetsStatic/SocialMediaBanner.png and b/public/assetsStatic/SocialMediaBanner.png differ diff --git a/src/components/buttons/playButton.jsx b/src/components/buttons/playButton.tsx similarity index 70% rename from src/components/buttons/playButton.jsx rename to src/components/buttons/playButton.tsx index b199f16..a005926 100644 --- a/src/components/buttons/playButton.jsx +++ b/src/components/buttons/playButton.tsx @@ -1,15 +1,20 @@ import PropTypes from "prop-types"; import React from "react"; -import Button from "@mui/material/Button"; +import Button, { + ButtonProps, + ButtonPropsSizeOverrides, +} from "@mui/material/Button"; import Fab from "@mui/material/Fab"; import LinearProgress from "@mui/material/LinearProgress"; import Typography from "@mui/material/Typography"; import { + BaseItemDto, BaseItemKind, ItemFields, SortOrder, + UserItemDataDto, } from "@jellyfin/sdk/lib/generated-client"; import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api"; import { getPlaylistsApi } from "@jellyfin/sdk/lib/utils/api/playlists-api"; @@ -25,7 +30,10 @@ import { usePlaybackStore, } from "../../utils/store/playback"; +import { SxProps } from "@mui/material"; + const PlayButton = ({ + item, itemId, itemUserData, userId, @@ -42,6 +50,24 @@ const PlayButton = ({ playlistItem, playlistItemId = "", trackIndex, +}: { + item: BaseItemDto; + itemId: string; + itemUserData: UserItemDataDto; + userId: string; + itemType: BaseItemKind; + currentAudioTrack: number; + currentVideoTrack: number; + currentSubTrack: number; + className: string; + sx: SxProps; + buttonProps: ButtonProps; + iconOnly: boolean; + audio: boolean; + size: ButtonPropsSizeOverrides; + playlistItem: BaseItemDto; + playlistItemId: string; + trackIndex: number; }) => { const [api] = useApi((state) => [state.api]); @@ -96,11 +122,11 @@ const PlayButton = ({ const { enqueueSnackbar } = useSnackbar(); - const item = useMutation({ + const itemQuery = useMutation({ mutationKey: ["playButton", itemId, userId], mutationFn: async () => { setPlaybackDataLoading(true); - let result; + let result: any; if (playlistItem) { result = await getPlaylistsApi(api).getPlaylistItems({ userId: userId, @@ -112,9 +138,9 @@ const PlayButton = ({ result = await getTvShowsApi(api).getEpisodes({ seriesId: itemId, limit: 1, - startIndex: 0, fields: [ItemFields.MediaSources, ItemFields.MediaStreams], enableUserData: true, + userId: userId, }); break; case BaseItemKind.Playlist: @@ -129,7 +155,7 @@ const PlayButton = ({ userId: userId, fields: [ItemFields.MediaSources, ItemFields.MediaStreams], sortOrder: SortOrder.Ascending, - sortBy: "IndexNumber", + sortBy: ["IndexNumber"], }); break; case BaseItemKind.MusicArtist: @@ -143,6 +169,15 @@ const PlayButton = ({ sortBy: ["PremiereDate", "ProductionYear", "SortName"], }); break; + case BaseItemKind.BoxSet: + result = await getItemsApi(api).getItems({ + parentId: itemId, + userId, + fields: [ItemFields.MediaSources, ItemFields.MediaStreams], + sortOrder: SortOrder.Ascending, + sortBy: "IndexNumber", + }); + break; default: result = await getItemsApi(api).getItems({ ids: [itemId], @@ -156,51 +191,51 @@ const PlayButton = ({ } return result.data; }, - onSuccess: (item) => { - console.log(item.Items[0].MediaSources); + onSuccess: (result) => { + console.log(result.Items[0].MediaSources); if (trackIndex) { setPlaylistItemId(playlistItemId); setCurrentTrack(trackIndex); - setAudioTracks(item.Items); + setAudioTracks(result.Items); setAudioUrl( - `${api.basePath}/Audio/${item.Items[trackIndex].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`, + `${api.basePath}/Audio/${result.Items[trackIndex].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`, ); - setAudioItem(item.Items[trackIndex]); + setAudioItem(result.Items[trackIndex]); setAudioDisplay(true); } else if (audio) { - setAudioItem(item.Items[0]); - setAudioTracks(item.Items); + setAudioItem(result.Items[0]); + setAudioTracks(result.Items); setAudioUrl( - `${api.basePath}/Audio/${item.Items[0].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`, + `${api.basePath}/Audio/${result.Items[0].Id}/universal?deviceId=${api.deviceInfo.id}&userId=${userId}&api_key=${api.accessToken}`, ); setAudioDisplay(true); } else { setUserId(userId); - setItemId(item.Items[0].Id); - setDuration(item.Items[0].RunTimeTicks); + setItemId(result.Items[0].Id); + setDuration(result.Items[0].RunTimeTicks); - if (item.Items[0].Type === BaseItemKind.Episode) { - setSeriesId(item.Items[0].SeriesId); - // setEpisodeIndex(item.Ite) + if (result.Items[0].Type === BaseItemKind.Episode) { + setSeriesId(result.Items[0].SeriesId); + // setEpisodeIndex(result.Ite) } - setMediaContainer(item.Items[0].MediaSources[0].Container); + setMediaContainer(result.Items[0].MediaSources[0].Container); // Set all required stream index setAudioStreamIndex(currentAudioTrack); setVideoStreamIndex(currentVideoTrack); setSubtitleStreamIndex(currentSubTrack); - setMediaSourceId(item.Items[0].Id); - setItem(item.Items[0]); + setMediaSourceId(result.Items[0].Id); + setItem(result.Items[0]); - switch (item.Items[0].Type) { + switch (result.Items[0].Type) { case BaseItemKind.Movie: - if (item.Items[0].ImageBlurHashes.Logo) { + if (result.Items[0].ImageBlurHashes.Logo) { setItemName(
{item.Items[0].Name} { e.target.style.opacity = 1; @@ -211,27 +246,27 @@ const PlayButton = ({ } else { setItemName(
- {item.Items[0].Name} + {result.Items[0].Name}
, ); } break; case BaseItemKind.Episode: - if (item.Items[0].ImageBlurHashes.Logo) { + if (result.Items[0].ImageBlurHashes.Logo) { setItemName(
{item.Items[0].SeriesName} { e.target.style.opacity = 1; }} /> - S{item.Items[0].ParentIndexNumber} + S{result.Items[0].ParentIndexNumber} :E - {item.Items[0].IndexNumber} {item.Items[0].Name} + {result.Items[0].IndexNumber} {result.Items[0].Name}
, ); @@ -239,12 +274,12 @@ const PlayButton = ({ setItemName(
- {item.Items[0].SeriesName} + {result.Items[0].SeriesName} - S{item.Items[0].ParentIndexNumber} + S{result.Items[0].ParentIndexNumber} :E - {item.Items[0].IndexNumber} {item.Items[0].Name} + {result.Items[0].IndexNumber} {result.Items[0].Name}
, ); @@ -254,17 +289,17 @@ const PlayButton = ({ default: setItemName(
- {item.Items[0].Name} + {result.Items[0].Name}
, ); break; } - setPosition(item.Items[0].UserData?.PlaybackPositionTicks); + setPosition(result.Items[0].UserData?.PlaybackPositionTicks); setUrl( - `${api.basePath}/Videos/${item.Items[0].Id}/stream. - ${item.Items[0].MediaSources[0].Container} - ?Static=true&mediaSourceId=${item.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${item.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`, + `${api.basePath}/Videos/${result.Items[0].Id}/stream. + ${result.Items[0].MediaSources[0].Container} + ?Static=true&mediaSourceId=${result.Items[0].Id}&deviceId=${api.deviceInfo.id}&api_key=${api.accessToken}&Tag=${result.Items[0].MediaSources[0].ETag}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`, ); navigate("/player"); @@ -281,7 +316,7 @@ const PlayButton = ({ }); const handleClick = (e) => { e.stopPropagation(); - item.mutate(); + itemQuery.mutate(); }; if (iconOnly) { return ( diff --git a/src/components/carousel/carousel.scss b/src/components/carousel/carousel.scss index 9329471..5c98b6c 100644 --- a/src/components/carousel/carousel.scss +++ b/src/components/carousel/carousel.scss @@ -30,9 +30,9 @@ &-container { display: flex; position: absolute; - bottom: -1em; - left: 1em; - right: 1em; + bottom: -1.5em; + left: 10px; + right: 10px; gap: 1em; align-items: center; justify-content: center; diff --git a/src/components/carouselSlide/index.jsx b/src/components/carouselSlide/index.jsx index 35dfdfb..ee1c142 100644 --- a/src/components/carouselSlide/index.jsx +++ b/src/components/carouselSlide/index.jsx @@ -73,7 +73,7 @@ const CarouselSlide = ({ item }) => { background: "transparent", px: 3, }} - elevation={6} + elevation={10} >
{!!item.ImageBlurHashes.Backdrop && ( diff --git a/src/routes/album/index.jsx b/src/routes/album/index.jsx index 3d93f76..22b04f4 100644 --- a/src/routes/album/index.jsx +++ b/src/routes/album/index.jsx @@ -255,9 +255,30 @@ const MusicAlbumTitlePage = () => { )}
- {item.data.Name} + {item.data.Name} - + + artist + + } + size="large" + sx={{ + "& .MuiChip-label": { + marginLeft: 0.5, + }, + }} + /> { refetchOnWindowFocus: true, }); - const [setAppBackdrop] = useBackdropStore((state) => [state.setBackdrop]); - - const [directors, setDirectors] = useState([]); - const [writers, setWriters] = useState([]); - useEffect(() => { if (item.isSuccess) { - setAppBackdrop( - item.data.Type === BaseItemKind.MusicAlbum || - item.data.Type === BaseItemKind.Episode - ? `${api.basePath}/Items/${item.data.ParentBackdropItemId}/Images/Backdrop` - : `${api.basePath}/Items/${item.data.Id}/Images/Backdrop`, - item.data.Id, - ); - const direTp = item.data.People.filter((itm) => itm.Type === "Director"); - setDirectors(direTp); - const writeTp = item.data.People.filter((itm) => itm.Type === "Writer"); - setWriters(writeTp); + setBackdrop("", ""); } - }); + }, [item.isSuccess]); if (item.isPending || similarItems.isPending) { return ( @@ -159,41 +157,260 @@ const BoxSetTitlePage = () => { duration: 0.25, ease: "easeInOut", }} - className="scrollY" - style={{ - padding: "5em 2em 2em 1em", - display: "flex", - flexDirection: "column", - gap: "0.5em", - }} + className="scrollY item item-boxset padded-top" > - - {item.data.People.length > 0 && ( - - {item.data.People.map((person, index) => { - return ( - +
+ {item.data.BackdropImageTags ? ( + {item.data.Name} { + e.currentTarget.style.opacity = 1; + }} + /> + ) : ( + <> + )} +
+
+ {Object.keys(item.data.ImageTags).includes("Primary") ? ( + <> + - ); - })} - - )} + {item.data.Name} { + e.currentTarget.style.opacity = 1; + }} + className="item-hero-image" + /> + + ) : ( + <> + )} +
+
+ {Object.keys(item.data.ImageTags).includes("Logo") ? ( + {item.data.Name} { + e.currentTarget.style.opacity = 1; + }} + className="item-hero-logo" + /> + ) : ( + {item.data.Name} + )} + + + + {item.data.ProductionYear ?? ""} + + {item.data.OfficialRating && ( + + )} + + {item.data.CommunityRating && ( +
+
+ star +
+ + {Math.round(item.data.CommunityRating * 10) / 10} + +
+ )} + {item.data.CriticRating && ( +
+
50 ? green[400] : red[400], + fontVariationSettings: + '"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40', + }} + > + {item.data.CriticRating > 50 ? "thumb_up" : "thumb_down"} +
+ + {item.data.CriticRating} + +
+ )} + + {item.data.RunTimeTicks && ( + + {getRuntime(item.data.RunTimeTicks)} + + )} + {item.data.RunTimeTicks && ( + + {endsAt( + item.data.RunTimeTicks - + item.data.UserData.PlaybackPositionTicks, + )} + + )} +
+ + {item.data.Genres.join(", ")} + + +
+
+ +
+
+ + +
+
+
+
+
+
+ {item.data.UserData.PlaybackPositionTicks > 0 && ( +
+ + {getRuntime( + item.data.RunTimeTicks - + item.data.UserData.PlaybackPositionTicks, + )}{" "} + left + + +
+ )} + + {item.data.Taglines[0] ?? ""} + + +
+ +
+
+ {item.data.ExternalUrls.map((url) => ( + + {url.Name} + + ))} +
+
+
{collectionItems.data.TotalRecordCount > 0 && ( {collectionItems.data.Items.map((similar, index) => { diff --git a/src/routes/episode/index.jsx b/src/routes/episode/index.jsx index 3f87bd1..e467015 100644 --- a/src/routes/episode/index.jsx +++ b/src/routes/episode/index.jsx @@ -312,7 +312,7 @@ const EpisodeTitlePage = () => { )}
- + {item.data.ParentLogoItemId.length > 0 ? ( {item.data.SeriesName} { marginBottom: "1em", }} value={selectedVideoTrack} + variant="filled" onChange={(e) => setSelectedVideoTrack(e.target.value)} > {videoTracks.map((track) => ( @@ -680,6 +681,7 @@ const EpisodeTitlePage = () => { marginBottom: "1em", }} value={selectedAudioTrack} + variant="filled" onChange={(e) => setSelectedAudioTrack(e.target.value)} > {audioTracks.map((track) => ( @@ -697,6 +699,7 @@ const EpisodeTitlePage = () => { width: "100%", }} value={selectedSubtitleTrack} + variant="filled" onChange={(e) => setSelectedSubtitleTrack(e.target.value)} > @@ -760,175 +763,185 @@ const EpisodeTitlePage = () => { })} )} -
- - Cast & Crew - - {actors.length > 0 && ( -
- Actors -
- {actors.map((actor) => ( - - {actor.PrimaryImageTag ? ( - {actor.Name} - ) : ( -
- {getTypeIcon("Person")} + {item.data.People?.length > 0 && ( +
+ + Cast & Crew + + {actors.length > 0 && ( +
+ Actors +
+ {actors.map((actor) => ( + + {actor.PrimaryImageTag ? ( + {actor.Name} + ) : ( +
+ {getTypeIcon("Person")} +
+ )} +
+ + {actor.Name} + + + {actor.Role} +
- )} -
- {actor.Name} - - {actor.Role} - -
-
- ))} + + ))} +
-
- )} - {writers.length > 0 && ( -
- Writers -
- {writers.map((actor) => ( - - {actor.PrimaryImageTag ? ( - {actor.Name} - ) : ( -
- {getTypeIcon("Person")} + )} + {writers.length > 0 && ( +
+ Writers +
+ {writers.map((actor) => ( + + {actor.PrimaryImageTag ? ( + {actor.Name} + ) : ( +
+ {getTypeIcon("Person")} +
+ )} +
+ + {actor.Name} + + + {actor.Role} +
- )} -
- {actor.Name} - - {actor.Role} - -
-
- ))} + + ))} +
-
- )} - {directors.length > 0 && ( -
- Directors -
- {directors.map((actor) => ( - - {actor.PrimaryImageTag ? ( - {actor.Name} - ) : ( -
- {getTypeIcon("Person")} + )} + {directors.length > 0 && ( +
+ Directors +
+ {directors.map((actor) => ( + + {actor.PrimaryImageTag ? ( + {actor.Name} + ) : ( +
+ {getTypeIcon("Person")} +
+ )} +
+ + {actor.Name} + + + {actor.Role} +
- )} -
- {actor.Name} - - {actor.Role} - -
-
- ))} + + ))} +
-
- )} - {producers.length > 0 && ( -
- Producers -
- {producers.map((actor) => ( - - {actor.PrimaryImageTag ? ( - {actor.Name} - ) : ( -
- {getTypeIcon("Person")} + )} + {producers.length > 0 && ( +
+ Producers +
+ {producers.map((actor) => ( + + {actor.PrimaryImageTag ? ( + {actor.Name} + ) : ( +
+ {getTypeIcon("Person")} +
+ )} +
+ + {actor.Name} + + + {actor.Role} +
- )} -
- {actor.Name} - - {actor.Role} - -
-
- ))} + + ))} +
-
- )} -
+ )} +
+ )} ); } diff --git a/src/routes/home/home.module.scss b/src/routes/home/home.module.scss index 808d3ca..69bb5f3 100644 --- a/src/routes/home/home.module.scss +++ b/src/routes/home/home.module.scss @@ -10,7 +10,8 @@ border-radius: 10px !important; overflow: hidden; margin: 0 auto; - // box-shadow: 0 0 40px red; + border: 1.2px solid rgb(255 255 255 / 0.15); + // box-shadow: 0 0 30px black !important; } &-background { &-blurhash { @@ -93,17 +94,6 @@ justify-content: center; align-items: flex-start; } - &-indicator { - &-container { - // width: calc(100% - 2em) !important; - margin-top: -1em !important; - margin-left: 1em !important; - margin-right: 1em !important; - } - width: 100%; - height: 5px; - border-radius: 0; - } } .backdropContainer { diff --git a/src/routes/item/index.jsx b/src/routes/item/index.jsx index c9e70aa..d22fedd 100644 --- a/src/routes/item/index.jsx +++ b/src/routes/item/index.jsx @@ -348,7 +348,7 @@ const ItemDetail = () => { className="item-hero-logo" /> ) : ( - {item.data.Name} + {item.data.Name} )} {!!qualityLabel() && ( @@ -537,6 +537,9 @@ const ItemDetail = () => { currentAudioTrack={selectedAudioTrack} currentSubTrack={selectedSubtitleTrack} userId={user.data.Id} + sx={{ + background: "hsl(195.56deg 29.03% 18.24%) !important", + }} />
@@ -677,6 +680,7 @@ const ItemDetail = () => { marginBottom: "1em", }} value={selectedVideoTrack} + variant="filled" onChange={(e) => setSelectedVideoTrack(e.target.value)} > {videoTracks.map((track) => ( @@ -695,6 +699,7 @@ const ItemDetail = () => { marginBottom: "1em", }} value={selectedAudioTrack} + variant="filled" onChange={(e) => setSelectedAudioTrack(e.target.value)} > {audioTracks.map((track) => ( @@ -712,6 +717,12 @@ const ItemDetail = () => { width: "100%", }} value={selectedSubtitleTrack} + variant="filled" + SelectProps={{ + MenuProps: { + disablePortal: true, + }, + }} onChange={(e) => setSelectedSubtitleTrack(e.target.value)} > @@ -745,175 +756,185 @@ const ItemDetail = () => {
-
- - Cast & Crew - - {actors.length > 0 && ( -
- Actors -
- {actors.map((actor) => ( - - {actor.PrimaryImageTag ? ( - {actor.Name} - ) : ( -
- {getTypeIcon("Person")} + {item.data.People.length > 0 && ( +
+ + Cast & Crew + + {actors.length > 0 && ( +
+ Actors +
+ {actors.map((actor) => ( + + {actor.PrimaryImageTag ? ( + {actor.Name} + ) : ( +
+ {getTypeIcon("Person")} +
+ )} +
+ + {actor.Name} + + + {actor.Role} +
- )} -
- {actor.Name} - - {actor.Role} - -
-
- ))} + + ))} +
-
- )} - {writers.length > 0 && ( -
- Writers -
- {writers.map((actor) => ( - - {actor.PrimaryImageTag ? ( - {actor.Name} - ) : ( -
- {getTypeIcon("Person")} + )} + {writers.length > 0 && ( +
+ Writers +
+ {writers.map((actor) => ( + + {actor.PrimaryImageTag ? ( + {actor.Name} + ) : ( +
+ {getTypeIcon("Person")} +
+ )} +
+ + {actor.Name} + + + {actor.Role} +
- )} -
- {actor.Name} - - {actor.Role} - -
-
- ))} + + ))} +
-
- )} - {directors.length > 0 && ( -
- Directors -
- {directors.map((actor) => ( - - {actor.PrimaryImageTag ? ( - {actor.Name} - ) : ( -
- {getTypeIcon("Person")} + )} + {directors.length > 0 && ( +
+ Directors +
+ {directors.map((actor) => ( + + {actor.PrimaryImageTag ? ( + {actor.Name} + ) : ( +
+ {getTypeIcon("Person")} +
+ )} +
+ + {actor.Name} + + + {actor.Role} +
- )} -
- {actor.Name} - - {actor.Role} - -
-
- ))} + + ))} +
-
- )} - {producers.length > 0 && ( -
- Producers -
- {producers.map((actor) => ( - - {actor.PrimaryImageTag ? ( - {actor.Name} - ) : ( -
- {getTypeIcon("Person")} + )} + {producers.length > 0 && ( +
+ Producers +
+ {producers.map((actor) => ( + + {actor.PrimaryImageTag ? ( + {actor.Name} + ) : ( +
+ {getTypeIcon("Person")} +
+ )} +
+ + {actor.Name} + + + {actor.Role} +
- )} -
- {actor.Name} - - {actor.Role} - -
-
- ))} + + ))} +
-
- )} -
+ )} +
+ )} {/* {item.data.People.length > 0 && ( { duration: 0.25, ease: "easeInOut", }} - className="scrollY padded-top item item-person" + className="scrollY padded-top item item-person flex flex-column" >
@@ -317,22 +318,7 @@ const PersonTitlePage = () => { )}
- {Object.keys(item.data.ImageTags).includes("Logo") ? ( - {item.data.Name} { - e.currentTarget.style.opacity = 1; - }} - className="item-hero-logo" - /> - ) : ( - {item.data.Name} - )} + {item.data.Name} { className="item-hero-logo" /> ) : ( - {item.data.Name} + {item.data.Name} )} {
void; setDuration: (adur: number) => void; setItemId: (aid: string) => void; - setItemName: (anm: string) => void; + setItemName: (anm: string | Element) => void; setUserId: (anm: string) => void; setSeriesId: (anm: string) => void; setMediaContainer: (anm: string) => void; @@ -64,7 +64,7 @@ export const usePlaybackStore = create((set) => ({ set((state: PlaybackState) => ({ ...state, duration: adur })), setItemId: (aid: string) => set((state: PlaybackState) => ({ ...state, itemId: aid })), - setItemName: (anm: string) => + setItemName: (anm: string | Element) => set((state: PlaybackState) => ({ ...state, itemName: anm })), setUserId: (anm: string) => set((state: PlaybackState) => ({ ...state, userId: anm })),