Allow server to return .data files

This commit is contained in:
crobibero 2020-10-02 13:30:31 -06:00
parent b87db136cc
commit 6a32385588

View File

@ -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
});
}