update mime types

This commit is contained in:
Luke Pulverenti 2015-09-20 11:37:39 -04:00
parent 63b62e5f40
commit 317c6bcd68
2 changed files with 5 additions and 3 deletions

View File

@ -318,7 +318,7 @@ namespace MediaBrowser.Model.Net
{
return result;
}
throw new ArgumentNullException("Unable to determine extension for mimeType: " + mimeType);
return null;
}
}
}

View File

@ -8,6 +8,7 @@ using MediaBrowser.Model.Devices;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Session;
using MediaBrowser.Model.Users;
@ -151,12 +152,13 @@ namespace MediaBrowser.Server.Implementations.Devices
path = Path.Combine(path, _fileSystem.GetValidFilename(file.Album));
}
Directory.CreateDirectory(path);
path = Path.Combine(path, file.Name);
path = Path.ChangeExtension(path, MimeTypes.ToExtension(file.MimeType) ?? "jpg");
_libraryMonitor.ReportFileSystemChangeBeginning(path);
Directory.CreateDirectory(Path.GetDirectoryName(path));
try
{
using (var fs = _fileSystem.GetFileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read))