update channel db

This commit is contained in:
Luke Pulverenti
2015-10-04 14:10:50 -04:00
parent cf87301f45
commit 5c613f2dda
22 changed files with 178 additions and 224 deletions

View File

@@ -39,38 +39,39 @@ namespace MediaBrowser.Server.Implementations.LiveTv
var imageResponse = new DynamicImageResponse();
if (!string.IsNullOrEmpty(liveTvItem.ProviderImagePath))
if (!string.IsNullOrEmpty(liveTvItem.ExternalImagePath))
{
imageResponse.Path = liveTvItem.ProviderImagePath;
imageResponse.HasImage = true;
}
else if (!string.IsNullOrEmpty(liveTvItem.ProviderImageUrl))
{
var options = new HttpRequestOptions
if (liveTvItem.ExternalImagePath.StartsWith("http", StringComparison.OrdinalIgnoreCase))
{
CancellationToken = cancellationToken,
Url = liveTvItem.ProviderImageUrl,
var options = new HttpRequestOptions
{
CancellationToken = cancellationToken,
Url = liveTvItem.ExternalImagePath,
// Some image hosts require a user agent to be specified.
UserAgent = "Emby Server/" + _appHost.ApplicationVersion
};
// Some image hosts require a user agent to be specified.
UserAgent = "Emby Server/" + _appHost.ApplicationVersion
};
var response = await _httpClient.GetResponse(options).ConfigureAwait(false);
var response = await _httpClient.GetResponse(options).ConfigureAwait(false);
var contentType = response.ContentType;
if (contentType.StartsWith("image/", StringComparison.OrdinalIgnoreCase))
{
imageResponse.HasImage = true;
imageResponse.Stream = response.Content;
imageResponse.SetFormatFromMimeType(contentType);
if (response.ContentType.StartsWith("image/", StringComparison.OrdinalIgnoreCase))
{
imageResponse.HasImage = true;
imageResponse.Stream = response.Content;
imageResponse.SetFormatFromMimeType(response.ContentType);
}
else
{
_logger.Error("Provider did not return an image content type.");
}
}
else
{
_logger.Error("Provider did not return an image content type.");
imageResponse.Path = liveTvItem.ExternalImagePath;
imageResponse.HasImage = true;
}
}
else if (liveTvItem.HasProviderImage ?? true)
else
{
var service = _liveTvManager.Services.FirstOrDefault(i => string.Equals(i.Name, liveTvItem.ServiceName, StringComparison.OrdinalIgnoreCase));