|
@@ -14,6 +14,8 @@ namespace Vinno.FIS.Sonopost.Managers
|
|
|
|
|
|
private string _oldVCloudServerName;
|
|
|
|
|
|
+ private ILiveVideoManager _liveVideoManager;
|
|
|
+
|
|
|
private readonly object _locker = new object();
|
|
|
|
|
|
public string VCloudServerAddress { get; private set; }
|
|
@@ -76,6 +78,10 @@ namespace Vinno.FIS.Sonopost.Managers
|
|
|
SonopostUserDefinedSettings.Instance.ServerSetting.DefaultServer = serverInfo;
|
|
|
SonopostUserDefinedSettings.Instance.ServerSetting.Servers.Add(serverInfo);
|
|
|
}
|
|
|
+ if (_liveVideoManager == null)
|
|
|
+ {
|
|
|
+ _liveVideoManager = AppManager.Instance.GetManager<ILiveVideoManager>();
|
|
|
+ }
|
|
|
if (_oldVCloudServerAddress != VCloudServerAddress || _oldVCloudServerPort != VCloudServerPort || _oldVCloudServerName != VCloudServerName)
|
|
|
{
|
|
|
_oldVCloudServerAddress = VCloudServerAddress;
|
|
@@ -85,9 +91,23 @@ namespace Vinno.FIS.Sonopost.Managers
|
|
|
var config = videoInfos.FirstOrDefault(x => x.Category == FISLiveChannelCategory.Main);
|
|
|
if (config != null)
|
|
|
{
|
|
|
- config.Model = null;
|
|
|
- config.Brand = null;
|
|
|
- config.IsEnable = false;
|
|
|
+ if (!string.IsNullOrWhiteSpace(config.Brand))
|
|
|
+ {
|
|
|
+ var brandList = _liveVideoManager.GetBrandList();
|
|
|
+ if (brandList == null || brandList.Count == 0 || !brandList.Contains(config.Brand))
|
|
|
+ {
|
|
|
+ config.Brand = null;
|
|
|
+ config.Model = null;
|
|
|
+ }
|
|
|
+ else if (!string.IsNullOrWhiteSpace(config.Model))
|
|
|
+ {
|
|
|
+ var modelList = _liveVideoManager.GetModelList(config.Brand);
|
|
|
+ if (modelList == null || modelList.Count == 0 || !modelList.Contains(config.Model))
|
|
|
+ {
|
|
|
+ config.Model = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
Save();
|