forked from sim0n00ps/OF-DL
Added Cajetan OF-DL project
This commit is contained in:
parent
a96f9f3da6
commit
51f42bddff
8
Cajetan.OF-DL.slnx
Normal file
8
Cajetan.OF-DL.slnx
Normal file
@ -0,0 +1,8 @@
|
||||
<Solution>
|
||||
<Folder Name="/Cajetan/">
|
||||
<Project Path="Cajetan.OF-DL/Cajetan.OF-DL.csproj" />
|
||||
</Folder>
|
||||
<Project Path="OF DL.Core/OF DL.Core.csproj" />
|
||||
<Project Path="OF DL.Tests/OF DL.Tests.csproj" />
|
||||
<Project Path="OF DL/OF DL.csproj" />
|
||||
</Solution>
|
||||
48
Cajetan.OF-DL/Cajetan.OF-DL.csproj
Normal file
48
Cajetan.OF-DL/Cajetan.OF-DL.csproj
Normal file
@ -0,0 +1,48 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<RootNamespace>OF_DL</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<ApplicationIcon>Icon\download.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SelfContained>false</SelfContained>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Icon\download.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Spectre.Console">
|
||||
<HintPath>..\OF DL\References\Spectre.Console.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OF DL\OF DL.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Akka" Version="1.5.60"/>
|
||||
<PackageReference Include="BouncyCastle.NetCore" Version="2.2.1"/>
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.12.4"/>
|
||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="10.0.3"/>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3"/>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4"/>
|
||||
<PackageReference Include="protobuf-net" Version="3.2.56"/>
|
||||
<PackageReference Include="PuppeteerSharp" Version="20.2.6"/>
|
||||
<PackageReference Include="Serilog" Version="4.3.1"/>
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1"/>
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0"/>
|
||||
<PackageReference Include="System.Reactive" Version="6.1.0"/>
|
||||
<PackageReference Include="xFFmpeg.NET" Version="7.2.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
BIN
Cajetan.OF-DL/Icon/download.ico
Normal file
BIN
Cajetan.OF-DL/Icon/download.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
51
Cajetan.OF-DL/ProgramCajetan.cs
Normal file
51
Cajetan.OF-DL/ProgramCajetan.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
AnsiConsole.Write(new FigletText("Welcome to OF-DL").Color(Color.Red));
|
||||
|
||||
ServiceCollection services = await ConfigureServices(args);
|
||||
|
||||
|
||||
|
||||
static async Task<ServiceCollection> ConfigureServices(string[] args)
|
||||
{
|
||||
// Set up dependency injection with LoggingService and ConfigService
|
||||
ServiceCollection services = new();
|
||||
services.AddSingleton<ILoggingService, SeqLoggingService>();
|
||||
services.AddSingleton<IConfigService, ConfigService>();
|
||||
services.AddSingleton(new ExitHelper(new SpectreDownloadEventHandler()));
|
||||
ServiceProvider tempServiceProvider = services.BuildServiceProvider();
|
||||
|
||||
ILoggingService loggingService = tempServiceProvider.GetRequiredService<ILoggingService>();
|
||||
IConfigService configService = tempServiceProvider.GetRequiredService<IConfigService>();
|
||||
ExitHelper exitHelper = tempServiceProvider.GetRequiredService<ExitHelper>();
|
||||
|
||||
if (!await configService.LoadConfigurationAsync(args))
|
||||
{
|
||||
AnsiConsole.MarkupLine("\n[red]config.conf is not valid, check your syntax![/]\n");
|
||||
if (!configService.IsCliNonInteractive)
|
||||
{
|
||||
AnsiConsole.MarkupLine("[red]Press any key to exit.[/]");
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
exitHelper.ExitWithCode(3);
|
||||
}
|
||||
|
||||
AnsiConsole.Markup("[green]config.conf located successfully!\n[/]");
|
||||
|
||||
// Set up full dependency injection with loaded config
|
||||
services = [];
|
||||
services.AddSingleton(loggingService);
|
||||
services.AddSingleton(configService);
|
||||
services.AddSingleton(exitHelper);
|
||||
services.AddSingleton<IAuthService, AuthService>();
|
||||
services.AddSingleton<IApiService, ApiService>();
|
||||
services.AddSingleton<IDbService, DbService>();
|
||||
services.AddSingleton<IDownloadService, DownloadService>();
|
||||
services.AddSingleton<IFileNameService, FileNameService>();
|
||||
services.AddSingleton<IStartupService, StartupService>();
|
||||
services.AddSingleton<IDownloadOrchestrationService, DownloadOrchestrationService>();
|
||||
services.AddSingleton<Program>();
|
||||
|
||||
return services;
|
||||
}
|
||||
9
Cajetan.OF-DL/Properties/GlobalUsings.cs
Normal file
9
Cajetan.OF-DL/Properties/GlobalUsings.cs
Normal file
@ -0,0 +1,9 @@
|
||||
global using Spectre.Console;
|
||||
global using OF_DL;
|
||||
global using OF_DL.CLI;
|
||||
global using OF_DL.Crypto;
|
||||
global using OF_DL.Enumerations;
|
||||
global using OF_DL.Helpers;
|
||||
global using OF_DL.Models;
|
||||
global using OF_DL.Services;
|
||||
global using OF_DL.Utils;
|
||||
Loading…
x
Reference in New Issue
Block a user