最後整理,不連接SQLite(完成)

This commit is contained in:
jasonchenwork 2025-04-14 16:54:40 +08:00
parent 8ea87307f1
commit fb2ae757bb
6 changed files with 10 additions and 27 deletions

View File

@ -25,7 +25,7 @@ namespace DBObj
public ArtistManager()
{
AllArtists = new List<Artist>();
LoadArtists();
//LoadArtists();
}

View File

@ -29,7 +29,7 @@ namespace DBObj
// 继续使用可用的数据库(可能是更新后的或原本的本地数据库)
InitializeDatabase();
LoadSongs();
//LoadSongs();
InitializeNewSongLists();
InitializeHotSongLists();
}

View File

@ -111,14 +111,6 @@ namespace DualScreenDemo
activeButton.BackgroundImage = activeBackground;
}
private List<SongData> GetSongsByCategory(string category, int limit)
{
return allSongs.Where(song => song.Category == category)
.OrderByDescending(song => song.Plays)
.Take(limit)
.ToList();
}
private void UpdateSongList(List<SongData> songs)
{
currentPage = 0;

View File

@ -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);

View File

@ -173,22 +173,11 @@ namespace DualScreenDemo
private static Bitmap normalStateImageForLightControl;
private static Bitmap resizedNormalStateImageForLightControl;
public VideoPlayerForm videoPlayerForm;
public List<SongData> allSongs;
public List<Artist> allArtists;
public List<SongData> currentSongList;
public List<Artist> currentArtistList;
public List<SongData> publicSongList;
//private List<SongData> guoYuSongs;
//private List<SongData> guoYuSongs2;
//private List<SongData> taiYuSongs2;
//private List<SongData> yueYuSongs2;
//private List<SongData> yingWenSongs2;
//private List<SongData> riYuSongs2;
//private List<SongData> hanYuSongs2;
public static List<SongData> userRequestedSongs;
public static List<SongData> playedSongsHistory;
public static List<PlayState> playStates;

View File

@ -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);