diff options
Diffstat (limited to 'MediaBrowser.Controller')
6 files changed, 47 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index c8f618a03..dd6189bc5 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 5aafc8eb3..00a42271b 100644 --- a/MediaBrowser.Controller/Entities/IHasImages.cs +++ b/MediaBrowser.Controller/Entities/IHasImages.cs @@ -184,6 +184,12 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <value><c>true</c> if [always scan internal metadata path]; otherwise, <c>false</c>.</value> bool AlwaysScanInternalMetadataPath { get; } + + /// <summary> + /// Determines whether [is internet metadata enabled]. + /// </summary> + /// <returns><c>true</c> if [is internet metadata enabled]; otherwise, <c>false</c>.</returns> + bool IsInternetMetadataEnabled(); } public static class HasImagesExtensions diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 2f9673db2..0b07d8b6d 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<LiveTvProgramLookupInfo> { /// <summary> /// 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<LiveTvProgramLookupInfo>(); + info.IsMovie = IsMovie; + return info; + } } } diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs index 4d7e5ee63..36f082b02 100644 --- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs @@ -145,6 +145,12 @@ namespace MediaBrowser.Controller.LiveTv /// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value> public bool IsPremiere { get; set; } + /// <summary> + /// Gets or sets the production year. + /// </summary> + /// <value>The production year.</value> + public int? ProductionYear { get; set; } + public ProgramInfo() { Genres = new List<string>(); diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 678d7841c..06f18729b 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -293,6 +293,7 @@ <Compile Include="Providers\IRemoteSearchProvider.cs" /> <Compile Include="Providers\ISeriesOrderProvider.cs" /> <Compile Include="Providers\ItemInfo.cs" /> + <Compile Include="Providers\LiveTvProgramLookupInfo.cs" /> <Compile Include="Providers\LocalImageInfo.cs" /> <Compile Include="Providers\LocalMetadataResult.cs" /> <Compile Include="Providers\MetadataRefreshMode.cs" /> diff --git a/MediaBrowser.Controller/Providers/LiveTvProgramLookupInfo.cs b/MediaBrowser.Controller/Providers/LiveTvProgramLookupInfo.cs new file mode 100644 index 000000000..4e2c11c22 --- /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; } + } +} |
