add preferred language (#109)

* add explicit warning for zero/invalid duration media items

* set dateadded on plex media versions

* add media stream table

* save local media streams to db

* save plex media streams to db

* add preferred language settings (no validation)

* use preferred language if possible

* code cleanup

* proper language code validation

* force scan of all libraries to pull in media streams
This commit is contained in:
Jason Dove
2021-03-28 21:54:48 +00:00
committed by GitHub
parent 51b671dec7
commit d303bc0158
52 changed files with 6265 additions and 181 deletions
@@ -0,0 +1,47 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ErsatzTV.Infrastructure.Migrations
{
public partial class Add_MediaStream : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
"MediaStream",
table => new
{
Id = table.Column<int>("INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Index = table.Column<int>("INTEGER", nullable: false),
Codec = table.Column<string>("TEXT", nullable: true),
Profile = table.Column<string>("TEXT", nullable: true),
MediaStreamKind = table.Column<int>("INTEGER", nullable: false),
Language = table.Column<string>("TEXT", nullable: true),
Channels = table.Column<int>("INTEGER", nullable: false),
Title = table.Column<string>("TEXT", nullable: true),
Default = table.Column<bool>("INTEGER", nullable: false),
Forced = table.Column<bool>("INTEGER", nullable: false),
MediaVersionId = table.Column<int>("INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_MediaStream", x => x.Id);
table.ForeignKey(
"FK_MediaStream_MediaVersion_MediaVersionId",
x => x.MediaVersionId,
"MediaVersion",
"Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
"IX_MediaStream_MediaVersionId",
"MediaStream",
"MediaVersionId");
}
protected override void Down(MigrationBuilder migrationBuilder) =>
migrationBuilder.DropTable(
"MediaStream");
}
}