The Free Software Media System - Server Backend & API
Fix releasing lock
Nils Fürnißd7d36a102aed
diff --git a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.csindex 00aafa1262..142571e8f6 100644--- a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs+++ b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs@@ -93,9 +93,9 @@ namespace MediaBrowser.MediaEncoding.Attachmentsawait semaphore.WaitAsync(cancellationToken).ConfigureAwait(false);- if (!Directory.Exists(outputPath))+ try{- try+ if (!Directory.Exists(outputPath)){await ExtractAllAttachmentsInternal(_mediaEncoder.GetInputArgument(inputFile, mediaSource),@@ -103,10 +103,10 @@ namespace MediaBrowser.MediaEncoding.Attachmentsfalse,cancellationToken).ConfigureAwait(false);}- finally- {- semaphore.Release();- }+ }+ finally+ {+ semaphore.Release();}}@@ -120,26 +120,26 @@ namespace MediaBrowser.MediaEncoding.Attachmentsawait semaphore.WaitAsync(cancellationToken).ConfigureAwait(false);- if (!File.Exists(Path.Join(outputPath, id)))+ try{- try+ if (!File.Exists(Path.Join(outputPath, id))){await ExtractAllAttachmentsInternal(inputArgument,outputPath,true,cancellationToken).ConfigureAwait(false);- }- finally- {+if (Directory.Exists(outputPath)){File.Create(Path.Join(outputPath, id));}-- semaphore.Release();}}+ finally+ {+ semaphore.Release();+ }}private async Task ExtractAllAttachmentsInternal(