superstar 1.2.1 20250711

調整變數名稱
This commit is contained in:
jasonchenwork 2025-07-11 13:35:47 +08:00
parent 7b5fed4332
commit 7c27380fac
26 changed files with 28 additions and 62 deletions

View File

@ -18,11 +18,10 @@ namespace DualScreenDemo
string query = SetQueryforSQL("F1"); // Set the query for SQL to filter by genre "F1" string query = SetQueryforSQL("F1"); // Set the query for SQL to filter by genre "F1"
var chinaSongs = SearchSongs_Mysql(query); var chinaSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = chinaSongs;
totalPages = (int)Math.Ceiling((double)chinaSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)chinaSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(chinaSongs);
} }
} }
} }

View File

@ -18,11 +18,10 @@ namespace DualScreenDemo
string query = SetQueryforSQL("A1"); // Set the query for SQL to filter by genre "F1" string query = SetQueryforSQL("A1"); // Set the query for SQL to filter by genre "F1"
var loveDuetSongs = SearchSongs_Mysql(query); var loveDuetSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = loveDuetSongs;
totalPages = (int)Math.Ceiling((double)loveDuetSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)loveDuetSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(loveDuetSongs);
} }
} }
} }

View File

@ -18,11 +18,10 @@ namespace DualScreenDemo
string query = SetQueryforSQL("C1"); // Set the query for SQL to filter by genre "F1" string query = SetQueryforSQL("C1"); // Set the query for SQL to filter by genre "F1"
var medleyDanceSongs = SearchSongs_Mysql(query); var medleyDanceSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = medleyDanceSongs;
totalPages = (int)Math.Ceiling((double)medleyDanceSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)medleyDanceSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(medleyDanceSongs);
} }
} }
} }

View File

@ -18,11 +18,10 @@ namespace DualScreenDemo
string query = SetQueryforSQL("D1"); // Set the query for SQL to filter by genre "F1" string query = SetQueryforSQL("D1"); // Set the query for SQL to filter by genre "F1"
var ninetiesSongs = SearchSongs_Mysql(query); var ninetiesSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = ninetiesSongs;
totalPages = (int)Math.Ceiling((double)ninetiesSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)ninetiesSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(ninetiesSongs);
} }
} }
} }

View File

@ -18,11 +18,10 @@ namespace DualScreenDemo
string query = SetQueryforSQL("E1"); // Set the query for SQL to filter by genre "F1" string query = SetQueryforSQL("E1"); // Set the query for SQL to filter by genre "F1"
var nostalgicSongs = SearchSongs_Mysql(query); var nostalgicSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = nostalgicSongs;
totalPages = (int)Math.Ceiling((double)nostalgicSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)nostalgicSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(nostalgicSongs);
} }
} }
} }

View File

@ -18,11 +18,10 @@ namespace DualScreenDemo
string query = SetQueryforSQL("B1"); // Set the query for SQL to filter by genre "F1" string query = SetQueryforSQL("B1"); // Set the query for SQL to filter by genre "F1"
var talentShowSongs = SearchSongs_Mysql(query); var talentShowSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = talentShowSongs;
totalPages = (int)Math.Ceiling((double)talentShowSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)talentShowSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(talentShowSongs);
} }
} }
} }

View File

@ -18,11 +18,10 @@ namespace DualScreenDemo
string query = SetQueryforSQL("G1"); // Set the query for SQL to filter by genre "F1" string query = SetQueryforSQL("G1"); // Set the query for SQL to filter by genre "F1"
var vietnameseSongs = SearchSongs_Mysql(query); var vietnameseSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = vietnameseSongs;
totalPages = (int)Math.Ceiling((double)vietnameseSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)vietnameseSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(vietnameseSongs);
} }
} }
} }

View File

@ -185,12 +185,11 @@ namespace DualScreenDemo
string query = SetQueryforSQL("A1"); string query = SetQueryforSQL("A1");
var loveDuetSongs = SearchSongs_Mysql(query); var loveDuetSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = loveDuetSongs;
totalPages = (int)Math.Ceiling((double)loveDuetSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)loveDuetSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(loveDuetSongs);
SetHotSongButtonsVisibility(false); SetHotSongButtonsVisibility(false);

View File

