Updating the search api

This commit is contained in:
Zoe Roux
2020-08-04 20:18:33 +02:00
parent 6a0fb2dd38
commit 2df3562045
18 changed files with 351 additions and 103 deletions
@@ -292,6 +292,26 @@ namespace Kyoo.Controllers
Expression<Func<Library, object>> sort,
Pagination limit = default
) => GetLibrariesFromCollection(slug, where, new Sort<Library>(sort), limit);
Task<ICollection<ShowRole>> GetRolesFromPeople(int showID,
Expression<Func<ShowRole, bool>> where = null,
Sort<ShowRole> sort = default,
Pagination limit = default);
Task<ICollection<ShowRole>> GetRolesFromPeople(int showID,
[Optional] Expression<Func<ShowRole, bool>> where,
Expression<Func<ShowRole, object>> sort,
Pagination limit = default
) => GetRolesFromPeople(showID, where, new Sort<ShowRole>(sort), limit);
Task<ICollection<ShowRole>> GetRolesFromPeople(string showSlug,
Expression<Func<ShowRole, bool>> where = null,
Sort<ShowRole> sort = default,
Pagination limit = default);
Task<ICollection<ShowRole>> GetRolesFromPeople(string showSlug,
[Optional] Expression<Func<ShowRole, bool>> where,
Expression<Func<ShowRole, object>> sort,
Pagination limit = default
) => GetRolesFromPeople(showSlug, where, new Sort<ShowRole>(sort), limit);
// Helpers
+20
View File
@@ -395,6 +395,26 @@ namespace Kyoo.Controllers
Expression<Func<PeopleLink, object>> sort,
Pagination limit = default
) => GetFromShow(showSlug, where, new Sort<PeopleLink>(sort), limit);
Task<ICollection<ShowRole>> GetFromPeople(int showID,
Expression<Func<ShowRole, bool>> where = null,
Sort<ShowRole> sort = default,
Pagination limit = default);
Task<ICollection<ShowRole>> GetFromPeople(int showID,
[Optional] Expression<Func<ShowRole, bool>> where,
Expression<Func<ShowRole, object>> sort,
Pagination limit = default
) => GetFromPeople(showID, where, new Sort<ShowRole>(sort), limit);
Task<ICollection<ShowRole>> GetFromPeople(string showSlug,
Expression<Func<ShowRole, bool>> where = null,
Sort<ShowRole> sort = default,
Pagination limit = default);
Task<ICollection<ShowRole>> GetFromPeople(string showSlug,
[Optional] Expression<Func<ShowRole, bool>> where,
Expression<Func<ShowRole, object>> sort,
Pagination limit = default
) => GetFromPeople(showSlug, where, new Sort<ShowRole>(sort), limit);
}
public interface IProviderRepository : IRepository<ProviderID> {}
}
@@ -411,6 +411,22 @@ namespace Kyoo.Controllers
{
return LibraryRepository.GetFromCollection(slug, where, sort, limit);
}
public Task<ICollection<ShowRole>> GetRolesFromPeople(int id,
Expression<Func<ShowRole, bool>> where = null,
Sort<ShowRole> sort = default,
Pagination limit = default)
{
return PeopleRepository.GetFromPeople(id, where, sort, limit);
}
public Task<ICollection<ShowRole>> GetRolesFromPeople(string slug,
Expression<Func<ShowRole, bool>> where = null,
Sort<ShowRole> sort = default,
Pagination limit = default)
{
return PeopleRepository.GetFromPeople(slug, where, sort, limit);
}
public Task AddShowLink(int showID, int? libraryID, int? collectionID)
{