From 7c6d639c94f4a930067030884dbae7fb354a579a Mon Sep 17 00:00:00 2001 From: jasonchenwork Date: Fri, 11 Apr 2025 17:00:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=86=B1=E9=96=80=E6=AD=8C=E6=9B=B2SQL?= =?UTF-8?q?=E6=9F=A5=E8=A9=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PrimaryFormParts/HotSong/PrimaryForm.HotSong.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PrimaryFormParts/HotSong/PrimaryForm.HotSong.cs b/PrimaryFormParts/HotSong/PrimaryForm.HotSong.cs index eed5e28..b885018 100644 --- a/PrimaryFormParts/HotSong/PrimaryForm.HotSong.cs +++ b/PrimaryFormParts/HotSong/PrimaryForm.HotSong.cs @@ -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); }