Merge branch 'master' into hwaccel

This commit is contained in:
dkanada
2020-06-15 20:21:25 +09:00
committed by GitHub
471 changed files with 4933 additions and 4044 deletions

View File

@@ -1,3 +1,5 @@
using Jellyfin.Data.Enums;
#pragma warning disable CS1591
namespace MediaBrowser.Model.Configuration

View File

@@ -1,18 +0,0 @@
#pragma warning disable CS1591
namespace MediaBrowser.Model.Configuration
{
public enum DynamicDayOfWeek
{
Sunday = 0,
Monday = 1,
Tuesday = 2,
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6,
Everyday = 7,
Weekday = 8,
Weekend = 9
}
}

View File

@@ -1,13 +0,0 @@
#pragma warning disable CS1591
namespace MediaBrowser.Model.Configuration
{
public enum SubtitlePlaybackMode
{
Default = 0,
Always = 1,
OnlyForced = 2,
None = 3,
Smart = 4
}
}

View File

@@ -1,23 +0,0 @@
namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Enum SyncPlayAccess.
/// </summary>
public enum SyncPlayAccess
{
/// <summary>
/// User can create groups and join them.
/// </summary>
CreateAndJoinGroups,
/// <summary>
/// User can only join already existing groups.
/// </summary>
JoinGroups,
/// <summary>
/// SyncPlay is disabled for the user.
/// </summary>
None
}
}

View File

@@ -1,17 +0,0 @@
#pragma warning disable CS1591
namespace MediaBrowser.Model.Configuration
{
public enum UnratedItem
{
Movie,
Trailer,
Series,
Music,
Book,
LiveTvChannel,
LiveTvProgram,
ChannelContent,
Other
}
}

View File

@@ -2,6 +2,7 @@
#pragma warning disable CS1591
using System;
using Jellyfin.Data.Enums;
namespace MediaBrowser.Model.Configuration
{

View File

@@ -79,11 +79,11 @@ namespace MediaBrowser.Model.Dlna
DlnaFlags.InteractiveTransferMode |
DlnaFlags.DlnaV15;
//if (isDirectStream)
// if (isDirectStream)
//{
// flagValue = flagValue | DlnaFlags.ByteBasedSeek;
//}
//else if (runtimeTicks.HasValue)
// else if (runtimeTicks.HasValue)
//{
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
//}
@@ -148,11 +148,11 @@ namespace MediaBrowser.Model.Dlna
DlnaFlags.InteractiveTransferMode |
DlnaFlags.DlnaV15;
//if (isDirectStream)
// if (isDirectStream)
//{
// flagValue = flagValue | DlnaFlags.ByteBasedSeek;
//}
//else if (runtimeTicks.HasValue)
// else if (runtimeTicks.HasValue)
//{
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
//}

View File

@@ -158,7 +158,6 @@ namespace MediaBrowser.Model.Dlna
return new MediaFormatProfile[] { ValueOf(string.Format("VC1_TS_HD_DTS{0}", suffix)) };
}
}
else if (string.Equals(videoCodec, "mpeg4", StringComparison.OrdinalIgnoreCase) || string.Equals(videoCodec, "msmpeg4", StringComparison.OrdinalIgnoreCase))
{

View File

@@ -15,7 +15,6 @@ namespace MediaBrowser.Model.Dlna
public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value)
: this(condition, property, value, false)
{
}
public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value, bool isRequired)

View File

@@ -10,7 +10,6 @@ namespace MediaBrowser.Model.Dlna
public SortCriteria(string value)
{
}
}
}

View File

