mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-06-04 21:35:19 -04:00
Finishing the Lazy load migration and solving some bugs with the API
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kyoo.Models
|
||||
{
|
||||
@@ -7,6 +8,8 @@ namespace Kyoo.Models
|
||||
[JsonIgnore] public long ID { get; set; }
|
||||
public string Slug { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
// public IEnumerable<Show> Shows { get; set; }
|
||||
|
||||
public Genre(string slug, string name)
|
||||
{
|
||||
|
||||
@@ -2,12 +2,17 @@ namespace Kyoo.Models
|
||||
{
|
||||
public class GenreLink
|
||||
{
|
||||
// TODO Make json serializer ignore this class and only serialize the Genre child.
|
||||
// TODO include this class in the EF workflows.
|
||||
|
||||
public long ShowID { get; set; }
|
||||
public virtual Show Show { get; set; }
|
||||
public long GenreID { get; set; }
|
||||
public virtual Genre Genre { get; set; }
|
||||
|
||||
public GenreLink() {}
|
||||
|
||||
public GenreLink(Show show, Genre genre)
|
||||
{
|
||||
Show = show;
|
||||
Genre = genre;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,12 @@ namespace Kyoo.Models
|
||||
{
|
||||
[JsonIgnore] public long ID { get; set; }
|
||||
[JsonIgnore] public long PeopleID { get; set; }
|
||||
public virtual People People { get; set; }
|
||||
[JsonIgnore] public virtual People People { get; set; }
|
||||
|
||||
public string Slug => People.Slug;
|
||||
public string Name => People.Name;
|
||||
public string ExternalIDs => People.ExternalIDs;
|
||||
|
||||
[JsonIgnore] public long ShowID { get; set; }
|
||||
[JsonIgnore] public virtual Show Show { get; set; }
|
||||
public string Role { get; set; }
|
||||
|
||||
@@ -29,7 +29,12 @@ namespace Kyoo.Models
|
||||
|
||||
public bool IsCollection;
|
||||
|
||||
public virtual IEnumerable<Genre> Genres { get; set; }
|
||||
public virtual IEnumerable<Genre> Genres
|
||||
{
|
||||
get { return GenreLinks?.Select(x => x.Genre); }
|
||||
set { GenreLinks = value?.Select(x => new GenreLink(this, x)).ToList(); }
|
||||
}
|
||||
[JsonIgnore] public virtual List<GenreLink> GenreLinks { get; set; }
|
||||
public virtual Studio Studio { get; set; }
|
||||
public virtual IEnumerable<PeopleLink> People { get; set; }
|
||||
public virtual IEnumerable<Season> Seasons { get; set; }
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Kyoo.Models
|
||||
|
||||
public class Track : Stream
|
||||
{
|
||||
public int ID { get; set; }
|
||||
[JsonIgnore] public long ID { get; set; }
|
||||
[JsonIgnore] public long EpisodeID { get; set; }
|
||||
public bool IsDefault
|
||||
{
|
||||
@@ -72,7 +72,7 @@ namespace Kyoo.Models
|
||||
public string Link;
|
||||
|
||||
[JsonIgnore] public bool IsExternal { get; set; }
|
||||
public virtual Episode Episode { get; set; }
|
||||
[JsonIgnore] public virtual Episode Episode { get; set; }
|
||||
|
||||
public Track() { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user