diff options
| author | Fredrik Zetterlund <fredrik.zetterlund@7illusions.com> | 2014-08-30 19:49:54 +0200 |
|---|---|---|
| committer | Fredrik Zetterlund <fredrik.zetterlund@7illusions.com> | 2014-08-30 19:49:54 +0200 |
| commit | d0ac58768f9544ee85dd54fc351c7438ec8ec351 (patch) | |
| tree | 9c94614cbb532998835f4645f54ed63f98a6483a /MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs | |
| parent | 66ad1699e22029b605e17735e8d9450285d8748a (diff) | |
Fix to return proper BrowseMetaData for Root-folder
(Fixes DLNA for PS3)
Diffstat (limited to 'MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs')
| -rw-r--r-- | MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs b/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs index 6d5ed9eb8..563f9c59a 100644 --- a/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs +++ b/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs @@ -190,6 +190,8 @@ namespace MediaBrowser.Dlna.ContentDirectory if (string.Equals(flag, "BrowseMetadata")) { + + var folder = item as Folder; if (folder == null) @@ -198,10 +200,12 @@ namespace MediaBrowser.Dlna.ContentDirectory } else { + + var childrenResult = (await GetChildrenSorted(folder, user, sortCriteria, start, requested).ConfigureAwait(false)); totalCount = childrenResult.TotalRecordCount; - result.DocumentElement.AppendChild(_didlBuilder.GetFolderElement(result, folder, totalCount, filter)); + result.DocumentElement.AppendChild(_didlBuilder.GetFolderElement(result, folder, totalCount, filter, id)); } provided++; } @@ -237,7 +241,7 @@ namespace MediaBrowser.Dlna.ContentDirectory { new KeyValuePair<string,string>("Result", resXML), new KeyValuePair<string,string>("NumberReturned", provided.ToString(_usCulture)), - new KeyValuePair<string,string>("TotalMatches", totalCount.ToString(_usCulture)), + new KeyValuePair<string,string>("TotalMatches", id == "0" ? "1" :totalCount.ToString(_usCulture)), new KeyValuePair<string,string>("UpdateID", _systemUpdateId.ToString(_usCulture)) }; } |