@@ -109,7 +109,6 @@ namespace MediaBrowser.Model.Dlna
}
return 1;
}).ThenBy(i =>
{
switch (i.PlayMethod)
@@ -121,7 +120,6 @@ namespace MediaBrowser.Model.Dlna
default:
return 1;
}
}).ThenBy(i =>
{
switch (i.MediaSource.Protocol)
@@ -131,7 +129,6 @@ namespace MediaBrowser.Model.Dlna
default:
return 1;
}
}).ThenBy(i =>
{
if (maxBitrate > 0)
@@ -143,7 +140,6 @@ namespace MediaBrowser.Model.Dlna
}
return 0;
}).ThenBy(streams.IndexOf);
}
@@ -781,7 +777,7 @@ namespace MediaBrowser.Model.Dlna
if (!ConditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{
//LogConditionFailure(options.Profile, "VideoCodecProfile.ApplyConditions", applyCondition, item);
// LogConditionFailure(options.Profile, "VideoCodecProfile.ApplyConditions", applyCondition, item);
applyConditions = false;
break;
}
@@ -825,7 +821,7 @@ namespace MediaBrowser.Model.Dlna
if (!ConditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth, audioProfile, isSecondaryAudio))
{
//LogConditionFailure(options.Profile, "VideoCodecProfile.ApplyConditions", applyCondition, item);
// LogConditionFailure(options.Profile, "VideoCodecProfile.ApplyConditions", applyCondition, item);
applyConditions = false;
break;
}
@@ -1046,7 +1042,7 @@ namespace MediaBrowser.Model.Dlna
{
if (!ConditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{
//LogConditionFailure(profile, "VideoCodecProfile.ApplyConditions", applyCondition, mediaSource);
// LogConditionFailure(profile, "VideoCodecProfile.ApplyConditions", applyCondition, mediaSource);
applyConditions = false;
break;
}
@@ -1092,7 +1088,7 @@ namespace MediaBrowser.Model.Dlna
{
if (!ConditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, audioBitrate, audioSampleRate, audioBitDepth, audioProfile, isSecondaryAudio))
{
//LogConditionFailure(profile, "VideoAudioCodecProfile.ApplyConditions", applyCondition, mediaSource);
// LogConditionFailure(profile, "VideoAudioCodecProfile.ApplyConditions", applyCondition, mediaSource);
applyConditions = false;
break;
}

View File

@@ -582,7 +582,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the locked fields.
/// </summary>
/// <value>The locked fields.</value>
public MetadataFields[] LockedFields { get; set; }
public MetadataField[] LockedFields { get; set; }
/// <summary>
/// Gets or sets the trailer count.

View File

@@ -63,6 +63,11 @@ namespace MediaBrowser.Model.Entities
/// <summary>
/// The box rear.
/// </summary>
BoxRear = 11
BoxRear = 11,
/// <summary>
/// The user profile image.
/// </summary>
Profile = 12
}
}

View File

@@ -114,7 +114,7 @@ namespace MediaBrowser.Model.Entities
{
if (Type == MediaStreamType.Audio)
{
//if (!string.IsNullOrEmpty(Title))
// if (!string.IsNullOrEmpty(Title))
//{
// return AddLanguageIfNeeded(Title);
//}
@@ -208,7 +208,6 @@ namespace MediaBrowser.Model.Entities
if (Type == MediaStreamType.Video)
{
}
return null;

View File

@@ -3,7 +3,7 @@ namespace MediaBrowser.Model.Entities
/// <summary>
/// Enum MetadataFields.
/// </summary>
public enum MetadataFields
public enum MetadataField
{
/// <summary>
/// The cast.

View File

@@ -5,7 +5,7 @@ namespace MediaBrowser.Model.Entities
/// <summary>
/// Enum MetadataProviders
/// </summary>
public enum MetadataProviders
public enum MetadataProvider
{
/// <summary>
/// The imdb

View File

@@ -36,6 +36,5 @@ namespace MediaBrowser.Model.Entities
/// Gets or sets the time of review.
/// </summary>
public DateTime timestamp { get; set; }
}
}

View File

@@ -14,7 +14,7 @@ namespace MediaBrowser.Model.Entities
/// <param name="instance">The instance.</param>
/// <param name="provider">The provider.</param>
/// <returns><c>true</c> if [has provider identifier] [the specified instance]; otherwise, <c>false</c>.</returns>
public static bool HasProviderId(this IHasProviderIds instance, MetadataProviders provider)
public static bool HasProviderId(this IHasProviderIds instance, MetadataProvider provider)
{
return !string.IsNullOrEmpty(instance.GetProviderId(provider.ToString()));
}
@@ -25,7 +25,7 @@ namespace MediaBrowser.Model.Entities
/// <param name="instance">The instance.</param>
/// <param name="provider">The provider.</param>
/// <returns>System.String.</returns>
public static string? GetProviderId(this IHasProviderIds instance, MetadataProviders provider)
public static string? GetProviderId(this IHasProviderIds instance, MetadataProvider provider)
{
return instance.GetProviderId(provider.ToString());
}
@@ -94,7 +94,7 @@ namespace MediaBrowser.Model.Entities
/// <param name="instance">The instance.</param>
/// <param name="provider">The provider.</param>
/// <param name="value">The value.</param>
public static void SetProviderId(this IHasProviderIds instance, MetadataProviders provider, string value)
public static void SetProviderId(this IHasProviderIds instance, MetadataProvider provider, string value)
{
instance.SetProviderId(provider.ToString(), value);
}

View File

@@ -41,6 +41,5 @@ namespace MediaBrowser.Model.LiveTv
/// </summary>
/// <value>The program information.</value>
public BaseItemDto ProgramInfo { get; set; }
}
}

View File

