From b2aaed792e2d577ca71260453098aa65033360fa Mon Sep 17 00:00:00 2001 From: prayag17 Date: Wed, 3 May 2023 13:54:51 +0530 Subject: [PATCH] Fix Carousel and Server connection err dialog --- src/App.jsx | 6 ++++- src/routes/home/index.jsx | 48 +++++++++++++++++++++--------------- src/routes/item/index.jsx | 6 ++--- src/routes/library/index.jsx | 11 ++++----- 4 files changed, 41 insertions(+), 30 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 76f3971..9632347 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -245,7 +245,10 @@ function App() { }); }; - const handleRelaunch = async () => { + const handleRelaunch = async (event, reason) => { + if (reason && reason == "backdropClick") { + return; + } let result = await relaunch(); }; @@ -309,6 +312,7 @@ function App() { { >
{item.Type == - BaseItemKind.MusicAlbum ? ( + BaseItemKind.MusicAlbum || + item.Type == + BaseItemKind.Episode ? ( item .ParentBackdropImageTags .length != 0 && ( @@ -291,26 +293,32 @@ const Home = () => { ) : item.ImageBlurHashes .Backdrop ? ( <> - + .ImageBlurHashes + .Backdrop[ + item + .BackdropImageTags[0] + ] + } + // hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj" + width="1080" + height="720" + resolutionX={ + 64 + } + resolutionY={ + 96 + } + className="hero-carousel-background-blurhash" + punch={1} + /> + )}
{ const [audioTracks, setAudioTracks] = useState([]); const [subtitleTracks, setSubtitleTracks] = useState([]); - const [currentVideoTrack, setCurrentVideoTrack] = useState(); - const [currentAudioTrack, setCurrentAudioTrack] = useState(); - const [currentSubTrack, setCurrentSubTrack] = useState(); + const [currentVideoTrack, setCurrentVideoTrack] = useState(""); + const [currentAudioTrack, setCurrentAudioTrack] = useState(""); + const [currentSubTrack, setCurrentSubTrack] = useState(""); useEffect(() => { if (item.isSuccess && !!item.data.MediaStreams) { diff --git a/src/routes/library/index.jsx b/src/routes/library/index.jsx index d2c4b74..2507cad 100644 --- a/src/routes/library/index.jsx +++ b/src/routes/library/index.jsx @@ -469,8 +469,8 @@ const LibraryView = () => { position="fixed" elevation={trigger ? 1 : 0} sx={{ - width: `calc(100vw - ${theme.spacing(7)})`, - mt: 8, + width: `calc(100vw - ${theme.spacing(7)} - 10px)`, + top: `${8 * 8}px !important`, backdropFilter: trigger ? `blur(30px)` : "none", background: "transparent", backgroundColor: trigger @@ -987,9 +987,8 @@ const LibraryView = () => { : false } watchedCount={ - !!item.UserData && item.UserData - .UnplayedItemCount + ?.UnplayedItemCount } blurhash={ item.ImageBlurHashes == @@ -1012,7 +1011,7 @@ const LibraryView = () => { } currentUser={user.data} favourite={ - item.UserData.IsFavorite + item.UserData?.IsFavorite } > @@ -1026,7 +1025,7 @@ const LibraryView = () => { {items.data.Items.map((item, index) => { return (