mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-05-11 08:18:16 -04:00
37 lines
996 B
C#
37 lines
996 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Text.Json.Serialization;
|
|
using Cleanuparr.Shared.Attributes;
|
|
|
|
namespace Cleanuparr.Persistence.Models.Configuration.Arr;
|
|
|
|
public sealed class ArrInstance
|
|
{
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public Guid Id { get; set; } = Guid.NewGuid();
|
|
|
|
public bool Enabled { get; set; }
|
|
|
|
public float Version { get; set; }
|
|
|
|
public Guid ArrConfigId { get; set; }
|
|
|
|
public ArrConfig ArrConfig { get; set; } = null!;
|
|
|
|
public required string Name { get; set; }
|
|
|
|
public required Uri Url { get; set; }
|
|
|
|
public Uri? ExternalUrl { get; set; }
|
|
|
|
[SensitiveData]
|
|
public required string ApiKey { get; set; }
|
|
|
|
/// <summary>
|
|
/// Returns ExternalUrl if set, otherwise falls back to computed Url
|
|
/// </summary>
|
|
[NotMapped]
|
|
[JsonIgnore]
|
|
public Uri ExternalOrInternalUrl => ExternalUrl ?? Url;
|
|
} |