parent
8ccc17a83e
commit
af809aac18
@ -0,0 +1,35 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Recyclarr.Settings.Models;
|
||||
|
||||
[UsedImplicitly(ImplicitUseKindFlags.Assign, ImplicitUseTargetFlags.WithMembers)]
|
||||
public record AppriseNotificationSettings
|
||||
{
|
||||
public AppriseMode? Mode { get; init; }
|
||||
public Uri BaseUrl { get; init; } = new("about:empty");
|
||||
public string Key { get; init; } = "";
|
||||
public string Tags { get; init; } = "";
|
||||
public Collection<string> Urls { get; init; } = [];
|
||||
}
|
||||
|
||||
[UsedImplicitly(ImplicitUseKindFlags.Assign, ImplicitUseTargetFlags.WithMembers)]
|
||||
public record NotificationSettings
|
||||
{
|
||||
public NotificationVerbosity Verbosity { get; init; } = NotificationVerbosity.Normal;
|
||||
public AppriseNotificationSettings? Apprise { get; init; }
|
||||
|
||||
public bool IsConfigured() => Apprise is not null;
|
||||
}
|
||||
|
||||
public enum NotificationVerbosity
|
||||
{
|
||||
Minimal,
|
||||
Normal,
|
||||
Detailed,
|
||||
}
|
||||
|
||||
public enum AppriseMode
|
||||
{
|
||||
Stateful,
|
||||
Stateless,
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
namespace Recyclarr.Settings.Models;
|
||||
|
||||
[UsedImplicitly(ImplicitUseKindFlags.Assign, ImplicitUseTargetFlags.WithMembers)]
|
||||
public record LogJanitorSettings
|
||||
{
|
||||
public int MaxFiles { get; init; } = 20;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
namespace Recyclarr.Settings.Models;
|
||||
|
||||
[UsedImplicitly(ImplicitUseKindFlags.Assign, ImplicitUseTargetFlags.WithMembers)]
|
||||
public record RecyclarrSettings
|
||||
{
|
||||
public Repositories Repositories { get; init; } = new();
|
||||
public bool EnableSslCertificateValidation { get; init; } = true;
|
||||
public LogJanitorSettings LogJanitor { get; init; } = new();
|
||||
public string? GitPath { get; init; }
|
||||
public NotificationSettings Notifications { get; init; } = new();
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
namespace Recyclarr.Settings.Models;
|
||||
|
||||
[UsedImplicitly(ImplicitUseKindFlags.Assign, ImplicitUseTargetFlags.WithMembers)]
|
||||
public record Repositories
|
||||
{
|
||||
public TrashRepository TrashGuides { get; init; } = new();
|
||||
public ConfigTemplateRepository ConfigTemplates { get; init; } = new();
|
||||
}
|
||||
|
||||
[UsedImplicitly(ImplicitUseKindFlags.Assign, ImplicitUseTargetFlags.WithMembers)]
|
||||
public record TrashRepository : IRepositorySettings
|
||||
{
|
||||
public Uri CloneUrl { get; init; } = new("https://github.com/TRaSH-Guides/Guides.git");
|
||||
public string Branch { get; init; } = "master";
|
||||
public string? Sha1 { get; init; }
|
||||
}
|
||||
|
||||
[UsedImplicitly(ImplicitUseKindFlags.Assign, ImplicitUseTargetFlags.WithMembers)]
|
||||
public record ConfigTemplateRepository : IRepositorySettings
|
||||
{
|
||||
public Uri CloneUrl { get; init; } = new("https://github.com/recyclarr/config-templates.git");
|
||||
public string Branch { get; init; } = "master";
|
||||
public string? Sha1 { get; init; }
|
||||
}
|
@ -1,172 +0,0 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Recyclarr.Settings;
|
||||
|
||||
public record TrashRepository : IRepositorySettings
|
||||
{
|
||||
public Uri CloneUrl
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = new("https://github.com/TRaSH-Guides/Guides.git");
|
||||
public string Branch
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = "master";
|
||||
public string? Sha1
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
}
|
||||
}
|
||||
|
||||
public record ConfigTemplateRepository : IRepositorySettings
|
||||
{
|
||||
public Uri CloneUrl
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = new("https://github.com/recyclarr/config-templates.git");
|
||||
public string Branch
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = "master";
|
||||
public string? Sha1
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
}
|
||||
}
|
||||
|
||||
public record LogJanitorSettings
|
||||
{
|
||||
public int MaxFiles
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = 20;
|
||||
}
|
||||
|
||||
public record Repositories
|
||||
{
|
||||
public TrashRepository TrashGuides
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = new();
|
||||
public ConfigTemplateRepository ConfigTemplates
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = new();
|
||||
}
|
||||
|
||||
public record RecyclarrSettings
|
||||
{
|
||||
public Repositories Repositories
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = new();
|
||||
public bool EnableSslCertificateValidation
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = true;
|
||||
public LogJanitorSettings LogJanitor
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = new();
|
||||
public string? GitPath
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
}
|
||||
public NotificationSettings Notifications
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = new();
|
||||
}
|
||||
|
||||
public record NotificationSettings
|
||||
{
|
||||
public NotificationVerbosity Verbosity
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = NotificationVerbosity.Normal;
|
||||
public AppriseNotificationSettings? Apprise
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
}
|
||||
|
||||
public bool IsConfigured() => Apprise is not null;
|
||||
}
|
||||
|
||||
public enum NotificationVerbosity
|
||||
{
|
||||
Minimal,
|
||||
Normal,
|
||||
Detailed,
|
||||
}
|
||||
|
||||
public record AppriseNotificationSettings
|
||||
{
|
||||
public AppriseMode? Mode
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
}
|
||||
public Uri BaseUrl
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = new("about:empty");
|
||||
public string Key
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = "";
|
||||
public string Tags
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = "";
|
||||
public Collection<string> Urls
|
||||
{
|
||||
get;
|
||||
[UsedImplicitly]
|
||||
init;
|
||||
} = [];
|
||||
}
|
||||
|
||||
public enum AppriseMode
|
||||
{
|
||||
Stateful,
|
||||
Stateless,
|
||||
}
|
Loading…
Reference in new issue