Cover art support for folder view (Subsonic servers only) (#1608)

* add coverArt support for subsonic folders
This commit is contained in:
marank
2026-01-24 06:26:51 +01:00
committed by GitHub
parent c79e041777
commit f016d2cdf4
5 changed files with 10 additions and 1 deletions
@@ -778,6 +778,7 @@ export const SubsonicController: InternalControllerEndpoint = {
res.body.indexes?.index?.flatMap((idx) =>
idx.artist.map((artist) => ({
artist: artist.name,
coverArt: artist.coverArt,
id: artist.id.toString(),
isDir: true,
title: artist.name,
@@ -27,6 +27,9 @@ const ImageColumnBase = (props: ItemTableListInnerColumn) => {
const internalState = (props as any).internalState;
const [isHovered, setIsHovered] = useState(false);
const isFolder = (rowItem as unknown as Folder)?._itemType === LibraryItem.FOLDER;
const shouldShowFolderIcon = isFolder && !item?.imageId && !item?.imageUrl;
const handlePlay = (playType: Play, event: React.MouseEvent<HTMLButtonElement>) => {
if (!item) {
return;
@@ -114,7 +117,7 @@ const ImageColumnBase = (props: ItemTableListInnerColumn) => {
);
}
if ((rowItem as unknown as Folder)?._itemType === LibraryItem.FOLDER) {
if (shouldShowFolderIcon) {
return (
<TableColumnContainer {...props}>
<Icon className={styles.folderIcon} icon="folder" size="2xl" />
@@ -399,6 +399,8 @@ const normalizeFolder = (
songs: results?.songs || [],
},
id: item.id.toString(),
imageId: item.coverArt?.toString() || null,
imageUrl: null,
name: item.title,
parentId: item.parent,
};
@@ -613,6 +613,7 @@ const getIndexes = z.object({
.object({
artist: z
.object({
coverArt: z.string().optional(),
id: z.string(),
name: z.string(),
})
+2
View File
@@ -257,6 +257,8 @@ export type Folder = {
songs: Song[];
};
id: string;
imageId?: null | string;
imageUrl?: null | string;
name: string;
parentId?: string;
};