fix directory not found error in episode organization

This commit is contained in:
Luke Pulverenti
2014-02-25 10:40:16 -05:00
parent 7497fe9554
commit aef805efb9
23 changed files with 143 additions and 73 deletions

View File

@@ -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)