pull person sort order from tvdb/tmdb data

This commit is contained in:
Luke Pulverenti
2013-11-19 22:15:48 -05:00
parent de339b8265
commit bce86c5022
14 changed files with 109 additions and 24 deletions

View File

@@ -483,6 +483,22 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember]
public Folder Parent { get; set; }
[IgnoreDataMember]
public IEnumerable<Folder> Parents
{
get
{
var parent = Parent;
while (parent != null)
{
yield return parent;
parent = parent.Parent;
}
}
}
/// <summary>
/// When the item first debuted. For movies this could be premiere date, episodes would be first aired
/// </summary>
@@ -630,11 +646,6 @@ namespace MediaBrowser.Controller.Entities
/// <value>The original run time ticks.</value>
public long? OriginalRunTimeTicks { get; set; }
/// <summary>
/// Gets or sets the aspect ratio.
/// </summary>
/// <value>The aspect ratio.</value>
public string AspectRatio { get; set; }
/// <summary>
/// Gets or sets the production year.
/// </summary>
/// <value>The production year.</value>

View File

@@ -0,0 +1,14 @@
namespace MediaBrowser.Controller.Entities
{
/// <summary>
/// Interface IHasAspectRatio
/// </summary>
public interface IHasAspectRatio
{
/// <summary>
/// Gets or sets the aspect ratio.
/// </summary>
/// <value>The aspect ratio.</value>
string AspectRatio { get; set; }
}
}

View File

@@ -49,6 +49,12 @@ namespace MediaBrowser.Controller.Entities
/// <value>The type.</value>
public string Type { get; set; }
/// <summary>
/// Gets or sets the sort order - ascending
/// </summary>
/// <value>The sort order.</value>
public int? SortOrder { get; set; }
/// <summary>
/// Returns a <see cref="System.String" /> that represents this instance.
/// </summary>

View File

@@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class Video
/// </summary>
public class Video : BaseItem, IHasMediaStreams
public class Video : BaseItem, IHasMediaStreams, IHasAspectRatio
{
public bool IsMultiPart { get; set; }
@@ -65,6 +65,12 @@ namespace MediaBrowser.Controller.Entities
return GetPlayableStreamFiles(Path);
}
/// <summary>
/// Gets or sets the aspect ratio.
/// </summary>
/// <value>The aspect ratio.</value>
public string AspectRatio { get; set; }
/// <summary>
/// Should be overridden to return the proper folder where metadata lives
/// </summary>

View File

@@ -1,4 +1,5 @@
using MediaBrowser.Model.LiveTv;
using System.IO;
using MediaBrowser.Model.LiveTv;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@@ -23,6 +24,14 @@ namespace MediaBrowser.Controller.LiveTv
/// <returns>Task{IEnumerable{ChannelInfo}}.</returns>
Task<IEnumerable<ChannelInfo>> GetChannelsAsync(CancellationToken cancellationToken);
/// <summary>
/// Gets the channel image asynchronous.
/// </summary>
/// <param name="channelId">The channel identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
Task<Stream> GetChannelImageAsync(string channelId, CancellationToken cancellationToken);
/// <summary>
/// Gets the recordings asynchronous.
/// </summary>

View File

@@ -89,6 +89,7 @@
<Compile Include="Entities\GameGenre.cs" />
<Compile Include="Entities\GameSystem.cs" />
<Compile Include="Entities\IByReferenceItem.cs" />
<Compile Include="Entities\IHasAspectRatio.cs" />
<Compile Include="Entities\IHasCriticRating.cs" />
<Compile Include="Entities\IHasSoundtracks.cs" />
<Compile Include="Entities\IItemByName.cs" />

View File

@@ -375,9 +375,10 @@ namespace MediaBrowser.Controller.Providers
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
var hasAspectRatio = item as IHasAspectRatio;
if (!string.IsNullOrWhiteSpace(val) && hasAspectRatio != null)
{
item.AspectRatio = val;
hasAspectRatio.AspectRatio = val;
}
break;
}