diff --git a/src/components/common/SongItem.tsx b/src/components/common/SongItem.tsx index 6d58aea..7b8d4ac 100644 --- a/src/components/common/SongItem.tsx +++ b/src/components/common/SongItem.tsx @@ -2,6 +2,16 @@ import React from 'react'; import ActionButton from './ActionButton'; import type { SongItemProps } from '../../types'; +// Utility function to extract filename from path +const extractFilename = (path: string): string => { + if (!path) return ''; + + // Handle different path separators (Windows backslash, Unix forward slash) + const normalizedPath = path.replace(/\\/g, '/'); + const parts = normalizedPath.split('/'); + return parts[parts.length - 1] || ''; +}; + const SongItem: React.FC = ({ song, context, @@ -133,6 +143,12 @@ const SongItem: React.FC = ({

{song.artist}

+ {/* Show filename for all contexts except queue */} + {context !== 'queue' && song.path && ( +

+ {extractFilename(song.path)} +

+ )} {song.count && (

Played {song.count} times