add more data to media report
This commit is contained in:
parent
aacbd70c97
commit
2db452f68f
|
@ -332,7 +332,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
var userId = user == null ? (Guid?)null : user.Id;
|
||||
|
||||
var item = string.IsNullOrEmpty(request.ParentId) ?
|
||||
user == null ? (BaseItem)_libraryManager.RootFolder : user.RootFolder :
|
||||
user == null ? _libraryManager.RootFolder : user.RootFolder :
|
||||
_dtoService.GetItemByDtoId(request.ParentId, userId);
|
||||
|
||||
// Default list type = children
|
||||
|
|
|
@ -229,7 +229,19 @@ namespace MediaBrowser.Controller.Entities
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsUnidentified { get; set; }
|
||||
[IgnoreDataMember]
|
||||
public bool IsUnidentified
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ProviderIds.Any())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the locked fields.
|
||||
|
|
|
@ -49,11 +49,5 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// </summary>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||
bool BeforeMetadataRefresh();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is unidentified.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is unidentified; otherwise, <c>false</c>.</value>
|
||||
bool IsUnidentified { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -312,7 +312,6 @@ namespace MediaBrowser.Providers.Manager
|
|||
|
||||
// Only one local provider allowed per item
|
||||
hasLocalMetadata = true;
|
||||
item.IsUnidentified = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -387,9 +386,6 @@ namespace MediaBrowser.Providers.Manager
|
|||
{
|
||||
TIdType id = null;
|
||||
|
||||
var unidentifiedCount = 0;
|
||||
var identifiedCount = 0;
|
||||
|
||||
foreach (var provider in providers)
|
||||
{
|
||||
var providerName = provider.GetType().Name;
|
||||
|
@ -414,11 +410,9 @@ namespace MediaBrowser.Providers.Manager
|
|||
|
||||
refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataDownload;
|
||||
|
||||
identifiedCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
unidentifiedCount++;
|
||||
Logger.Debug("{0} returned no metadata for {1}", providerName, item.Path ?? item.Name);
|
||||
}
|
||||
}
|
||||
|
@ -428,20 +422,11 @@ namespace MediaBrowser.Providers.Manager
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
unidentifiedCount++;
|
||||
refreshResult.Status = ProviderRefreshStatus.CompletedWithErrors;
|
||||
refreshResult.ErrorMessage = ex.Message;
|
||||
Logger.ErrorException("Error in {0}", ex, provider.Name);
|
||||
}
|
||||
}
|
||||
|
||||
var isUnidentified = unidentifiedCount > 0 && identifiedCount == 0;
|
||||
|
||||
if (item.IsUnidentified != isUnidentified)
|
||||
{
|
||||
item.IsUnidentified = isUnidentified;
|
||||
refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataImport;
|
||||
}
|
||||
}
|
||||
|
||||
private void MergeNewData(TItemType source, TIdType lookupInfo)
|
||||
|
|
|
@ -84,7 +84,8 @@ namespace MediaBrowser.ServerApplication
|
|||
{
|
||||
treeView1.Nodes.Clear();
|
||||
|
||||
IEnumerable<BaseItem> children = _currentUser.Name == "Physical" ? new[] { _libraryManager.RootFolder } : _libraryManager.RootFolder.GetChildren(_currentUser, true);
|
||||
var isPhysical = _currentUser.Name == "Physical";
|
||||
IEnumerable<BaseItem> children = isPhysical ? new[] { _libraryManager.RootFolder } : _libraryManager.RootFolder.GetChildren(_currentUser, true);
|
||||
children = OrderByName(children, _currentUser);
|
||||
|
||||
foreach (Folder folder in children)
|
||||
|
@ -94,9 +95,9 @@ namespace MediaBrowser.ServerApplication
|
|||
|
||||
var node = new TreeNode { Tag = currentFolder };
|
||||
|
||||
var subChildren = currentFolder.GetChildren(_currentUser, true);
|
||||
var subChildren = isPhysical ? currentFolder.Children : currentFolder.GetChildren(_currentUser, true);
|
||||
subChildren = OrderByName(subChildren, _currentUser);
|
||||
AddChildren(node, subChildren, _currentUser);
|
||||
AddChildren(node, subChildren, _currentUser, isPhysical);
|
||||
node.Text = currentFolder.Name + " (" +
|
||||
node.Nodes.Count + ")";
|
||||
|
||||
|
@ -110,7 +111,7 @@ namespace MediaBrowser.ServerApplication
|
|||
/// <param name="parent">The parent.</param>
|
||||
/// <param name="children">The children.</param>
|
||||
/// <param name="user">The user.</param>
|
||||
private void AddChildren(TreeNode parent, IEnumerable<BaseItem> children, User user)
|
||||
private void AddChildren(TreeNode parent, IEnumerable<BaseItem> children, User user, bool isPhysical)
|
||||
{
|
||||
foreach (var item in children)
|
||||
{
|
||||
|
@ -120,7 +121,9 @@ namespace MediaBrowser.ServerApplication
|
|||
{
|
||||
var prefs = _displayPreferencesManager.GetDisplayPreferences(subFolder.DisplayPreferencesId, user.Id, "LibraryExplorer");
|
||||
|
||||
AddChildren(node, OrderBy(subFolder.GetChildren(user, true), user, prefs.SortBy), user);
|
||||
var subChildren = isPhysical ? subFolder.Children : subFolder.GetChildren(_currentUser, true);
|
||||
|
||||
AddChildren(node, OrderBy(subChildren, user, prefs.SortBy), user, isPhysical);
|
||||
node.Text = item.Name + " (" + node.Nodes.Count + ")";
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user