jellyfin/MediaBrowser.Controller/Channels/ChannelVideoItem.cs

58 lines
1.7 KiB
C#
Raw Normal View History

2014-03-18 01:45:41 +00:00
using MediaBrowser.Controller.Entities;
2014-05-03 04:20:04 +00:00
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using System.Globalization;
using System.Linq;
2014-03-18 01:45:41 +00:00
namespace MediaBrowser.Controller.Channels
{
2014-03-19 01:35:40 +00:00
public class ChannelVideoItem : Video, IChannelMediaItem
2014-03-18 01:45:41 +00:00
{
public string ExternalId { get; set; }
public ChannelItemType ChannelItemType { get; set; }
public bool IsInfiniteStream { get; set; }
public ChannelMediaContentType ContentType { get; set; }
public string OriginalImageUrl { get; set; }
2014-05-03 04:20:04 +00:00
public override string GetUserDataKey()
{
if (ContentType == ChannelMediaContentType.Trailer)
{
var key = this.GetProviderId(MetadataProviders.Tmdb) ?? this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Imdb) ?? this.GetProviderId(MetadataProviders.Tvcom);
if (!string.IsNullOrWhiteSpace(key))
{
key = key + "-trailer";
// Make sure different trailers have their own data.
if (RunTimeTicks.HasValue)
{
key += "-" + RunTimeTicks.Value.ToString(CultureInfo.InvariantCulture);
}
return key;
}
}
return base.GetUserDataKey();
}
protected override bool GetBlockUnratedValue(UserConfiguration config)
{
return config.BlockUnratedItems.Contains(UnratedItem.ChannelContent);
}
public override bool SupportsLocalMetadata
{
get
{
return false;
}
}
2014-03-18 01:45:41 +00:00
}
}