From a499dceb02f181e64956431ed0c682dd7d2ce7d7 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期二, 04 八月 2020 17:45:20 +0800 Subject: [PATCH] 2020-08-04-1 --- HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs index fca24fb..084b6b3 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs @@ -209,7 +209,7 @@ a31MusicModel.A31PlayStatus.loop = se.SearchForTextOfTag("LoopMode"); a31MusicModel.A31PlayStatus.Source = se.SearchForTextOfTag("PlayMedium"); a31MusicModel.A31PlayStatus.playSource = se.SearchForTextOfTag("TrackSource"); - a31MusicModel.A31PlayStatus.TrackURL = se.SearchForTextOfTag("TrackURI"); + a31MusicModel.A31PlayStatus.TrackURL = se.SearchForTextOfTag("TrackURI").Replace("&", "&amp;"); } catch (Exception ex) @@ -520,14 +520,14 @@ foreach (SecurityElement track in SecurityElement.FromString(se.Text).SearchForChildByTag("Tracks").Children) { MusicInfo musicInfo = new MusicInfo(); - musicInfo.URL = track.SearchForTextOfTag("URL"); + musicInfo.URL = track.SearchForTextOfTag("URL").Replace("&", "&amp;"); var metadata = track.SearchForTextOfTag("Metadata").Replace("&", "&"); var item = SecurityElement.FromString(metadata).SearchForChildByTag("item"); - musicInfo.Title = item.SearchForTextOfTag("dc:title"); - musicInfo.Artist = item.SearchForTextOfTag("upnp:artist"); - musicInfo.Album = item.SearchForTextOfTag("upnp:album"); + musicInfo.Title = item.SearchForTextOfTag("dc:title").Replace("&", "&amp;"); + musicInfo.Artist = item.SearchForTextOfTag("upnp:artist").Replace("&", "&amp;"); + musicInfo.Album = item.SearchForTextOfTag("upnp:album").Replace("&", "&amp;"); musicInfo.Duration = item.SearchForTextOfTag("res"); - musicInfo.AlbumId = item.SearchForTextOfTag("song:albumid"); + musicInfo.AlbumId = item.SearchForTextOfTag("song:albumid").Replace("&", "&amp;"); musicInfoList.Add(musicInfo); } return musicInfoList; @@ -654,7 +654,7 @@ /// <param name="musicInfo">鎾斁闊充箰</param> /// <param name="listName">鍒楄〃鍚嶇О</param> /// <param name="musicList">鎺ㄩ�佸垪琛�(榛樿鎺�50棣�)</param> - public static void PushList(MusicInfo musicInfo, string listName, List<MusicInfo> musicList, A31MusicModel a31player,bool bool_listName = false) + public static void PushList(MusicInfo musicInfo, string listName, List<MusicInfo> musicList, A31MusicModel a31player,string musicSource) { //鏈�澶у彂閫佺殑鏉℃暟 @@ -719,7 +719,6 @@ tempMusicInfo.URL = "http://" + new Shared.Net.NetWiFi().IpAddress + ":" + com.hdl.on.Server.Port + "/" + tempMusicInfo.ID; } - sb.AppendLine("<Track" + Tracknumber + ">"); sb.AppendLine("<URL>" + tempMusicInfo.URL + "</URL>"); sb.AppendLine("<Metadata>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;"); @@ -738,13 +737,12 @@ sb.AppendLine("&lt;dc:title&gt;" + tempMusicInfo.Title + "&lt;/dc:title&gt;"); sb.AppendLine("&lt;dc:creator&gt;DJ Sanny J&lt;/dc:creator&gt;"); - if (bool_listName) { + if (musicSource== "鎴戠殑鍒楄〃") { sb.AppendLine("&lt;upnp:artist&gt;" + listName + "&lt;/upnp:artist&gt;"); } else { sb.AppendLine("&lt;upnp:artist&gt;" + tempMusicInfo.Artist + "&lt;/upnp:artist&gt;"); } - sb.AppendLine("&lt;upnp:album&gt;" + tempMusicInfo.Album + "&lt;/upnp:album&gt;"); sb.AppendLine("&lt;upnp:albumArtURI&gt;unknown&lt;/upnp:albumArtURI&gt;"); sb.AppendLine("&lt;/item&gt;"); -- Gitblit v1.8.0