* properly scope jellyfin disconnect * add emby entities * add emby media source page * add emby media source editor * sync emby libraries * enable emby library sync toggle * add emby path replacements editor * add emby movie synchronization * fix emby artwork * sync emby television * code cleanup * add jellyfin/emby address placeholder * tweak jellyfin/emby address form
21 lines
567 B
C#
21 lines
567 B
C#
using System;
|
|
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();
|
|
}
|
|
}
|
|
}
|