mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-30 10:55:16 -04:00
Adding episodes related info & NotFound exceptions
This commit is contained in:
@@ -55,11 +55,61 @@ namespace Kyoo.Controllers
|
||||
Pagination limit = default
|
||||
) => GetSeasons(showSlug, where, new Sort<Season>(sort), limit);
|
||||
|
||||
Task<ICollection<Episode>> GetEpisodes(int showID, int seasonNumber);
|
||||
Task<ICollection<Episode>> GetEpisodes(string showSlug, int seasonNumber);
|
||||
Task<ICollection<Episode>> GetEpisodes(int seasonID);
|
||||
Task<ICollection<Episode>> GetEpisodes(int showID,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default);
|
||||
Task<ICollection<Episode>> GetEpisodes(int showID,
|
||||
[Optional] Expression<Func<Episode, bool>> where,
|
||||
Expression<Func<Episode, object>> sort,
|
||||
Pagination limit = default
|
||||
) => GetEpisodes(showID, where, new Sort<Episode>(sort), limit);
|
||||
|
||||
Task<ICollection<Episode>> GetEpisodes(string showSlug,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default);
|
||||
Task<ICollection<Episode>> GetEpisodes(string showSlug,
|
||||
[Optional] Expression<Func<Episode, bool>> where,
|
||||
Expression<Func<Episode, object>> sort,
|
||||
Pagination limit = default
|
||||
) => GetEpisodes(showSlug, where, new Sort<Episode>(sort), limit);
|
||||
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(int seasonID,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default);
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(int seasonID,
|
||||
[Optional] Expression<Func<Episode, bool>> where,
|
||||
Expression<Func<Episode, object>> sort,
|
||||
Pagination limit = default
|
||||
) => GetEpisodesFromSeason(seasonID, where, new Sort<Episode>(sort), limit);
|
||||
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(int showID,
|
||||
int seasonNumber,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default);
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(int showID,
|
||||
int seasonNumber,
|
||||
[Optional] Expression<Func<Episode, bool>> where,
|
||||
Expression<Func<Episode, object>> sort,
|
||||
Pagination limit = default
|
||||
) => GetEpisodesFromSeason(showID, seasonNumber, where, new Sort<Episode>(sort), limit);
|
||||
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(string showSlug,
|
||||
int seasonNumber,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default);
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(string showSlug,
|
||||
int seasonNumber,
|
||||
[Optional] Expression<Func<Episode, bool>> where,
|
||||
Expression<Func<Episode, object>> sort,
|
||||
Pagination limit = default
|
||||
) => GetEpisodesFromSeason(showSlug, seasonNumber, where, new Sort<Episode>(sort), limit);
|
||||
|
||||
|
||||
// Helpers
|
||||
Task AddShowLink(int showID, int? libraryID, int? collectionID);
|
||||
Task AddShowLink([NotNull] Show show, Library library, Collection collection);
|
||||
|
||||
@@ -106,6 +106,7 @@ namespace Kyoo.Controllers
|
||||
|
||||
public interface ISeasonRepository : IRepository<Season>
|
||||
{
|
||||
Task<Season> Get(int showID, int seasonNumber);
|
||||
Task<Season> Get(string showSlug, int seasonNumber);
|
||||
Task Delete(string showSlug, int seasonNumber);
|
||||
|
||||
@@ -128,7 +129,6 @@ namespace Kyoo.Controllers
|
||||
Expression<Func<Season, object>> sort,
|
||||
Pagination limit = default
|
||||
) => GetSeasons(showSlug, where, new Sort<Season>(sort), limit);
|
||||
|
||||
}
|
||||
|
||||
public interface IEpisodeRepository : IRepository<Episode>
|
||||
@@ -136,9 +136,57 @@ namespace Kyoo.Controllers
|
||||
Task<Episode> Get(string showSlug, int seasonNumber, int episodeNumber);
|
||||
Task Delete(string showSlug, int seasonNumber, int episodeNumber);
|
||||
|
||||
Task<ICollection<Episode>> GetEpisodes(int showID, int seasonNumber);
|
||||
Task<ICollection<Episode>> GetEpisodes(string showSlug, int seasonNumber);
|
||||
Task<ICollection<Episode>> GetEpisodes(int seasonID);
|
||||
Task<ICollection<Episode>> GetEpisodes(int showID,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default);
|
||||
Task<ICollection<Episode>> GetEpisodes(int showID,
|
||||
[Optional] Expression<Func<Episode, bool>> where,
|
||||
Expression<Func<Episode, object>> sort,
|
||||
Pagination limit = default
|
||||
) => GetEpisodes(showID, where, new Sort<Episode>(sort), limit);
|
||||
|
||||
Task<ICollection<Episode>> GetEpisodes(string showSlug,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default);
|
||||
Task<ICollection<Episode>> GetEpisodes(string showSlug,
|
||||
[Optional] Expression<Func<Episode, bool>> where,
|
||||
Expression<Func<Episode, object>> sort,
|
||||
Pagination limit = default
|
||||
) => GetEpisodes(showSlug, where, new Sort<Episode>(sort), limit);
|
||||
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(int seasonID,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default);
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(int seasonID,
|
||||
[Optional] Expression<Func<Episode, bool>> where,
|
||||
Expression<Func<Episode, object>> sort,
|
||||
Pagination limit = default
|
||||
) => GetEpisodesFromSeason(seasonID, where, new Sort<Episode>(sort), limit);
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(int showID,
|
||||
int seasonNumber,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default);
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(int showID,
|
||||
int seasonNumber,
|
||||
[Optional] Expression<Func<Episode, bool>> where,
|
||||
Expression<Func<Episode, object>> sort,
|
||||
Pagination limit = default
|
||||
) => GetEpisodesFromSeason(showID, seasonNumber, where, new Sort<Episode>(sort), limit);
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(string showSlug,
|
||||
int seasonNumber,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default);
|
||||
Task<ICollection<Episode>> GetEpisodesFromSeason(string showSlug,
|
||||
int seasonNumber,
|
||||
[Optional] Expression<Func<Episode, bool>> where,
|
||||
Expression<Func<Episode, object>> sort,
|
||||
Pagination limit = default
|
||||
) => GetEpisodesFromSeason(showSlug, seasonNumber, where, new Sort<Episode>(sort), limit);
|
||||
}
|
||||
|
||||
public interface ITrackRepository : IRepository<Track>
|
||||
|
||||
@@ -213,21 +213,48 @@ namespace Kyoo.Controllers
|
||||
return SeasonRepository.GetSeasons(showSlug, where, sort, limit);
|
||||
}
|
||||
|
||||
public Task<ICollection<Episode>> GetEpisodes(int showID, int seasonNumber)
|
||||
public Task<ICollection<Episode>> GetEpisodes(int showID,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default)
|
||||
{
|
||||
return EpisodeRepository.GetEpisodes(showID, seasonNumber);
|
||||
}
|
||||
|
||||
public Task<ICollection<Episode>> GetEpisodes(string showSlug, int seasonNumber)
|
||||
{
|
||||
return EpisodeRepository.GetEpisodes(showSlug, seasonNumber);
|
||||
}
|
||||
|
||||
public Task<ICollection<Episode>> GetEpisodes(int seasonID)
|
||||
{
|
||||
return EpisodeRepository.GetEpisodes(seasonID);
|
||||
return EpisodeRepository.GetEpisodes(showID, where, sort, limit);
|
||||
}
|
||||
|
||||
public Task<ICollection<Episode>> GetEpisodes(string showSlug,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default)
|
||||
{
|
||||
return EpisodeRepository.GetEpisodes(showSlug, where, sort, limit);
|
||||
}
|
||||
|
||||
public Task<ICollection<Episode>> GetEpisodesFromSeason(int seasonID,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default)
|
||||
{
|
||||
return EpisodeRepository.GetEpisodesFromSeason(seasonID, where, sort, limit);
|
||||
}
|
||||
|
||||
public Task<ICollection<Episode>> GetEpisodesFromSeason(int showID,
|
||||
int seasonNumber,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default)
|
||||
{
|
||||
return EpisodeRepository.GetEpisodesFromSeason(showID, seasonNumber, where, sort, limit);
|
||||
}
|
||||
|
||||
public Task<ICollection<Episode>> GetEpisodesFromSeason(string showSlug,
|
||||
int seasonNumber,
|
||||
Expression<Func<Episode, bool>> where = null,
|
||||
Sort<Episode> sort = default,
|
||||
Pagination limit = default)
|
||||
{
|
||||
return EpisodeRepository.GetEpisodesFromSeason(showSlug, seasonNumber, where, sort, limit);
|
||||
}
|
||||
|
||||
public Task AddShowLink(int showID, int? libraryID, int? collectionID)
|
||||
{
|
||||
return ShowRepository.AddShowLink(showID, libraryID, collectionID);
|
||||
|
||||
Reference in New Issue
Block a user