@@ -23,7 +23,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.5" />
<PackageReference Include="System.Globalization" Version="4.3.0" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
</ItemGroup>

View File

@@ -28,7 +28,6 @@ namespace MediaBrowser.Model.Net
public HttpException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>

View File

@@ -2,7 +2,10 @@
#pragma warning disable CS1591
using System;
using Jellyfin.Data.Enums;
using MediaBrowser.Model.Extensions;
using System.Linq;
using Jellyfin.Data.Entities;
using MediaBrowser.Model.Users;
namespace MediaBrowser.Model.Notifications
@@ -104,7 +107,7 @@ namespace MediaBrowser.Model.Notifications
!opt.DisabledMonitorUsers.Contains(userId.ToString(""), StringComparer.OrdinalIgnoreCase);
}
public bool IsEnabledToSendToUser(string type, string userId, UserPolicy userPolicy)
public bool IsEnabledToSendToUser(string type, string userId, User user)
{
NotificationOption opt = GetOptions(type);
@@ -115,7 +118,7 @@ namespace MediaBrowser.Model.Notifications
return true;
}
if (opt.SendToUserMode == SendToUserType.Admins && userPolicy.IsAdministrator)
if (opt.SendToUserMode == SendToUserType.Admins && user.HasPermission(PermissionKind.IsAdministrator))
{
return true;
}

View File

@@ -51,6 +51,5 @@ namespace MediaBrowser.Model.Providers
public RemoteSearchResult[] Artists { get; set; }
}
}

View File

@@ -9,42 +9,52 @@ namespace MediaBrowser.Model.SyncPlay
/// The user-joined update. Tells members of a group about a new user.
/// </summary>
UserJoined,
/// <summary>
/// The user-left update. Tells members of a group that a user left.
/// </summary>
UserLeft,
/// <summary>
/// The group-joined update. Tells a user that the group has been joined.
/// </summary>
GroupJoined,
/// <summary>
/// The group-left update. Tells a user that the group has been left.
/// </summary>
GroupLeft,
/// <summary>
/// The group-wait update. Tells members of the group that a user is buffering.
/// </summary>
GroupWait,
/// <summary>
/// The prepare-session update. Tells a user to load some content.
/// </summary>
PrepareSession,
/// <summary>
/// The not-in-group error. Tells a user that they don't belong to a group.
/// </summary>
NotInGroup,
/// <summary>
/// The group-does-not-exist error. Sent when trying to join a non-existing group.
/// </summary>
GroupDoesNotExist,
/// <summary>
/// The create-group-denied error. Sent when a user tries to create a group without required permissions.
/// </summary>
CreateGroupDenied,
/// <summary>
/// The join-group-denied error. Sent when a user tries to join a group without required permissions.
/// </summary>
JoinGroupDenied,
/// <summary>
/// The library-access-denied error. Sent when a user tries to join a group without required access to the library.
/// </summary>

View File

@@ -1,7 +1,7 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Enum PlaybackRequestType
/// Enum PlaybackRequestType.
/// </summary>
public enum PlaybackRequestType
{
@@ -9,22 +9,27 @@ namespace MediaBrowser.Model.SyncPlay
/// A user is requesting a play command for the group.
/// </summary>
Play = 0,
/// <summary>
/// A user is requesting a pause command for the group.
/// </summary>
Pause = 1,
/// <summary>
/// A user is requesting a seek command for the group.
/// </summary>
Seek = 2,
/// <summary>
/// A user is signaling that playback is buffering.
/// </summary>
Buffering = 3,
/// <summary>
/// A user is signaling that playback resumed.
/// </summary>
BufferingDone = 4,
/// <summary>
/// A user is reporting its ping.
/// </summary>

View File

@@ -9,10 +9,12 @@ namespace MediaBrowser.Model.SyncPlay
/// The play command. Instructs users to start playback.
/// </summary>
Play = 0,
/// <summary>
/// The pause command. Instructs users to pause playback.
/// </summary>
Pause = 1,
/// <summary>
/// The seek command. Instructs users to seek to a specified time.
/// </summary>

View File

@@ -2,7 +2,9 @@
#pragma warning disable CS1591
using System;
using MediaBrowser.Model.Configuration;
using System.Xml.Serialization;
using Jellyfin.Data.Enums;
using AccessSchedule = Jellyfin.Data.Entities.AccessSchedule;
namespace MediaBrowser.Model.Users
{
@@ -78,6 +80,8 @@ namespace MediaBrowser.Model.Users
public string[] BlockedChannels { get; set; }
public int RemoteClientBitrateLimit { get; set; }
[XmlElement(ElementName = "AuthenticationProviderId")]
public string AuthenticationProviderId { get; set; }
public string PasswordResetProviderId { get; set; }