Update migrations and fix a few bugs
This commit is contained in:
parent
7c823464bc
commit
46a0a2a601
|
@ -2,6 +2,7 @@
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
using System.Xml.Serialization;
|
||||||
using Jellyfin.Data.Enums;
|
using Jellyfin.Data.Enums;
|
||||||
|
|
||||||
namespace Jellyfin.Data.Entities
|
namespace Jellyfin.Data.Entities
|
||||||
|
@ -40,7 +41,7 @@ namespace Jellyfin.Data.Entities
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Identity, Indexed, Required.
|
/// Identity, Indexed, Required.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[JsonIgnore]
|
[XmlIgnore]
|
||||||
[Key]
|
[Key]
|
||||||
[Required]
|
[Required]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
@ -49,6 +50,7 @@ namespace Jellyfin.Data.Entities
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the id of the associated user.
|
/// Gets or sets the id of the associated user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[XmlIgnore]
|
||||||
[Required]
|
[Required]
|
||||||
[ForeignKey("Id")]
|
[ForeignKey("Id")]
|
||||||
public Guid UserId { get; protected set; }
|
public Guid UserId { get; protected set; }
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CS1591
|
||||||
#pragma warning disable SA1601
|
|
||||||
|
|
||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using System;
|
using System;
|
||||||
|
@ -12,7 +11,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
namespace Jellyfin.Server.Implementations.Migrations
|
namespace Jellyfin.Server.Implementations.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(JellyfinDb))]
|
[DbContext(typeof(JellyfinDb))]
|
||||||
[Migration("20200517002411_AddUsers")]
|
[Migration("20200527010628_AddUsers")]
|
||||||
partial class AddUsers
|
partial class AddUsers
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
@ -20,7 +19,7 @@ namespace Jellyfin.Server.Implementations.Migrations
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasDefaultSchema("jellyfin")
|
.HasDefaultSchema("jellyfin")
|
||||||
.HasAnnotation("ProductVersion", "3.1.3");
|
.HasAnnotation("ProductVersion", "3.1.4");
|
||||||
|
|
||||||
modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
|
modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
|
||||||
{
|
{
|
||||||
|
@ -129,7 +128,8 @@ namespace Jellyfin.Server.Implementations.Migrations
|
||||||
|
|
||||||
b.Property<string>("Path")
|
b.Property<string>("Path")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("TEXT");
|
.HasColumnType("TEXT")
|
||||||
|
.HasMaxLength(512);
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
@ -331,6 +331,9 @@ namespace Jellyfin.Server.Implementations.Migrations
|
||||||
b.Property<int>("SubtitleMode")
|
b.Property<int>("SubtitleMode")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
b.Property<int>("SyncPlayAccess")
|
||||||
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
b.Property<string>("Username")
|
b.Property<string>("Username")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("TEXT")
|
.HasColumnType("TEXT")
|
|
@ -17,7 +17,7 @@ namespace Jellyfin.Server.Implementations.Migrations
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true),
|
||||||
Path = table.Column<string>(nullable: false),
|
Path = table.Column<string>(maxLength: 512, nullable: false),
|
||||||
LastModified = table.Column<DateTime>(nullable: false)
|
LastModified = table.Column<DateTime>(nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
|
@ -58,6 +58,7 @@ namespace Jellyfin.Server.Implementations.Migrations
|
||||||
RemoteClientBitrateLimit = table.Column<int>(nullable: true),
|
RemoteClientBitrateLimit = table.Column<int>(nullable: true),
|
||||||
InternalId = table.Column<long>(nullable: false),
|
InternalId = table.Column<long>(nullable: false),
|
||||||
ProfileImageId = table.Column<int>(nullable: true),
|
ProfileImageId = table.Column<int>(nullable: true),
|
||||||
|
SyncPlayAccess = table.Column<int>(nullable: false),
|
||||||
RowVersion = table.Column<uint>(nullable: false)
|
RowVersion = table.Column<uint>(nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
|
@ -15,7 +15,7 @@ namespace Jellyfin.Server.Implementations.Migrations
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasDefaultSchema("jellyfin")
|
.HasDefaultSchema("jellyfin")
|
||||||
.HasAnnotation("ProductVersion", "3.1.3");
|
.HasAnnotation("ProductVersion", "3.1.4");
|
||||||
|
|
||||||
modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
|
modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
|
||||||
{
|
{
|
||||||
|
@ -124,7 +124,8 @@ namespace Jellyfin.Server.Implementations.Migrations
|
||||||
|
|
||||||
b.Property<string>("Path")
|
b.Property<string>("Path")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("TEXT");
|
.HasColumnType("TEXT")
|
||||||
|
.HasMaxLength(512);
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
@ -326,6 +327,9 @@ namespace Jellyfin.Server.Implementations.Migrations
|
||||||
b.Property<int>("SubtitleMode")
|
b.Property<int>("SubtitleMode")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
|
b.Property<int>("SyncPlayAccess")
|
||||||
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
b.Property<string>("Username")
|
b.Property<string>("Username")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("TEXT")
|
.HasColumnType("TEXT")
|
||||||
|
|
|
@ -6,6 +6,7 @@ using Jellyfin.Data.Entities;
|
||||||
using Jellyfin.Data.Enums;
|
using Jellyfin.Data.Enums;
|
||||||
using Jellyfin.Server.Implementations;
|
using Jellyfin.Server.Implementations;
|
||||||
using Jellyfin.Server.Implementations.Users;
|
using Jellyfin.Server.Implementations.Users;
|
||||||
|
using MediaBrowser.Common.Json;
|
||||||
using MediaBrowser.Controller;
|
using MediaBrowser.Controller;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Model.Configuration;
|
using MediaBrowser.Model.Configuration;
|
||||||
|
@ -70,7 +71,7 @@ namespace Jellyfin.Server.Migrations.Routines
|
||||||
|
|
||||||
foreach (var entry in queryResult)
|
foreach (var entry in queryResult)
|
||||||
{
|
{
|
||||||
UserMockup mockup = JsonSerializer.Deserialize<UserMockup>(entry[2].ToBlob());
|
UserMockup mockup = JsonSerializer.Deserialize<UserMockup>(entry[2].ToBlob(), JsonDefaults.GetOptions());
|
||||||
var userDataDir = Path.Combine(_paths.UserConfigurationDirectoryPath, mockup.Name);
|
var userDataDir = Path.Combine(_paths.UserConfigurationDirectoryPath, mockup.Name);
|
||||||
|
|
||||||
var config = File.Exists(Path.Combine(userDataDir, "config.xml"))
|
var config = File.Exists(Path.Combine(userDataDir, "config.xml"))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user