diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-10-02 23:05:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-02 23:05:01 +0200 |
| commit | 1c6a45f7a3ed45812a8a0874a522976c1b3ea0e1 (patch) | |
| tree | 0c003964bd15091e95acc14b3904660b234eec08 | |
| parent | cb94b5a94460be58e1b90366ef0ee45b8de1c0d1 (diff) | |
| parent | 6a32385588889074496dd94a6160614d01bdd63d (diff) | |
Merge pull request #4260 from crobibero/api-data-file
Allow server to return .data files
| -rw-r--r-- | Jellyfin.Server/Startup.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Jellyfin.Server/Startup.cs b/Jellyfin.Server/Startup.cs index 2f4620aa6..62ffe174c 100644 --- a/Jellyfin.Server/Startup.cs +++ b/Jellyfin.Server/Startup.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel; using System.Net.Http.Headers; +using System.Net.Mime; using Jellyfin.Api.TypeConverters; using Jellyfin.Server.Extensions; using Jellyfin.Server.Implementations; @@ -11,6 +12,7 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Extensions; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.StaticFiles; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; @@ -123,10 +125,15 @@ namespace Jellyfin.Server mainApp.UseStaticFiles(); if (appConfig.HostWebClient()) { + var extensionProvider = new FileExtensionContentTypeProvider(); + + // subtitles octopus requires .data files. + extensionProvider.Mappings.Add(".data", MediaTypeNames.Application.Octet); mainApp.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFileProvider(_serverConfigurationManager.ApplicationPaths.WebPath), - RequestPath = "/web" + RequestPath = "/web", + ContentTypeProvider = extensionProvider }); } |
