mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-10-31 10:37:22 -04:00 
			
		
		
		
	
						commit
						cd07bc23f8
					
				| @ -17,115 +17,136 @@ namespace MediaBrowser.Model.Net | |||||||
|         /// </summary> |         /// </summary> | ||||||
|         private static readonly HashSet<string> _videoFileExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase) |         private static readonly HashSet<string> _videoFileExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase) | ||||||
|         { |         { | ||||||
|             ".mkv", |             ".3gp", | ||||||
|             ".m2t", |             ".asf", | ||||||
|             ".m2ts", |  | ||||||
|             ".img", |  | ||||||
|             ".iso", |  | ||||||
|             ".mk3d", |  | ||||||
|             ".ts", |  | ||||||
|             ".rmvb", |  | ||||||
|             ".mov", |  | ||||||
|             ".avi", |             ".avi", | ||||||
|             ".mpg", |  | ||||||
|             ".mpeg", |  | ||||||
|             ".wmv", |  | ||||||
|             ".mp4", |  | ||||||
|             ".divx", |             ".divx", | ||||||
|             ".dvr-ms", |             ".dvr-ms", | ||||||
|             ".wtv", |             ".f4v", | ||||||
|  |             ".flv", | ||||||
|  |             ".img", | ||||||
|  |             ".iso", | ||||||
|  |             ".m2t", | ||||||
|  |             ".m2ts", | ||||||
|  |             ".m2v", | ||||||
|  |             ".m4v", | ||||||
|  |             ".mk3d", | ||||||
|  |             ".mkv", | ||||||
|  |             ".mov", | ||||||
|  |             ".mp4", | ||||||
|  |             ".mpg", | ||||||
|  |             ".mpeg", | ||||||
|  |             ".mts", | ||||||
|  |             ".ogg", | ||||||
|             ".ogm", |             ".ogm", | ||||||
|             ".ogv", |             ".ogv", | ||||||
|             ".asf", |             ".rec", | ||||||
|             ".m4v", |             ".ts", | ||||||
|             ".flv", |             ".rmvb", | ||||||
|             ".f4v", |  | ||||||
|             ".3gp", |  | ||||||
|             ".webm", |             ".webm", | ||||||
|             ".mts", |             ".wmv", | ||||||
|             ".m2v", |             ".wtv", | ||||||
|             ".rec" |  | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         // http://en.wikipedia.org/wiki/Internet_media_type |         // http://en.wikipedia.org/wiki/Internet_media_type | ||||||
|  |         // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types | ||||||
|  |         // http://www.iana.org/assignments/media-types/media-types.xhtml | ||||||
|         // Add more as needed |         // Add more as needed | ||||||
|         private static readonly Dictionary<string, string> _mimeTypeLookup = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) |         private static readonly Dictionary<string, string> _mimeTypeLookup = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) | ||||||
|         { |         { | ||||||
|             // Type application |             // Type application | ||||||
|  |             { ".7z", "application/x-7z-compressed" }, | ||||||
|  |             { ".azw", "application/vnd.amazon.ebook" }, | ||||||
|  |             { ".azw3", "application/vnd.amazon.ebook" }, | ||||||
|             { ".cbz", "application/x-cbz" }, |             { ".cbz", "application/x-cbz" }, | ||||||
|             { ".cbr", "application/epub+zip" }, |             { ".cbr", "application/epub+zip" }, | ||||||
|             { ".eot", "application/vnd.ms-fontobject" }, |             { ".eot", "application/vnd.ms-fontobject" }, | ||||||
|             { ".epub", "application/epub+zip" }, |             { ".epub", "application/epub+zip" }, | ||||||
|             { ".js", "application/x-javascript" }, |             { ".js", "application/x-javascript" }, | ||||||
|             { ".json", "application/json" }, |             { ".json", "application/json" }, | ||||||
|             { ".map", "application/x-javascript" }, |  | ||||||
|             { ".pdf", "application/pdf" }, |  | ||||||
|             { ".ttml", "application/ttml+xml" }, |  | ||||||
|             { ".m3u8", "application/x-mpegURL" }, |             { ".m3u8", "application/x-mpegURL" }, | ||||||
|  |             { ".map", "application/x-javascript" }, | ||||||
|             { ".mobi", "application/x-mobipocket-ebook" }, |             { ".mobi", "application/x-mobipocket-ebook" }, | ||||||
|             { ".xml", "application/xml" }, |             { ".pdf", "application/pdf" }, | ||||||
|  |             { ".rar", "application/vnd.rar" }, | ||||||
|  |             { ".srt", "application/x-subrip" }, | ||||||
|  |             { ".ttml", "application/ttml+xml" }, | ||||||
|             { ".wasm", "application/wasm" }, |             { ".wasm", "application/wasm" }, | ||||||
|  |             { ".xml", "application/xml" }, | ||||||
|  |             { ".zip", "application/zip" }, | ||||||
| 
 | 
 | ||||||
|             // Type image |             // Type image | ||||||
|  |             { ".bmp", "image/bmp" }, | ||||||
|  |             { ".gif", "image/gif" }, | ||||||
|  |             { ".ico", "image/vnd.microsoft.icon" }, | ||||||
|             { ".jpg", "image/jpeg" }, |             { ".jpg", "image/jpeg" }, | ||||||
|             { ".jpeg", "image/jpeg" }, |             { ".jpeg", "image/jpeg" }, | ||||||
|             { ".tbn", "image/jpeg" }, |  | ||||||
|             { ".png", "image/png" }, |             { ".png", "image/png" }, | ||||||
|             { ".gif", "image/gif" }, |  | ||||||
|             { ".tiff", "image/tiff" }, |  | ||||||
|             { ".webp", "image/webp" }, |  | ||||||
|             { ".ico", "image/vnd.microsoft.icon" }, |  | ||||||
|             { ".svg", "image/svg+xml" }, |             { ".svg", "image/svg+xml" }, | ||||||
|             { ".svgz", "image/svg+xml" }, |             { ".svgz", "image/svg+xml" }, | ||||||
|  |             { ".tbn", "image/jpeg" }, | ||||||
|  |             { ".tif", "image/tiff" }, | ||||||
|  |             { ".tiff", "image/tiff" }, | ||||||
|  |             { ".webp", "image/webp" }, | ||||||
| 
 | 
 | ||||||
|             // Type font |             // Type font | ||||||
|             { ".ttf" , "font/ttf" }, |             { ".ttf" , "font/ttf" }, | ||||||
|             { ".woff" , "font/woff" }, |             { ".woff" , "font/woff" }, | ||||||
|  |             { ".woff2" , "font/woff2" }, | ||||||
| 
 | 
 | ||||||
|             // Type text |             // Type text | ||||||
|             { ".ass", "text/x-ssa" }, |             { ".ass", "text/x-ssa" }, | ||||||
|             { ".ssa", "text/x-ssa" }, |             { ".ssa", "text/x-ssa" }, | ||||||
|             { ".css", "text/css" }, |             { ".css", "text/css" }, | ||||||
|             { ".csv", "text/csv" }, |             { ".csv", "text/csv" }, | ||||||
|  |             { ".rtf", "text/rtf" }, | ||||||
|             { ".txt", "text/plain" }, |             { ".txt", "text/plain" }, | ||||||
|             { ".vtt", "text/vtt" }, |             { ".vtt", "text/vtt" }, | ||||||
| 
 | 
 | ||||||
|             // Type video |             // Type video | ||||||
|             { ".mpg", "video/mpeg" }, |  | ||||||
|             { ".ogv", "video/ogg" }, |  | ||||||
|             { ".mov", "video/quicktime" }, |  | ||||||
|             { ".webm", "video/webm" }, |  | ||||||
|             { ".mkv", "video/x-matroska" }, |  | ||||||
|             { ".wmv", "video/x-ms-wmv" }, |  | ||||||
|             { ".flv", "video/x-flv" }, |  | ||||||
|             { ".avi", "video/x-msvideo" }, |  | ||||||
|             { ".asf", "video/x-ms-asf" }, |  | ||||||
|             { ".m4v", "video/x-m4v" }, |  | ||||||
|             { ".m4s", "video/mp4" }, |  | ||||||
|             { ".3gp", "video/3gpp" }, |             { ".3gp", "video/3gpp" }, | ||||||
|             { ".3g2", "video/3gpp2" }, |             { ".3g2", "video/3gpp2" }, | ||||||
|             { ".mpd", "video/vnd.mpeg.dash.mpd" }, |             { ".asf", "video/x-ms-asf" }, | ||||||
|             { ".ts", "video/mp2t" }, |             { ".avi", "video/x-msvideo" }, | ||||||
|  |             { ".flv", "video/x-flv" }, | ||||||
|  |             { ".mp4", "video/mp4" }, | ||||||
|  |             { ".m4s", "video/mp4" }, | ||||||
|  |             { ".m4v", "video/x-m4v" }, | ||||||
|             { ".mpegts", "video/mp2t" }, |             { ".mpegts", "video/mp2t" }, | ||||||
|  |             { ".mpg", "video/mpeg" }, | ||||||
|  |             { ".mkv", "video/x-matroska" }, | ||||||
|  |             { ".mov", "video/quicktime" }, | ||||||
|  |             { ".mpd", "video/vnd.mpeg.dash.mpd" }, | ||||||
|  |             { ".ogg", "video/ogg" }, | ||||||
|  |             { ".ogv", "video/ogg" }, | ||||||
|  |             { ".ts", "video/mp2t" }, | ||||||
|  |             { ".webm", "video/webm" }, | ||||||
|  |             { ".wmv", "video/x-ms-wmv" }, | ||||||
| 
 | 
 | ||||||
|             // Type audio |             // Type audio | ||||||
|             { ".mp3", "audio/mpeg" }, |  | ||||||
|             { ".m4a", "audio/mp4" }, |  | ||||||
|             { ".aac", "audio/mp4" }, |             { ".aac", "audio/mp4" }, | ||||||
|             { ".webma", "audio/webm" }, |  | ||||||
|             { ".wav", "audio/wav" }, |  | ||||||
|             { ".wma", "audio/x-ms-wma" }, |  | ||||||
|             { ".ogg", "audio/ogg" }, |  | ||||||
|             { ".oga", "audio/ogg" }, |  | ||||||
|             { ".opus", "audio/ogg" }, |  | ||||||
|             { ".ac3", "audio/ac3" }, |             { ".ac3", "audio/ac3" }, | ||||||
|  |             { ".ape", "audio/x-ape" }, | ||||||
|             { ".dsf", "audio/dsf" }, |             { ".dsf", "audio/dsf" }, | ||||||
|             { ".m4b", "audio/m4b" }, |  | ||||||
|             { ".xsp", "audio/xsp" }, |  | ||||||
|             { ".dsp", "audio/dsp" }, |             { ".dsp", "audio/dsp" }, | ||||||
|             { ".flac", "audio/flac" }, |             { ".flac", "audio/flac" }, | ||||||
|             { ".ape", "audio/x-ape" }, |             { ".m4a", "audio/mp4" }, | ||||||
|  |             { ".m4b", "audio/m4b" }, | ||||||
|  |             { ".mid", "audio/midi" }, | ||||||
|  |             { ".midi", "audio/midi" }, | ||||||
|  |             // There's also audio/x-midi, but no testing has been done to associate an extension with two seperate mime types. | ||||||
|  |             // { ".mid", "audio/x-midi" }, | ||||||
|  |             // { ".midi", "audio/x-midi" }, | ||||||
|  |             { ".mp3", "audio/mpeg" }, | ||||||
|  |             { ".oga", "audio/ogg" }, | ||||||
|  |             { ".ogg", "audio/ogg" }, | ||||||
|  |             { ".opus", "audio/ogg" }, | ||||||
|  |             { ".vorbis", "audio/vorbis" }, | ||||||
|  |             { ".wav", "audio/wav" }, | ||||||
|  |             { ".webma", "audio/webm" }, | ||||||
|  |             { ".wma", "audio/x-ms-wma" }, | ||||||
|             { ".wv", "audio/x-wavpack" }, |             { ".wv", "audio/x-wavpack" }, | ||||||
|  |             { ".xsp", "audio/xsp" }, | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         private static readonly Dictionary<string, string> _extensionLookup = CreateExtensionLookup(); |         private static readonly Dictionary<string, string> _extensionLookup = CreateExtensionLookup(); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user