mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
Merge branch 'master' into nullable3
This commit is contained in:
@@ -264,17 +264,20 @@ namespace MediaBrowser.Api.Images
|
||||
{
|
||||
Url = url,
|
||||
BufferContent = false
|
||||
|
||||
}).ConfigureAwait(false);
|
||||
var ext = result.ContentType.Split('/').Last();
|
||||
var ext = result.ContentType.Split('/')[^1];
|
||||
|
||||
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(fullCachePath));
|
||||
using (var stream = result.Content)
|
||||
var stream = result.Content;
|
||||
await using (stream.ConfigureAwait(false))
|
||||
{
|
||||
using var filestream = new FileStream(fullCachePath, FileMode.Create, FileAccess.Write, FileShare.Read, IODefaults.FileStreamBufferSize, true);
|
||||
await stream.CopyToAsync(filestream).ConfigureAwait(false);
|
||||
var filestream = new FileStream(fullCachePath, FileMode.Create, FileAccess.Write, FileShare.Read, IODefaults.FileStreamBufferSize, true);
|
||||
await using (filestream.ConfigureAwait(false))
|
||||
{
|
||||
await stream.CopyToAsync(filestream).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
|
||||
|
||||
Reference in New Issue
Block a user