From fb80d8ba957d0db875bee37ac5a0d8e62db6e021 Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Sat, 15 Feb 2025 16:56:35 -0600 Subject: [PATCH 1/3] useMemo on Text Ticker opnly --- components/Player/screens/index.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/components/Player/screens/index.tsx b/components/Player/screens/index.tsx index c8ab6de1..b57a4c3d 100644 --- a/components/Player/screens/index.tsx +++ b/components/Player/screens/index.tsx @@ -90,14 +90,14 @@ export default function PlayerScreen({ /> - { useMemo(() => { + - - Playing from + Playing from + { useMemo(() => { { @@ -108,10 +108,10 @@ export default function PlayerScreen({ } - - }, [ - queue - ])} + }, [ + queue + ])} + From 0538b316c89a1cb77fe89e6e592b8834cf0702cb Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Sat, 15 Feb 2025 16:58:05 -0600 Subject: [PATCH 2/3] remove usememo --- components/Player/screens/index.tsx | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/components/Player/screens/index.tsx b/components/Player/screens/index.tsx index b57a4c3d..4165d94e 100644 --- a/components/Player/screens/index.tsx +++ b/components/Player/screens/index.tsx @@ -97,20 +97,14 @@ export default function PlayerScreen({ > Playing from - { useMemo(() => { - - - { - // If the Queue is a BaseItemDto, display the name of it - typeof(queue) === 'object' - ? (queue as BaseItemDto).Name ?? "Untitled" - : queue - } - - - }, [ - queue - ])} + + { + // If the Queue is a BaseItemDto, display the name of it + typeof(queue) === 'object' + ? (queue as BaseItemDto).Name ?? "Untitled" + : queue + } + From 9395b78e7ed32e7a1a8f29f71937e3788c56f20f Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Sun, 16 Feb 2025 04:28:02 -0600 Subject: [PATCH 3/3] allow for null playlist library --- README.md | 8 ++++---- components/Global/components/blurhashed-image.tsx | 4 +--- components/Login/screens/server-library.tsx | 4 ++-- components/Playlist/component.tsx | 2 +- constants/query-client.ts | 3 ++- types/JellifyLibrary.ts | 8 ++++---- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 1760b011..22173179 100644 --- a/README.md +++ b/README.md @@ -72,15 +72,15 @@ Playlist Search ### Player -Player +Player -Queue +Queue ### CarPlay (Sneak Preview) -Now Playing (CarPlay) +Now Playing (CarPlay) ### On the Server -Playback Tracking +Playback Tracking ## 🏗 Built with: ### 🎨 Frontend diff --git a/components/Global/components/blurhashed-image.tsx b/components/Global/components/blurhashed-image.tsx index 884a6d22..80d4ea4f 100644 --- a/components/Global/components/blurhashed-image.tsx +++ b/components/Global/components/blurhashed-image.tsx @@ -32,9 +32,7 @@ export default function BlurhashedImage({ Math.ceil(height ?? width / 100) * 100 // So these keys need to match ], queryFn: () => fetchItemImage(item.AlbumId ? item.AlbumId : item.Id!, type ?? ImageType.Primary, width, height ?? width), - staleTime: (1000 * 60 * 60) * 24, // 1 day, images probably don't refresh that often - gcTime: (1000 * 1 * 1) * 1 // 1 second, these are stored on disk anyways so refetching is cheap - });; + }); const blurhash = !isEmpty(item.ImageBlurHashes) && !isEmpty(type ? item.ImageBlurHashes[type] : item.ImageBlurHashes.Primary) diff --git a/components/Login/screens/server-library.tsx b/components/Login/screens/server-library.tsx index 900400d8..d549eff7 100644 --- a/components/Login/screens/server-library.tsx +++ b/components/Login/screens/server-library.tsx @@ -75,8 +75,8 @@ export default function ServerLibrary(): React.JSX.Element { musicLibraryId: libraryId!, musicLibraryName: libraries?.filter((library) => library.Id == libraryId)[0].Name ?? "No library name", musicLibraryPrimaryImageId: libraries?.filter((library) => library.Id == libraryId)[0].ImageTags!.Primary, - playlistLibraryId: playlistLibrary!.Id!, - playlistLibraryPrimaryImageId: playlistLibrary!.ImageTags!.Primary, + playlistLibraryId: playlistLibrary?.Id!, + playlistLibraryPrimaryImageId: playlistLibrary?.ImageTags!.Primary, }); setLoggedIn(true); }}> diff --git a/components/Playlist/component.tsx b/components/Playlist/component.tsx index a82e59d2..58553c13 100644 --- a/components/Playlist/component.tsx +++ b/components/Playlist/component.tsx @@ -213,7 +213,7 @@ export default function Playlist({ color={"$borderColor"} style={{ display: "block"}} > - Total Runtime: + Total Runtime: { playlist.RunTimeTicks } diff --git a/constants/query-client.ts b/constants/query-client.ts index 273dc563..ee0cb9b0 100644 --- a/constants/query-client.ts +++ b/constants/query-client.ts @@ -3,8 +3,9 @@ import { QueryClient } from "@tanstack/react-query"; export const queryClient = new QueryClient({ defaultOptions: { queries: { + refetchOnWindowFocus: false, gcTime: (1000 * 60 * 60 * 24) * 5, // 5 days, for maximum cache-age - staleTime: (1000 * 60 * 30), // 30 minutes, this can be refreshed manually anyways + staleTime: (1000 * 60 * 60 * 1), // 1 hour, this can be refreshed manually anyways } } }); \ No newline at end of file diff --git a/types/JellifyLibrary.ts b/types/JellifyLibrary.ts index c25ca4f2..0647b7d3 100644 --- a/types/JellifyLibrary.ts +++ b/types/JellifyLibrary.ts @@ -1,8 +1,8 @@ export interface JellifyLibrary { musicLibraryId: string; - musicLibraryName?: string; - musicLibraryPrimaryImageId?: string; - playlistLibraryId: string; - playlistLibraryPrimaryImageId?: string; + musicLibraryName?: string | undefined; + musicLibraryPrimaryImageId?: string | undefined; + playlistLibraryId?: string | undefined; + playlistLibraryPrimaryImageId?: string | undefined; } \ No newline at end of file