feat(M003/S03): play count column + data pipeline

Backend:
- GetAllTracksWithFullMetadata queries now select play_count and last_played
- mapTrackRow accepts and passes through PlayCount/LastPlayed
- PlayCount + LastPlayed added to library.Track struct
- sqlcgen Row types updated with new fields

Frontend:
- PlayCount + LastPlayed added to library.Track TypeScript model
- 'Plays' column added to track-list column definitions (60px, right-aligned, sortable)

Queries without play data (search, genre, album) pass 0/empty defaults.
This commit is contained in:
2026-03-21 15:33:08 -04:00
parent 9c85cfcc7b
commit 2ee157a376
5 changed files with 48 additions and 4 deletions
+14
View File
@@ -65,6 +65,8 @@ func mapTrackRow(
year int64,
composer, fileType string,
sampleRate, bitDepth, channels, bitrate, fileSize int64,
playCount int64,
lastPlayed string,
) Track {
return Track{
TrackName: title,
@@ -83,6 +85,8 @@ func mapTrackRow(
Channels: channels,
Bitrate: bitrate,
FileSize: fileSize,
PlayCount: playCount,
LastPlayed: lastPlayed,
}
}
@@ -146,6 +150,8 @@ func (l *Library) GetAllTracks() ([]Track, error) {
row.Channels,
row.Bitrate,
row.FileSize,
row.PlayCount,
row.LastPlayed,
))
}
@@ -198,6 +204,7 @@ func (l *Library) SearchTracks(
row.Channels,
row.Bitrate,
row.FileSize,
0, "",
))
}
@@ -237,6 +244,7 @@ func (l *Library) GetAlbumTracks(albumID int64) ([]Track, error) {
row.Channels,
row.Bitrate,
row.FileSize,
0, "",
))
}
@@ -411,6 +419,7 @@ func (l *Library) GetTracksByGenre(
row.Channels,
row.Bitrate,
row.FileSize,
0, "",
))
}
@@ -492,6 +501,8 @@ func (l *Library) GetAllTracksByLibrary(
row.Channels,
row.Bitrate,
row.FileSize,
row.PlayCount,
row.LastPlayed,
))
}
@@ -724,6 +735,7 @@ func (l *Library) GetTracksByGenreByLibrary(
row.Channels,
row.Bitrate,
row.FileSize,
0, "",
))
}
@@ -775,6 +787,7 @@ func (l *Library) GetAlbumTracksByLibrary(
row.Channels,
row.Bitrate,
row.FileSize,
0, "",
))
}
@@ -822,6 +835,7 @@ func (l *Library) SearchTracksByLibrary(
row.Channels,
row.Bitrate,
row.FileSize,
0, "",
))
}