Implementing shows/genres & GetGenresByShow

This commit is contained in:
Zoe Roux
2020-07-25 04:22:27 +02:00
parent b73be95f11
commit fb2d5b24bd
5 changed files with 159 additions and 2 deletions
@@ -128,6 +128,26 @@ namespace Kyoo.Controllers
Expression<Func<PeopleLink, object>> sort,
Pagination limit = default
) => GetPeopleFromShow(showSlug, where, new Sort<PeopleLink>(sort), limit);
Task<ICollection<Genre>> GetGenresFromShow(int showID,
Expression<Func<Genre, bool>> where = null,
Sort<Genre> sort = default,
Pagination limit = default);
Task<ICollection<Genre>> GetGenresFromShow(int showID,
[Optional] Expression<Func<Genre, bool>> where,
Expression<Func<Genre, object>> sort,
Pagination limit = default
) => GetGenresFromShow(showID, where, new Sort<Genre>(sort), limit);
Task<ICollection<Genre>> GetGenresFromShow(string showSlug,
Expression<Func<Genre, bool>> where = null,
Sort<Genre> sort = default,
Pagination limit = default);
Task<ICollection<Genre>> GetGenresFromShow(string showSlug,
[Optional] Expression<Func<Genre, bool>> where,
Expression<Func<Genre, object>> sort,
Pagination limit = default
) => GetGenresFromShow(showSlug, where, new Sort<Genre>(sort), limit);
// Helpers
+23 -1
View File
@@ -195,7 +195,29 @@ namespace Kyoo.Controllers
}
public interface ILibraryRepository : IRepository<Library> {}
public interface ICollectionRepository : IRepository<Collection> {}
public interface IGenreRepository : IRepository<Genre> {}
public interface IGenreRepository : IRepository<Genre>
{
Task<ICollection<Genre>> GetFromShow(int showID,
Expression<Func<Genre, bool>> where = null,
Sort<Genre> sort = default,
Pagination limit = default);
Task<ICollection<Genre>> GetFromShow(int showID,
[Optional] Expression<Func<Genre, bool>> where,
Expression<Func<Genre, object>> sort,
Pagination limit = default
) => GetFromShow(showID, where, new Sort<Genre>(sort), limit);
Task<ICollection<Genre>> GetFromShow(string showSlug,
Expression<Func<Genre, bool>> where = null,
Sort<Genre> sort = default,
Pagination limit = default);
Task<ICollection<Genre>> GetFromShow(string showSlug,
[Optional] Expression<Func<Genre, bool>> where,
Expression<Func<Genre, object>> sort,
Pagination limit = default
) => GetFromShow(showSlug, where, new Sort<Genre>(sort), limit);
}
public interface IStudioRepository : IRepository<Studio> {}
public interface IPeopleRepository : IRepository<People>
@@ -271,6 +271,22 @@ namespace Kyoo.Controllers
return PeopleRepository.GetFromShow(showSlug, where, sort, limit);
}
public Task<ICollection<Genre>> GetGenresFromShow(int showID,
Expression<Func<Genre, bool>> where = null,
Sort<Genre> sort = default,
Pagination limit = default)
{
return GenreRepository.GetFromShow(showID, where, sort, limit);
}
public Task<ICollection<Genre>> GetGenresFromShow(string showSlug,
Expression<Func<Genre, bool>> where = null,
Sort<Genre> sort = default,
Pagination limit = default)
{
return GenreRepository.GetFromShow(showSlug, where, sort, limit);
}
public Task AddShowLink(int showID, int? libraryID, int? collectionID)
{
return ShowRepository.AddShowLink(showID, libraryID, collectionID);