@ -17,12 +17,11 @@ namespace DualScreenDemo
string query = "SELECT * FROM song_library_cache WHERE language_name = '國語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;"; string query = "SELECT * FROM song_library_cache WHERE language_name = '國語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;";
var guoYuSongs = SearchSongs_Mysql(query); var guoYuSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = guoYuSongs;
totalPages = (int)Math.Ceiling((double)guoYuSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)guoYuSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(guoYuSongs);
} }
} }
} }

View File

@ -17,12 +17,11 @@ namespace DualScreenDemo
string query = "SELECT * FROM song_library_cache WHERE language_name = '韓語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;"; string query = "SELECT * FROM song_library_cache WHERE language_name = '韓語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;";
var hanYuSongs = SearchSongs_Mysql(query); var hanYuSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = hanYuSongs;
totalPages = (int)Math.Ceiling((double)hanYuSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)hanYuSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(hanYuSongs);
} }
} }
} }

View File

@ -18,12 +18,11 @@ namespace DualScreenDemo
string query = "SELECT * FROM song_library_cache WHERE language_name = '日語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;"; string query = "SELECT * FROM song_library_cache WHERE language_name = '日語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;";
var riYuSongs = SearchSongs_Mysql(query); var riYuSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = riYuSongs;
totalPages = (int)Math.Ceiling((double)riYuSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)riYuSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(riYuSongs);
} }
} }
} }

View File

@ -17,12 +17,11 @@ namespace DualScreenDemo
string query = "SELECT * FROM song_library_cache WHERE language_name = '台語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;"; string query = "SELECT * FROM song_library_cache WHERE language_name = '台語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;";
var taiYuSongs = SearchSongs_Mysql(query); var taiYuSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = taiYuSongs;
totalPages = (int)Math.Ceiling((double)taiYuSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)taiYuSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(taiYuSongs);
} }
} }
} }

View File

@ -17,12 +17,11 @@ namespace DualScreenDemo
string query = "SELECT * FROM song_library_cache WHERE language_name = '英語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;"; string query = "SELECT * FROM song_library_cache WHERE language_name = '英語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;";
var yingWenSongs = SearchSongs_Mysql(query); var yingWenSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = yingWenSongs;
totalPages = (int)Math.Ceiling((double)yingWenSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)yingWenSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(yingWenSongs);
} }
} }
} }

View File

@ -18,12 +18,11 @@ namespace DualScreenDemo
string query = "SELECT * FROM song_library_cache WHERE language_name = '粵語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;"; string query = "SELECT * FROM song_library_cache WHERE language_name = '粵語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;";
var yueYuSongs = SearchSongs_Mysql(query); var yueYuSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = yueYuSongs;
totalPages = (int)Math.Ceiling((double)yueYuSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)yueYuSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(yueYuSongs);
} }
} }
} }

View File

@ -136,12 +136,11 @@ namespace DualScreenDemo
string query = "SELECT * FROM song_library_cache WHERE language_name = '國語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;"; string query = "SELECT * FROM song_library_cache WHERE language_name = '國語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;";
var guoYuSongs = SearchSongs_Mysql(query); var guoYuSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = guoYuSongs;
totalPages = (int)Math.Ceiling((double)guoYuSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)guoYuSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(guoYuSongs);
SetHotSongButtonsVisibility(false); SetHotSongButtonsVisibility(false);

View File

@ -112,12 +112,11 @@ namespace DualScreenDemo
private void UpdateSongList(List<SongData> songs) private void UpdateSongList(List<SongData> songs)
{ {
currentPage = 0; currentPage = 0;
currentSongList = songs;
totalPages = (int)Math.Ceiling((double)songs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)songs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(songs);
} }
private void SetButtonsVisibility() private void SetButtonsVisibility()

View File

@ -11,11 +11,10 @@ namespace DualScreenDemo
var selectedSongs = PrimaryForm.Instance.SearchSongs_Mysql(query); var selectedSongs = PrimaryForm.Instance.SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = selectedSongs;
totalPages = (int)Math.Ceiling((double)selectedSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)selectedSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(selectedSongs);
} }
} }
} }

View File

@ -11,11 +11,10 @@ namespace DualScreenDemo
var selectedSongs = SearchSongs_Mysql(query); var selectedSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = selectedSongs;
totalPages = (int)Math.Ceiling((double)selectedSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)selectedSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(selectedSongs);
} }
} }
} }

View File

