Fix StudioId casing on the movie

This commit is contained in:
Zoe Roux 2023-11-17 14:33:09 +01:00
parent e8f2a72516
commit d01ef02389
4 changed files with 11 additions and 11 deletions

View File

@ -115,12 +115,12 @@ namespace Kyoo.Abstractions.Models
/// <summary>
/// The ID of the Studio that made this show.
/// </summary>
[SerializeIgnore] public int? StudioID { get; set; }
[SerializeIgnore] public int? StudioId { get; set; }
/// <summary>
/// The Studio that made this show.
/// </summary>
[LoadableRelation(nameof(StudioID))][EditableRelation] public Studio? Studio { get; set; }
[LoadableRelation(nameof(StudioId))][EditableRelation] public Studio? Studio { get; set; }
/// <summary>
/// The list of people that made this show.

View File

@ -96,7 +96,7 @@ namespace Kyoo.Core.Controllers
if (resource.Studio != null)
{
resource.Studio = await _studios.CreateIfNotExists(resource.Studio);
resource.StudioID = resource.Studio.Id;
resource.StudioId = resource.Studio.Id;
}
if (resource.People != null)
@ -116,7 +116,7 @@ namespace Kyoo.Core.Controllers
{
await Validate(changed);
if (changed.Studio != null || changed.StudioID == null)
if (changed.Studio != null || changed.StudioId == null)
{
await Database.Entry(resource).Reference(x => x.Studio).LoadAsync();
resource.Studio = changed.Studio;

View File

@ -53,7 +53,7 @@ namespace Kyoo.Meiliseach
CamelCase.ConvertName(nameof(LibraryItem.Genres)),
CamelCase.ConvertName(nameof(LibraryItem.Status)),
CamelCase.ConvertName(nameof(LibraryItem.AirDate)),
CamelCase.ConvertName(nameof(Movie.StudioID)),
CamelCase.ConvertName(nameof(Movie.StudioId)),
CamelCase.ConvertName(nameof(LibraryItem.Kind)),
},
SortableAttributes = new[]

View File

@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using System;
using System.Collections.Generic;
using Kyoo.Abstractions.Models;
@ -216,7 +216,7 @@ namespace Kyoo.Postgresql.Migrations
.HasColumnType("integer")
.HasColumnName("rating");
b.Property<int>("Runtime")
b.Property<int?>("Runtime")
.HasColumnType("integer")
.HasColumnName("runtime");
@ -319,7 +319,7 @@ namespace Kyoo.Postgresql.Migrations
.HasColumnType("status")
.HasColumnName("status");
b.Property<int?>("StudioID")
b.Property<int?>("StudioId")
.HasColumnType("integer")
.HasColumnName("studio_id");
@ -343,7 +343,7 @@ namespace Kyoo.Postgresql.Migrations
.IsUnique()
.HasDatabaseName("ix_movies_slug");
b.HasIndex("StudioID")
b.HasIndex("StudioId")
.HasDatabaseName("ix_movies_studio_id");
b.ToTable("movies", (string)null);
@ -408,7 +408,7 @@ namespace Kyoo.Postgresql.Migrations
.HasColumnType("text")
.HasColumnName("path");
b.Property<int>("Rating")
b.Property<int?>("Rating")
.HasColumnType("integer")
.HasColumnName("rating");
@ -1133,7 +1133,7 @@ namespace Kyoo.Postgresql.Migrations
{
b.HasOne("Kyoo.Abstractions.Models.Studio", "Studio")
.WithMany("Movies")
.HasForeignKey("StudioID")
.HasForeignKey("StudioId")
.OnDelete(DeleteBehavior.SetNull)
.HasConstraintName("fk_movies_studios_studio_id");