mirror of https://github.com/ErsatzTV/ErsatzTV.git
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.
18 lines
503 B
18 lines
503 B
using ErsatzTV.ViewModels; |
|
using FluentValidation; |
|
|
|
namespace ErsatzTV.Validators; |
|
|
|
public class RemoteMediaSourceEditViewModelValidator : AbstractValidator<RemoteMediaSourceEditViewModel> |
|
{ |
|
public RemoteMediaSourceEditViewModelValidator() |
|
{ |
|
RuleFor(x => x.Address) |
|
.NotEmpty() |
|
.Must(uri => Uri.TryCreate(uri, UriKind.Absolute, out _)) |
|
.WithMessage("'Address' must be a valid URL"); |
|
|
|
RuleFor(x => x.ApiKey) |
|
.NotEmpty(); |
|
} |
|
}
|
|
|