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

@@ -36,30 +36,33 @@ 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
};
var response = await _httpClient.GetResponse(options).ConfigureAwait(false);
var response = await _httpClient.GetResponse(options).ConfigureAwait(false);
if (response.ContentType.StartsWith("image/", StringComparison.OrdinalIgnoreCase))
{
imageResponse.HasImage = true;
imageResponse.Stream = response.Content;
imageResponse.SetFormatFromMimeType(response.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
@@ -109,7 +112,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
if (liveTvItem != null)
{
return !liveTvItem.HasImage(ImageType.Primary) && (!string.IsNullOrWhiteSpace(liveTvItem.ProviderImagePath) || !string.IsNullOrWhiteSpace(liveTvItem.ProviderImageUrl));
return !liveTvItem.HasImage(ImageType.Primary);
}
return false;
}