fix ambiguous method call

This commit is contained in:
Luke Pulverenti 2013-10-04 15:48:31 -04:00
parent fe2eb6cb01
commit c9345179db
3 changed files with 20 additions and 17 deletions

View File

@ -1032,7 +1032,7 @@ namespace MediaBrowser.Controller.Entities
/// <exception cref="System.ArgumentNullException"></exception> /// <exception cref="System.ArgumentNullException"></exception>
public IEnumerable<BaseItem> GetRecursiveChildren(User user, bool includeLinkedChildren = true) public IEnumerable<BaseItem> GetRecursiveChildren(User user, bool includeLinkedChildren = true)
{ {
return GetRecursiveChildren(user, null, true); return GetRecursiveChildren(user, null, includeLinkedChildren);
} }
/// <summary> /// <summary>
@ -1047,7 +1047,7 @@ namespace MediaBrowser.Controller.Entities
{ {
if (user == null) if (user == null)
{ {
throw new ArgumentNullException(); throw new ArgumentNullException("user");
} }
var initialCount = _lastRecursiveCount == 0 ? _children.Count : _lastRecursiveCount; var initialCount = _lastRecursiveCount == 0 ? _children.Count : _lastRecursiveCount;
@ -1057,12 +1057,7 @@ namespace MediaBrowser.Controller.Entities
_lastRecursiveCount = list.Count; _lastRecursiveCount = list.Count;
if (includeLinkedChildren && hasLinkedChildren) return hasLinkedChildren ? list.DistinctBy(i => i.Id).ToList() : list;
{
list = list.DistinctBy(i => i.Id).ToList();
}
return list;
} }
/// <summary> /// <summary>
@ -1071,7 +1066,7 @@ namespace MediaBrowser.Controller.Entities
/// <returns>IList{BaseItem}.</returns> /// <returns>IList{BaseItem}.</returns>
public IList<BaseItem> GetRecursiveChildren() public IList<BaseItem> GetRecursiveChildren()
{ {
return GetRecursiveChildren(null); return GetRecursiveChildren(null, null, true);
} }
/// <summary> /// <summary>

View File

@ -230,7 +230,9 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
var collections = user.RootFolder.GetChildren(user, true).ToList(); var collections = user.RootFolder.GetChildren(user, true).ToList();
var allRecursiveChildren = user.RootFolder.GetRecursiveChildren(user).ToDictionary(i => i.Id); var allRecursiveChildren = user.RootFolder.GetRecursiveChildren(user)
.Select(i => i.Id)
.ToDictionary(i => i);
return new LibraryUpdateInfo return new LibraryUpdateInfo
{ {
@ -256,7 +258,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
/// <param name="allRecursiveChildren">All recursive children.</param> /// <param name="allRecursiveChildren">All recursive children.</param>
/// <param name="includeIfNotFound">if set to <c>true</c> [include if not found].</param> /// <param name="includeIfNotFound">if set to <c>true</c> [include if not found].</param>
/// <returns>IEnumerable{``0}.</returns> /// <returns>IEnumerable{``0}.</returns>
private IEnumerable<T> TranslatePhysicalItemToUserLibrary<T>(T item, User user, IEnumerable<BaseItem> collections, Dictionary<Guid, BaseItem> allRecursiveChildren, bool includeIfNotFound = false) private IEnumerable<T> TranslatePhysicalItemToUserLibrary<T>(T item, User user, IEnumerable<BaseItem> collections, Dictionary<Guid, Guid> allRecursiveChildren, bool includeIfNotFound = false)
where T : BaseItem where T : BaseItem
{ {
// If the physical root changed, return the user root // If the physical root changed, return the user root

View File

@ -95,17 +95,23 @@ namespace MediaBrowser.Server.Implementations.Session
var version = vals[2]; var version = vals[2];
var deviceName = vals.Length > 3 ? vals[3] : string.Empty; var deviceName = vals.Length > 3 ? vals[3] : string.Empty;
if (!string.IsNullOrEmpty(deviceName))
{
_logger.Debug("Logging session activity");
await _sessionManager.LogSessionActivity(client, version, deviceId, deviceName, null).ConfigureAwait(false);
}
var session = _sessionManager.Sessions var session = _sessionManager.Sessions
.FirstOrDefault(i => string.Equals(i.DeviceId, deviceId) && .FirstOrDefault(i => string.Equals(i.DeviceId, deviceId) &&
string.Equals(i.Client, client) && string.Equals(i.Client, client) &&
string.Equals(i.ApplicationVersion, version)); string.Equals(i.ApplicationVersion, version));
if (session == null && !string.IsNullOrEmpty(deviceName))
{
_logger.Debug("Logging session activity");
await _sessionManager.LogSessionActivity(client, version, deviceId, deviceName, null).ConfigureAwait(false);
session = _sessionManager.Sessions
.FirstOrDefault(i => string.Equals(i.DeviceId, deviceId) &&
string.Equals(i.Client, client) &&
string.Equals(i.ApplicationVersion, version));
}
if (session != null) if (session != null)
{ {
var controller = new WebSocketController(session, _appHost); var controller = new WebSocketController(session, _appHost);