diff --git a/back/src/Kyoo.Abstractions/Controllers/ILibraryManager.cs b/back/src/Kyoo.Abstractions/Controllers/ILibraryManager.cs index ef5bd683..12bb63fe 100644 --- a/back/src/Kyoo.Abstractions/Controllers/ILibraryManager.cs +++ b/back/src/Kyoo.Abstractions/Controllers/ILibraryManager.cs @@ -68,11 +68,6 @@ namespace Kyoo.Abstractions.Controllers /// IRepository Episodes { get; } - /// - /// The repository that handle people. - /// - IRepository People { get; } - /// /// The repository that handle studios. /// diff --git a/back/src/Kyoo.Abstractions/Models/PeopleRole.cs b/back/src/Kyoo.Abstractions/Models/PeopleRole.cs deleted file mode 100644 index 96b52fe2..00000000 --- a/back/src/Kyoo.Abstractions/Models/PeopleRole.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Kyoo - A portable and vast media library solution. -// Copyright (c) Kyoo. -// -// See AUTHORS.md and LICENSE file in the project root for full license information. -// -// Kyoo is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// Kyoo is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Kyoo. If not, see . - -using System; - -namespace Kyoo.Abstractions.Models -{ - /// - /// A role a person played for a show. It can be an actor, musician, voice actor, director, writer... - /// - /// - /// This class is not serialized like other classes. - /// Based on the field, it is serialized like - /// a show with two extra fields ( and ). - /// - public class PeopleRole : IResource - { - /// - public Guid Id { get; set; } - - /// - public string Slug => ForPeople ? Show!.Slug : People.Slug; - - /// - /// Should this role be used as a Show substitute (the value is true) or - /// as a People substitute (the value is false). - /// - public bool ForPeople { get; set; } - - /// - /// The ID of the People playing the role. - /// - public Guid PeopleID { get; set; } - - /// - /// The people that played this role. - /// - public People People { get; set; } - - /// - /// The ID of the Show where the People playing in. - /// - public Guid? ShowID { get; set; } - - /// - /// The show where the People played in. - /// - public Show? Show { get; set; } - - public Guid? MovieID { get; set; } - - public Movie? Movie { get; set; } - - /// - /// The type of work the person has done for the show. - /// That can be something like "Actor", "Writer", "Music", "Voice Actor"... - /// - public string Type { get; set; } - - /// - /// The role the People played. - /// This is mostly used to inform witch character was played for actor and voice actors. - /// - public string Role { get; set; } - } -} diff --git a/back/src/Kyoo.Abstractions/Models/Resources/Movie.cs b/back/src/Kyoo.Abstractions/Models/Resources/Movie.cs index 092432ce..257ddcb8 100644 --- a/back/src/Kyoo.Abstractions/Models/Resources/Movie.cs +++ b/back/src/Kyoo.Abstractions/Models/Resources/Movie.cs @@ -36,7 +36,6 @@ namespace Kyoo.Abstractions.Models : IQuery, IResource, IMetadata, - IOnMerge, IThumbnails, IAddedDate, ILibraryItem, @@ -147,11 +146,6 @@ namespace Kyoo.Abstractions.Models [LoadableRelation(nameof(StudioId))] public Studio? Studio { get; set; } - // /// - // /// The list of people that made this show. - // /// - // [SerializeIgnore] public ICollection? People { get; set; } - /// /// The list of collections that contains this show. /// @@ -180,16 +174,6 @@ namespace Kyoo.Abstractions.Models // There is a global query filter to filter by user so we just need to do single. private MovieWatchStatus? _WatchStatus => Watched!.FirstOrDefault(); - /// - public void OnMerge(object merged) - { - // if (People != null) - // { - // foreach (PeopleRole link in People) - // link.Movie = this; - // } - } - public Movie() { } [JsonConstructor] diff --git a/back/src/Kyoo.Abstractions/Models/Resources/People.cs b/back/src/Kyoo.Abstractions/Models/Resources/People.cs deleted file mode 100644 index 7537440d..00000000 --- a/back/src/Kyoo.Abstractions/Models/Resources/People.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Kyoo - A portable and vast media library solution. -// Copyright (c) Kyoo. -// -// See AUTHORS.md and LICENSE file in the project root for full license information. -// -// Kyoo is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// Kyoo is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Kyoo. If not, see . - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Text.Json.Serialization; -using Kyoo.Abstractions.Controllers; -using Kyoo.Utils; - -namespace Kyoo.Abstractions.Models -{ - /// - /// An actor, voice actor, writer, animator, somebody who worked on a . - /// - [Table("people")] - public class People : IQuery, IResource, IMetadata, IThumbnails - { - public static Sort DefaultSort => new Sort.By(x => x.Name); - - /// - public Guid Id { get; set; } - - /// - [MaxLength(256)] - public string Slug { get; set; } - - /// - /// The name of this person. - /// - public string Name { get; set; } - - /// - public Image? Poster { get; set; } - - /// - public Image? Thumbnail { get; set; } - - /// - public Image? Logo { get; set; } - - /// - public Dictionary ExternalId { get; set; } = new(); - - /// - /// The list of roles this person has played in. See for more information. - /// - [JsonIgnore] - public ICollection? Roles { get; set; } - - public People() { } - - [JsonConstructor] - public People(string name) - { - if (name != null) - { - Slug = Utility.ToSlug(name); - Name = name; - } - } - } -} diff --git a/back/src/Kyoo.Abstractions/Models/Resources/Show.cs b/back/src/Kyoo.Abstractions/Models/Resources/Show.cs index c0ddc4f6..117d5069 100644 --- a/back/src/Kyoo.Abstractions/Models/Resources/Show.cs +++ b/back/src/Kyoo.Abstractions/Models/Resources/Show.cs @@ -138,11 +138,6 @@ namespace Kyoo.Abstractions.Models [LoadableRelation(nameof(StudioId))] public Studio? Studio { get; set; } - // /// - // /// The list of people that made this show. - // /// - // [SerializeIgnore] public ICollection? People { get; set; } - /// /// The different seasons in this show. If this is a movie, this list is always null or empty. /// @@ -232,11 +227,6 @@ namespace Kyoo.Abstractions.Models /// public void OnMerge(object merged) { - // if (People != null) - // { - // foreach (PeopleRole link in People) - // link.Show = this; - // } if (Seasons != null) { foreach (Season season in Seasons) diff --git a/back/src/Kyoo.Core/Controllers/LibraryManager.cs b/back/src/Kyoo.Core/Controllers/LibraryManager.cs index e86e4cad..74ccfa4c 100644 --- a/back/src/Kyoo.Core/Controllers/LibraryManager.cs +++ b/back/src/Kyoo.Core/Controllers/LibraryManager.cs @@ -38,7 +38,6 @@ namespace Kyoo.Core.Controllers IRepository showRepository, IRepository seasonRepository, IRepository episodeRepository, - IRepository peopleRepository, IRepository studioRepository, IRepository userRepository ) @@ -51,7 +50,6 @@ namespace Kyoo.Core.Controllers Shows = showRepository; Seasons = seasonRepository; Episodes = episodeRepository; - People = peopleRepository; Studios = studioRepository; Users = userRepository; @@ -64,7 +62,6 @@ namespace Kyoo.Core.Controllers Shows, Seasons, Episodes, - People, Studios, Users }; @@ -94,9 +91,6 @@ namespace Kyoo.Core.Controllers /// public IRepository Episodes { get; } - /// - public IRepository People { get; } - /// public IRepository Studios { get; } diff --git a/back/src/Kyoo.Core/Controllers/Repositories/MovieRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/MovieRepository.cs index 52e0f2ee..327dd906 100644 --- a/back/src/Kyoo.Core/Controllers/Repositories/MovieRepository.cs +++ b/back/src/Kyoo.Core/Controllers/Repositories/MovieRepository.cs @@ -42,29 +42,15 @@ namespace Kyoo.Core.Controllers /// private readonly IRepository _studios; - /// - /// A people repository to handle creation/validation of related people. - /// - private readonly IRepository _people; - - /// - /// Create a new . - /// - /// The database handle to use - /// A studio repository - /// A people repository - /// The thumbnail manager used to store images. public MovieRepository( DatabaseContext database, IRepository studios, - IRepository people, IThumbnailsManager thumbs ) : base(database, thumbs) { _database = database; _studios = studios; - _people = people; } /// @@ -98,17 +84,6 @@ namespace Kyoo.Core.Controllers resource.Studio = await _studios.CreateIfNotExists(resource.Studio); resource.StudioId = resource.Studio.Id; } - - // if (resource.People != null) - // { - // foreach (PeopleRole role in resource.People) - // { - // role.People = _database.LocalEntity(role.People.Slug) - // ?? await _people.CreateIfNotExists(role.People); - // role.PeopleID = role.People.Id; - // _database.Entry(role).State = EntityState.Added; - // } - // } } /// @@ -121,12 +96,6 @@ namespace Kyoo.Core.Controllers await Database.Entry(resource).Reference(x => x.Studio).LoadAsync(); resource.Studio = changed.Studio; } - - // if (changed.People != null) - // { - // await Database.Entry(resource).Collection(x => x.People!).LoadAsync(); - // resource.People = changed.People; - // } } /// diff --git a/back/src/Kyoo.Core/Controllers/Repositories/PeopleRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/PeopleRepository.cs deleted file mode 100644 index ab143315..00000000 --- a/back/src/Kyoo.Core/Controllers/Repositories/PeopleRepository.cs +++ /dev/null @@ -1,206 +0,0 @@ -// Kyoo - A portable and vast media library solution. -// Copyright (c) Kyoo. -// -// See AUTHORS.md and LICENSE file in the project root for full license information. -// -// Kyoo is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// Kyoo is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Kyoo. If not, see . - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Kyoo.Abstractions.Controllers; -using Kyoo.Abstractions.Models; -using Kyoo.Abstractions.Models.Utils; -using Kyoo.Postgresql; -using Kyoo.Utils; -using Microsoft.EntityFrameworkCore; - -namespace Kyoo.Core.Controllers -{ - /// - /// A local repository to handle people. - /// - public class PeopleRepository : LocalRepository - { - /// - /// The database handle - /// - private readonly DatabaseContext _database; - - /// - /// A lazy loaded show repository to validate requests from shows. - /// - private readonly Lazy> _shows; - - /// - /// Create a new - /// - /// The database handle - /// A lazy loaded show repository - /// The thumbnail manager used to store images. - public PeopleRepository( - DatabaseContext database, - Lazy> shows, - IThumbnailsManager thumbs - ) - : base(database, thumbs) - { - _database = database; - _shows = shows; - } - - /// - public override Task> Search( - string query, - Include? include = default - ) - { - throw new NotImplementedException(); - // return await AddIncludes(_database.People, include) - // .Where(x => EF.Functions.ILike(x.Name, $"%{query}%")) - // .Take(20) - // .ToListAsync(); - } - - /// - public override async Task Create(People obj) - { - await base.Create(obj); - _database.Entry(obj).State = EntityState.Added; - await _database.SaveChangesAsync(() => Get(obj.Slug)); - await IRepository.OnResourceCreated(obj); - return obj; - } - - /// - protected override async Task Validate(People resource) - { - await base.Validate(resource); - - if (resource.Roles != null) - { - foreach (PeopleRole role in resource.Roles) - { - role.Show = - _database.LocalEntity(role.Show!.Slug) - ?? await _shows.Value.CreateIfNotExists(role.Show); - role.ShowID = role.Show.Id; - _database.Entry(role).State = EntityState.Added; - } - } - } - - /// - protected override async Task EditRelations(People resource, People changed) - { - await Validate(changed); - - if (changed.Roles != null) - { - await Database.Entry(resource).Collection(x => x.Roles!).LoadAsync(); - resource.Roles = changed.Roles; - } - } - - /// - public override async Task Delete(People obj) - { - _database.Entry(obj).State = EntityState.Deleted; - obj.Roles.ForEach(x => _database.Entry(x).State = EntityState.Deleted); - await _database.SaveChangesAsync(); - await base.Delete(obj); - } - - // /// - // public Task> GetFromShow(int showID, - // Expression>? where = null, - // Sort? sort = default, - // Pagination? limit = default) - // { - // ICollection people = await ApplyFilters(_database.PeopleRoles - // .Where(x => x.ShowID == showID) - // .Include(x => x.People), - // x => x.People.Name, - // where, - // sort, - // limit); - // if (!people.Any() && await _shows.Value.GetOrDefault(showID) == null) - // throw new ItemNotFoundException(); - // foreach (PeopleRole role in people) - // role.ForPeople = true; - // return people; - // } - - // /// - // public Task> GetFromShow(string showSlug, - // Expression>? where = null, - // Sort? sort = default, - // Pagination? limit = default) - // { - // ICollection people = await ApplyFilters(_database.PeopleRoles - // .Where(x => x.Show.Slug == showSlug) - // .Include(x => x.People) - // .Include(x => x.Show), - // id => _database.PeopleRoles.FirstOrDefaultAsync(x => x.ID == id), - // x => x.People.Name, - // where, - // sort, - // limit); - // if (!people.Any() && await _shows.Value.GetOrDefault(showSlug) == null) - // throw new ItemNotFoundException(); - // foreach (PeopleRole role in people) - // role.ForPeople = true; - // return people; - // } - - // /// - // public Task> GetFromPeople(int id, - // Expression>? where = null, - // Sort? sort = default, - // Pagination? limit = default) - // { - // ICollection roles = await ApplyFilters(_database.PeopleRoles - // .Where(x => x.PeopleID == id) - // .Include(x => x.Show), - // y => _database.PeopleRoles.FirstOrDefaultAsync(x => x.ID == y), - // x => x.Show.Title, - // where, - // sort, - // limit); - // if (!roles.Any() && await GetOrDefault(id) == null) - // throw new ItemNotFoundException(); - // return roles; - // } - - // /// - // public Task> GetFromPeople(string slug, - // Expression>? where = null, - // Sort? sort = default, - // Pagination? limit = default) - // { - // ICollection roles = await ApplyFilters(_database.PeopleRoles - // .Where(x => x.People.Slug == slug) - // .Include(x => x.Show), - // id => _database.PeopleRoles.FirstOrDefaultAsync(x => x.ID == id), - // x => x.Show.Title, - // where, - // sort, - // limit); - // if (!roles.Any() && await GetOrDefault(slug) == null) - // throw new ItemNotFoundException(); - // return roles; - // } - } -} diff --git a/back/src/Kyoo.Core/Controllers/Repositories/ShowRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/ShowRepository.cs index e6e4c3d4..5bc8e194 100644 --- a/back/src/Kyoo.Core/Controllers/Repositories/ShowRepository.cs +++ b/back/src/Kyoo.Core/Controllers/Repositories/ShowRepository.cs @@ -43,29 +43,15 @@ namespace Kyoo.Core.Controllers /// private readonly IRepository _studios; - /// - /// A people repository to handle creation/validation of related people. - /// - private readonly IRepository _people; - - /// - /// Create a new . - /// - /// The database handle to use - /// A studio repository - /// A people repository - /// The thumbnail manager used to store images. public ShowRepository( DatabaseContext database, IRepository studios, - IRepository people, IThumbnailsManager thumbs ) : base(database, thumbs) { _database = database; _studios = studios; - _people = people; } /// @@ -99,17 +85,6 @@ namespace Kyoo.Core.Controllers resource.Studio = await _studios.CreateIfNotExists(resource.Studio); resource.StudioId = resource.Studio.Id; } - - // if (resource.People != null) - // { - // foreach (PeopleRole role in resource.People) - // { - // role.People = _database.LocalEntity(role.People.Slug) - // ?? await _people.CreateIfNotExists(role.People); - // role.PeopleID = role.People.Id; - // _database.Entry(role).State = EntityState.Added; - // } - // } } /// @@ -122,12 +97,6 @@ namespace Kyoo.Core.Controllers await Database.Entry(resource).Reference(x => x.Studio).LoadAsync(); resource.Studio = changed.Studio; } - - // if (changed.People != null) - // { - // await Database.Entry(resource).Collection(x => x.People!).LoadAsync(); - // resource.People = changed.People; - // } } /// diff --git a/back/src/Kyoo.Core/CoreModule.cs b/back/src/Kyoo.Core/CoreModule.cs index d343bd72..d3341e31 100644 --- a/back/src/Kyoo.Core/CoreModule.cs +++ b/back/src/Kyoo.Core/CoreModule.cs @@ -66,7 +66,6 @@ namespace Kyoo.Core builder.RegisterRepository(); builder.RegisterRepository(); builder.RegisterRepository(); - builder.RegisterRepository(); builder.RegisterRepository(); builder.RegisterRepository().As(); builder.RegisterRepository(); diff --git a/back/src/Kyoo.Core/Views/Metadata/StaffApi.cs b/back/src/Kyoo.Core/Views/Metadata/StaffApi.cs deleted file mode 100644 index 7cbf0cfc..00000000 --- a/back/src/Kyoo.Core/Views/Metadata/StaffApi.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Kyoo - A portable and vast media library solution. -// Copyright (c) Kyoo. -// -// See AUTHORS.md and LICENSE file in the project root for full license information. -// -// Kyoo is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// Kyoo is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Kyoo. If not, see . - -using Kyoo.Abstractions.Controllers; -using Kyoo.Abstractions.Models; -using Kyoo.Abstractions.Models.Attributes; -using Kyoo.Abstractions.Models.Permissions; -using Microsoft.AspNetCore.Mvc; -using static Kyoo.Abstractions.Models.Utils.Constants; - -namespace Kyoo.Core.Api -{ - /// - /// Information about one or multiple staff member. - /// - [Route("staff")] - [Route("people", Order = AlternativeRoute)] - [ApiController] - [PartialPermission(nameof(People))] - [ApiDefinition("Staff", Group = MetadataGroup)] - public class StaffApi : CrudThumbsApi - { - /// - /// The library manager used to modify or retrieve information in the data store. - /// - private readonly ILibraryManager _libraryManager; - - /// - /// Create a new . - /// - /// - /// The library manager used to modify or retrieve information about the data store. - /// - /// The thumbnail manager used to retrieve images paths. - public StaffApi(ILibraryManager libraryManager, IThumbnailsManager thumbs) - : base(libraryManager.People, thumbs) - { - _libraryManager = libraryManager; - } - - // /// - // /// Get roles - // /// - // /// - // /// List the roles in witch this person has played, written or worked in a way. - // /// - // /// The ID or slug of the person. - // /// A key to sort roles by. - // /// An optional list of filters. - // /// The number of roles to return. - // /// A page of roles. - // /// The filters or the sort parameters are invalid. - // /// No person with the given ID or slug could be found. - // [HttpGet("{identifier:id}/roles")] - // [HttpGet("{identifier:id}/role", Order = AlternativeRoute)] - // [PartialPermission(Kind.Read)] - // [ProducesResponseType(StatusCodes.Status200OK)] - // [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(RequestError))] - // [ProducesResponseType(StatusCodes.Status404NotFound)] - // public async Task>> GetRoles(Identifier identifier, - // [FromQuery] Sort sortBy, - // [FromQuery] Dictionary where, - // [FromQuery] Pagination pagination) - // { - // Expression>? whereQuery = ApiHelper.ParseWhere(where); - // - // ICollection resources = await identifier.Match( - // id => _libraryManager.GetRolesFromPeople(id, whereQuery, sortBy, pagination), - // slug => _libraryManager.GetRolesFromPeople(slug, whereQuery, sortBy, pagination) - // ); - // - // return Page(resources, pagination.Limit); - // } - } -} diff --git a/back/src/Kyoo.Core/Views/Resources/MovieApi.cs b/back/src/Kyoo.Core/Views/Resources/MovieApi.cs index b148f85d..f83d92cc 100644 --- a/back/src/Kyoo.Core/Views/Resources/MovieApi.cs +++ b/back/src/Kyoo.Core/Views/Resources/MovieApi.cs @@ -43,40 +43,6 @@ namespace Kyoo.Core.Api public class MovieApi(ILibraryManager libraryManager, IThumbnailsManager thumbs) : TranscoderApi(libraryManager.Movies, thumbs) { - // /// - // /// Get staff - // /// - // /// - // /// List staff members that made this show. - // /// - // /// The ID or slug of the . - // /// A key to sort staff members by. - // /// An optional list of filters. - // /// The number of people to return. - // /// A page of people. - // /// The filters or the sort parameters are invalid. - // /// No show with the given ID or slug could be found. - // [HttpGet("{identifier:id}/staff")] - // [HttpGet("{identifier:id}/people", Order = AlternativeRoute)] - // [PartialPermission(Kind.Read)] - // [ProducesResponseType(StatusCodes.Status200OK)] - // [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(RequestError))] - // [ProducesResponseType(StatusCodes.Status404NotFound)] - // public async Task>> GetPeople(Identifier identifier, - // [FromQuery] string sortBy, - // [FromQuery] Dictionary where, - // [FromQuery] Pagination pagination) - // { - // Expression> whereQuery = ApiHelper.ParseWhere(where); - // Sort sort = Sort.From(sortBy); - // - // ICollection resources = await identifier.Match( - // id => _libraryManager.GetPeopleFromShow(id, whereQuery, sort, pagination), - // slug => _libraryManager.GetPeopleFromShow(slug, whereQuery, sort, pagination) - // ); - // return Page(resources, pagination.Limit); - // } - /// /// Get studio that made the show /// diff --git a/back/src/Kyoo.Core/Views/Resources/ShowApi.cs b/back/src/Kyoo.Core/Views/Resources/ShowApi.cs index f0dc5122..96da58c2 100644 --- a/back/src/Kyoo.Core/Views/Resources/ShowApi.cs +++ b/back/src/Kyoo.Core/Views/Resources/ShowApi.cs @@ -146,41 +146,6 @@ namespace Kyoo.Core.Api return Page(resources, pagination.Limit); } - // /// - // /// Get staff - // /// - // /// - // /// List staff members that made this show. - // /// - // /// The ID or slug of the . - // /// A key to sort staff members by. - // /// An optional list of filters. - // /// The number of people to return. - // /// The aditional fields to include in the result. - // /// A page of people. - // /// The filters or the sort parameters are invalid. - // /// No show with the given ID or slug could be found. - // [HttpGet("{identifier:id}/staff")] - // [HttpGet("{identifier:id}/people", Order = AlternativeRoute)] - // [PartialPermission(Kind.Read)] - // [ProducesResponseType(StatusCodes.Status200OK)] - // [ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(RequestError))] - // [ProducesResponseType(StatusCodes.Status404NotFound)] - // public async Task>> GetPeople(Identifier identifier, - // [FromQuery] Sort sortBy, - // [FromQuery] Dictionary where, - // [FromQuery] Pagination pagination, - // [FromQuery] Include fields) - // { - // Expression>? whereQuery = ApiHelper.ParseWhere(where); - // - // ICollection resources = await identifier.Match( - // id => _libraryManager.GetPeopleFromShow(id, whereQuery, sortBy, pagination), - // slug => _libraryManager.GetPeopleFromShow(slug, whereQuery, sortBy, pagination) - // ); - // return Page(resources, pagination.Limit); - // } - /// /// Get studio that made the show /// diff --git a/back/src/Kyoo.Postgresql/DatabaseContext.cs b/back/src/Kyoo.Postgresql/DatabaseContext.cs index 8f728ce6..6d40001a 100644 --- a/back/src/Kyoo.Postgresql/DatabaseContext.cs +++ b/back/src/Kyoo.Postgresql/DatabaseContext.cs @@ -78,11 +78,6 @@ namespace Kyoo.Postgresql /// public DbSet Episodes { get; set; } - // /// - // /// All people of Kyoo. See . - // /// - // public DbSet People { get; set; } - /// /// All studios of Kyoo. See . /// @@ -93,11 +88,6 @@ namespace Kyoo.Postgresql /// public DbSet Users { get; set; } - // /// - // /// All people's role. See . - // /// - // public DbSet PeopleRoles { get; set; } - public DbSet MovieWatchStatus { get; set; } public DbSet ShowWatchStatus { get; set; } @@ -275,8 +265,6 @@ namespace Kyoo.Postgresql .Ignore(x => x.PreviousEpisode) .Ignore(x => x.NextEpisode); - // modelBuilder.Entity() - // .Ignore(x => x.ForPeople); modelBuilder .Entity() .HasMany(x => x.Seasons) @@ -312,14 +300,12 @@ namespace Kyoo.Postgresql _HasMetadata(modelBuilder); _HasMetadata(modelBuilder); _HasMetadata(modelBuilder); - // _HasMetadata(modelBuilder); _HasMetadata(modelBuilder); _HasImages(modelBuilder); _HasImages(modelBuilder); _HasImages(modelBuilder); _HasImages(modelBuilder); - // _HasImages(modelBuilder); _HasImages(modelBuilder); _HasAddedDate(modelBuilder); @@ -382,9 +368,6 @@ namespace Kyoo.Postgresql modelBuilder.Entity().Ignore(x => x.WatchStatus); modelBuilder.Entity().HasIndex(x => x.Slug).IsUnique(); - // modelBuilder.Entity() - // .HasIndex(x => x.Slug) - // .IsUnique(); modelBuilder.Entity().HasIndex(x => x.Slug).IsUnique(); modelBuilder.Entity().HasIndex(x => x.Slug).IsUnique(); modelBuilder.Entity().HasIndex(x => x.Slug).IsUnique();