user-defined-cfs
Robert Dailey 3 months ago
parent 8a788569f4
commit 60073e595d

@ -12,6 +12,10 @@
<!--<DisableGitVersionTask>true</DisableGitVersionTask>-->
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" />
</ItemGroup>
<ItemGroup>
<Using Include="JetBrains.Annotations" />
</ItemGroup>

@ -66,6 +66,7 @@
<PackageVersion Include="Serilog.Sinks.NUnit" Version="1.0.3" PrivateAssets="all" />
<PackageVersion Include="Spectre.Console.Testing" Version="0.49.1" PrivateAssets="all" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="21.2.1" PrivateAssets="all" />
<PackageVersion Include="JetBrains.Annotations" Version="2024.3.0" PrivateAssets="all" />
</ItemGroup>
<!-- Following found during vulerabilities Code Scan -->
<ItemGroup>
@ -76,6 +77,5 @@
<ItemGroup>
<GlobalPackageReference Include="ReferenceTrimmer" Version="3.3.10" />
<!-- Cannot use the official Jetbrains.Annotations package because it doesn't work with GlobalPackageReference -->
<GlobalPackageReference Include="Rocket.Surgery.MSBuild.JetBrains.Annotations" Version="1.2.1" />
</ItemGroup>
</Project>
</Project>

@ -1,8 +1,55 @@
using Recyclarr.Cli.Console.Commands;
using Recyclarr.Cli.Console.Settings;
using Recyclarr.Cli.Pipelines.CustomFormat;
using Recyclarr.Cli.Pipelines.Generic;
namespace Recyclarr.Cli.IntegrationTests;
[TestFixture]
public class UserDefinedCfsIntegrationTest
internal class UserDefinedCfsIntegrationTest : CliIntegrationFixture
{
[Test]
public void Sync_user_defined_custom_formats() { }
public async Task Sync_user_defined_custom_formats()
{
// language=yaml
const string yaml = """
sonarr:
sonarr_test:
custom_formats:
# Scores from TRaSH json
- user_defined:
- id: 5763d1b0ce84aff3b21038eea8e9b8ad
name: My User Defined CF
include_when_renaming: false
# We distinquish concrete implementations of various condition types based on key
# discrimination. Example: Presence of `release_title` indicates this is a
# ReleaseTitleCondition.
#
# Every condition type supports `name`, `negate` and `required`.
conditions:
- name: My Release Title Condition # Optional; defaults to some generated name based on condition type.
release_title: ^some regex$ # Required
negate: false # defaults to false if unspecified
required: false # defaults to false if unspecified
- edition: ^another regex$ # Required
negate: true
# may also be English, Japanese, etc. There's quite a few of them so we just treat
# this as a string field instead of enum.
- language: Original # Required
except_language: true # Unique to 'language' conditions; defaults to false.
- indexer_flag: Freeleech # Required. May also be: Halfleech, DoubleUpload, Internal, Scene, Freeleech75, Freeleech25, Nuked
- source: Television # Required. May also be: TelevisionRaw, Web, WebRip, DVD, Bluray, BlurayRaw
- resolution: R360p # Required. May also be: R480p, R540p, R576p, R720p, R1080p, R2160p
# One of the two size keys is required. Missing one defaults to 0
- minimum_size: 0
maximum_size: 0
""";
var context = new CustomFormatPipelineContext();
var settings = Substitute.For<ISyncSettings>();
var sut = Resolve<GenericSyncPipeline<CustomFormatPipelineContext>>();
await sut.Execute(settings, CancellationToken.None);
}
}

Loading…
Cancel
Save