手機歌曲查詢修正

This commit is contained in:
allen.yan 2025-08-08 16:31:26 +08:00
parent 068075c89b
commit a4b397e812
11 changed files with 67 additions and 97 deletions

View File

@ -71,7 +71,7 @@ namespace DBObj
}
public List<SongData> SearchSongsByName(string keyword)
{
string query = $"SELECT * FROM song_library_cache WHERE LOWER(song_name) LIKE CONCAT('%', LOWER('{keyword}'), '%');";
string query = $"SELECT * FROM song_library_cache WHERE LOWER(song_name) LIKE CONCAT('%', LOWER('{keyword}'), '%') ORDER BY song_name DESC;";
return select_Mysql(query);
}
public SongData SearchSongByNumber(string songNumber)

View File

@ -1,6 +1,7 @@
using DualScreenDemo;
using System;
using System.IO;
using System.Numerics;
using System.Windows.Navigation;
namespace DBObj
{
@ -93,6 +94,18 @@ namespace DBObj
}
}
public static void Cancel(SongData song)
{
//if (song.FileExistsInServers())
//{
not_played.Remove(song);
played.Remove(song);
// PrimaryForm.Instance.AddSongCount(songData.Number);
chkCut();
//}
}
public static void Insert(SongData song)
{
if (song.FileExistsInServers()) {

View File

@ -5,7 +5,7 @@ namespace DualScreenDemo
private void ChinaSongsButton_Click(object sender, EventArgs e)
{
ResetCatBtnStatus();
chinaSongsButton.BackgroundImage = chinaActiveBackground;
/*chinaSongs = allSongs.Where(song => song.SongGenre.Contains("F1"))
.OrderByDescending(song => song.Plays)
.ToList();*/

View File

@ -6,7 +6,7 @@ namespace DualScreenDemo
{
ResetCatBtnStatus();
loveDuetButton.BackgroundImage = loveDuetActiveBackground;
/*loveDuetSongs = allSongs.Where(song => song.SongGenre.Contains("A1"))
.OrderByDescending(song => song.Plays)
.ToList();*/

View File

@ -5,7 +5,7 @@ namespace DualScreenDemo
private void MedleyDanceButton_Click(object sender, EventArgs e)
{
ResetCatBtnStatus();
medleyDanceButton.BackgroundImage = medleyDanceActiveBackground;
/*medleyDanceSongs = allSongs.Where(song => song.SongGenre.Contains("C1"))
.OrderByDescending(song => song.Plays)
.ToList();*/

View File

@ -5,7 +5,7 @@ namespace DualScreenDemo
private void NinetiesButton_Click(object sender, EventArgs e)
{
ResetCatBtnStatus();
ninetiesButton.BackgroundImage = ninetiesActiveBackground;
/*ninetiesSongs = allSongs.Where(song => song.SongGenre.Contains("D1"))
.OrderByDescending(song => song.Plays)
.ToList();*/

View File

@ -5,7 +5,7 @@ namespace DualScreenDemo
private void NostalgicSongsButton_Click(object sender, EventArgs e)
{
ResetCatBtnStatus();
nostalgicSongsButton.BackgroundImage = nostalgicSongsActiveBackground;
/*nostalgicSongs = allSongs.Where(song => song.SongGenre.Contains("E1"))
.OrderByDescending(song => song.Plays)
.ToList();*/

View File

@ -5,7 +5,7 @@ namespace DualScreenDemo
private void TalentShowButton_Click(object sender, EventArgs e)
{
ResetCatBtnStatus();
talentShowButton.BackgroundImage = talentShowActiveBackground;
/*talentShowSongs = allSongs.Where(song => song.SongGenre.Contains("B1"))
.OrderByDescending(song => song.Plays)
.ToList();*/

View File

@ -5,7 +5,7 @@ namespace DualScreenDemo
private void VietnameseSongsButton_Click(object sender, EventArgs e)
{
ResetCatBtnStatus();
vietnameseSongsButton.BackgroundImage = vietnameseActiveBackground;
/*vietnameseSongs = allSongs.Where(song => song.SongGenre.Contains("G1"))
.OrderByDescending(song => song.Plays)
.ToList();*/

View File

@ -62,91 +62,23 @@ namespace DualScreenDemo
private void InitializeCategorySearchButtons()
{
loveDuetNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_男女情歌(未按).png"));
talentShowNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_選秀節目(未按).png"));
medleyDanceNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_串燒舞曲(未按).png"));
ninetiesNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_90年代(未按).png"));
nostalgicSongsNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_懷舊老歌(未按).png"));
chinaNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_中國大陸(未按).png"));
vietnameseNormalBackground= new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_越南歌曲(未按).png"));
loveDuetActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_男女情歌(已按).png"));
talentShowActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_選秀節目(已按).png"));
medleyDanceActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_串燒舞曲(已按).png"));
ninetiesActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_90年代(已按).png"));
nostalgicSongsActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_懷舊老歌(已按).png"));
chinaActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_中國大陸(已按).png"));
vietnameseActiveBackground= new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\7.類別查詢_越南歌曲(已按).png"));
loveDuetButton = new Button { Text = "", Visible = false };
ConfigureButton(loveDuetButton, 1197, 225, 225, 50,
loveDuetNormalBackground,
loveDuetNormalBackground,
loveDuetActiveBackground,
LoveDuetButton_Click);
loveDuetButton.MouseLeave += (sender, e) => loveDuetButton.BackgroundImage = loveDuetActiveBackground;
var data = LoadBtnConfigData();
talentShowButton = new Button { Text = "", Visible = false };
ConfigureButton(talentShowButton, 1197, 280, 225, 50,
talentShowNormalBackground,
talentShowNormalBackground,
talentShowNormalBackground,
TalentShowButton_Click);
InitializeButton(ref loveDuetButton, ref loveDuetNormalBackground, ref loveDuetActiveBackground, "loveDuetButton", 1197, 225, 225, 50, data["CategorySubBtn"]["LoveDuetNormal"], data["CategorySubBtn"]["LoveDuetActive"], LoveDuetButton_Click);
talentShowButton.MouseLeave += (sender, e) => talentShowButton.BackgroundImage = talentShowActiveBackground;
InitializeButton(ref talentShowButton, ref talentShowNormalBackground, ref talentShowActiveBackground, "talentShowButton", 1197, 280, 225, 50, data["CategorySubBtn"]["TalentNormal"], data["CategorySubBtn"]["TalentActive"], TalentShowButton_Click);
InitializeButton(ref medleyDanceButton, ref medleyDanceNormalBackground, ref medleyDanceActiveBackground, "medleyDanceButton", 1197, 335, 225, 50, data["CategorySubBtn"]["MedleyNormal"], data["CategorySubBtn"]["MedleyActive"], MedleyDanceButton_Click);
medleyDanceButton = new Button { Text = "", Visible = false };
ConfigureButton(medleyDanceButton, 1197, 335, 225, 50,
medleyDanceNormalBackground,
medleyDanceNormalBackground,
medleyDanceNormalBackground,
MedleyDanceButton_Click);
InitializeButton(ref ninetiesButton, ref ninetiesNormalBackground, ref ninetiesActiveBackground, "ninetiesButton", 1197, 390, 225, 50, data["CategorySubBtn"]["NintiesNormail"], data["CategorySubBtn"]["NintiesActive"], NinetiesButton_Click);
medleyDanceButton.MouseLeave += (sender, e) => medleyDanceButton.BackgroundImage = medleyDanceActiveBackground;
InitializeButton(ref nostalgicSongsButton, ref nostalgicSongsNormalBackground, ref nostalgicSongsActiveBackground, "nostalgicSongsButton", 1197, 445, 225, 50, data["CategorySubBtn"]["NostalgicNormal"], data["CategorySubBtn"]["NostalgicActive"], NostalgicSongsButton_Click);
InitializeButton(ref chinaSongsButton, ref chinaNormalBackground, ref chinaActiveBackground, "chinaSongsButton", 1197, 500, 225, 50, data["CategorySubBtn"]["ChinaNormal"], data["CategorySubBtn"]["ChinaActive"], ChinaSongsButton_Click);
ninetiesButton = new Button { Text = "", Visible = false };
ConfigureButton(ninetiesButton, 1197, 390, 225, 50,
ninetiesNormalBackground,
ninetiesNormalBackground,
ninetiesNormalBackground,
NinetiesButton_Click);
InitializeButton(ref vietnameseSongsButton, ref vietnameseNormalBackground, ref vietnameseActiveBackground, "vietnameseSongsButton", 1197, 555, 225, 50, data["CategorySubBtn"]["VietNormal"], data["CategorySubBtn"]["VietActive"], VietnameseSongsButton_Click);
ninetiesButton.MouseLeave += (sender, e) => ninetiesButton.BackgroundImage = ninetiesActiveBackground;
nostalgicSongsButton = new Button { Text = "", Visible = false };
ConfigureButton(nostalgicSongsButton, 1197, 445, 225, 50,
nostalgicSongsNormalBackground,
nostalgicSongsNormalBackground,
nostalgicSongsNormalBackground,
NostalgicSongsButton_Click);
nostalgicSongsButton.MouseLeave += (sender, e) => nostalgicSongsButton.BackgroundImage = nostalgicSongsActiveBackground;
chinaSongsButton = new Button { Text = "", Visible = false };
ConfigureButton(chinaSongsButton, 1197, 500, 225, 50,
chinaNormalBackground,
chinaNormalBackground,
chinaNormalBackground,
ChinaSongsButton_Click);
chinaSongsButton.MouseLeave += (sender, e) => chinaSongsButton.BackgroundImage = chinaActiveBackground;
vietnameseSongsButton = new Button { Text = "", Visible = false };
ConfigureButton(vietnameseSongsButton, 1197, 555, 225, 50,
vietnameseNormalBackground,
vietnameseNormalBackground,
vietnameseNormalBackground,
VietnameseSongsButton_Click);
vietnameseSongsButton.MouseLeave += (sender, e) => vietnameseSongsButton.BackgroundImage = vietnameseActiveBackground;
}
@ -154,7 +86,6 @@ namespace DualScreenDemo
{
ResetPrimaryBtnStatus();
//categorySearchButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_類別查詢(已按).png"));
categorySearchButton.BackgroundImage = categorySearchActiveBackground;
isOnOrderedSongsPage = false;

View File

@ -24,15 +24,31 @@ namespace DualScreenDemo
var data=LoadConfigData();
vodButton = new Button();
vodButton.Text = "";
ConfigureButton(vodButton, xPosition - 119, yPosition + 35, 110, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
VodButton_Click);
if (isOnOrderedSongsPage)
{
vodButton = new Button();
vodButton.Text = "";
ConfigureButton(vodButton, xPosition - 119, yPosition + 35, 110, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播-08.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播-08.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播-08.png")),
VodButton_Click);
vodButton.Visible = false;
}
else
{
vodButton = new Button();
vodButton.Text = "";
ConfigureButton(vodButton, xPosition - 119, yPosition + 35, 110, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
VodButton_Click);
vodButton.Visible = false;
}
vodButton.Visible = false;
insertButton = new Button();
@ -100,8 +116,18 @@ namespace DualScreenDemo
}
private void VodButton_Click(object sender, EventArgs e)
{
SetVodScreenPictureBoxAndButtonsVisibility(false);
SongList.Add(currentSelectedSong);
if (isOnOrderedSongsPage)
{
SetVodScreenPictureBoxAndButtonsVisibility(false);
SongList.Cancel(currentSelectedSong);
orderedSongsButton.PerformClick();
}
else
{
SetVodScreenPictureBoxAndButtonsVisibility(false);
SongList.Add(currentSelectedSong);
}
}
private void InsertButton_Click(object sender, EventArgs e)