- {placeholders.map((placeholder) => (
+
+ {columns > 0 && (
-
-
-
+ {placeholders.map((placeholder) => (
+
+
+
+
+
+ ))}
- ))}
+ )}
);
};
diff --git a/src/components/skeleton/musicPage.tsx b/src/components/skeleton/musicPage.tsx
new file mode 100644
index 0000000..9120fb3
--- /dev/null
+++ b/src/components/skeleton/musicPage.tsx
@@ -0,0 +1,111 @@
+import { Skeleton } from "@mui/material";
+import React from "react";
+
+import "@/components/albumMusicTrack/albumMusicTrack.scss";
+
+type MusicPageSkeletonProps = {
+ /** Artist pages open on a round portrait and a discography grid. */
+ artist?: boolean;
+};
+
+const ALBUM_SKELETONS = ["one", "two", "three", "four", "five"];
+const TRACK_SKELETONS = [
+ "one",
+ "two",
+ "three",
+ "four",
+ "five",
+ "six",
+ "seven",
+ "eight",
+];
+
+const AlbumCardSkeleton = () => (
+
+
+
+
+
+);
+
+const MusicPageSkeleton = ({ artist = false }: MusicPageSkeletonProps) => (
+
+
+
+ {artist ? (
+ <>
+
+
+
+
+
+
+ {ALBUM_SKELETONS.map((id) => (
+
+ ))}
+
+ >
+ ) : (
+
+
+
+
+
+
+
+ {TRACK_SKELETONS.map((id) => (
+
+ ))}
+
+ )}
+
+);
+
+export default MusicPageSkeleton;
diff --git a/src/components/skeleton/seasonSelector.tsx b/src/components/skeleton/seasonSelector.tsx
index 8281165..b4f3eae 100644
--- a/src/components/skeleton/seasonSelector.tsx
+++ b/src/components/skeleton/seasonSelector.tsx
@@ -1,52 +1,44 @@
import Divider from "@mui/material/Divider";
-import Grid2 from "@mui/material/Grid";
import Skeleton from "@mui/material/Skeleton";
-import Typography from "@mui/material/Typography";
import React from "react";
import EpisodeSkeleton from "./episode";
-export const SeasonSelectorSkeleton = () => {
- return (
-
(
+
+
-
-
-
-
-
+
+
+
-
-
-
+
+
+
+
+
+);
+
+export default SeasonSelectorSkeleton;
diff --git a/src/routes/_api/home/home.scss b/src/routes/_api/home/home.scss
index b0307f1..1bc1e39 100644
--- a/src/routes/_api/home/home.scss
+++ b/src/routes/_api/home/home.scss
@@ -124,6 +124,7 @@ body.has-player-bar .home-sections {
.home-skeleton-cards {
display: flex;
gap: 0.75rem;
+ overflow: hidden;
}
.home-skeleton-cards span {
@@ -180,3 +181,17 @@ body.has-player-bar .home-sections {
padding: 2rem 1.1rem calc(8rem + var(--safe-bottom));
}
}
+
+
+.home-skeleton-sections {
+ gap: 1.8em;
+}
+
+.home-skeleton-row {
+ display: flex;
+ flex-direction: column;
+}
+
+.home-skeleton-row .home-skeleton-heading {
+ margin-bottom: 0.9em;
+}
diff --git a/src/routes/_api/home/index.tsx b/src/routes/_api/home/index.tsx
index 1be903b..ac78366 100644
--- a/src/routes/_api/home/index.tsx
+++ b/src/routes/_api/home/index.tsx
@@ -200,6 +200,18 @@ function HomeContent({ api, user }: { api: Api; user: UserDto }) {
+
+ {[0, 1, 2].map((row) => (
+
+
+
+ {[0, 1, 2, 3].map((card) => (
+
+ ))}
+
+
+ ))}
+
);
}
diff --git a/src/routes/_api/library/$id.tsx b/src/routes/_api/library/$id.tsx
index 1faa2f8..1b137b8 100644
--- a/src/routes/_api/library/$id.tsx
+++ b/src/routes/_api/library/$id.tsx
@@ -109,16 +109,18 @@ function Library() {
>
+
+
+
}
>
diff --git a/src/routes/_api/library/library.scss b/src/routes/_api/library/library.scss
index d28d7cc..bda4dc1 100644
--- a/src/routes/_api/library/library.scss
+++ b/src/routes/_api/library/library.scss
@@ -227,7 +227,6 @@
}
.library-items {
- padding-top: 0.5rem !important;
- padding-bottom: calc(7.5em + var(--safe-bottom)) !important;
+ padding: 0.5rem 0.75rem calc(7.5em + var(--safe-bottom)) !important;
}
}
diff --git a/src/routes/_api/music/album/$id.tsx b/src/routes/_api/music/album/$id.tsx
index 6924a44..f4431d4 100644
--- a/src/routes/_api/music/album/$id.tsx
+++ b/src/routes/_api/music/album/$id.tsx
@@ -1,7 +1,5 @@
import { BaseItemKind, SortOrder } from "@jellyfin/sdk/lib/generated-client";
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
-import Box from "@mui/material/Box";
-import CircularProgress from "@mui/material/CircularProgress";
import { useQuery } from "@tanstack/react-query";
import { createFileRoute, Link } from "@tanstack/react-router";
import React, { useLayoutEffect, useMemo } from "react";
@@ -13,6 +11,7 @@ import RatingControl from "@/components/buttons/ratingControl";
import { Card } from "@/components/card/card";
import CardScroller from "@/components/cardScroller/cardScroller";
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
+import MusicPageSkeleton from "@/components/skeleton/musicPage";
import ShowMoreText from "@/components/showMoreText";
import TagChip from "@/components/tagChip";
import { getTypeIcon } from "@/components/utils/iconsCollection";
@@ -130,19 +129,7 @@ function MusicAlbumTitlePage() {
}, [item.isSuccess, item.data, setBackdrop]);
if (item.isPending) {
- return (
-
-
-
- );
+ return ;
}
if (item.isError) {
diff --git a/src/routes/_api/music/artist/$id.tsx b/src/routes/_api/music/artist/$id.tsx
index 3510d27..fa9f8d2 100644
--- a/src/routes/_api/music/artist/$id.tsx
+++ b/src/routes/_api/music/artist/$id.tsx
@@ -6,8 +6,6 @@ import {
SortOrder,
} from "@jellyfin/sdk/lib/generated-client";
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
-import Box from "@mui/material/Box";
-import CircularProgress from "@mui/material/CircularProgress";
import IconButton from "@mui/material/IconButton";
import Tooltip from "@mui/material/Tooltip";
import { useQuery } from "@tanstack/react-query";
@@ -21,6 +19,7 @@ import RatingControl from "@/components/buttons/ratingControl";
import { Card } from "@/components/card/card";
import IconLink from "@/components/iconLink";
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
+import MusicPageSkeleton from "@/components/skeleton/musicPage";
import ShowMoreText from "@/components/showMoreText";
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
import { useBackdropStore } from "@/utils/store/backdrop";
@@ -195,19 +194,7 @@ function ArtistTitlePage() {
].filter(Boolean);
if (item.isPending) {
- return (
-
-
-
- );
+ return ;
}
if (item.isError) {
diff --git a/src/routes/_api/music/playlist/$id.tsx b/src/routes/_api/music/playlist/$id.tsx
index 4afb58e..6f23023 100644
--- a/src/routes/_api/music/playlist/$id.tsx
+++ b/src/routes/_api/music/playlist/$id.tsx
@@ -1,8 +1,6 @@
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
import { getLibraryApi } from "@jellyfin/sdk/lib/utils/api/library-api";
import { getPlaylistApi } from "@jellyfin/sdk/lib/utils/api/playlist-api";
-import Box from "@mui/material/Box";
-import CircularProgress from "@mui/material/CircularProgress";
import { useQuery } from "@tanstack/react-query";
import { createFileRoute } from "@tanstack/react-router";
import React, { useEffect } from "react";
@@ -13,6 +11,7 @@ import RatingControl from "@/components/buttons/ratingControl";
import { Card } from "@/components/card/card";
import CardScroller from "@/components/cardScroller/cardScroller";
import { ErrorNotice } from "@/components/notices/errorNotice/errorNotice";
+import MusicPageSkeleton from "@/components/skeleton/musicPage";
import ShowMoreText from "@/components/showMoreText";
import TagChip from "@/components/tagChip";
import { getTypeIcon } from "@/components/utils/iconsCollection";
@@ -100,19 +99,7 @@ function PlaylistTitlePage() {
}, [item.isSuccess, setAppBackdrop]);
if (item.isPending) {
- return (
-
-
-
- );
+ return ;
}
if (item.isError) {
diff --git a/src/routes/_api/search/index.tsx b/src/routes/_api/search/index.tsx
index 265925b..0cfaccf 100644
--- a/src/routes/_api/search/index.tsx
+++ b/src/routes/_api/search/index.tsx
@@ -6,6 +6,7 @@ import { useQuery } from "@tanstack/react-query";
import React, { useEffect, useMemo, useState } from "react";
import { Card } from "@/components/card/card";
import CardScroller from "@/components/cardScroller/cardScroller";
+import { CardSkeleton } from "@/components/skeleton/cards";
import { useBackdropStore } from "@/utils/store/backdrop";
import "./search.scss";
import {
@@ -424,7 +425,7 @@ function CategorySection({ category, query, api, user, onResult }: any) {
}
}, [data, isLoading, onResult]);
- if (isLoading) return ;
+ if (isLoading) return ;
if (!data?.items || data.items.length === 0) return null;
// ... (Card mapping logic same as before) ...
@@ -477,31 +478,30 @@ function CategorySection({ category, query, api, user, onResult }: any) {
);
}
-function CategorySkeleton() {
+function CategorySkeleton({ category }: { category: any }) {
+ const displayCards = category.value === "Episode" ? 4 : 7;
+ const cardType =
+ category.value === "Episode"
+ ? "thumb"
+ : ["MusicAlbum", "MusicArtist", "Person"].includes(category.value)
+ ? "square"
+ : "portrait";
+
return (
-
-
-
- {[1, 2, 3, 4, 5, 6].map((i) => (
-
+
+ {Array.from({ length: displayCards }, (_, index) => (
+
))}
-
-
+
+
);
}