mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-26 20:16:33 +00:00
Merge remote-tracking branch 'upstream/master' into NetworkPR2
This commit is contained in:
@@ -25,8 +25,6 @@ namespace MediaBrowser.Model.Configuration
|
||||
|
||||
public bool EnableInternetProviders { get; set; }
|
||||
|
||||
public bool ImportMissingEpisodes { get; set; }
|
||||
|
||||
public bool EnableAutomaticSeriesGrouping { get; set; }
|
||||
|
||||
public bool EnableEmbeddedTitles { get; set; }
|
||||
|
||||
@@ -455,9 +455,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (directPlayProfile == null)
|
||||
{
|
||||
_logger.LogInformation("Profile: {0}, No direct play profiles found for Path: {1}",
|
||||
_logger.LogInformation("Profile: {0}, No audio direct play profiles found for {1} with codec {2}",
|
||||
options.Profile.Name ?? "Unknown Profile",
|
||||
item.Path ?? "Unknown path");
|
||||
item.Path ?? "Unknown path",
|
||||
audioStream.Codec ?? "Unknown codec");
|
||||
|
||||
return (Enumerable.Empty<PlayMethod>(), GetTranscodeReasonsFromDirectPlayProfile(item, null, audioStream, options.Profile.DirectPlayProfiles));
|
||||
}
|
||||
@@ -972,9 +973,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (directPlay == null)
|
||||
{
|
||||
_logger.LogInformation("Profile: {0}, No direct play profiles found for Path: {1}",
|
||||
_logger.LogInformation("Profile: {0}, No video direct play profiles found for {1} with codec {2}",
|
||||
profile.Name ?? "Unknown Profile",
|
||||
mediaSource.Path ?? "Unknown path");
|
||||
mediaSource.Path ?? "Unknown path",
|
||||
videoStream.Codec ?? "Unknown codec");
|
||||
|
||||
return (null, GetTranscodeReasonsFromDirectPlayProfile(mediaSource, videoStream, audioStream, profile.DirectPlayProfiles));
|
||||
}
|
||||
|
||||
46
MediaBrowser.Model/Extensions/EnumerableExtensions.cs
Normal file
46
MediaBrowser.Model/Extensions/EnumerableExtensions.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.Providers;
|
||||
|
||||
namespace MediaBrowser.Model.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for <see cref="IEnumerable{T}"/>.
|
||||
/// </summary>
|
||||
public static class EnumerableExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Orders <see cref="RemoteImageInfo"/> by requested language in descending order, prioritizing "en" over other non-matches.
|
||||
/// </summary>
|
||||
/// <param name="remoteImageInfos">The remote image infos.</param>
|
||||
/// <param name="requestedLanguage">The requested language for the images.</param>
|
||||
/// <returns>The ordered remote image infos.</returns>
|
||||
public static IEnumerable<RemoteImageInfo> OrderByLanguageDescending(this IEnumerable<RemoteImageInfo> remoteImageInfos, string requestedLanguage)
|
||||
{
|
||||
var isRequestedLanguageEn = string.Equals(requestedLanguage, "en", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
return remoteImageInfos.OrderByDescending(i =>
|
||||
{
|
||||
if (string.Equals(requestedLanguage, i.Language, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
if (!isRequestedLanguageEn && string.Equals("en", i.Language, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(i.Language))
|
||||
{
|
||||
return isRequestedLanguageEn ? 3 : 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
})
|
||||
.ThenByDescending(i => i.CommunityRating ?? 0)
|
||||
.ThenByDescending(i => i.VoteCount ?? 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Model.Net
|
||||
{
|
||||
@@ -15,7 +16,7 @@ namespace MediaBrowser.Model.Net
|
||||
/// Gets or sets the type of the message.
|
||||
/// </summary>
|
||||
/// <value>The type of the message.</value>
|
||||
public string MessageType { get; set; }
|
||||
public SessionMessageType MessageType { get; set; }
|
||||
|
||||
public Guid MessageId { get; set; }
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace MediaBrowser.Model.Session
|
||||
{
|
||||
public string[] PlayableMediaTypes { get; set; }
|
||||
|
||||
public string[] SupportedCommands { get; set; }
|
||||
public GeneralCommandType[] SupportedCommands { get; set; }
|
||||
|
||||
public bool SupportsMediaControl { get; set; }
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace MediaBrowser.Model.Session
|
||||
public ClientCapabilities()
|
||||
{
|
||||
PlayableMediaTypes = Array.Empty<string>();
|
||||
SupportedCommands = Array.Empty<string>();
|
||||
SupportedCommands = Array.Empty<GeneralCommandType>();
|
||||
SupportsPersistentIdentifier = true;
|
||||
}
|
||||
}
|
||||
|
||||
50
MediaBrowser.Model/Session/SessionMessageType.cs
Normal file
50
MediaBrowser.Model/Session/SessionMessageType.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Session
|
||||
{
|
||||
/// <summary>
|
||||
/// The different kinds of messages that are used in the WebSocket api.
|
||||
/// </summary>
|
||||
public enum SessionMessageType
|
||||
{
|
||||
// Server -> Client
|
||||
ForceKeepAlive,
|
||||
GeneralCommand,
|
||||
UserDataChanged,
|
||||
Sessions,
|
||||
Play,
|
||||
SyncPlayCommand,
|
||||
SyncPlayGroupUpdate,
|
||||
PlayState,
|
||||
RestartRequired,
|
||||
ServerShuttingDown,
|
||||
ServerRestarting,
|
||||
LibraryChanged,
|
||||
UserDeleted,
|
||||
UserUpdated,
|
||||
SeriesTimerCreated,
|
||||
TimerCreated,
|
||||
SeriesTimerCancelled,
|
||||
TimerCancelled,
|
||||
RefreshProgress,
|
||||
ScheduledTaskEnded,
|
||||
PackageInstallationCancelled,
|
||||
PackageInstallationFailed,
|
||||
PackageInstallationCompleted,
|
||||
PackageInstalling,
|
||||
PackageUninstalled,
|
||||
ActivityLogEntry,
|
||||
ScheduledTasksInfo,
|
||||
|
||||
// Client -> Server
|
||||
ActivityLogEntryStart,
|
||||
ActivityLogEntryStop,
|
||||
SessionsStart,
|
||||
SessionsStop,
|
||||
ScheduledTasksInfoStart,
|
||||
ScheduledTasksInfoStop,
|
||||
|
||||
// Shared
|
||||
KeepAlive,
|
||||
}
|
||||
}
|
||||
@@ -92,6 +92,8 @@ namespace MediaBrowser.Model.Users
|
||||
|
||||
public int LoginAttemptsBeforeLockout { get; set; }
|
||||
|
||||
public int MaxActiveSessions { get; set; }
|
||||
|
||||
public bool EnablePublicSharing { get; set; }
|
||||
|
||||
public Guid[] BlockedMediaFolders { get; set; }
|
||||
@@ -144,6 +146,8 @@ namespace MediaBrowser.Model.Users
|
||||
|
||||
LoginAttemptsBeforeLockout = -1;
|
||||
|
||||
MaxActiveSessions = 0;
|
||||
|
||||
EnableAllChannels = true;
|
||||
EnabledChannels = Array.Empty<Guid>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user