Browse Source

change watermark width and margins to allow decimals (#2167)

pull/2168/head
Jason Dove 4 weeks ago committed by GitHub
parent
commit
c953176cee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      CHANGELOG.md
  2. 6
      ErsatzTV.Application/Watermarks/Commands/CreateWatermark.cs
  3. 6
      ErsatzTV.Application/Watermarks/Commands/UpdateWatermark.cs
  4. 6
      ErsatzTV.Application/Watermarks/WatermarkViewModel.cs
  5. 6
      ErsatzTV.Core/Domain/ChannelWatermark.cs
  6. 6
      ErsatzTV.FFmpeg/State/WatermarkState.cs
  7. 5920
      ErsatzTV.Infrastructure.MySql/Migrations/20250718210751_Modify_WatermarkMarginsAndWidth.Designer.cs
  8. 66
      ErsatzTV.Infrastructure.MySql/Migrations/20250718210751_Modify_WatermarkMarginsAndWidth.cs
  9. 12
      ErsatzTV.Infrastructure.MySql/Migrations/TvContextModelSnapshot.cs
  10. 5759
      ErsatzTV.Infrastructure.Sqlite/Migrations/20250718210833_Modify_WatermarkMarginsAndWidth.Designer.cs
  11. 66
      ErsatzTV.Infrastructure.Sqlite/Migrations/20250718210833_Modify_WatermarkMarginsAndWidth.cs
  12. 12
      ErsatzTV.Infrastructure.Sqlite/Migrations/TvContextModelSnapshot.cs
  13. 3
      ErsatzTV/Pages/WatermarkEditor.razor
  14. 12
      ErsatzTV/Validators/WatermarkEditViewModelValidator.cs
  15. 6
      ErsatzTV/ViewModels/WatermarkEditViewModel.cs

3
CHANGELOG.md

@ -116,6 +116,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -116,6 +116,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `Collection Size`: similar to count of zero before, will play all media items from the collection before continuing to the next schedule item
- `Playlist Item Size`: will play all media items from the current playlist item before continuing to the next schedule item
- `Multi-Episode Group Size`: will play all media items from the current multi-part episode group, or one ungrouped media item
- Change watermark width and margins to allow decimals
### Fixed
- Fix QSV acceleration in docker with older Intel devices
@ -138,7 +139,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -138,7 +139,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix VAAPI tonemap failure
- Fix green bars after VAAPI tonemap
- Fix bug where playout mode `Multiple` would ignore fixed start time
- Fix block playout EPG generation to use XMLTV Time Zone setting
- Fix block playout EPG generation to use `XMLTV Time Zone` setting
## [25.2.0] - 2025-06-24
### Added

6
ErsatzTV.Application/Watermarks/Commands/CreateWatermark.cs

@ -12,9 +12,9 @@ public record CreateWatermark( @@ -12,9 +12,9 @@ public record CreateWatermark(
ChannelWatermarkImageSource ImageSource,
WatermarkLocation Location,
WatermarkSize Size,
int Width,
int HorizontalMargin,
int VerticalMargin,
double Width,
double HorizontalMargin,
double VerticalMargin,
int FrequencyMinutes,
int DurationSeconds,
int Opacity,

6
ErsatzTV.Application/Watermarks/Commands/UpdateWatermark.cs

@ -13,9 +13,9 @@ public record UpdateWatermark( @@ -13,9 +13,9 @@ public record UpdateWatermark(
ChannelWatermarkImageSource ImageSource,
WatermarkLocation Location,
WatermarkSize Size,
int Width,
int HorizontalMargin,
int VerticalMargin,
double Width,
double HorizontalMargin,
double VerticalMargin,
int FrequencyMinutes,
int DurationSeconds,
int Opacity,

6
ErsatzTV.Application/Watermarks/WatermarkViewModel.cs

@ -12,9 +12,9 @@ public record WatermarkViewModel( @@ -12,9 +12,9 @@ public record WatermarkViewModel(
ChannelWatermarkImageSource ImageSource,
WatermarkLocation Location,
WatermarkSize Size,
int Width,
int HorizontalMargin,
int VerticalMargin,
double Width,
double HorizontalMargin,
double VerticalMargin,
int FrequencyMinutes,
int DurationSeconds,
int Opacity,

6
ErsatzTV.Core/Domain/ChannelWatermark.cs

@ -12,9 +12,9 @@ public class ChannelWatermark @@ -12,9 +12,9 @@ public class ChannelWatermark
public string OriginalContentType { get; set; }
public WatermarkLocation Location { get; set; }
public WatermarkSize Size { get; set; }
public int WidthPercent { get; set; }
public int HorizontalMarginPercent { get; set; }
public int VerticalMarginPercent { get; set; }
public double WidthPercent { get; set; }
public double HorizontalMarginPercent { get; set; }
public double VerticalMarginPercent { get; set; }
public int FrequencyMinutes { get; set; }
public int DurationSeconds { get; set; }
public int Opacity { get; set; }

6
ErsatzTV.FFmpeg/State/WatermarkState.cs

@ -4,9 +4,9 @@ public record WatermarkState( @@ -4,9 +4,9 @@ public record WatermarkState(
Option<List<WatermarkFadePoint>> MaybeFadePoints,
WatermarkLocation Location,
WatermarkSize Size,
int WidthPercent,
int HorizontalMarginPercent,
int VerticalMarginPercent,
double WidthPercent,
double HorizontalMarginPercent,
double VerticalMarginPercent,
int Opacity,
bool PlaceWithinSourceContent);

5920
ErsatzTV.Infrastructure.MySql/Migrations/20250718210751_Modify_WatermarkMarginsAndWidth.Designer.cs generated

File diff suppressed because it is too large Load Diff

66
ErsatzTV.Infrastructure.MySql/Migrations/20250718210751_Modify_WatermarkMarginsAndWidth.cs

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.MySql.Migrations
{
/// <inheritdoc />
public partial class Modify_WatermarkMarginsAndWidth : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<double>(
name: "WidthPercent",
table: "ChannelWatermark",
type: "double",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<double>(
name: "VerticalMarginPercent",
table: "ChannelWatermark",
type: "double",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<double>(
name: "HorizontalMarginPercent",
table: "ChannelWatermark",
type: "double",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "WidthPercent",
table: "ChannelWatermark",
type: "int",
nullable: false,
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<int>(
name: "VerticalMarginPercent",
table: "ChannelWatermark",
type: "int",
nullable: false,
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<int>(
name: "HorizontalMarginPercent",
table: "ChannelWatermark",
type: "int",
nullable: false,
oldClrType: typeof(double),
oldType: "double");
}
}
}

12
ErsatzTV.Infrastructure.MySql/Migrations/TvContextModelSnapshot.cs

@ -335,8 +335,8 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations @@ -335,8 +335,8 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations
b.Property<int>("FrequencyMinutes")
.HasColumnType("int");
b.Property<int>("HorizontalMarginPercent")
.HasColumnType("int");
b.Property<double>("HorizontalMarginPercent")
.HasColumnType("double");
b.Property<string>("Image")
.HasColumnType("longtext");
@ -365,11 +365,11 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations @@ -365,11 +365,11 @@ namespace ErsatzTV.Infrastructure.MySql.Migrations
b.Property<int>("Size")
.HasColumnType("int");
b.Property<int>("VerticalMarginPercent")
.HasColumnType("int");
b.Property<double>("VerticalMarginPercent")
.HasColumnType("double");
b.Property<int>("WidthPercent")
.HasColumnType("int");
b.Property<double>("WidthPercent")
.HasColumnType("double");
b.HasKey("Id");

5759
ErsatzTV.Infrastructure.Sqlite/Migrations/20250718210833_Modify_WatermarkMarginsAndWidth.Designer.cs generated

File diff suppressed because it is too large Load Diff

66
ErsatzTV.Infrastructure.Sqlite/Migrations/20250718210833_Modify_WatermarkMarginsAndWidth.cs

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ErsatzTV.Infrastructure.Sqlite.Migrations
{
/// <inheritdoc />
public partial class Modify_WatermarkMarginsAndWidth : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<double>(
name: "WidthPercent",
table: "ChannelWatermark",
type: "REAL",
nullable: false,
oldClrType: typeof(int),
oldType: "INTEGER");
migrationBuilder.AlterColumn<double>(
name: "VerticalMarginPercent",
table: "ChannelWatermark",
type: "REAL",
nullable: false,
oldClrType: typeof(int),
oldType: "INTEGER");
migrationBuilder.AlterColumn<double>(
name: "HorizontalMarginPercent",
table: "ChannelWatermark",
type: "REAL",
nullable: false,
oldClrType: typeof(int),
oldType: "INTEGER");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "WidthPercent",
table: "ChannelWatermark",
type: "INTEGER",
nullable: false,
oldClrType: typeof(double),
oldType: "REAL");
migrationBuilder.AlterColumn<int>(
name: "VerticalMarginPercent",
table: "ChannelWatermark",
type: "INTEGER",
nullable: false,
oldClrType: typeof(double),
oldType: "REAL");
migrationBuilder.AlterColumn<int>(
name: "HorizontalMarginPercent",
table: "ChannelWatermark",
type: "INTEGER",
nullable: false,
oldClrType: typeof(double),
oldType: "REAL");
}
}
}

12
ErsatzTV.Infrastructure.Sqlite/Migrations/TvContextModelSnapshot.cs

@ -320,8 +320,8 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations @@ -320,8 +320,8 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations
b.Property<int>("FrequencyMinutes")
.HasColumnType("INTEGER");
b.Property<int>("HorizontalMarginPercent")
.HasColumnType("INTEGER");
b.Property<double>("HorizontalMarginPercent")
.HasColumnType("REAL");
b.Property<string>("Image")
.HasColumnType("TEXT");
@ -350,11 +350,11 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations @@ -350,11 +350,11 @@ namespace ErsatzTV.Infrastructure.Sqlite.Migrations
b.Property<int>("Size")
.HasColumnType("INTEGER");
b.Property<int>("VerticalMarginPercent")
.HasColumnType("INTEGER");
b.Property<double>("VerticalMarginPercent")
.HasColumnType("REAL");
b.Property<int>("WidthPercent")
.HasColumnType("INTEGER");
b.Property<double>("WidthPercent")
.HasColumnType("REAL");
b.HasKey("Id");

3
ErsatzTV/Pages/WatermarkEditor.razor

@ -113,7 +113,8 @@ @@ -113,7 +113,8 @@
<div class="d-flex">
<MudText>Width</MudText>
</div>
<MudTextField For="@(() => _model.Width)"
<MudTextField @bind-Value="_model.Width"
For="@(() => _model.Width)"
Adornment="Adornment.End"
AdornmentText="%"
Disabled="@(_model.Mode == ChannelWatermarkMode.None || _model.Size == WatermarkSize.ActualSize)"

12
ErsatzTV/Validators/WatermarkEditViewModelValidator.cs

@ -18,19 +18,19 @@ public class WatermarkEditViewModelValidator : AbstractValidator<WatermarkEditVi @@ -18,19 +18,19 @@ public class WatermarkEditViewModelValidator : AbstractValidator<WatermarkEditVi
.When(vm => vm.ImageSource == ChannelWatermarkImageSource.Custom);
RuleFor(x => x.Width)
.GreaterThan(0)
.LessThanOrEqualTo(100)
.GreaterThan(0.0)
.LessThanOrEqualTo(100.0)
.When(vm => vm.Mode != ChannelWatermarkMode.None &&
vm.Size == WatermarkSize.Scaled);
RuleFor(x => x.HorizontalMargin)
.GreaterThanOrEqualTo(0)
.LessThanOrEqualTo(50)
.GreaterThanOrEqualTo(0.0)
.LessThanOrEqualTo(50.0)
.When(vm => vm.Mode != ChannelWatermarkMode.None);
RuleFor(x => x.VerticalMargin)
.GreaterThanOrEqualTo(0)
.LessThanOrEqualTo(50)
.GreaterThanOrEqualTo(0.0)
.LessThanOrEqualTo(50.0)
.When(vm => vm.Mode != ChannelWatermarkMode.None);
RuleFor(x => x.DurationSeconds)

6
ErsatzTV/ViewModels/WatermarkEditViewModel.cs

@ -36,9 +36,9 @@ public class WatermarkEditViewModel @@ -36,9 +36,9 @@ public class WatermarkEditViewModel
public ChannelWatermarkImageSource ImageSource { get; set; }
public WatermarkLocation Location { get; set; }
public WatermarkSize Size { get; set; }
public int Width { get; set; }
public int HorizontalMargin { get; set; }
public int VerticalMargin { get; set; }
public double Width { get; set; }
public double HorizontalMargin { get; set; }
public double VerticalMargin { get; set; }
public int FrequencyMinutes { get; set; }
public int DurationSeconds { get; set; }
public int Opacity { get; set; }

Loading…
Cancel
Save