@@ -116,6 +116,7 @@ const CarouselSlide = ({ item }) => {
y: 0,
opacity: 1,
}}
+ overflow="visible"
>
{!item.ImageTags.Logo ? (
item.Name
@@ -166,21 +167,14 @@ const CarouselSlide = ({ item }) => {
}
className="hero-carousel-info"
>
-
+
{!!item.ProductionYear
? item.ProductionYear
: "Unknown"}
{
{item.Overview}
- {item.UserData.PlaybackPositionTicks > 0 && (
-
-
- {getRuntime(
- item.RunTimeTicks -
- item.UserData
- .PlaybackPositionTicks,
- )}
-
-
-
- )}
{/* TODO Link PLay and More info buttons in carousel */}
{
mt={3}
direction="row"
gap={3}
+ width="100%"
className="hero-carousel-button-container"
+ alignItems="center"
>
- }
- disabled
+
- Play
-
+
+ }
+ sx={{
+ textTransform: "none !important",
+ }}
+ >
+ {item.UserData.PlaybackPositionTicks >
+ 0 ? (
+
+ Resume
+
+ ) : (
+ "Play"
+ )}
+
+
+
}
@@ -364,4 +341,4 @@ const CarouselSlide = ({ item }) => {
);
};
-export default CarouselSlide;
+export default memo(CarouselSlide);
diff --git a/src/routes/home/home.module.scss b/src/routes/home/home.module.scss
index b821b79..adaf919 100644
--- a/src/routes/home/home.module.scss
+++ b/src/routes/home/home.module.scss
@@ -90,8 +90,8 @@
-webkit-line-clamp: 2;
margin-bottom: 0.5em;
&-logo {
- max-width: 12em;
- height: 2em;
+ max-width: 9em;
+ height: 3em;
object-fit: contain;
object-position: bottom;
}
diff --git a/src/routes/home/index.jsx b/src/routes/home/index.jsx
index 44635d8..39ff9f7 100644
--- a/src/routes/home/index.jsx
+++ b/src/routes/home/index.jsx
@@ -95,6 +95,18 @@ const Home = () => {
networkMode: "always",
});
+ const latestMediaLibraries = useQuery({
+ queryKey: ["libraries"],
+ queryFn: async () => {
+ let libs = await getUserViewsApi(window.api).getUserViews({
+ userId: user.data.Id,
+ });
+ return libs.data;
+ },
+ enabled: !!user.data,
+ networkMode: "always",
+ });
+
const latestMedia = useQuery({
queryKey: ["home", "latestMedia"],
queryFn: async () => {
@@ -110,7 +122,6 @@ const Home = () => {
],
enableUserData: true,
enableImages: true,
- limit: 16,
},
);
return media.data;
@@ -172,30 +183,22 @@ const Home = () => {
const excludeTypes = ["boxsets", "playlists", "livetv", "channels"];
- const handleLogout = async () => {
- console.log("Logging out user...");
- await window.api.logout();
- delUser();
- sessionStorage.removeItem("accessToken");
- event.emit("create-jellyfin-api", window.api.basePath);
- navigate("/login");
- };
-
let tempData = [];
if (libraries.status == "success") {
libraries.data.Items.map((lib) => {
- if (!excludeTypes.includes(lib.CollectionType)) {
- tempData = latestMediaLibs;
- if (
- !tempData.some(
- (el) =>
- JSON.stringify(el) ==
- JSON.stringify([lib.Id, lib.Name]),
- )
- ) {
- tempData.push([lib.Id, lib.Name]);
- setLatestMediaLibs(tempData);
- }
+ if (excludeTypes.includes(lib.CollectionType)) {
+ return;
+ }
+ tempData = latestMediaLibs;
+ if (
+ !tempData.some(
+ (el) =>
+ JSON.stringify(el) ==
+ JSON.stringify([lib.Id, lib.Name]),
+ )
+ ) {
+ tempData.push([lib.Id, lib.Name]);
+ setLatestMediaLibs(tempData);
}
});
}
@@ -226,6 +229,7 @@ const Home = () => {
autoPlay={false}
animation="fade"
height="100vh"
+ // navButtonsAlwaysVisible
IndicatorIcon={
}
@@ -257,10 +261,20 @@ const Home = () => {
}}
onChange={(now) => {
if (latestMedia.isSuccess) {
- setAppBackdrop(
- `${window.api.basePath}/Items/${latestMedia.data[now].Id}/Images/Backdrop`,
- latestMedia.data[now].Id,
- );
+ if (
+ !!latestMedia.data[now]
+ .ParentBackdropImageTags
+ ) {
+ setAppBackdrop(
+ `${window.api.basePath}/Items/${latestMedia.data[now].ParentBackdropItemId}/Images/Backdrop`,
+ latestMedia.data[now].Id,
+ );
+ } else {
+ setAppBackdrop(
+ `${window.api.basePath}/Items/${latestMedia.data[now].Id}/Images/Backdrop`,
+ latestMedia.data[now].Id,
+ );
+ }
}
}}
changeOnFirstRender={true}
@@ -579,70 +593,4 @@ const Home = () => {
);
};
-/*
-
-
-
-
-
-
-
-
- {userLibraries.map((library, index) => {
- return (
-
-
-
- {
- MediaCollectionTypeIconCollection[
- library
- .CollectionType
- ]
- }
-
-
-
-
- );
- })}
-
- */
-
export default Home;
diff --git a/src/styles/global.scss b/src/styles/global.scss
index 6685768..d998578 100644
--- a/src/styles/global.scss
+++ b/src/styles/global.scss
@@ -30,7 +30,7 @@ div::-webkit-scrollbar {
}
body {
- font-family: "Open Sans";
+ font-family: "Open Sans Variable";
background: $clr-background-default;
margin: 0;
padding: 0;
@@ -39,6 +39,7 @@ body {
height: 100vh;
overflow-x: hidden;
overflow-y: overlay;
+ overscroll-behavior: none;
}
.app-backdrop {
@@ -127,7 +128,7 @@ h1 {
.home {
padding-left: 0 !important;
- padding-right: 0 !important;
+ padding-right: 14px !important;
}
.empty {
diff --git a/src/theme.js b/src/theme.js
index 95bc31e..8a9900c 100644
--- a/src/theme.js
+++ b/src/theme.js
@@ -32,7 +32,7 @@ export const theme = createTheme({
mode: "dark",
},
typography: {
- fontFamily: "Open Sans",
+ fontFamily: "Open Sans Variable",
},
components: {
MuiButton: {