|
|
|
@ -265,18 +265,21 @@ 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))
|
|
|
|
|
{
|
|
|
|
|
var filestream = new FileStream(fullCachePath, FileMode.Create, FileAccess.Write, FileShare.Read, IODefaults.FileStreamBufferSize, true);
|
|
|
|
|
await using (filestream.ConfigureAwait(false))
|
|
|
|
|
{
|
|
|
|
|
using var filestream = new FileStream(fullCachePath, FileMode.Create, FileAccess.Write, FileShare.Read, IODefaults.FileStreamBufferSize, true);
|
|
|
|
|
await stream.CopyToAsync(filestream).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Directory.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
|
|
|
|
|
File.WriteAllText(pointerCachePath, fullCachePath);
|
|
|
|
|