mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-30 12:28:27 +01:00
Merge remote-tracking branch 'upstream/master' into 3.1.7
This commit is contained in:
@@ -229,7 +229,7 @@ namespace Jellyfin.Api.Controllers
|
||||
});
|
||||
}
|
||||
|
||||
private EventSubscriptionResponse ProcessEventRequest(IEventManager eventManager)
|
||||
private EventSubscriptionResponse ProcessEventRequest(IDlnaEventManager dlnaEventManager)
|
||||
{
|
||||
var subscriptionId = Request.Headers["SID"];
|
||||
if (string.Equals(Request.Method, "subscribe", StringComparison.OrdinalIgnoreCase))
|
||||
@@ -240,17 +240,17 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
if (string.IsNullOrEmpty(notificationType))
|
||||
{
|
||||
return eventManager.RenewEventSubscription(
|
||||
return dlnaEventManager.RenewEventSubscription(
|
||||
subscriptionId,
|
||||
notificationType,
|
||||
timeoutString,
|
||||
callback);
|
||||
}
|
||||
|
||||
return eventManager.CreateEventSubscription(notificationType, timeoutString, callback);
|
||||
return dlnaEventManager.CreateEventSubscription(notificationType, timeoutString, callback);
|
||||
}
|
||||
|
||||
return eventManager.CancelEventSubscription(subscriptionId);
|
||||
return dlnaEventManager.CancelEventSubscription(subscriptionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1356,7 +1356,7 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} -map_metadata -1 -map_chapters -1 -threads {2} {3} {4} {5} -copyts -avoid_negative_ts disabled -f hls -max_delay 5000000 -hls_time {6} -individual_header_trailer 0 -hls_segment_type {7} -start_number {8} -hls_segment_filename \"{9}\" -hls_playlist_type vod -hls_list_size 0 -y \"{10}\"",
|
||||
"{0} {1} -map_metadata -1 -map_chapters -1 -threads {2} {3} {4} {5} -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time {6} -individual_header_trailer 0 -hls_segment_type {7} -start_number {8} -hls_segment_filename \"{9}\" -hls_playlist_type vod -hls_list_size 0 -y \"{10}\"",
|
||||
inputModifier,
|
||||
_encodingHelper.GetInputArgument(state, encodingOptions),
|
||||
threads,
|
||||
|
||||
@@ -619,7 +619,7 @@ namespace Jellyfin.Api.Controllers
|
||||
[Authorize(Policy = Policies.Download)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public ActionResult GetDownload([FromRoute] Guid itemId)
|
||||
public async Task<ActionResult> GetDownload([FromRoute] Guid itemId)
|
||||
{
|
||||
var item = _libraryManager.GetItemById(itemId);
|
||||
if (item == null)
|
||||
@@ -648,7 +648,7 @@ namespace Jellyfin.Api.Controllers
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
LogDownload(item, user, auth);
|
||||
await LogDownloadAsync(item, user, auth).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
var path = item.Path;
|
||||
@@ -861,17 +861,17 @@ namespace Jellyfin.Api.Controllers
|
||||
: item;
|
||||
}
|
||||
|
||||
private void LogDownload(BaseItem item, User user, AuthorizationInfo auth)
|
||||
private async Task LogDownloadAsync(BaseItem item, User user, AuthorizationInfo auth)
|
||||
{
|
||||
try
|
||||
{
|
||||
_activityManager.Create(new ActivityLog(
|
||||
await _activityManager.CreateAsync(new ActivityLog(
|
||||
string.Format(CultureInfo.InvariantCulture, _localization.GetLocalizedString("UserDownloadingItemWithValues"), user.Username, item.Name),
|
||||
"UserDownloadingContent",
|
||||
auth.UserId)
|
||||
{
|
||||
ShortOverview = string.Format(CultureInfo.InvariantCulture, _localization.GetLocalizedString("AppDeviceValues"), auth.Client, auth.Device),
|
||||
});
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -120,10 +120,14 @@ namespace Jellyfin.Api.Controllers
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
var configuration = (BasePluginConfiguration)await JsonSerializer.DeserializeAsync(Request.Body, plugin.ConfigurationType, _serializerOptions)
|
||||
var configuration = (BasePluginConfiguration?)await JsonSerializer.DeserializeAsync(Request.Body, plugin.ConfigurationType, _serializerOptions)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
plugin.UpdateConfiguration(configuration);
|
||||
if (configuration != null)
|
||||
{
|
||||
plugin.UpdateConfiguration(configuration);
|
||||
}
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,11 @@ namespace Jellyfin.Api.Helpers
|
||||
{
|
||||
// Since we're going to be setting properties on MediaSourceInfos that come out of _mediaSourceManager, we should clone it
|
||||
// Should we move this directly into MediaSourceManager?
|
||||
result.MediaSources = JsonSerializer.Deserialize<MediaSourceInfo[]>(JsonSerializer.SerializeToUtf8Bytes(mediaSources));
|
||||
var mediaSourcesClone = JsonSerializer.Deserialize<MediaSourceInfo[]>(JsonSerializer.SerializeToUtf8Bytes(mediaSources));
|
||||
if (mediaSourcesClone != null)
|
||||
{
|
||||
result.MediaSources = mediaSourcesClone;
|
||||
}
|
||||
|
||||
result.PlaySessionId = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Events;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Api.WebSocketListeners
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user