Save the language code against the request so we can use it later e.g. Sending to the DVR apps

This commit is contained in:
tidusjar 2019-01-04 20:57:05 +00:00
commit 9cc9bf7e78
9 changed files with 1248 additions and 6 deletions

View file

@ -1,4 +1,4 @@
using System;
using Ombi.Helpers;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
@ -19,5 +19,13 @@ namespace Ombi.Store.Entities.Requests
public int RootPathOverride { get; set; }
public int QualityOverride { get; set; }
/// <summary>
/// Only Use for setting the Language Code, Use the LanguageCode property for reading
/// </summary>
public string LangCode { get; set; }
[NotMapped]
public string LanguageCode => LangCode.IsNullOrEmpty() ? "en" : LangCode;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Ombi.Store.Migrations
{
public partial class LanguageCode : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "LangCode",
table: "MovieRequests",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "LangCode",
table: "MovieRequests");
}
}
}

View file

@ -2,6 +2,7 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Ombi.Store.Context;
namespace Ombi.Store.Migrations
@ -730,6 +731,8 @@ namespace Ombi.Store.Migrations
b.Property<int?>("IssueId");
b.Property<string>("LangCode");
b.Property<DateTime>("MarkedAsApproved");
b.Property<DateTime?>("MarkedAsAvailable");