Well, this should be rather easy by using a “distinct” or “group by” on the SQL backends. (difficult on gdb however)
The catch is, on what to specify the “distinct” ? I’d say artist || album || song for a start, but this has to be thought out cleverly with NVLs for the various file-types.
Filename without extension might be a candidate too.