mirror of https://github.com/ErsatzTV/ErsatzTV.git
Browse Source
* wip * wip * implement watermark settings * code cleanup * update changelogpull/255/head
23 changed files with 3520 additions and 35 deletions
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
namespace ErsatzTV.Core.Domain |
||||
{ |
||||
public class ChannelWatermark |
||||
{ |
||||
public int Id { get; set; } |
||||
public Channel Channel { get; set; } |
||||
public ChannelWatermarkLocation Location { get; set; } |
||||
public ChannelWatermarkSize Size { get; set; } |
||||
public ChannelWatermarkMode Mode { get; set; } |
||||
public int WidthPercent { get; set; } |
||||
public int HorizontalMarginPercent { get; set; } |
||||
public int VerticalMarginPercent { get; set; } |
||||
public int FrequencyMinutes { get; set; } |
||||
public int DurationSeconds { get; set; } |
||||
} |
||||
|
||||
public enum ChannelWatermarkLocation |
||||
{ |
||||
BottomRight = 0, |
||||
BottomLeft = 1, |
||||
TopRight = 2, |
||||
TopLeft = 3 |
||||
} |
||||
|
||||
public enum ChannelWatermarkSize |
||||
{ |
||||
Scaled = 0, |
||||
ActualSize = 1 |
||||
} |
||||
|
||||
public enum ChannelWatermarkMode |
||||
{ |
||||
None = 0, |
||||
Permanent = 1, |
||||
Intermittent = 2 |
||||
} |
||||
} |
||||
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
using ErsatzTV.Core.Domain; |
||||
using Microsoft.EntityFrameworkCore; |
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Data.Configurations |
||||
{ |
||||
public class ChannelWatermarkConfiguration : IEntityTypeConfiguration<ChannelWatermark> |
||||
{ |
||||
public void Configure(EntityTypeBuilder<ChannelWatermark> builder) => builder.ToTable("ChannelWatermark"); |
||||
} |
||||
} |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,68 @@
@@ -0,0 +1,68 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Migrations |
||||
{ |
||||
public partial class Add_ChannelWatermark : Migration |
||||
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.AddColumn<int>( |
||||
name: "WatermarkId", |
||||
table: "Channel", |
||||
type: "INTEGER", |
||||
nullable: true); |
||||
|
||||
migrationBuilder.CreateTable( |
||||
name: "ChannelWatermark", |
||||
columns: table => new |
||||
{ |
||||
Id = table.Column<int>(type: "INTEGER", nullable: false) |
||||
.Annotation("Sqlite:Autoincrement", true), |
||||
Location = table.Column<int>(type: "INTEGER", nullable: false), |
||||
Size = table.Column<int>(type: "INTEGER", nullable: false), |
||||
Mode = table.Column<int>(type: "INTEGER", nullable: false), |
||||
WidthPercent = table.Column<int>(type: "INTEGER", nullable: false), |
||||
HorizontalMarginPercent = table.Column<int>(type: "INTEGER", nullable: false), |
||||
VerticalMarginPercent = table.Column<int>(type: "INTEGER", nullable: false), |
||||
FrequencyMinutes = table.Column<int>(type: "INTEGER", nullable: false), |
||||
DurationSeconds = table.Column<int>(type: "INTEGER", nullable: false) |
||||
}, |
||||
constraints: table => |
||||
{ |
||||
table.PrimaryKey("PK_ChannelWatermark", x => x.Id); |
||||
}); |
||||
|
||||
migrationBuilder.CreateIndex( |
||||
name: "IX_Channel_WatermarkId", |
||||
table: "Channel", |
||||
column: "WatermarkId", |
||||
unique: true); |
||||
|
||||
migrationBuilder.AddForeignKey( |
||||
name: "FK_Channel_ChannelWatermark_WatermarkId", |
||||
table: "Channel", |
||||
column: "WatermarkId", |
||||
principalTable: "ChannelWatermark", |
||||
principalColumn: "Id", |
||||
onDelete: ReferentialAction.Cascade); |
||||
} |
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
||||
migrationBuilder.DropForeignKey( |
||||
name: "FK_Channel_ChannelWatermark_WatermarkId", |
||||
table: "Channel"); |
||||
|
||||
migrationBuilder.DropTable( |
||||
name: "ChannelWatermark"); |
||||
|
||||
migrationBuilder.DropIndex( |
||||
name: "IX_Channel_WatermarkId", |
||||
table: "Channel"); |
||||
|
||||
migrationBuilder.DropColumn( |
||||
name: "WatermarkId", |
||||
table: "Channel"); |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue