國語台語新歌排行SQL查詢
This commit is contained in:
parent
1c8894c348
commit
0a69e4a3d7
@ -8,13 +8,10 @@ namespace DualScreenDemo
|
||||
UpdateHotSongButtons(guoYuNewSongButtonHotSong, guoYuNewSongHotSongActiveBackground);
|
||||
|
||||
int songLimit = ReadHotSongLimit();
|
||||
|
||||
// 使用 AddedTime 排序
|
||||
var selectedSongs = allSongs.Where(song => song.Category == "國語")
|
||||
.OrderByDescending(song => song.AddedTime)
|
||||
.Take(songLimit)
|
||||
.ToList();
|
||||
|
||||
string query = $"SELECT * FROM SongLibrary WHERE `語別` = '國語' ORDER BY `新增日期` DESC LIMIT {songLimit}";
|
||||
var selectedSongs = PrimaryForm.Instance.SearchSongs_Mysql(query);
|
||||
|
||||
currentPage = 0;
|
||||
currentSongList = selectedSongs;
|
||||
totalPages = (int)Math.Ceiling((double)selectedSongs.Count / itemsPerPage);
|
||||
|
@ -8,12 +8,9 @@ namespace DualScreenDemo
|
||||
UpdateHotSongButtons(taiYuNewSongButtonHotSong, taiYuNewSongHotSongActiveBackground);
|
||||
|
||||
int songLimit = ReadHotSongLimit();
|
||||
|
||||
// 使用 AddedTime 排序
|
||||
var selectedSongs = allSongs.Where(song => song.Category == "台語")
|
||||
.OrderByDescending(song => song.AddedTime)
|
||||
.Take(songLimit)
|
||||
.ToList();
|
||||
|
||||
string query = $"SELECT * FROM SongLibrary WHERE `語別` = '台語' ORDER BY `新增日期` DESC LIMIT {songLimit}";
|
||||
var selectedSongs = PrimaryForm.Instance.SearchSongs_Mysql(query);
|
||||
|
||||
currentPage = 0;
|
||||
currentSongList = selectedSongs;
|
||||
|
@ -15,21 +15,10 @@ namespace DualScreenDemo
|
||||
private Button clearButtonWordCountSongs;
|
||||
private Button closeButtonWordCountSongs;
|
||||
|
||||
//private string[] numberWordCountSymbols;
|
||||
//private (int X, int Y, int Width, int Height)[] numberWordCountButtonCoords;
|
||||
//private Dictionary<string, (string normal, string mouseDown, string mouseOver)> numberWordCountButtonImages;
|
||||
|
||||
//private (int X, int Y, int Width, int Height) modifyButtonWordCountCoords;
|
||||
//private (int X, int Y, int Width, int Height) clearButtonWordCountCoords;
|
||||
//private (int X, int Y, int Width, int Height) closeButtonWordCountCoords;
|
||||
|
||||
private RichTextBox inputBoxWordCountSongs;
|
||||
|
||||
//private (int X, int Y, int Width, int Height) inputBoxWordCountCoords;
|
||||
//private string inputBoxWordCountFontName;
|
||||
//private float inputBoxWordCountFontSize;
|
||||
//private FontStyle inputBoxWordCountFontStyle;
|
||||
//private Color inputBoxWordCountForeColor;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para> 點擊「注音歌手搜尋」按鈕時執行的事件處理函式。</para>
|
||||
@ -71,35 +60,6 @@ namespace DualScreenDemo
|
||||
pictureBoxWordCountSongs.Visible = true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>從 config.ini 設定檔中載入注音符號(NumberWordCount Symbols)。</para>
|
||||
/// <para>讀取 ini 檔的 [NumberWordCountSymbols] 區塊,並將「Symbols」欄位的值解析為陣列。</para>
|
||||
/// </summary>
|
||||
/*private void LoadNumberWordCountSymbolsFromConfig()
|
||||
{
|
||||
// 建立 INI 檔案解析器
|
||||
var parser = new FileIniDataParser();
|
||||
|
||||
// 設定檔路徑
|
||||
string iniFilePath = "config.ini";
|
||||
|
||||
IniData data;
|
||||
|
||||
// 以 UTF-8 編碼開啟並讀取 INI 檔案
|
||||
using (var reader = new StreamReader(iniFilePath, Encoding.UTF8))
|
||||
{
|
||||
// 解析 INI 檔內容
|
||||
data = parser.ReadData(reader);
|
||||
}
|
||||
|
||||
// 取得 [NumberWordCountSymbols] 區塊中的 "Symbols" 欄位內容
|
||||
string symbols = data["NumberWordCountSymbols"]["Symbols"];
|
||||
|
||||
// 將符號字串以逗號分隔,轉換為字串陣列
|
||||
numberWordCountSymbols = symbols.Split(',');
|
||||
}*/
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 從設定檔 (config.ini) 載入 INI 設定數據。
|
||||
@ -117,20 +77,6 @@ namespace DualScreenDemo
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 從 INI 設定數據中讀取注音符號 (NumberWordCount Symbols)。
|
||||
/// </summary>
|
||||
/// <param name="data">已解析的 INI 設定數據。</param>
|
||||
/// <returns>回傳包含注音符號的字串陣列。</returns>
|
||||
/*private string[] LoadNumberWordCountSymbols(IniData data)
|
||||
{
|
||||
// 從 INI 檔案的 [NumberWordCountSymbols] 區塊取得 Symbols 欄位值
|
||||
string symbols = data["NumberWordCountSymbols"]["Symbols"];
|
||||
|
||||
// 以逗號分隔字串並轉換為字串陣列
|
||||
return symbols.Split(',');
|
||||
}*/
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 從 INI 設定數據中載入按鈕座標資料。
|
||||
|
Loading…
x
Reference in New Issue
Block a user