使歌曲搜尋同歌名在同頁面排列

This commit is contained in:
allen.yan 2025-08-08 11:11:15 +08:00
parent 65c7ad7c14
commit baa0179fb1
6 changed files with 7 additions and 7 deletions

View File

@ -489,8 +489,8 @@ namespace DualScreenDemo
if (artistText.Length > 3)
{
artistLabel.Location = new Point(artistX - 581, y + 33);
artistLabel.Size = new Size(artistWidth + 573, ItemHeight - 35);
artistLabel.Location = new Point(artistX - 502, y + 33);
artistLabel.Size = new Size(artistWidth + 490, ItemHeight - 35);
}
artistLabel.Text = artistText;

View File

@ -312,7 +312,7 @@ namespace DualScreenDemo
string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM song_library_cache ORDER BY `song_id` DESC LIMIT 1000;"
: $"SELECT * FROM song_library_cache WHERE `phonetic_abbr` LIKE '{searchText}%' ORDER BY `song_id`;";
: $"SELECT * FROM song_library_cache WHERE `phonetic_abbr` LIKE '{searchText}%' ORDER BY `song_name`;";
var searchResults = SearchSongs_Mysql(query);
// 重置分頁

View File

@ -231,7 +231,7 @@ namespace DualScreenDemo
// 檢查是否為空字串或空白字元
string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM song_library_cache ORDER BY song_id DESC LIMIT 1000;"
: $"SELECT * FROM song_library_cache WHERE song_name LIKE '{searchText}%' ORDER BY song_id DESC;";
: $"SELECT * FROM song_library_cache WHERE song_name LIKE '{searchText}%' ORDER BY song_name DESC;";
var searchResults = SearchSongs_Mysql(query);
// 重置分頁

View File

@ -288,7 +288,7 @@ namespace DualScreenDemo
// 例如:根據輸入框的內容搜尋歌曲
string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM song_library_cache ORDER BY song_id DESC LIMIT 1000;"
: $"SELECT * FROM song_library_cache WHERE song_name LIKE '{searchText}%' ORDER BY song_id DESC;";
: $"SELECT * FROM song_library_cache WHERE song_name LIKE '{searchText}%' ORDER BY song_name DESC;";
var searchResults = SearchSongs_Mysql(query);

View File

@ -267,7 +267,7 @@ namespace DualScreenDemo
// 例如:根據輸入框的內容搜尋歌曲
string query = string.IsNullOrWhiteSpace(searchText)
? "SELECT * FROM song_library_cache ORDER BY song_id DESC LIMIT 1000;"
: $"SELECT * FROM song_library_cache WHERE pinyin_abbr LIKE '{searchText}%' ORDER BY `song_id` DESC;";
: $"SELECT * FROM song_library_cache WHERE pinyin_abbr LIKE '{searchText}%' ORDER BY `song_name` DESC;";
var searchResults = SearchSongs_Mysql(query);
// 重置分頁
currentPage = 0;

View File

@ -509,7 +509,7 @@ namespace DualScreenDemo
string query;
if (int.TryParse(searchText, out int length))
{
query = $"SELECT * FROM song_library_cache WHERE CHAR_LENGTH(song_name) = {length} ;";
query = $"SELECT * FROM song_library_cache WHERE CHAR_LENGTH(song_name) = {length} order by 'song_name' DESC ;";
}
else
{