熱門歌曲SQL查詢

This commit is contained in:
jasonchenwork 2025-04-11 17:00:30 +08:00
parent 0a69e4a3d7
commit 7c6d639c94

View File

@ -92,11 +92,12 @@ namespace DualScreenDemo
UpdateHotSongButtons(activeButton, activeBackground);
int songLimit = ReadHotSongLimit();
var selectedSongs = allSongs.Where(song => song.Category == category)
string query = $"SELECT * FROM SongLibrary WHERE `語別` = '{category}' ORDER BY `點播次數` DESC LIMIT {songLimit}";
var selectedSongs = PrimaryForm.Instance.SearchSongs_Mysql(query);
/*var selectedSongs = allSongs.Where(song => song.Category == category)
.OrderByDescending(song => song.Plays)
.Take(songLimit)
.ToList();
.ToList();*/
UpdateSongList(selectedSongs);
}