Move non-CLI specific code from Trash project to TrashLib. This is for future code sharing with Recyclarr. Trash project is officially deprecated and will eventually go away in favor of the web app.recyclarr
parent
e197fb2bd0
commit
1db23e6be9
@ -1,2 +1,5 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="YamlDotNet" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Trash.Extensions
|
||||
namespace Common.Extensions
|
||||
{
|
||||
public static class RegexExtensions
|
||||
{
|
@ -1,8 +1,8 @@
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using Trash.Radarr.QualityDefinition;
|
||||
using TrashLib.Radarr.QualityDefinition;
|
||||
|
||||
namespace Trash.Tests.Radarr.QualityDefinition
|
||||
namespace TrashLib.Tests.Radarr.QualityDefinition
|
||||
{
|
||||
[TestFixture]
|
||||
[Parallelizable(ParallelScope.All)]
|
@ -1,8 +1,8 @@
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using Trash.Sonarr.QualityDefinition;
|
||||
using TrashLib.Sonarr.QualityDefinition;
|
||||
|
||||
namespace Trash.Tests.Sonarr.QualityDefinition
|
||||
namespace TrashLib.Tests.Sonarr.QualityDefinition
|
||||
{
|
||||
[TestFixture]
|
||||
[Parallelizable(ParallelScope.All)]
|
@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TestLibrary\TestLibrary.csproj" />
|
||||
<ProjectReference Include="..\Trash.TestLibrary\Trash.TestLibrary.csproj" />
|
||||
<ProjectReference Include="..\Trash\Trash.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -0,0 +1,13 @@
|
||||
using Autofac;
|
||||
|
||||
namespace TrashLib.Cache
|
||||
{
|
||||
public class CacheAutofacModule : Module
|
||||
{
|
||||
protected override void Load(ContainerBuilder builder)
|
||||
{
|
||||
// Clients must register their own implementation of ICacheStoragePath
|
||||
builder.RegisterType<ServiceCache>().As<IServiceCache>();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using Autofac;
|
||||
|
||||
namespace TrashLib.Config
|
||||
{
|
||||
public class ConfigAutofacModule : Module
|
||||
{
|
||||
protected override void Load(ContainerBuilder builder)
|
||||
{
|
||||
builder.RegisterType<ConfigurationProvider>()
|
||||
.As<IConfigurationProvider>()
|
||||
.SingleInstance();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace Trash.Config
|
||||
namespace TrashLib.Config
|
||||
{
|
||||
public interface IServiceConfiguration
|
||||
{
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace TrashLib.ExceptionTypes
|
||||
{
|
||||
public class VersionException : Exception
|
||||
{
|
||||
public VersionException(string msg)
|
||||
: base(msg)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace Trash.Config
|
||||
namespace TrashLib
|
||||
{
|
||||
public interface IServerInfo
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Trash.Radarr.CustomFormat
|
||||
namespace TrashLib.Radarr.CustomFormat
|
||||
{
|
||||
public enum ApiOperationType
|
||||
{
|
@ -1,13 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Serilog;
|
||||
using Trash.Cache;
|
||||
using Trash.Radarr.CustomFormat.Models;
|
||||
using Trash.Radarr.CustomFormat.Models.Cache;
|
||||
using TrashLib.Cache;
|
||||
using TrashLib.Radarr.CustomFormat.Models;
|
||||
using TrashLib.Radarr.CustomFormat.Models.Cache;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat
|
||||
namespace TrashLib.Radarr.CustomFormat
|
||||
{
|
||||
public class CachePersister : ICachePersister
|
||||
internal class CachePersister : ICachePersister
|
||||
{
|
||||
private readonly IServiceCache _cache;
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat.Guide
|
||||
namespace TrashLib.Radarr.CustomFormat.Guide
|
||||
{
|
||||
public interface IRadarrGuideService
|
||||
{
|
@ -1,8 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using Trash.Radarr.CustomFormat.Models;
|
||||
using Trash.Radarr.CustomFormat.Models.Cache;
|
||||
using TrashLib.Radarr.CustomFormat.Models;
|
||||
using TrashLib.Radarr.CustomFormat.Models.Cache;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat
|
||||
namespace TrashLib.Radarr.CustomFormat
|
||||
{
|
||||
public interface ICachePersister
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat.Models
|
||||
namespace TrashLib.Radarr.CustomFormat.Models
|
||||
{
|
||||
public class ProcessedConfigData
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
namespace Trash.Radarr.CustomFormat.Models
|
||||
namespace TrashLib.Radarr.CustomFormat.Models
|
||||
{
|
||||
public enum FormatScoreUpdateReason
|
||||
{
|
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Common.Extensions;
|
||||
using MoreLinq.Extensions;
|
||||
using Trash.Extensions;
|
||||
using Trash.Radarr.CustomFormat.Models;
|
||||
using TrashLib.Radarr.CustomFormat.Models;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat.Processors.GuideSteps
|
||||
namespace TrashLib.Radarr.CustomFormat.Processors.GuideSteps
|
||||
{
|
||||
public class ConfigStep : IConfigStep
|
||||
internal class ConfigStep : IConfigStep
|
||||
{
|
||||
public List<string> CustomFormatsNotInGuide { get; } = new();
|
||||
public List<ProcessedConfigData> ConfigData { get; } = new();
|
@ -1,14 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Common.Extensions;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Trash.Extensions;
|
||||
using Trash.Radarr.CustomFormat.Models;
|
||||
using Trash.Radarr.CustomFormat.Models.Cache;
|
||||
using TrashLib.Radarr.CustomFormat.Models;
|
||||
using TrashLib.Radarr.CustomFormat.Models.Cache;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat.Processors.GuideSteps
|
||||
namespace TrashLib.Radarr.CustomFormat.Processors.GuideSteps
|
||||
{
|
||||
public class CustomFormatStep : ICustomFormatStep
|
||||
internal class CustomFormatStep : ICustomFormatStep
|
||||
{
|
||||
public List<(string, string)> CustomFormatsWithOutdatedNames { get; } = new();
|
||||
public List<ProcessedCustomFormatData> ProcessedCustomFormats { get; } = new();
|
@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Trash.Radarr.CustomFormat.Models;
|
||||
using TrashLib.Radarr.CustomFormat.Models;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat.Processors.GuideSteps
|
||||
namespace TrashLib.Radarr.CustomFormat.Processors.GuideSteps
|
||||
{
|
||||
public interface IConfigStep
|
||||
{
|
@ -1,8 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using Trash.Radarr.CustomFormat.Models;
|
||||
using Trash.Radarr.CustomFormat.Models.Cache;
|
||||
using TrashLib.Radarr.CustomFormat.Models;
|
||||
using TrashLib.Radarr.CustomFormat.Models.Cache;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat.Processors.GuideSteps
|
||||
namespace TrashLib.Radarr.CustomFormat.Processors.GuideSteps
|
||||
{
|
||||
public interface ICustomFormatStep
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Trash.Radarr.CustomFormat.Models;
|
||||
using TrashLib.Radarr.CustomFormat.Models;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat.Processors.GuideSteps
|
||||
namespace TrashLib.Radarr.CustomFormat.Processors.GuideSteps
|
||||
{
|
||||
public interface IQualityProfileStep
|
||||
{
|
@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using Trash.Radarr.CustomFormat.Models;
|
||||
using TrashLib.Radarr.CustomFormat.Models;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat.Processors.GuideSteps
|
||||
namespace TrashLib.Radarr.CustomFormat.Processors.GuideSteps
|
||||
{
|
||||
public class QualityProfileStep : IQualityProfileStep
|
||||
internal class QualityProfileStep : IQualityProfileStep
|
||||
{
|
||||
public Dictionary<string, QualityProfileCustomFormatScoreMapping> ProfileScores { get; } = new();
|
||||
public List<(string name, string trashId, string profileName)> CustomFormatsWithoutScore { get; } = new();
|
@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Trash.Radarr.CustomFormat.Models;
|
||||
using Trash.Radarr.CustomFormat.Models.Cache;
|
||||
using TrashLib.Radarr.CustomFormat.Models;
|
||||
using TrashLib.Radarr.CustomFormat.Models.Cache;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat.Processors
|
||||
namespace TrashLib.Radarr.CustomFormat.Processors
|
||||
{
|
||||
internal interface IGuideProcessor
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Trash.Radarr.CustomFormat.Models;
|
||||
using Trash.Radarr.CustomFormat.Models.Cache;
|
||||
using Trash.Radarr.CustomFormat.Processors.PersistenceSteps;
|
||||
using TrashLib.Radarr.CustomFormat.Models;
|
||||
using TrashLib.Radarr.CustomFormat.Models.Cache;
|
||||
using TrashLib.Radarr.CustomFormat.Processors.PersistenceSteps;
|
||||
|
||||
namespace Trash.Radarr.CustomFormat.Processors
|
||||
namespace TrashLib.Radarr.CustomFormat.Processors
|
||||
{
|
||||
public interface IPersistenceProcessor
|
||||
{
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue