diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-04-30 19:05:21 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-04-30 19:05:21 -0400 |
| commit | 6330b13262bf24793f059a269fdba7ea2514efe0 (patch) | |
| tree | dddbf1133289936bfaa689ed1a1ab46ec4122902 /MediaBrowser.Controller/LiveTv | |
| parent | 1f9d32afc52e9bd133ddf22d12bdc468adaf9ebe (diff) | |
support multiple user data keys
Diffstat (limited to 'MediaBrowser.Controller/LiveTv')
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvChannel.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 28 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs | 26 |
4 files changed, 21 insertions, 55 deletions
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs index 17a27eac1..e6f472414 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs @@ -46,17 +46,6 @@ namespace MediaBrowser.Controller.LiveTv } /// <summary> - /// Gets the user data key. - /// </summary> - /// <returns>System.String.</returns> - protected override string CreateUserDataKey() - { - var name = GetClientTypeName(); - - return name + "-" + Name + (EpisodeTitle ?? string.Empty); - } - - /// <summary> /// Gets a value indicating whether this instance is owned item. /// </summary> /// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value> diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index 2bb6cc182..50aeed27d 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -11,13 +11,12 @@ namespace MediaBrowser.Controller.LiveTv { public class LiveTvChannel : BaseItem, IHasMediaSources { - /// <summary> - /// Gets the user data key. - /// </summary> - /// <returns>System.String.</returns> - protected override string CreateUserDataKey() + public override List<string> GetUserDataKeys() { - return GetClientTypeName() + "-" + Name; + var list = base.GetUserDataKeys(); + + list.Insert(0, GetClientTypeName() + "-" + Name); + return list; } public override UnratedItem GetBlockUnratedType() diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 59b921c6a..cc30709db 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -4,36 +4,40 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.LiveTv; using System; +using System.Collections.Generic; using System.Runtime.Serialization; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.LiveTv { public class LiveTvProgram : BaseItem, IHasLookupInfo<LiveTvProgramLookupInfo>, IHasStartDate, IHasProgramAttributes { - /// <summary> - /// Gets the user data key. - /// </summary> - /// <returns>System.String.</returns> - protected override string CreateUserDataKey() + public override List<string> GetUserDataKeys() { - if (IsMovie) + var list = base.GetUserDataKeys(); + + if (!IsSeries) { - var key = Movie.GetMovieUserDataKey(this); + var key = this.GetProviderId(MetadataProviders.Imdb); + if (!string.IsNullOrWhiteSpace(key)) + { + list.Insert(0, key); + } + key = this.GetProviderId(MetadataProviders.Tmdb); if (!string.IsNullOrWhiteSpace(key)) { - return key; + list.Insert(0, key); } } - - if (IsSeries && !string.IsNullOrWhiteSpace(EpisodeTitle)) + else if (!string.IsNullOrWhiteSpace(EpisodeTitle)) { var name = GetClientTypeName(); - return name + "-" + Name + (EpisodeTitle ?? string.Empty); + list.Insert(0, name + "-" + Name + (EpisodeTitle ?? string.Empty)); } - return base.CreateUserDataKey(); + return list; } [IgnoreDataMember] diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs index f310a957c..a8c737673 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -45,32 +45,6 @@ namespace MediaBrowser.Controller.LiveTv set { } } - /// <summary> - /// Gets the user data key. - /// </summary> - /// <returns>System.String.</returns> - protected override string CreateUserDataKey() - { - if (IsMovie) - { - var key = Movie.GetMovieUserDataKey(this); - - if (!string.IsNullOrWhiteSpace(key)) - { - return key; - } - } - - if (IsSeries && !string.IsNullOrWhiteSpace(EpisodeTitle)) - { - var name = GetClientTypeName(); - - return name + "-" + Name + (EpisodeTitle ?? string.Empty); - } - - return base.CreateUserDataKey(); - } - [IgnoreDataMember] public override string MediaType { |
