Merge pull request #3858 from cvium/fix_wizard_redirect

Fix startup wizard redirect
This commit is contained in:
Bond-009 2020-08-09 20:02:15 +02:00 committed by GitHub
commit e9c9fc4369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Plugins;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
@ -202,10 +203,11 @@ namespace Jellyfin.Api.Controllers
var path = resourceName;
var basePath = WebClientUiPath;
var requestPathAndQuery = Request.GetEncodedPathAndQuery();
// Bounce them to the startup wizard if it hasn't been completed yet
if (!_serverConfigurationManager.Configuration.IsStartupWizardCompleted
&& !Request.Path.Value.Contains("wizard", StringComparison.OrdinalIgnoreCase)
&& Request.Path.Value.Contains("index", StringComparison.OrdinalIgnoreCase))
&& !requestPathAndQuery.Contains("wizard", StringComparison.OrdinalIgnoreCase)
&& requestPathAndQuery.Contains("index", StringComparison.OrdinalIgnoreCase))
{
return Redirect("index.html?start=wizard#!/wizardstart.html");
}