@ -78,13 +78,10 @@ namespace DualScreenDemo
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY song_counts DESC LIMIT 100"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY song_counts DESC LIMIT 100";
var guoYuSongs = SearchSongs_Mysql(query); var guoYuSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = guoYuSongs;
totalPages = (int)Math.Ceiling((double)guoYuSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)guoYuSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(guoYuSongs);
SetHotSongButtonsVisibility(false); SetHotSongButtonsVisibility(false);
SetNewSongButtonsVisibility(false); SetNewSongButtonsVisibility(false);
@ -125,16 +122,12 @@ namespace DualScreenDemo
activeButton.BackgroundImage = activeBackground; activeButton.BackgroundImage = activeBackground;
string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY song_counts DESC LIMIT 100"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY song_counts DESC LIMIT 100";
var selectedSongs = SearchSongs_Mysql(query); var selectedSongs = SearchSongs_Mysql(query);
/*var selectedSongs = allSongs.Where(song => song.Category == category)
.OrderByDescending(song => song.Plays)
.ToList();*/
currentPage = 0; currentPage = 0;
currentSongList = selectedSongs;
totalPages = (int)Math.Ceiling((double)selectedSongs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)selectedSongs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(selectedSongs);
} }
private void SetPictureBoxLanguageButtonsVisibility(bool isVisible) private void SetPictureBoxLanguageButtonsVisibility(bool isVisible)

View File

@ -89,14 +89,11 @@ namespace DualScreenDemo
string query = setQueryforNewSong("國語"); string query = setQueryforNewSong("國語");
var guoYuSongs2 = SearchSongs_Mysql(query); var guoYuSongs2 = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = guoYuSongs2;
totalPages = (int)Math.Ceiling((double)guoYuSongs2.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)guoYuSongs2.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(guoYuSongs2);
SetHotSongButtonsVisibility(false); SetHotSongButtonsVisibility(false);
SetSingerSearchButtonsVisibility(false); SetSingerSearchButtonsVisibility(false);
SetSongSearchButtonsVisibility(false); SetSongSearchButtonsVisibility(false);

View File

@ -317,11 +317,10 @@ namespace DualScreenDemo
var searchResults = SearchSongs_Mysql(query); var searchResults = SearchSongs_Mysql(query);
// 重置分頁 // 重置分頁
currentPage = 0; currentPage = 0;
currentSongList = searchResults;
totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage);
// 更新多頁面面板的內容 // 更新多頁面面板的內容
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(searchResults);
} }

View File

@ -236,11 +236,10 @@ namespace DualScreenDemo
var searchResults = SearchSongs_Mysql(query); var searchResults = SearchSongs_Mysql(query);
// 重置分頁 // 重置分頁
currentPage = 0; currentPage = 0;
currentSongList = searchResults;
totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage);
// 更新多頁面面板的內容 // 更新多頁面面板的內容
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(searchResults);
} }

View File

@ -294,11 +294,10 @@ namespace DualScreenDemo
var searchResults = SearchSongs_Mysql(query); var searchResults = SearchSongs_Mysql(query);
// 重置分頁 // 重置分頁
currentPage = 0; currentPage = 0;
currentSongList = searchResults;
totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage);
// 更新多頁面面板的內容 // 更新多頁面面板的內容
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(searchResults);
} }

View File

@ -557,11 +557,10 @@ namespace DualScreenDemo
var searchResults = SearchSongs_Mysql(query); var searchResults = SearchSongs_Mysql(query);
// 重置分頁 // 重置分頁
currentPage = 0; currentPage = 0;
currentSongList = searchResults;
totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage);
// 更新多頁面面板的內容 // 更新多頁面面板的內容
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(searchResults);
} }

View File

@ -490,11 +490,10 @@ namespace DualScreenDemo
var searchResults = SearchSongs_Mysql(query); var searchResults = SearchSongs_Mysql(query);
// 重置分頁 // 重置分頁
currentPage = 0; currentPage = 0;
currentSongList = searchResults;
totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage);
// 更新多頁面面板的內容 // 更新多頁面面板的內容
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(searchResults);
} }

View File

@ -52,12 +52,11 @@ namespace DualScreenDemo
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' LIMIT 100;"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' LIMIT 100;";
var searchResult = SearchSongs_Mysql(query); var searchResult = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;
currentSongList = searchResult;
totalPages = (int)Math.Ceiling((double)searchResult.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)searchResult.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(currentSongList); multiPagePanel.LoadSongs(searchResult);
// 隱藏其他 UI // 隱藏其他 UI
SetHotSongButtonsVisibility(false); SetHotSongButtonsVisibility(false);