feat: enable run dry options to skip download

This commit is contained in:
Guillermo Marcel 2025-02-17 13:37:00 -03:00
parent 461c545cb0
commit dc34c85834
3 changed files with 8 additions and 1 deletions

View File

@ -63,6 +63,11 @@ public class ShinobiConnector : IDVRConnector
_logger.LogDebug("Downloading video..."); _logger.LogDebug("Downloading video...");
var videoData = await _httpClient.GetByteArrayAsync(endpoint); var videoData = await _httpClient.GetByteArrayAsync(endpoint);
if(_options.RunDry)
{
_logger.LogInformation("RunDry is enabled, skipping video download");
return;
}
//Write the video to the file //Write the video to the file
await File.WriteAllBytesAsync(videoPath, videoData); await File.WriteAllBytesAsync(videoPath, videoData);
_logger.LogInformation("Video downloaded successfully!"); _logger.LogInformation("Video downloaded successfully!");

View File

@ -6,4 +6,5 @@ public class ShinobiOptions
public string? APIKey { get; set; } public string? APIKey { get; set; }
public string? GroupId { get; set; } public string? GroupId { get; set; }
public string? MonitorId { get; set; } public string? MonitorId { get; set; }
public bool RunDry { get; set; } = false;
} }

View File

@ -16,7 +16,8 @@
"URL": "http://localhost:8080", "URL": "http://localhost:8080",
"APIKey": "APIKEY", "APIKey": "APIKEY",
"GroupId": "Group", "GroupId": "Group",
"MonitorId": "Monitor" "MonitorId": "Monitor",
"RunDry": false
}, },
"AutoScan": { "AutoScan": {
"Enabled": false, "Enabled": false,