From b1d2841583079cdfbb9c3c3c63a1f0a15d5259d3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 14 Mar 2015 16:00:32 -0400 Subject: add movie metadata support to live tv --- MediaBrowser.Controller/Entities/BaseItem.cs | 5 +++++ MediaBrowser.Controller/Entities/IHasImages.cs | 6 ++++++ MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 21 ++++++++++++++++++++- MediaBrowser.Controller/LiveTv/ProgramInfo.cs | 6 ++++++ .../MediaBrowser.Controller.csproj | 1 + .../Providers/LiveTvProgramLookupInfo.cs | 9 +++++++++ 6 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 MediaBrowser.Controller/Providers/LiveTvProgramLookupInfo.cs (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index c8f618a039..dd6189bc57 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -239,6 +239,11 @@ namespace MediaBrowser.Controller.Entities get { return this.GetImagePath(ImageType.Primary); } } + public virtual bool IsInternetMetadataEnabled() + { + return ConfigurationManager.Configuration.EnableInternetProviders; + } + public virtual bool CanDelete() { var locationType = LocationType; diff --git a/MediaBrowser.Controller/Entities/IHasImages.cs b/MediaBrowser.Controller/Entities/IHasImages.cs index 5aafc8eb31..00a42271b5 100644 --- a/MediaBrowser.Controller/Entities/IHasImages.cs +++ b/MediaBrowser.Controller/Entities/IHasImages.cs @@ -184,6 +184,12 @@ namespace MediaBrowser.Controller.Entities /// /// true if [always scan internal metadata path]; otherwise, false. bool AlwaysScanInternalMetadataPath { get; } + + /// + /// Determines whether [is internet metadata enabled]. + /// + /// true if [is internet metadata enabled]; otherwise, false. + bool IsInternetMetadataEnabled(); } public static class HasImagesExtensions diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 2f9673db20..0b07d8b6d1 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -1,5 +1,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Users; @@ -11,7 +12,7 @@ using System.Threading.Tasks; namespace MediaBrowser.Controller.LiveTv { - public class LiveTvProgram : BaseItem, ILiveTvItem + public class LiveTvProgram : BaseItem, ILiveTvItem, IHasLookupInfo { /// /// Gets the user data key. @@ -220,5 +221,23 @@ namespace MediaBrowser.Controller.LiveTv { return false; } + + public override bool IsInternetMetadataEnabled() + { + if (IsMovie) + { + var options = (LiveTvOptions)ConfigurationManager.GetConfiguration("livetv"); + return options.EnableMovieProviders; + } + + return false; + } + + public LiveTvProgramLookupInfo GetLookupInfo() + { + var info = GetItemLookupInfo(); + info.IsMovie = IsMovie; + return info; + } } } diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs index 4d7e5ee63e..36f082b02c 100644 --- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs @@ -145,6 +145,12 @@ namespace MediaBrowser.Controller.LiveTv /// true if this instance is premiere; otherwise, false. public bool IsPremiere { get; set; } + /// + /// Gets or sets the production year. + /// + /// The production year. + public int? ProductionYear { get; set; } + public ProgramInfo() { Genres = new List(); diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 678d7841c6..06f18729b8 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -293,6 +293,7 @@ + diff --git a/MediaBrowser.Controller/Providers/LiveTvProgramLookupInfo.cs b/MediaBrowser.Controller/Providers/LiveTvProgramLookupInfo.cs new file mode 100644 index 0000000000..4e2c11c22d --- /dev/null +++ b/MediaBrowser.Controller/Providers/LiveTvProgramLookupInfo.cs @@ -0,0 +1,9 @@ +using System; + +namespace MediaBrowser.Controller.Providers +{ + public class LiveTvProgramLookupInfo : ItemLookupInfo + { + public Boolean IsMovie { get; set; } + } +} -- cgit v1.2.3