add genre image card placeholder

This commit is contained in:
jeffvli
2026-01-30 21:39:05 -08:00
parent 6962a05c96
commit 4d60f5b8d9
6 changed files with 148 additions and 40 deletions
@@ -2,7 +2,15 @@ import {
ItemListStateActions,
ItemListStateItemWithRequiredProperties,
} from '/@/renderer/components/item-list/helpers/item-list-state';
import { Album, AlbumArtist, Artist, Folder, Playlist, Song } from '/@/shared/types/domain-types';
import {
Album,
AlbumArtist,
Artist,
Folder,
Genre,
Playlist,
Song,
} from '/@/shared/types/domain-types';
/**
* Type guard to assert that an item has the required properties for dragging
@@ -34,7 +42,7 @@ const hasRequiredDragProperties = (
* @returns Array of items that should be dragged (with original values, asserting id, itemType, and _serverId)
*/
export const getDraggedItems = (
data: Album | AlbumArtist | Artist | Folder | Playlist | Song | undefined,
data: Album | AlbumArtist | Artist | Folder | Genre | Playlist | Song | undefined,
internalState?: ItemListStateActions,
updateSelection: boolean = true,
): ItemListStateItemWithRequiredProperties[] => {
@@ -26,6 +26,10 @@ const getDefaultRowsForItemType = (
return [rowMap.get('name')].filter(
(row): row is NonNullable<typeof row> => row !== undefined,
);
case LibraryItem.GENRE:
return [rowMap.get('name')].filter(
(row): row is NonNullable<typeof row> => row !== undefined,
);
case LibraryItem.PLAYLIST:
return [rowMap.get('name')].filter(
(row): row is NonNullable<typeof row> => row !== undefined,
@@ -53,6 +57,7 @@ const getRowIdFromTableColumn = (tableColumn: TableColumn): null | string => {
[TableColumn.CHANNELS]: null,
[TableColumn.CODEC]: null,
[TableColumn.COMMENT]: null,
[TableColumn.COMPOSER]: null,
[TableColumn.DATE_ADDED]: 'createdAt',
[TableColumn.DISC_NUMBER]: null,
[TableColumn.DURATION]: 'duration',
+10 -1
View File
@@ -4,6 +4,7 @@ import {
AlbumArtist,
Artist,
Folder,
Genre,
LibraryItem,
Playlist,
Song,
@@ -78,7 +79,15 @@ export interface ItemListHandle {
scrollToOffset: (offset: number, options?: { behavior?: 'auto' | 'smooth' }) => void;
}
export type ItemListItem = Album | AlbumArtist | Artist | Folder | Playlist | Song | undefined;
export type ItemListItem =
| Album
| AlbumArtist
| Artist
| Folder
| Genre
| Playlist
| Song
| undefined;
export interface ItemListTableComponentProps<TQuery> extends ItemListComponentProps<TQuery> {
autoFitColumns?: boolean;