mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 10:53:33 +00:00
include album artist song/album count for jellyfin, and disable playing/adding playinsts for artists with no albums
This commit is contained in:
parent
6f7cb468b2
commit
5d9906b8f2
4 changed files with 20 additions and 5 deletions
|
|
@ -284,7 +284,7 @@ const normalizeAlbumArtist = (
|
||||||
) || [];
|
) || [];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
albumCount: null,
|
albumCount: item.AlbumCount ?? null,
|
||||||
backgroundImageUrl: null,
|
backgroundImageUrl: null,
|
||||||
biography: item.Overview || null,
|
biography: item.Overview || null,
|
||||||
duration: item.RunTimeTicks / 10000,
|
duration: item.RunTimeTicks / 10000,
|
||||||
|
|
@ -308,7 +308,7 @@ const normalizeAlbumArtist = (
|
||||||
serverId: server?.id || '',
|
serverId: server?.id || '',
|
||||||
serverType: ServerType.JELLYFIN,
|
serverType: ServerType.JELLYFIN,
|
||||||
similarArtists,
|
similarArtists,
|
||||||
songCount: null,
|
songCount: item.SongCount ?? null,
|
||||||
userFavorite: item.UserData?.IsFavorite || false,
|
userFavorite: item.UserData?.IsFavorite || false,
|
||||||
userRating: null,
|
userRating: null,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -431,6 +431,7 @@ const providerIds = z.object({
|
||||||
});
|
});
|
||||||
|
|
||||||
const albumArtist = z.object({
|
const albumArtist = z.object({
|
||||||
|
AlbumCount: z.number().optional(),
|
||||||
BackdropImageTags: z.array(z.string()),
|
BackdropImageTags: z.array(z.string()),
|
||||||
ChannelId: z.null(),
|
ChannelId: z.null(),
|
||||||
DateCreated: z.string(),
|
DateCreated: z.string(),
|
||||||
|
|
@ -446,6 +447,7 @@ const albumArtist = z.object({
|
||||||
ProviderIds: providerIds.optional(),
|
ProviderIds: providerIds.optional(),
|
||||||
RunTimeTicks: z.number(),
|
RunTimeTicks: z.number(),
|
||||||
ServerId: z.string(),
|
ServerId: z.string(),
|
||||||
|
SongCount: z.number().optional(),
|
||||||
Type: z.string(),
|
Type: z.string(),
|
||||||
UserData: userData.optional(),
|
UserData: userData.optional(),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -340,9 +340,15 @@ export const AlbumArtistDetailContent = ({ background }: AlbumArtistDetailConten
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const albumCount = detailQuery?.data?.albumCount;
|
||||||
|
const artistContextItems =
|
||||||
|
(albumCount ?? 1) > 0
|
||||||
|
? ARTIST_CONTEXT_MENU_ITEMS
|
||||||
|
: ARTIST_CONTEXT_MENU_ITEMS.filter((item) => !item.id.toLowerCase().includes('play'));
|
||||||
|
|
||||||
const handleGeneralContextMenu = useHandleGeneralContextMenu(
|
const handleGeneralContextMenu = useHandleGeneralContextMenu(
|
||||||
LibraryItem.ALBUM_ARTIST,
|
LibraryItem.ALBUM_ARTIST,
|
||||||
ARTIST_CONTEXT_MENU_ITEMS,
|
artistContextItems,
|
||||||
);
|
);
|
||||||
|
|
||||||
const topSongs = topSongsQuery?.data?.items?.slice(0, 10);
|
const topSongs = topSongsQuery?.data?.items?.slice(0, 10);
|
||||||
|
|
@ -369,7 +375,10 @@ export const AlbumArtistDetailContent = ({ background }: AlbumArtistDetailConten
|
||||||
<LibraryBackgroundOverlay $backgroundColor={background} />
|
<LibraryBackgroundOverlay $backgroundColor={background} />
|
||||||
<DetailContainer>
|
<DetailContainer>
|
||||||
<Group spacing="md">
|
<Group spacing="md">
|
||||||
<PlayButton onClick={() => handlePlay(playButtonBehavior)} />
|
<PlayButton
|
||||||
|
disabled={albumCount === 0}
|
||||||
|
onClick={() => handlePlay(playButtonBehavior)}
|
||||||
|
/>
|
||||||
<Group spacing="xs">
|
<Group spacing="xs">
|
||||||
<Button
|
<Button
|
||||||
compact
|
compact
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ const MotionButton = styled(UnstyledButton)`
|
||||||
fill: var(--btn-filled-fg);
|
fill: var(--btn-filled-fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover:not([disabled]) {
|
||||||
background: var(--btn-filled-bg);
|
background: var(--btn-filled-bg);
|
||||||
transform: scale(1.1);
|
transform: scale(1.1);
|
||||||
|
|
||||||
|
|
@ -28,6 +28,10 @@ const MotionButton = styled(UnstyledButton)`
|
||||||
transform: scale(0.95);
|
transform: scale(0.95);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
transition: background-color 0.2s ease-in-out;
|
transition: background-color 0.2s ease-in-out;
|
||||||
transition: transform 0.2s ease-in-out;
|
transition: transform 0.2s ease-in-out;
|
||||||
`;
|
`;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue