${discNumbers.map((discNum) => {
const discTracks = discMap.get(discNum) ?? [];
return html`
${multiDisc
? html`
Disc ${discNum}
`
: nothing}
${discTracks.map((track) => {
// A row is owned if a file is behind it.
// It used to be the backend's inLibrary
// flag, which was set from a metadata
// row and could be true for a track
// that could not be played.
const owned = this.filePathFor(track) !== '';
return html`
this.onTrackRowDblClick(track)}
@contextmenu=${(e: MouseEvent) => this.onTrackContextMenu(e, track)}
@keydown=${(e: KeyboardEvent) => this.onTrackRowKeydown(e, track)}
>
${track.position}
${track.title}
${formatDuration(
track.length,
)}
${owned
? nothing
: html`
`}
`;
})}
`;
})}