diff options
| author | hatharry <hatharry@hotmail.com> | 2016-08-29 01:27:43 +1200 |
|---|---|---|
| committer | hatharry <hatharry@hotmail.com> | 2016-08-29 01:27:43 +1200 |
| commit | cabf2cdc1be4c06714ac6bcf835a19d2f652a6e2 (patch) | |
| tree | d375b8a41e9fd40a2569ceea6b02e4f8237db797 /MediaBrowser.Api/Library/FileOrganizationService.cs | |
| parent | e564b54686029a90595e1bb4277f87490763e183 (diff) | |
| parent | c974641a352685b2e6595dd7b291843c8e6364ac (diff) | |
Merge branch 'dev' of https://github.com/hatharry/Emby.git
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) |
