From fb2ae757bb4f96d1152b21b74d3a5fa8323f01c3 Mon Sep 17 00:00:00 2001 From: jasonchenwork Date: Mon, 14 Apr 2025 16:54:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=BE=8C=E6=95=B4=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E9=80=A3=E6=8E=A5SQLite(=E5=AE=8C=E6=88=90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DBObj/ArtistManager.cs | 2 +- DBObj/SongListManager.cs | 2 +- PrimaryFormParts/HotSong/PrimaryForm.HotSong.cs | 8 -------- PrimaryFormParts/PrimaryForm.VodScreen.cs | 8 +++++--- PrimaryFormParts/PrimaryForm.cs | 13 +------------ Program.cs | 4 ++-- 6 files changed, 10 insertions(+), 27 deletions(-) diff --git a/DBObj/ArtistManager.cs b/DBObj/ArtistManager.cs index 8b126dd..cf64819 100644 --- a/DBObj/ArtistManager.cs +++ b/DBObj/ArtistManager.cs @@ -25,7 +25,7 @@ namespace DBObj public ArtistManager() { AllArtists = new List(); - LoadArtists(); + //LoadArtists(); } diff --git a/DBObj/SongListManager.cs b/DBObj/SongListManager.cs index 704c787..430ce2d 100644 --- a/DBObj/SongListManager.cs +++ b/DBObj/SongListManager.cs @@ -29,7 +29,7 @@ namespace DBObj // 继续使用可用的数据库(可能是更新后的或原本的本地数据库) InitializeDatabase(); - LoadSongs(); + //LoadSongs(); InitializeNewSongLists(); InitializeHotSongLists(); } diff --git a/PrimaryFormParts/HotSong/PrimaryForm.HotSong.cs b/PrimaryFormParts/HotSong/PrimaryForm.HotSong.cs index 4556349..d1ac97b 100644 --- a/PrimaryFormParts/HotSong/PrimaryForm.HotSong.cs +++ b/PrimaryFormParts/HotSong/PrimaryForm.HotSong.cs @@ -111,14 +111,6 @@ namespace DualScreenDemo activeButton.BackgroundImage = activeBackground; } - private List GetSongsByCategory(string category, int limit) - { - return allSongs.Where(song => song.Category == category) - .OrderByDescending(song => song.Plays) - .Take(limit) - .ToList(); - } - private void UpdateSongList(List songs) { currentPage = 0; diff --git a/PrimaryFormParts/PrimaryForm.VodScreen.cs b/PrimaryFormParts/PrimaryForm.VodScreen.cs index 3611ea9..e2f169b 100644 --- a/PrimaryFormParts/PrimaryForm.VodScreen.cs +++ b/PrimaryFormParts/PrimaryForm.VodScreen.cs @@ -131,10 +131,12 @@ namespace DualScreenDemo private void AlbumButton_Click(object sender, EventArgs e) { - - var selectedSongs = allSongs.Where(song => song.ArtistA == currentSelectedSong.ArtistA) + string name = currentSelectedSong.ArtistA; + string query = $"SELECT * FROM SongLibrary WHERE `歌星 A` = '{name}' ORDER BY `新增日期` DESC"; + var selectedSongs = SearchSongs_Mysql(query); + /*var selectedSongs = allSongs.Where(song => song.ArtistA == currentSelectedSong.ArtistA) .OrderByDescending(song => song.AddedTime) - .ToList(); + .ToList();*/ UpdateSongList(selectedSongs); SetVodScreenPictureBoxAndButtonsVisibility(false); diff --git a/PrimaryFormParts/PrimaryForm.cs b/PrimaryFormParts/PrimaryForm.cs index 1c4a5fd..935d25b 100644 --- a/PrimaryFormParts/PrimaryForm.cs +++ b/PrimaryFormParts/PrimaryForm.cs @@ -173,22 +173,11 @@ namespace DualScreenDemo private static Bitmap normalStateImageForLightControl; private static Bitmap resizedNormalStateImageForLightControl; - public VideoPlayerForm videoPlayerForm; - - - public List allSongs; - public List allArtists; public List currentSongList; public List currentArtistList; public List publicSongList; - //private List guoYuSongs; - //private List guoYuSongs2; - //private List taiYuSongs2; - //private List yueYuSongs2; - //private List yingWenSongs2; - //private List riYuSongs2; - //private List hanYuSongs2; + public static List userRequestedSongs; public static List playedSongsHistory; public static List playStates; diff --git a/Program.cs b/Program.cs index 8fb18c4..cf1a596 100644 --- a/Program.cs +++ b/Program.cs @@ -51,8 +51,8 @@ static void Main() // 創建主窗體 primaryForm = new PrimaryForm(); - primaryForm.allSongs = songListManager.AllSongs; - primaryForm.allArtists = artistManager.AllArtists; + //primaryForm.allSongs = songListManager.AllSongs; + //primaryForm.allArtists = artistManager.AllArtists; primaryForm.StartPosition = FormStartPosition.Manual; primaryForm.Location = new Point(0, 0); primaryForm.Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);