Added episodes page
This commit is contained in:
parent
dc5fb2f4c2
commit
b07a1e67c2
|
@ -164,6 +164,9 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
[ApiMember(Name = "MinIndexNumber", Description = "Optional filter by minimum index number.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
[ApiMember(Name = "MinIndexNumber", Description = "Optional filter by minimum index number.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||||
public int? MinIndexNumber { get; set; }
|
public int? MinIndexNumber { get; set; }
|
||||||
|
|
||||||
|
[ApiMember(Name = "ParentIndexNumber", Description = "Optional filter by parent index number.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||||
|
public int? ParentIndexNumber { get; set; }
|
||||||
|
|
||||||
[ApiMember(Name = "HasParentalRating", Description = "Optional filter by items that have or do not have a parental rating", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
|
[ApiMember(Name = "HasParentalRating", Description = "Optional filter by items that have or do not have a parental rating", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
|
||||||
public bool? HasParentalRating { get; set; }
|
public bool? HasParentalRating { get; set; }
|
||||||
|
|
||||||
|
@ -733,6 +736,30 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
items = items.OfType<Video>().Where(i => i.IsHd == request.IsHD.Value);
|
items = items.OfType<Video>().Where(i => i.IsHd == request.IsHD.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (request.ParentIndexNumber.HasValue)
|
||||||
|
{
|
||||||
|
var filterValue = request.ParentIndexNumber.Value;
|
||||||
|
|
||||||
|
items = items.Where(i =>
|
||||||
|
{
|
||||||
|
var episode = i as Episode;
|
||||||
|
|
||||||
|
if (episode != null)
|
||||||
|
{
|
||||||
|
return episode.ParentIndexNumber.HasValue && episode.ParentIndexNumber.Value == filterValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var song = i as Audio;
|
||||||
|
|
||||||
|
if (song != null)
|
||||||
|
{
|
||||||
|
return song.ParentIndexNumber.HasValue && song.ParentIndexNumber.Value == filterValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,14 +176,32 @@ namespace MediaBrowser.Model.Querying
|
||||||
/// <value>The max official rating.</value>
|
/// <value>The max official rating.</value>
|
||||||
public string MaxOfficialRating { get; set; }
|
public string MaxOfficialRating { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the min index number.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The min index number.</value>
|
||||||
public int? MinIndexNumber { get; set; }
|
public int? MinIndexNumber { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether this instance has parental rating.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>null</c> if [has parental rating] contains no value, <c>true</c> if [has parental rating]; otherwise, <c>false</c>.</value>
|
||||||
public bool? HasParentalRating { get; set; }
|
public bool? HasParentalRating { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether this instance is HD.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>null</c> if [is HD] contains no value, <c>true</c> if [is HD]; otherwise, <c>false</c>.</value>
|
||||||
public bool? IsHD { get; set; }
|
public bool? IsHD { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ItemQuery"/> class.
|
/// Gets or sets the parent index number.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The parent index number.</value>
|
||||||
|
public int? ParentIndexNumber { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ItemQuery" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ItemQuery()
|
public ItemQuery()
|
||||||
{
|
{
|
||||||
|
|
|
@ -81,5 +81,6 @@ namespace MediaBrowser.Model.Querying
|
||||||
public const string SongCount = "SongCount";
|
public const string SongCount = "SongCount";
|
||||||
public const string AlbumCount = "AlbumCount";
|
public const string AlbumCount = "AlbumCount";
|
||||||
public const string MusicVideoCount = "MusicVideoCount";
|
public const string MusicVideoCount = "MusicVideoCount";
|
||||||
|
public const string SeriesSortName = "SeriesSortName";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,6 +202,7 @@
|
||||||
<Compile Include="Sorting\RevenueComparer.cs" />
|
<Compile Include="Sorting\RevenueComparer.cs" />
|
||||||
<Compile Include="Sorting\RuntimeComparer.cs" />
|
<Compile Include="Sorting\RuntimeComparer.cs" />
|
||||||
<Compile Include="Sorting\SeriesCountComparer.cs" />
|
<Compile Include="Sorting\SeriesCountComparer.cs" />
|
||||||
|
<Compile Include="Sorting\SeriesSortNameComparer.cs" />
|
||||||
<Compile Include="Sorting\SongCountComparer.cs" />
|
<Compile Include="Sorting\SongCountComparer.cs" />
|
||||||
<Compile Include="Sorting\SortNameComparer.cs" />
|
<Compile Include="Sorting\SortNameComparer.cs" />
|
||||||
<Compile Include="Persistence\SqliteDisplayPreferencesRepository.cs" />
|
<Compile Include="Persistence\SqliteDisplayPreferencesRepository.cs" />
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
using MediaBrowser.Controller.Entities;
|
||||||
|
using MediaBrowser.Controller.Entities.TV;
|
||||||
|
using MediaBrowser.Controller.Sorting;
|
||||||
|
using MediaBrowser.Model.Querying;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace MediaBrowser.Server.Implementations.Sorting
|
||||||
|
{
|
||||||
|
class SeriesSortNameComparer : IBaseItemComparer
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Compares the specified x.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="x">The x.</param>
|
||||||
|
/// <param name="y">The y.</param>
|
||||||
|
/// <returns>System.Int32.</returns>
|
||||||
|
public int Compare(BaseItem x, BaseItem y)
|
||||||
|
{
|
||||||
|
return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetValue(BaseItem item)
|
||||||
|
{
|
||||||
|
Series series = null;
|
||||||
|
|
||||||
|
var season = item as Season;
|
||||||
|
|
||||||
|
if (season != null)
|
||||||
|
{
|
||||||
|
series = season.Series;
|
||||||
|
}
|
||||||
|
|
||||||
|
var episode = item as Episode;
|
||||||
|
|
||||||
|
if (episode != null)
|
||||||
|
{
|
||||||
|
series = episode.Series;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (series == null)
|
||||||
|
{
|
||||||
|
series = item as Series;
|
||||||
|
}
|
||||||
|
|
||||||
|
return series != null ? series.SortName : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The name.</value>
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get { return ItemSortBy.SeriesSortName; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -457,7 +457,6 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
"edititempeople.js",
|
"edititempeople.js",
|
||||||
"edititemimages.js",
|
"edititemimages.js",
|
||||||
"edituserpage.js",
|
"edituserpage.js",
|
||||||
"favoritetv.js",
|
|
||||||
"gamesrecommendedpage.js",
|
"gamesrecommendedpage.js",
|
||||||
"gamesystemspage.js",
|
"gamesystemspage.js",
|
||||||
"gamespage.js",
|
"gamespage.js",
|
||||||
|
@ -498,6 +497,7 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
"songs.js",
|
"songs.js",
|
||||||
"supporterkeypage.js",
|
"supporterkeypage.js",
|
||||||
"supporterpage.js",
|
"supporterpage.js",
|
||||||
|
"episodes.js",
|
||||||
"tvgenres.js",
|
"tvgenres.js",
|
||||||
"tvnextup.js",
|
"tvnextup.js",
|
||||||
"tvpeople.js",
|
"tvpeople.js",
|
||||||
|
|
|
@ -300,7 +300,7 @@
|
||||||
<Content Include="dashboard-ui\edititemmetadata.html">
|
<Content Include="dashboard-ui\edititemmetadata.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="dashboard-ui\favoritetv.html">
|
<Content Include="dashboard-ui\episodes.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="dashboard-ui\gamegenres.html">
|
<Content Include="dashboard-ui\gamegenres.html">
|
||||||
|
@ -318,6 +318,9 @@
|
||||||
<Content Include="dashboard-ui\gamesystems.html">
|
<Content Include="dashboard-ui\gamesystems.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\scripts\episodes.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\scripts\wizardsettings.js">
|
<Content Include="dashboard-ui\scripts\wizardsettings.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
@ -396,9 +399,6 @@
|
||||||
<Content Include="dashboard-ui\scripts\edititemmetadata.js">
|
<Content Include="dashboard-ui\scripts\edititemmetadata.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="dashboard-ui\scripts\favoritetv.js">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="dashboard-ui\scripts\itemgallery.js">
|
<Content Include="dashboard-ui\scripts\itemgallery.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user