From 685afb1642ebd2f696dc323ea1186cc2c95335c3 Mon Sep 17 00:00:00 2001 From: "allen.yan" Date: Tue, 12 Aug 2025 17:15:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=A9=9F,=E9=81=99=E6=8E=A7=E5=99=A8?= =?UTF-8?q?=E9=BB=9E=E6=AD=8C=E6=AD=8C=E5=90=8D=E4=BD=9C=E6=A8=99=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CommandHandler.cs | 2 ++ DBObj/Song.cs | 1 + HttpServer.cs | 8 ++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) 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" };