diff --git a/backend/konduktor/collection_service.py b/backend/konduktor/collection_service.py index 9ae7b32..fbd545a 100644 --- a/backend/konduktor/collection_service.py +++ b/backend/konduktor/collection_service.py @@ -105,6 +105,7 @@ class CollectionService: cue_count=len(cues), hotcue_count=hotcues, has_grid=has_grid, + is_stem=getattr(e, "stems", None) is not None, ) def _build_tree(self, node, counter, is_root=True) -> list[PlaylistNode]: diff --git a/backend/konduktor/schemas.py b/backend/konduktor/schemas.py index 46c9ecf..a33d461 100644 --- a/backend/konduktor/schemas.py +++ b/backend/konduktor/schemas.py @@ -30,6 +30,7 @@ class Track(BaseModel): cue_count: int = 0 hotcue_count: int = 0 has_grid: bool = False + is_stem: bool = False # a Stem file ( child) vs a normal audio track class TrackPage(BaseModel): diff --git a/frontend/src/api.ts b/frontend/src/api.ts index c47953c..6146390 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -24,6 +24,7 @@ export interface Track { cue_count: number hotcue_count: number has_grid: boolean + is_stem: boolean } export interface TrackPage { diff --git a/frontend/src/lib/trackColumns.tsx b/frontend/src/lib/trackColumns.tsx index c90e93f..89a5fce 100644 --- a/frontend/src/lib/trackColumns.tsx +++ b/frontend/src/lib/trackColumns.tsx @@ -122,6 +122,29 @@ export const TRACK_COLUMNS: ColumnDef[] = [ ) }, }), + col.accessor('is_stem', { + id: 'type', + header: 'Type', + size: 64, + cell: (c) => + c.getValue() ? ( + // Stem file → stacked lines ("burger"), the usual stem glyph. + + + + + + + + ) : ( + // Normal audio track → music note. + + + + + + ), + }), col.accessor('album', { id: 'album', header: 'Album', size: 180, cell: editable('album') }), col.accessor('genre', { id: 'genre', header: 'Genre', size: 140, cell: editable('genre') }), col.accessor('label', { id: 'label', header: 'Label', size: 140, cell: editable('label') }), @@ -247,7 +270,7 @@ export const DEFAULT_COLUMN_ORDER: string[] = TRACK_COLUMNS.map((c) => c.id as s // Columns shown out of the box; the rest are opt-in via the menu. const DEFAULT_VISIBLE = new Set([ - 'title', 'album', 'genre', 'bpm', 'key', 'rating', 'length', 'cue_count', 'playcount', + 'title', 'type', 'album', 'genre', 'bpm', 'key', 'rating', 'length', 'cue_count', 'playcount', ]) export const DEFAULT_COLUMN_VISIBILITY: VisibilityState = Object.fromEntries( DEFAULT_COLUMN_ORDER.map((id) => [id, DEFAULT_VISIBLE.has(id)]),