support multiple user data keys

This commit is contained in:
Luke Pulverenti
2016-04-30 19:05:21 -04:00
parent 1f9d32afc5
commit 6330b13262
26 changed files with 219 additions and 268 deletions

View File

@@ -1158,7 +1158,7 @@ namespace MediaBrowser.Controller.Entities
{
if (string.IsNullOrWhiteSpace(_userDataKey))
{
var key = CreateUserDataKey();
var key = GetUserDataKeys().First();
_userDataKey = key;
return key;
}
@@ -1166,16 +1166,20 @@ namespace MediaBrowser.Controller.Entities
return _userDataKey;
}
protected virtual string CreateUserDataKey()
public virtual List<string> GetUserDataKeys()
{
var list = new List<string>();
if (SourceType == SourceType.Channel)
{
if (!string.IsNullOrWhiteSpace(ExternalId))
{
return ExternalId;
list.Add(ExternalId);
}
}
return Id.ToString();
list.Add(Id.ToString());
return list;
}
internal virtual bool IsValidFromResolver(BaseItem newItem)