NetMQ 协议,支持摄像头增、删、改
This commit is contained in:
@@ -55,8 +55,11 @@ public class FileStorageService : IStorageService
|
||||
await _configLock.WaitAsync();
|
||||
try
|
||||
{
|
||||
var json = JsonSerializer.Serialize(configs, _jsonOptions);
|
||||
await File.WriteAllTextAsync(_devicesPath, json);
|
||||
if (SdkGlobal.SaveCameraConfigEnable)
|
||||
{
|
||||
var json = JsonSerializer.Serialize(configs, _jsonOptions);
|
||||
await File.WriteAllTextAsync(_devicesPath, json);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -72,6 +75,9 @@ public class FileStorageService : IStorageService
|
||||
await _configLock.WaitAsync();
|
||||
try
|
||||
{
|
||||
if (!SdkGlobal.SaveCameraConfigEnable)
|
||||
return new List<VideoSourceConfig>();
|
||||
|
||||
var json = await File.ReadAllTextAsync(_devicesPath);
|
||||
if (string.IsNullOrWhiteSpace(json)) return new List<VideoSourceConfig>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user