Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/recyclarr/commit/0106bc5111d95f61f4973c897bbfa22fd01df6c9?style=unified&whitespace=ignore-eol
You should set ROOT_URL correctly, otherwise the web may not work correctly.
3 changed files with
17 additions and
34 deletions
@ -0,0 +1,12 @@
namespace Recyclarr.Cli.Pipelines.QualityProfile.Api ;
public static class DtoUtil
{
public static void SetIfNotNull < T > ( ref T propertyValue , T ? newValue )
{
if ( newValue is not null )
{
propertyValue = newValue ;
}
}
}
@ -3,17 +3,6 @@ using JetBrains.Annotations;
namespace Recyclarr.Cli.Pipelines.QualityProfile.Api ;
public static class DtoUtil
{
public static void SetIfNotNull < T > ( ref T propertyValue , T ? newValue )
{
if ( newValue is not null )
{
propertyValue = newValue ;
}
}
}
[UsedImplicitly]
public record QualityProfileDto
{
@ -9,33 +9,15 @@ public sealed class JsonNoSerializeAttribute : Attribute
public static class JsonSerializationModifiers
{
private static bool HasAttribute < T > ( JsonPropertyInfo ? prop , IReadOnlyDictionary < string , IEnumerable < Type > > allAttrs )
where T : Attribute
{
if ( prop is null )
{
return false ;
}
if ( ! allAttrs . TryGetValue ( prop . Name , out var attrs ) )
{
return false ;
}
return attrs . Any ( x = > x . IsAssignableTo ( typeof ( T ) ) ) ;
}
public static void IgnoreNoSerializeAttribute ( JsonTypeInfo type )
{
var attrs = type . Properties
. Select ( x = > ( Property : x , Attributes : x . PropertyType . GetCustomAttributes ( false ) . Select ( y = > y . GetType ( ) ) ) )
. Where ( x = > x . Attributes . Any ( ) )
. ToDictionary ( x = > x . Property . Name , x = > x . Attributes ) ;
var propertiesToRemove = type . Properties
. Where ( x = > x . AttributeProvider ? . IsDefined ( typeof ( JsonNoSerializeAttribute ) , false ) ? ? false )
. ToList ( ) ;
var props = type . Properties ;
foreach ( var prop in props )
foreach ( var prop in propertiesToRemove )
{
prop . ShouldSerialize = ( _ , _ ) = > ! HasAttribute < JsonNoSerializeAttribute > ( prop , attrs ) ;
prop . ShouldSerialize = ( _ , _ ) = > false ;
}
}
}