From c26c06ef4a22d6fb9e59dc734abca92fa8a23c47 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 05 六月 2020 17:41:00 +0800
Subject: [PATCH] 2020-06-05-02

---
 HDL_ON/UI/Music/SendMethod.cs |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/HDL_ON/UI/Music/SendMethod.cs b/HDL_ON/UI/Music/SendMethod.cs
index 16c3a95..a6ae4bb 100644
--- a/HDL_ON/UI/Music/SendMethod.cs
+++ b/HDL_ON/UI/Music/SendMethod.cs
@@ -153,22 +153,17 @@
             try
             {
 
-                if (a31MusicModel.ServerClientType == -1)
+                if (a31MusicModel.ServerClientType == 1)
                 {
-                    var result = OpenWeb("http://" + a31MusicModel.ServerIP + "/httpapi.asp?command=multiroom:getSlaveList");
-                    if (result != null)
+                    var result = OpenWeb("http://" + a31MusicModel.IPAddress + "/httpapi.asp?command=multiroom:getSlaveList");
+                    if (result != null && result != "Failed")
                     {
                         var slaves = Newtonsoft.Json.JsonConvert.DeserializeObject<Slaves>(result);
-                        if (slaves != null && slaves.slave_list != null)
+                        if (slaves != null && slaves.slave_list != null && slaves.slave_list.Count != 0)
                         {
-                            var slave = slaves.slave_list.Find((obj) => obj.uuid.Replace("uuid:", "") == a31MusicModel.UniqueDeviceName);
-                            if (slave != null)
-                            {
-                                a31MusicModel.A31PlayStatus.vol = slave.volume;
-                            }
+                            a31MusicModel.Slave = slaves;
                         }
                     }
-                    return;
                 }
 
                 WebClient webClient = new WebClient();
@@ -460,7 +455,7 @@
                 {
                     if (a31player.ServerClientType == -1)
                     {
-                        new System.Net.WebClient().DownloadData(new Uri("http://" + a31player.ServerIP + "/httpapi.asp?command=multiroom:SlaveVolume:" + a31player.IPAddress + ":" + volume));
+                        new System.Net.WebClient().DownloadData(new Uri("http://" + a31player.MainPlayIP + "/httpapi.asp?command=multiroom:SlaveVolume:" + a31player.IPAddress + ":" + volume));
                     }
                     else if (a31player.ServerClientType == 1)
                     {

--
Gitblit v1.8.0