diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-08-25 14:46:19 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-25 14:46:19 -0400 |
| commit | ba9577f3801105c2f85c061fa7c4c3ee445032ad (patch) | |
| tree | d06d1da4e2284fcf36c36f7ac1ec84c9613ad812 /MediaBrowser.Api/Library/FileOrganizationService.cs | |
| parent | 870c843194a8684d1f1098bbed79ecb27cd3478b (diff) | |
| parent | 1ffd9b31577773d3c87c2b6621c8803b2b17e85c (diff) | |
Merge pull request #2101 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Api/Library/FileOrganizationService.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/FileOrganizationService.cs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/MediaBrowser.Api/Library/FileOrganizationService.cs b/MediaBrowser.Api/Library/FileOrganizationService.cs index 0ed08a8607..ca391bef08 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) |
