mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 15:03:06 +03:00
fix directory not found error in episode organization
This commit is contained in:
@@ -285,17 +285,8 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||
EnsureSuccessStatusCode(httpResponse);
|
||||
|
||||
options.CancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
return new HttpResponseInfo
|
||||
{
|
||||
Content = httpResponse.GetResponseStream(),
|
||||
|
||||
StatusCode = httpResponse.StatusCode,
|
||||
|
||||
ContentType = httpResponse.ContentType,
|
||||
|
||||
Headers = httpResponse.Headers
|
||||
};
|
||||
return GetResponseInfo(httpResponse, httpResponse.GetResponseStream(), GetContentLength(httpResponse));
|
||||
}
|
||||
|
||||
using (var response = await httpWebRequest.GetResponseAsync().ConfigureAwait(false))
|
||||
@@ -314,16 +305,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||
|
||||
memoryStream.Position = 0;
|
||||
|
||||
return new HttpResponseInfo
|
||||
{
|
||||
Content = memoryStream,
|
||||
|
||||
StatusCode = httpResponse.StatusCode,
|
||||
|
||||
ContentType = httpResponse.ContentType,
|
||||
|
||||
Headers = httpResponse.Headers
|
||||
};
|
||||
return GetResponseInfo(httpResponse, memoryStream, memoryStream.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -367,6 +349,38 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||
}
|
||||
}
|
||||
|
||||
private HttpResponseInfo GetResponseInfo(HttpWebResponse httpResponse, Stream content, long? contentLength)
|
||||
{
|
||||
return new HttpResponseInfo
|
||||
{
|
||||
Content = content,
|
||||
|
||||
StatusCode = httpResponse.StatusCode,
|
||||
|
||||
ContentType = httpResponse.ContentType,
|
||||
|
||||
Headers = httpResponse.Headers,
|
||||
|
||||
ContentLength = contentLength
|
||||
};
|
||||
}
|
||||
|
||||
private HttpResponseInfo GetResponseInfo(HttpWebResponse httpResponse, string tempFile, long? contentLength)
|
||||
{
|
||||
return new HttpResponseInfo
|
||||
{
|
||||
TempFilePath = tempFile,
|
||||
|
||||
StatusCode = httpResponse.StatusCode,
|
||||
|
||||
ContentType = httpResponse.ContentType,
|
||||
|
||||
Headers = httpResponse.Headers,
|
||||
|
||||
ContentLength = contentLength
|
||||
};
|
||||
}
|
||||
|
||||
public Task<HttpResponseInfo> Post(HttpRequestOptions options)
|
||||
{
|
||||
return SendAsync(options, "POST");
|
||||
@@ -493,16 +507,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||
|
||||
options.Progress.Report(100);
|
||||
|
||||
return new HttpResponseInfo
|
||||
{
|
||||
TempFilePath = tempFile,
|
||||
|
||||
StatusCode = httpResponse.StatusCode,
|
||||
|
||||
ContentType = httpResponse.ContentType,
|
||||
|
||||
Headers = httpResponse.Headers
|
||||
};
|
||||
return GetResponseInfo(httpResponse, tempFile, contentLength);
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException ex)
|
||||
|
||||
Reference in New Issue
Block a user