parent
9ede5125bf
commit
aae8897250
@ -0,0 +1,20 @@
|
||||
using Autofac;
|
||||
using Recyclarr.ServarrApi.Http;
|
||||
using Recyclarr.ServarrApi.Services;
|
||||
using IFlurlClientFactory = Flurl.Http.Configuration.IFlurlClientFactory;
|
||||
|
||||
namespace Recyclarr.ServarrApi;
|
||||
|
||||
public class ApiServicesAutofacModule : Module
|
||||
{
|
||||
protected override void Load(ContainerBuilder builder)
|
||||
{
|
||||
base.Load(builder);
|
||||
builder.RegisterType<SystemApiService>().As<ISystemApiService>();
|
||||
builder.RegisterType<FlurlClientFactory>().As<IFlurlClientFactory>().SingleInstance();
|
||||
builder.RegisterType<ServiceRequestBuilder>().As<IServiceRequestBuilder>();
|
||||
builder.RegisterType<QualityProfileService>().As<IQualityProfileService>();
|
||||
builder.RegisterType<CustomFormatService>().As<ICustomFormatService>();
|
||||
builder.RegisterType<QualityDefinitionService>().As<IQualityDefinitionService>();
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.QualityProfile.Api;
|
||||
namespace Recyclarr.ServarrApi.Dto;
|
||||
|
||||
[UsedImplicitly]
|
||||
public record QualityProfileDto
|
@ -1,6 +1,6 @@
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.QualitySize.Api;
|
||||
namespace Recyclarr.ServarrApi.Dto;
|
||||
|
||||
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
|
||||
public class ServiceQualityItem
|
@ -1,7 +1,7 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.ReleaseProfile.Api.Objects;
|
||||
namespace Recyclarr.ServarrApi.Dto;
|
||||
|
||||
[UsedImplicitly(ImplicitUseKindFlags.Assign, ImplicitUseTargetFlags.Members)]
|
||||
public class SonarrPreferredTerm
|
@ -1,7 +1,7 @@
|
||||
using JetBrains.Annotations;
|
||||
using Recyclarr.Common;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.Tags.Api;
|
||||
namespace Recyclarr.ServarrApi.Dto;
|
||||
|
||||
public class SonarrTag
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Recyclarr.TrashLib.ApiServices.System.Dto;
|
||||
namespace Recyclarr.ServarrApi.Dto;
|
||||
|
||||
public record SystemStatus(
|
||||
string AppName,
|
@ -1,4 +1,4 @@
|
||||
namespace Recyclarr.Cli.Pipelines.QualityProfile.Api;
|
||||
namespace Recyclarr.ServarrApi;
|
||||
|
||||
public static class DtoUtil
|
||||
{
|
@ -0,0 +1,15 @@
|
||||
using Recyclarr.Common.Extensions;
|
||||
using Recyclarr.ServarrApi.Dto;
|
||||
|
||||
namespace Recyclarr.ServarrApi.Extensions;
|
||||
|
||||
public static class QualityProfileApiExtensions
|
||||
{
|
||||
public static QualityProfileDto ReverseItems(this QualityProfileDto dto)
|
||||
{
|
||||
return dto with {Items = ReverseItemsImpl(dto.Items).AsReadOnly()};
|
||||
|
||||
static ICollection<ProfileItemDto> ReverseItemsImpl(IEnumerable<ProfileItemDto> items)
|
||||
=> items.Reverse().Select(x => x with {Items = ReverseItemsImpl(x.Items)}).ToList();
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace Recyclarr.TrashLib.Http;
|
||||
namespace Recyclarr.ServarrApi.Http;
|
||||
|
||||
public static partial class FlurlExtensions
|
||||
{
|
@ -1,8 +1,9 @@
|
||||
using System.Text.Json;
|
||||
using Flurl;
|
||||
using Flurl.Http.Configuration;
|
||||
using Serilog;
|
||||
|
||||
namespace Recyclarr.TrashLib.Http;
|
||||
namespace Recyclarr.ServarrApi.Http;
|
||||
|
||||
public static class FlurlLogging
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using Flurl.Http;
|
||||
|
||||
namespace Recyclarr.TrashLib.Http;
|
||||
namespace Recyclarr.ServarrApi.Http;
|
||||
|
||||
public interface IFlurlClientFactory
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using Flurl.Http;
|
||||
using Recyclarr.Config.Models;
|
||||
|
||||
namespace Recyclarr.TrashLib.Http;
|
||||
namespace Recyclarr.ServarrApi.Http;
|
||||
|
||||
public interface IServiceRequestBuilder
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using Flurl.Http;
|
||||
using Recyclarr.Config.Models;
|
||||
|
||||
namespace Recyclarr.TrashLib.Http;
|
||||
namespace Recyclarr.ServarrApi.Http;
|
||||
|
||||
public class ServiceRequestBuilder : IServiceRequestBuilder
|
||||
{
|
@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Flurl.Http" />
|
||||
<PackageReference Include="JetBrains.Annotations" />
|
||||
<PackageReference Include="Serilog" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Recyclarr.Config\Recyclarr.Config.csproj" />
|
||||
<ProjectReference Include="..\Recyclarr.Json\Recyclarr.Json.csproj" />
|
||||
<ProjectReference Include="..\Recyclarr.Settings\Recyclarr.Settings.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,9 +1,9 @@
|
||||
using Flurl.Http;
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.ServarrApi.Http;
|
||||
using Recyclarr.TrashGuide.CustomFormat;
|
||||
using Recyclarr.TrashLib.Http;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.CustomFormat.Api;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
public class CustomFormatService : ICustomFormatService
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.TrashGuide.CustomFormat;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.CustomFormat.Api;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
public interface ICustomFormatService
|
||||
{
|
@ -1,6 +1,7 @@
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.ServarrApi.Dto;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.QualitySize.Api;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
public interface IQualityDefinitionService
|
||||
{
|
@ -1,6 +1,7 @@
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.ServarrApi.Dto;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.QualityProfile.Api;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
public interface IQualityProfileService
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using Recyclarr.Cli.Pipelines.ReleaseProfile.Api.Objects;
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.ServarrApi.Dto;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.ReleaseProfile.Api;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
public interface IReleaseProfileApiService
|
||||
{
|
@ -1,6 +1,7 @@
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.ServarrApi.Dto;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.Tags.Api;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
public interface ISonarrTagApiService
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.TrashLib.ApiServices.System.Dto;
|
||||
using Recyclarr.ServarrApi.Dto;
|
||||
|
||||
namespace Recyclarr.TrashLib.ApiServices.System;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
public interface ISystemApiService
|
||||
{
|
@ -1,8 +1,9 @@
|
||||
using Flurl.Http;
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.TrashLib.Http;
|
||||
using Recyclarr.ServarrApi.Dto;
|
||||
using Recyclarr.ServarrApi.Http;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.QualitySize.Api;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
internal class QualityDefinitionService : IQualityDefinitionService
|
||||
{
|
@ -1,8 +1,10 @@
|
||||
using Flurl.Http;
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.TrashLib.Http;
|
||||
using Recyclarr.ServarrApi.Dto;
|
||||
using Recyclarr.ServarrApi.Extensions;
|
||||
using Recyclarr.ServarrApi.Http;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.QualityProfile.Api;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
internal class QualityProfileService : IQualityProfileService
|
||||
{
|
@ -1,9 +1,9 @@
|
||||
using Flurl.Http;
|
||||
using Recyclarr.Cli.Pipelines.ReleaseProfile.Api.Objects;
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.TrashLib.Http;
|
||||
using Recyclarr.ServarrApi.Dto;
|
||||
using Recyclarr.ServarrApi.Http;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.ReleaseProfile.Api;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
public class ReleaseProfileApiService : IReleaseProfileApiService
|
||||
{
|
@ -1,8 +1,9 @@
|
||||
using Flurl.Http;
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.TrashLib.Http;
|
||||
using Recyclarr.ServarrApi.Dto;
|
||||
using Recyclarr.ServarrApi.Http;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.Tags.Api;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
public class SonarrTagApiService : ISonarrTagApiService
|
||||
{
|
@ -1,9 +1,9 @@
|
||||
using Flurl.Http;
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.TrashLib.ApiServices.System.Dto;
|
||||
using Recyclarr.TrashLib.Http;
|
||||
using Recyclarr.ServarrApi.Dto;
|
||||
using Recyclarr.ServarrApi.Http;
|
||||
|
||||
namespace Recyclarr.TrashLib.ApiServices.System;
|
||||
namespace Recyclarr.ServarrApi.Services;
|
||||
|
||||
public class SystemApiService : ISystemApiService
|
||||
{
|
@ -1,15 +0,0 @@
|
||||
using Autofac;
|
||||
using Recyclarr.TrashLib.ApiServices.System;
|
||||
|
||||
namespace Recyclarr.TrashLib.ApiServices;
|
||||
|
||||
public class ApiServicesAutofacModule : Module
|
||||
{
|
||||
protected override void Load(ContainerBuilder builder)
|
||||
{
|
||||
base.Load(builder);
|
||||
builder.RegisterType<SystemApiService>().As<ISystemApiService>();
|
||||
builder.RegisterType<ServiceInformation>().As<IServiceInformation>()
|
||||
.InstancePerLifetimeScope();
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
using Recyclarr.Config.Models;
|
||||
|
||||
namespace Recyclarr.TrashLib.ApiServices.System;
|
||||
namespace Recyclarr.TrashLib.Compatibility;
|
||||
|
||||
public interface IServiceInformation
|
||||
{
|
@ -1,7 +1,8 @@
|
||||
using Flurl.Http;
|
||||
using Recyclarr.Config.Models;
|
||||
using Recyclarr.ServarrApi.Services;
|
||||
|
||||
namespace Recyclarr.TrashLib.ApiServices.System;
|
||||
namespace Recyclarr.TrashLib.Compatibility;
|
||||
|
||||
public class ServiceInformation : IServiceInformation
|
||||
{
|
Loading…
Reference in new issue