Fixing sqlite episodes nullable

This commit is contained in:
Zoe Roux 2021-06-26 18:29:49 +02:00
parent 8a9dfd5951
commit d4c674f2be
7 changed files with 16 additions and 16 deletions

View File

@ -40,7 +40,7 @@ namespace Kyoo.Models
}
else
{
match = Regex.Match(value, @"(?<show>.*)-(?<absolute>\d*)");
match = Regex.Match(value, @"(?<show>.+)-(?<absolute>\d+)");
if (match.Success)
{
ShowSlug = match.Groups["show"].Value;

View File

@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Kyoo.SqLite.Migrations
{
[DbContext(typeof(SqLiteContext))]
[Migration("20210621175330_Initial")]
[Migration("20210626141337_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -51,10 +51,10 @@ namespace Kyoo.SqLite.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("AbsoluteNumber")
b.Property<int?>("AbsoluteNumber")
.HasColumnType("INTEGER");
b.Property<int>("EpisodeNumber")
b.Property<int?>("EpisodeNumber")
.HasColumnType("INTEGER");
b.Property<string>("Overview")
@ -69,7 +69,7 @@ namespace Kyoo.SqLite.Migrations
b.Property<int?>("SeasonID")
.HasColumnType("INTEGER");
b.Property<int>("SeasonNumber")
b.Property<int?>("SeasonNumber")
.HasColumnType("INTEGER");
b.Property<int>("ShowID")

View File

@ -407,9 +407,9 @@ namespace Kyoo.SqLite.Migrations
Slug = table.Column<string>(type: "TEXT", nullable: true),
ShowID = table.Column<int>(type: "INTEGER", nullable: false),
SeasonID = table.Column<int>(type: "INTEGER", nullable: true),
SeasonNumber = table.Column<int>(type: "INTEGER", nullable: false),
EpisodeNumber = table.Column<int>(type: "INTEGER", nullable: false),
AbsoluteNumber = table.Column<int>(type: "INTEGER", nullable: false),
SeasonNumber = table.Column<int>(type: "INTEGER", nullable: true),
EpisodeNumber = table.Column<int>(type: "INTEGER", nullable: true),
AbsoluteNumber = table.Column<int>(type: "INTEGER", nullable: true),
Path = table.Column<string>(type: "TEXT", nullable: true),
Thumb = table.Column<string>(type: "TEXT", nullable: true),
Title = table.Column<string>(type: "TEXT", nullable: true),

View File

@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Kyoo.SqLite.Migrations
{
[DbContext(typeof(SqLiteContext))]
[Migration("20210621175342_Triggers")]
[Migration("20210626141347_Triggers")]
partial class Triggers
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -51,10 +51,10 @@ namespace Kyoo.SqLite.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("AbsoluteNumber")
b.Property<int?>("AbsoluteNumber")
.HasColumnType("INTEGER");
b.Property<int>("EpisodeNumber")
b.Property<int?>("EpisodeNumber")
.HasColumnType("INTEGER");
b.Property<string>("Overview")
@ -69,7 +69,7 @@ namespace Kyoo.SqLite.Migrations
b.Property<int?>("SeasonID")
.HasColumnType("INTEGER");
b.Property<int>("SeasonNumber")
b.Property<int?>("SeasonNumber")
.HasColumnType("INTEGER");
b.Property<int>("ShowID")

View File

@ -49,10 +49,10 @@ namespace Kyoo.SqLite.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("AbsoluteNumber")
b.Property<int?>("AbsoluteNumber")
.HasColumnType("INTEGER");
b.Property<int>("EpisodeNumber")
b.Property<int?>("EpisodeNumber")
.HasColumnType("INTEGER");
b.Property<string>("Overview")
@ -67,7 +67,7 @@ namespace Kyoo.SqLite.Migrations
b.Property<int?>("SeasonID")
.HasColumnType("INTEGER");
b.Property<int>("SeasonNumber")
b.Property<int?>("SeasonNumber")
.HasColumnType("INTEGER");
b.Property<int>("ShowID")

View File

@ -60,7 +60,7 @@ namespace Kyoo.Tests.Library
ID = 1,
SeasonNumber = 2
}, false);
Assert.Equal($"{TestSample.Get<Show>().Slug}-s2e2", episode.Slug);
Assert.Equal($"{TestSample.Get<Show>().Slug}-s2e1", episode.Slug);
episode = await _repository.Get(1);
Assert.Equal($"{TestSample.Get<Show>().Slug}-s2e1", episode.Slug);
}