diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-08-21 15:39:41 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-21 15:39:41 -0400 |
| commit | 3f6b5feffba3aacbbf0387edffad0428f93ad675 (patch) | |
| tree | f3eaac4c45a827b111ed4813a8c22ad0e57f6885 /MediaBrowser.Api/Library/FileOrganizationService.cs | |
| parent | 30ba965ed2096139d9064b031e338bf81835aba8 (diff) | |
| parent | 9f7dbec0db461fe416d825b483d475f476c9d42d (diff) | |
Merge pull request #2087 from MediaBrowser/dev
Dev
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 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) |
