aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library/FileOrganizationService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/Library/FileOrganizationService.cs')
-rw-r--r--MediaBrowser.Api/Library/FileOrganizationService.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/MediaBrowser.Api/Library/FileOrganizationService.cs b/MediaBrowser.Api/Library/FileOrganizationService.cs
index 0ed08a860..ca391bef0 100644
--- a/MediaBrowser.Api/Library/FileOrganizationService.cs
+++ b/MediaBrowser.Api/Library/FileOrganizationService.cs
@@ -154,9 +154,12 @@ namespace MediaBrowser.Api.Library
public void Post(PerformOrganization request)
{
+ // Don't await this
var task = _iFileOrganizationService.PerformOrganization(request.Id);
- Task.WaitAll(task);
+ // Async processing (close dialog early instead of waiting until the file has been copied)
+ // Wait 2s for exceptions that may occur to have them forwarded to the client for immediate error display
+ task.Wait(2000);
}
public void Post(OrganizeEpisode request)
@@ -168,6 +171,7 @@ namespace MediaBrowser.Api.Library
dicNewProviderIds = request.NewSeriesProviderIds;
}
+ // Don't await this
var task = _iFileOrganizationService.PerformEpisodeOrganization(new EpisodeFileOrganizationRequest
{
EndingEpisodeNumber = request.EndingEpisodeNumber,
@@ -182,11 +186,9 @@ namespace MediaBrowser.Api.Library
TargetFolder = request.TargetFolder
});
- // For async processing (close dialog early instead of waiting until the file has been copied)
- //var tasks = new Task[] { task };
- //Task.WaitAll(tasks, 8000);
-
- Task.WaitAll(task);
+ // Async processing (close dialog early instead of waiting until the file has been copied)
+ // Wait 2s for exceptions that may occur to have them forwarded to the client for immediate error display
+ task.Wait(2000);
}
public object Get(GetSmartMatchInfos request)