aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/ContentDirectory/ControlHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Dlna/ContentDirectory/ControlHandler.cs')
-rw-r--r--Emby.Dlna/ContentDirectory/ControlHandler.cs36
1 files changed, 18 insertions, 18 deletions
diff --git a/Emby.Dlna/ContentDirectory/ControlHandler.cs b/Emby.Dlna/ContentDirectory/ControlHandler.cs
index a5229c4fa..e93ee5990 100644
--- a/Emby.Dlna/ContentDirectory/ControlHandler.cs
+++ b/Emby.Dlna/ContentDirectory/ControlHandler.cs
@@ -86,7 +86,7 @@ namespace Emby.Dlna.ContentDirectory
return HandleGetSystemUpdateID();
if (string.Equals(methodName, "Browse", StringComparison.OrdinalIgnoreCase))
- return HandleBrowse(methodParams, user, deviceId).Result;
+ return HandleBrowse(methodParams, user, deviceId);
if (string.Equals(methodName, "X_GetFeatureList", StringComparison.OrdinalIgnoreCase))
return HandleXGetFeatureList();
@@ -98,10 +98,10 @@ namespace Emby.Dlna.ContentDirectory
return HandleXSetBookmark(methodParams, user);
if (string.Equals(methodName, "Search", StringComparison.OrdinalIgnoreCase))
- return HandleSearch(methodParams, user, deviceId).Result;
+ return HandleSearch(methodParams, user, deviceId);
if (string.Equals(methodName, "X_BrowseByLetter", StringComparison.OrdinalIgnoreCase))
- return HandleX_BrowseByLetter(methodParams, user, deviceId).Result;
+ return HandleX_BrowseByLetter(methodParams, user, deviceId);
throw new ResourceNotFoundException("Unexpected control request name: " + methodName);
}
@@ -203,7 +203,7 @@ namespace Emby.Dlna.ContentDirectory
return defaultValue;
}
- private async Task<IEnumerable<KeyValuePair<string, string>>> HandleBrowse(IDictionary<string, string> sparams, User user, string deviceId)
+ private IEnumerable<KeyValuePair<string, string>> HandleBrowse(IDictionary<string, string> sparams, User user, string deviceId)
{
var id = sparams["ObjectID"];
var flag = sparams["BrowseFlag"];
@@ -263,7 +263,7 @@ namespace Emby.Dlna.ContentDirectory
if (item.IsDisplayedAsFolder || serverItem.StubType.HasValue)
{
- var childrenResult = (await GetUserItems(item, serverItem.StubType, user, sortCriteria, start, requestedCount).ConfigureAwait(false));
+ var childrenResult = (GetUserItems(item, serverItem.StubType, user, sortCriteria, start, requestedCount));
_didlBuilder.WriteFolderElement(writer, item, serverItem.StubType, null, childrenResult.TotalRecordCount, filter, id);
}
@@ -276,7 +276,7 @@ namespace Emby.Dlna.ContentDirectory
}
else
{
- var childrenResult = (await GetUserItems(item, serverItem.StubType, user, sortCriteria, start, requestedCount).ConfigureAwait(false));
+ var childrenResult = (GetUserItems(item, serverItem.StubType, user, sortCriteria, start, requestedCount));
totalCount = childrenResult.TotalRecordCount;
provided = childrenResult.Items.Length;
@@ -288,7 +288,7 @@ namespace Emby.Dlna.ContentDirectory
if (childItem.IsDisplayedAsFolder || displayStubType.HasValue)
{
- var childCount = (await GetUserItems(childItem, displayStubType, user, sortCriteria, null, 0).ConfigureAwait(false))
+ var childCount = (GetUserItems(childItem, displayStubType, user, sortCriteria, null, 0))
.TotalRecordCount;
_didlBuilder.WriteFolderElement(writer, childItem, displayStubType, item, childCount, filter);
@@ -314,13 +314,13 @@ namespace Emby.Dlna.ContentDirectory
};
}
- private Task<IEnumerable<KeyValuePair<string, string>>> HandleX_BrowseByLetter(IDictionary<string, string> sparams, User user, string deviceId)
+ private IEnumerable<KeyValuePair<string, string>> HandleX_BrowseByLetter(IDictionary<string, string> sparams, User user, string deviceId)
{
// TODO: Implement this method
return HandleSearch(sparams, user, deviceId);
}
- private async Task<IEnumerable<KeyValuePair<string, string>>> HandleSearch(IDictionary<string, string> sparams, User user, string deviceId)
+ private IEnumerable<KeyValuePair<string, string>> HandleSearch(IDictionary<string, string> sparams, User user, string deviceId)
{
var searchCriteria = new SearchCriteria(GetValueOrDefault(sparams, "SearchCriteria", ""));
var sortCriteria = new SortCriteria(GetValueOrDefault(sparams, "SortCriteria", ""));
@@ -374,7 +374,7 @@ namespace Emby.Dlna.ContentDirectory
var item = serverItem.Item;
- var childrenResult = (await GetChildrenSorted(item, user, searchCriteria, sortCriteria, start, requestedCount).ConfigureAwait(false));
+ var childrenResult = (GetChildrenSorted(item, user, searchCriteria, sortCriteria, start, requestedCount));
totalCount = childrenResult.TotalRecordCount;
@@ -384,7 +384,7 @@ namespace Emby.Dlna.ContentDirectory
{
if (i.IsDisplayedAsFolder)
{
- var childCount = (await GetChildrenSorted(i, user, searchCriteria, sortCriteria, null, 0).ConfigureAwait(false))
+ var childCount = (GetChildrenSorted(i, user, searchCriteria, sortCriteria, null, 0))
.TotalRecordCount;
_didlBuilder.WriteFolderElement(writer, i, null, item, childCount, filter);
@@ -410,7 +410,7 @@ namespace Emby.Dlna.ContentDirectory
};
}
- private Task<QueryResult<BaseItem>> GetChildrenSorted(BaseItem item, User user, SearchCriteria search, SortCriteria sort, int? startIndex, int? limit)
+ private QueryResult<BaseItem> GetChildrenSorted(BaseItem item, User user, SearchCriteria search, SortCriteria sort, int? startIndex, int? limit)
{
var folder = (Folder)item;
@@ -470,7 +470,7 @@ namespace Emby.Dlna.ContentDirectory
return new DtoOptions(true);
}
- private async Task<QueryResult<ServerItem>> GetUserItems(BaseItem item, StubType? stubType, User user, SortCriteria sort, int? startIndex, int? limit)
+ private QueryResult<ServerItem> GetUserItems(BaseItem item, StubType? stubType, User user, SortCriteria sort, int? startIndex, int? limit)
{
if (item is MusicGenre)
{
@@ -518,15 +518,15 @@ namespace Emby.Dlna.ContentDirectory
StartIndex = startIndex,
User = user,
IsMissing = false,
- PresetViews = new[] {CollectionType.Movies, CollectionType.TvShows, CollectionType.Music},
- ExcludeItemTypes = new[] {typeof (Game).Name, typeof (Book).Name},
+ PresetViews = new[] { CollectionType.Movies, CollectionType.TvShows, CollectionType.Music },
+ ExcludeItemTypes = new[] { typeof(Game).Name, typeof(Book).Name },
IsPlaceHolder = false,
DtoOptions = GetDtoOptions()
};
SetSorting(query, sort, folder.IsPreSorted);
- var queryResult = await folder.GetItems(query).ConfigureAwait(false);
+ var queryResult = folder.GetItems(query);
return ToResult(queryResult);
}
@@ -557,8 +557,8 @@ namespace Emby.Dlna.ContentDirectory
{
Recursive = true,
ParentId = parentId,
- GenreIds = new[] {item.Id.ToString("N")},
- IncludeItemTypes = new[] {typeof (MusicAlbum).Name},
+ GenreIds = new[] { item.Id.ToString("N") },
+ IncludeItemTypes = new[] { typeof(MusicAlbum).Name },
Limit = limit,
StartIndex = startIndex,
DtoOptions = GetDtoOptions()