mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 05:57:20 -04:00
Fix releasing lock
This commit is contained in:
parent
b4bb82b6d7
commit
d7d36a102a
1 changed files with 13 additions and 13 deletions
|
@ -93,9 +93,9 @@ namespace MediaBrowser.MediaEncoding.Attachments
|
|||
|
||||
await 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.Attachments
|
|||
false,
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
finally
|
||||
{
|
||||
semaphore.Release();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
semaphore.Release();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,26 +120,26 @@ namespace MediaBrowser.MediaEncoding.Attachments
|
|||
|
||||
await 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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue