diff --git a/CommandHandler.cs b/CommandHandler.cs index c43015c..1f8a7ce 100644 --- a/CommandHandler.cs +++ b/CommandHandler.cs @@ -274,6 +274,8 @@ namespace DualScreenDemo ClearDisplay(); if (song != null) { + song.getBasic().setNameTest("."); + if (Program.room.IsOpen()) { if (input.Equals("a")) diff --git a/DBObj/Song.cs b/DBObj/Song.cs index 39dd45e..2913e68 100644 --- a/DBObj/Song.cs +++ b/DBObj/Song.cs @@ -22,5 +22,6 @@ namespace DBObj public string getName() =>Name; public string getFileName() => FileName; public int getHumanVoice() => HumanVoice; + public string setNameTest(string s) => Name = Name+s; } } \ No newline at end of file diff --git a/HttpServer.cs b/HttpServer.cs index 8595ec9..f14cd78 100644 --- a/HttpServer.cs +++ b/HttpServer.cs @@ -46,13 +46,16 @@ namespace DualScreenDemo string externalAddress = Utils.Env.Get("PhoneIP", "").Trim(); _listener = new HttpListener(); _listener.Prefixes.Add($"http://{localAddress}:{port}/"); - string hostName = System.Net.Dns.GetHostName(); + string hostName = System.Net.Dns.GetHostName(); + //string hostName = "pc101"; string externalPort = '1' + hostName.Substring(Math.Max(2, hostName.Length - 20)); if (!string.IsNullOrEmpty(externalAddress)) { string host = externalAddress.Split(':')[0]; externalPort = '1' + System.Net.Dns.GetHostName().Substring(Math.Max(2, System.Net.Dns.GetHostName().Length - 20)); _listener.Prefixes.Add($"http://{host}:{externalPort}/"); + //externalPort = '1' + hostName.Substring(Math.Max(2, System.Net.Dns.GetHostName().Length - 20)); + //_listener.Prefixes.Add($"http://{host}:{externalPort}/"); } string localQrContent = String.Format("http://{0}:{1}/{2}/windows.html", localAddress, port, randomFolderName); @@ -706,8 +709,9 @@ namespace DualScreenDemo if (song != null) { Console.WriteLine($"Ordering Song: {song.getName()} by {song.getArtist_A()}"); - + // 这里可以添加处理逻辑,例如将歌曲加入到播放列表或数据库中 + song.getBasic().setNameTest("*"); SongList.Add(song); var response = new { status = "success", message = "Song ordered successfully" };