Browse Source

allow two decimals in channel numbers (#724)

pull/726/head
Jason Dove 4 years ago committed by GitHub
parent
commit
1f27aef11d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 2
      ErsatzTV.Application/Channels/Commands/CreateChannelHandler.cs
  3. 2
      ErsatzTV.Application/Channels/Commands/UpdateChannelHandler.cs
  4. 2
      ErsatzTV.Core/Domain/Channel.cs
  5. 2
      ErsatzTV/Validators/ChannelEditViewModelValidator.cs

1
CHANGELOG.md

@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- This mode is only used when the `Reset Playout` button is clicked on the Playouts page
- Use ffmpeg to resize images; this should help reduce ErsatzTV's memory use
- Use ffprobe to check for animated logos and watermarks; this should help reduce ErsatzTV's memory use
- Allow two decimals in channel numbers (e.g. `5.73`)
## [0.4.5-alpha] - 2022-03-29
### Fixed

2
ErsatzTV.Application/Channels/Commands/CreateChannelHandler.cs

@ -119,7 +119,7 @@ public class CreateChannelHandler : IRequestHandler<CreateChannel, Either<BaseEr @@ -119,7 +119,7 @@ public class CreateChannelHandler : IRequestHandler<CreateChannel, Either<BaseEr
return createChannel.Number;
}
return BaseError.New("Invalid channel number; one decimal is allowed for subchannels");
return BaseError.New("Invalid channel number; two decimals are allowed for subchannels");
});
}

2
ErsatzTV.Application/Channels/Commands/UpdateChannelHandler.cs

@ -102,7 +102,7 @@ public class UpdateChannelHandler : IRequestHandler<UpdateChannel, Either<BaseEr @@ -102,7 +102,7 @@ public class UpdateChannelHandler : IRequestHandler<UpdateChannel, Either<BaseEr
return updateChannel.Number;
}
return BaseError.New("Invalid channel number; one decimal is allowed for subchannels");
return BaseError.New("Invalid channel number; two decimals are allowed for subchannels");
}
return BaseError.New("Channel number must be unique");

2
ErsatzTV.Core/Domain/Channel.cs

@ -4,7 +4,7 @@ namespace ErsatzTV.Core.Domain; @@ -4,7 +4,7 @@ namespace ErsatzTV.Core.Domain;
public class Channel
{
public static string NumberValidator = @"^[0-9]+(\.[0-9])?$";
public static string NumberValidator = @"^[0-9]+(\.[0-9]{1,2})?$";
public Channel(Guid uniqueId) => UniqueId = uniqueId;
public int Id { get; set; }

2
ErsatzTV/Validators/ChannelEditViewModelValidator.cs

@ -10,7 +10,7 @@ public class ChannelEditViewModelValidator : AbstractValidator<ChannelEditViewMo @@ -10,7 +10,7 @@ public class ChannelEditViewModelValidator : AbstractValidator<ChannelEditViewMo
public ChannelEditViewModelValidator()
{
RuleFor(x => x.Number).Matches(Channel.NumberValidator)
.WithMessage("Invalid channel number; one decimal is allowed for subchannels");
.WithMessage("Invalid channel number; two decimals are allowed for subchannels");
RuleFor(x => x.Name).NotEmpty();
RuleFor(x => x.Group).NotEmpty();

Loading…
Cancel
Save