handle x-png

This commit is contained in:
Luke Pulverenti 2016-10-19 02:29:00 -04:00
parent 7895b5457c
commit b7c6ffe013
2 changed files with 6 additions and 0 deletions

View File

@ -100,6 +100,7 @@ namespace MediaBrowser.Model.Net
.ToDictionary(x => x.Key, x => x.First().Key, StringComparer.OrdinalIgnoreCase); .ToDictionary(x => x.Key, x => x.First().Key, StringComparer.OrdinalIgnoreCase);
dict["image/jpg"] = ".jpg"; dict["image/jpg"] = ".jpg";
dict["image/x-png"] = ".png";
return dict; return dict;
} }

View File

@ -356,6 +356,11 @@ namespace MediaBrowser.Providers.Manager
var season = item as Season; var season = item as Season;
var extension = MimeTypes.ToExtension(mimeType); var extension = MimeTypes.ToExtension(mimeType);
if (string.IsNullOrWhiteSpace(extension))
{
throw new ArgumentException(string.Format("Unable to determine image file extension from mime type {0}", mimeType));
}
if (type == ImageType.Thumb && saveLocally) if (type == ImageType.Thumb && saveLocally)
{ {
if (season != null && season.IndexNumber.HasValue) if (season != null && season.IndexNumber.HasValue)