mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Sorting items in query responses
This commit is contained in:
parent
1eba074e1d
commit
55448b4caf
@ -31,7 +31,7 @@ namespace Kyoo.Models
|
||||
|
||||
public virtual IEnumerable<Genre> Genres
|
||||
{
|
||||
get { return GenreLinks?.Select(x => x.Genre); }
|
||||
get { return GenreLinks?.Select(x => x.Genre).OrderBy(x => x.Name); }
|
||||
set { GenreLinks = value?.Select(x => new GenreLink(this, x)).ToList(); }
|
||||
}
|
||||
[JsonIgnore] public virtual List<GenreLink> GenreLinks { get; set; }
|
||||
|
@ -86,7 +86,8 @@ namespace Kyoo.Controllers
|
||||
|
||||
public IEnumerable<Season> GetSeasons(long showID)
|
||||
{
|
||||
return from season in _database.Seasons where season.ShowID == showID select season;
|
||||
return (from season in _database.Seasons where season.ShowID == showID select season)
|
||||
.OrderBy(x => x.SeasonNumber);
|
||||
}
|
||||
|
||||
public Season GetSeason(string showSlug, long seasonNumber)
|
||||
@ -112,8 +113,9 @@ namespace Kyoo.Controllers
|
||||
|
||||
public IEnumerable<Episode> GetEpisodes(string showSlug, long seasonNumber)
|
||||
{
|
||||
return from episode in _database.Episodes where episode.SeasonNumber == seasonNumber
|
||||
&& episode.Show.Slug == showSlug select episode.SetLink(showSlug);
|
||||
return (from episode in _database.Episodes where episode.SeasonNumber == seasonNumber
|
||||
&& episode.Show.Slug == showSlug select episode.SetLink(showSlug))
|
||||
.OrderBy(x => x.EpisodeNumber);
|
||||
}
|
||||
|
||||
public IEnumerable<Episode> GetEpisodes(long showID, long seasonNumber)
|
||||
@ -169,7 +171,7 @@ namespace Kyoo.Controllers
|
||||
|
||||
public IEnumerable<Genre> GetGenreForShow(long showID)
|
||||
{
|
||||
return (from show in _database.Shows where show.ID == showID select show.Genres).FirstOrDefault();
|
||||
return ((from show in _database.Shows where show.ID == showID select show.Genres).FirstOrDefault());
|
||||
}
|
||||
|
||||
public Genre GetGenreBySlug(string slug)
|
||||
|
Loading…
x
Reference in New Issue
Block a user