mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 13:58:29 +01:00
support multiple user data keys
This commit is contained in:
@@ -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 key = Movie.GetMovieUserDataKey(this);
|
||||
var list = base.GetUserDataKeys();
|
||||
|
||||
if (!IsSeries)
|
||||
{
|
||||
var key = this.GetProviderId(MetadataProviders.Imdb);
|
||||
if (!string.IsNullOrWhiteSpace(key))
|
||||
{
|
||||
return key;
|
||||
list.Insert(0, key);
|
||||
}
|
||||
|
||||
key = this.GetProviderId(MetadataProviders.Tmdb);
|
||||
if (!string.IsNullOrWhiteSpace(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]
|
||||
|
||||
Reference in New Issue
Block a user