feat: add new AutoScan library
This commit is contained in:
parent
c3fb8b9c6f
commit
a95d3f997f
13
src/CasaBot/AutoScan/AutoScan.csproj
Normal file
13
src/CasaBot/AutoScan/AutoScan.csproj
Normal file
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
22
src/CasaBot/AutoScan/AutoScanApp.cs
Normal file
22
src/CasaBot/AutoScan/AutoScanApp.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using AutoScan.Options;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace AutoScan;
|
||||
|
||||
public class AutoScanApp
|
||||
{
|
||||
private readonly AutoScanOptions _options;
|
||||
private readonly ILogger<AutoScanApp> _logger;
|
||||
|
||||
public AutoScanApp(AutoScanOptions options, ILogger<AutoScanApp> logger)
|
||||
{
|
||||
_options = options;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
private void Run()
|
||||
{
|
||||
_logger.LogInformation("AutoScanApp is running...");
|
||||
_logger.LogInformation("Waiting for next scan at {At}.", _options.At);
|
||||
}
|
||||
}
|
15
src/CasaBot/AutoScan/Options/AutoScanOptions.cs
Normal file
15
src/CasaBot/AutoScan/Options/AutoScanOptions.cs
Normal file
@ -0,0 +1,15 @@
|
||||
namespace AutoScan.Options;
|
||||
|
||||
public class AutoScanOptions
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
public string? At { get; set; }
|
||||
public bool FromDayBefore { get; set; }
|
||||
public string? From { get; set; }
|
||||
public string? To { get; set; }
|
||||
public int MaxAmount { get; set; }
|
||||
public string? MediaFolder { get; set; }
|
||||
public ShinobiOptions? Shinobi { get; set; }
|
||||
public ScannerOptions? Scanner { get; set; }
|
||||
public ScreenshotOptions? Screenshot { get; set; }
|
||||
}
|
8
src/CasaBot/AutoScan/Options/ScannerOptions.cs
Normal file
8
src/CasaBot/AutoScan/Options/ScannerOptions.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace AutoScan.Options;
|
||||
|
||||
public class ScannerOptions
|
||||
{
|
||||
public string? Exe { get; set; }
|
||||
public string? ConfigFile { get; set; }
|
||||
public string? DetectionFolder { get; set; }
|
||||
}
|
7
src/CasaBot/AutoScan/Options/ScreenshotOptions.cs
Normal file
7
src/CasaBot/AutoScan/Options/ScreenshotOptions.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace AutoScan.Options;
|
||||
|
||||
public class ScreenshotOptions
|
||||
{
|
||||
public string? Folder { get; set; }
|
||||
public int OffsetSeconds { get; set; }
|
||||
}
|
9
src/CasaBot/AutoScan/Options/ShinobiOptions.cs
Normal file
9
src/CasaBot/AutoScan/Options/ShinobiOptions.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace AutoScan.Options;
|
||||
|
||||
public class ShinobiOptions
|
||||
{
|
||||
public string? URL { get; set; }
|
||||
public string? APIKey { get; set; }
|
||||
public string? GroupId { get; set; }
|
||||
public string? MonitorId { get; set; }
|
||||
}
|
@ -2,6 +2,8 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CasaBotApp", "CasaBotApp\CasaBotApp.csproj", "{FF1AF6E7-88E4-488B-B6FB-BDAC126DD94E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoScan", "AutoScan\AutoScan.csproj", "{13D75ACB-7913-4C4B-B696-9BD7383012AF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -12,5 +14,9 @@ Global
|
||||
{FF1AF6E7-88E4-488B-B6FB-BDAC126DD94E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FF1AF6E7-88E4-488B-B6FB-BDAC126DD94E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FF1AF6E7-88E4-488B-B6FB-BDAC126DD94E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{13D75ACB-7913-4C4B-B696-9BD7383012AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{13D75ACB-7913-4C4B-B696-9BD7383012AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{13D75ACB-7913-4C4B-B696-9BD7383012AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{13D75ACB-7913-4C4B-B696-9BD7383012AF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@ -18,4 +18,22 @@
|
||||
<PackageReference Include="Telegram.Bot" Version="22.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="dvr-scanner\**\*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="appsettings.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AutoScan\AutoScan.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
</Project>
|
||||
|
Loading…
Reference in New Issue
Block a user