mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-26 02:27:06 +01:00
add channels infrastructure
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Controller.Channels
|
||||
{
|
||||
@@ -13,5 +17,41 @@ namespace MediaBrowser.Controller.Channels
|
||||
public ChannelMediaContentType ContentType { get; set; }
|
||||
|
||||
public string OriginalImageUrl { get; set; }
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user