You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
922 B
31 lines
922 B
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace Recyclarr.Config.Parsing.PostProcessing.ConfigMerging;
|
|
|
|
public class RadarrConfigMerger : ServiceConfigMerger<RadarrConfigYaml>
|
|
{
|
|
public override RadarrConfigYaml Merge(RadarrConfigYaml a, RadarrConfigYaml b)
|
|
{
|
|
return base.Merge(a, b) with
|
|
{
|
|
MediaNaming = Combine(a.MediaNaming, b.MediaNaming, MergeMediaNaming)
|
|
};
|
|
}
|
|
|
|
[SuppressMessage("ReSharper", "WithExpressionModifiesAllMembers")]
|
|
private static RadarrMediaNamingConfigYaml MergeMediaNaming(
|
|
RadarrMediaNamingConfigYaml a,
|
|
RadarrMediaNamingConfigYaml b)
|
|
{
|
|
return a with
|
|
{
|
|
Folder = b.Folder ?? a.Folder,
|
|
Movie = Combine(a.Movie, b.Movie, (a1, b1) => a1 with
|
|
{
|
|
Rename = b1.Rename ?? a1.Rename,
|
|
Format = b1.Format ?? a1.Format
|
|
})
|
|
};
|
|
}
|
|
}
|