aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Api')
-rw-r--r--Jellyfin.Api/Auth/FirstTimeOrIgnoreParentalControlSetupPolicy/FirstTimeOrIgnoreParentalControlSetupHandler.cs5
-rw-r--r--Jellyfin.Api/Controllers/DashboardController.cs6
-rw-r--r--Jellyfin.Api/Controllers/DynamicHlsController.cs11
-rw-r--r--Jellyfin.Api/Controllers/VideosController.cs7
-rw-r--r--Jellyfin.Api/Jellyfin.Api.csproj2
5 files changed, 21 insertions, 10 deletions
diff --git a/Jellyfin.Api/Auth/FirstTimeOrIgnoreParentalControlSetupPolicy/FirstTimeOrIgnoreParentalControlSetupHandler.cs b/Jellyfin.Api/Auth/FirstTimeOrIgnoreParentalControlSetupPolicy/FirstTimeOrIgnoreParentalControlSetupHandler.cs
index 2a02f8bc71..31482a930f 100644
--- a/Jellyfin.Api/Auth/FirstTimeOrIgnoreParentalControlSetupPolicy/FirstTimeOrIgnoreParentalControlSetupHandler.cs
+++ b/Jellyfin.Api/Auth/FirstTimeOrIgnoreParentalControlSetupPolicy/FirstTimeOrIgnoreParentalControlSetupHandler.cs
@@ -1,5 +1,4 @@
using System.Threading.Tasks;
-using Jellyfin.Api.Auth.IgnoreParentalControlPolicy;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Library;
@@ -11,7 +10,7 @@ namespace Jellyfin.Api.Auth.FirstTimeOrIgnoreParentalControlSetupPolicy
/// <summary>
/// Ignore parental control schedule and allow before startup wizard has been completed.
/// </summary>
- public class FirstTimeOrIgnoreParentalControlSetupHandler : BaseAuthorizationHandler<IgnoreParentalControlRequirement>
+ public class FirstTimeOrIgnoreParentalControlSetupHandler : BaseAuthorizationHandler<FirstTimeOrIgnoreParentalControlSetupRequirement>
{
private readonly IConfigurationManager _configurationManager;
@@ -33,7 +32,7 @@ namespace Jellyfin.Api.Auth.FirstTimeOrIgnoreParentalControlSetupPolicy
}
/// <inheritdoc />
- protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, IgnoreParentalControlRequirement requirement)
+ protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, FirstTimeOrIgnoreParentalControlSetupRequirement requirement)
{
if (!_configurationManager.CommonConfiguration.IsStartupWizardCompleted)
{
diff --git a/Jellyfin.Api/Controllers/DashboardController.cs b/Jellyfin.Api/Controllers/DashboardController.cs
index a7bdb24f6d..33abe3ccdc 100644
--- a/Jellyfin.Api/Controllers/DashboardController.cs
+++ b/Jellyfin.Api/Controllers/DashboardController.cs
@@ -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");
}
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs
index f6f08e873c..d581ab8cd2 100644
--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs
+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs
@@ -1496,9 +1496,14 @@ namespace Jellyfin.Api.Controllers
StringBuilder codecs = new StringBuilder();
- codecs.Append(videoCodecs)
- .Append(',')
- .Append(audioCodecs);
+ codecs.Append(videoCodecs);
+
+ if (!string.IsNullOrEmpty(videoCodecs) && !string.IsNullOrEmpty(audioCodecs))
+ {
+ codecs.Append(',');
+ }
+
+ codecs.Append(audioCodecs);
if (codecs.Length > 1)
{
diff --git a/Jellyfin.Api/Controllers/VideosController.cs b/Jellyfin.Api/Controllers/VideosController.cs
index fe065c76f6..fafa722c57 100644
--- a/Jellyfin.Api/Controllers/VideosController.cs
+++ b/Jellyfin.Api/Controllers/VideosController.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
@@ -170,6 +170,11 @@ namespace Jellyfin.Api.Controllers
return NotFound("The video either does not exist or the id does not belong to a video.");
}
+ if (video.LinkedAlternateVersions.Length == 0)
+ {
+ video = (Video)_libraryManager.GetItemById(video.PrimaryVersionId);
+ }
+
foreach (var link in video.GetLinkedAlternateVersions())
{
link.SetPrimaryVersionId(null);
diff --git a/Jellyfin.Api/Jellyfin.Api.csproj b/Jellyfin.Api/Jellyfin.Api.csproj
index db20e82670..24bc07b666 100644
--- a/Jellyfin.Api/Jellyfin.Api.csproj
+++ b/Jellyfin.Api/Jellyfin.Api.csproj
@@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.6" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />
- <PackageReference Include="Swashbuckle.AspNetCore.ReDoc" Version="5.3.3" />
+ <PackageReference Include="Swashbuckle.AspNetCore.ReDoc" Version="5.5.1" />
</ItemGroup>
<ItemGroup>