Merge branch 'master' into authenticationdb-efcore

# Conflicts:
#	Emby.Server.Implementations/Devices/DeviceManager.cs
#	Emby.Server.Implementations/HttpServer/Security/SessionContext.cs
#	Emby.Server.Implementations/Security/AuthenticationRepository.cs
#	Emby.Server.Implementations/Session/SessionManager.cs
#	Jellyfin.Server.Implementations/Security/AuthorizationContext.cs
#	MediaBrowser.Controller/Library/IUserManager.cs
#	MediaBrowser.Controller/Net/ISessionContext.cs
This commit is contained in:
Patrick Barron
2021-06-18 18:47:44 -04:00
357 changed files with 3277 additions and 2315 deletions

View File

@@ -1,5 +1,3 @@
#nullable enable
namespace MediaBrowser.Model.Configuration
{
/// <summary>

View File

@@ -104,6 +104,19 @@ namespace MediaBrowser.Model.Entities
return "HDR";
}
// For some Dolby Vision files, no color transfer is provided, so check the codec
var codecTag = CodecTag;
if (string.Equals(codecTag, "dva1", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dvav", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dvh1", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dvhe", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dav1", StringComparison.OrdinalIgnoreCase))
{
return "HDR";
}
return "SDR";
}
}

View File

@@ -17,7 +17,8 @@ namespace MediaBrowser.Model.Extensions
return str;
}
if (char.IsUpper(str[0]))
// We check IsLower instead of IsUpper because both return false for non-letters
if (!char.IsLower(str[0]))
{
return str;
}

View File

@@ -1,4 +1,3 @@
#nullable disable
#pragma warning disable CS1591
using System;
@@ -25,7 +24,7 @@ namespace MediaBrowser.Model.IO
/// </summary>
/// <param name="filename">The filename.</param>
/// <returns>System.String.</returns>
string ResolveShortcut(string filename);
string? ResolveShortcut(string filename);
/// <summary>
/// Creates the shortcut.
@@ -160,7 +159,7 @@ namespace MediaBrowser.Model.IO
/// <returns>All found files.</returns>
IEnumerable<FileSystemMetadata> GetFiles(string path, bool recursive = false);
IEnumerable<FileSystemMetadata> GetFiles(string path, IReadOnlyList<string> extensions, bool enableCaseSensitiveExtensions, bool recursive);
IEnumerable<FileSystemMetadata> GetFiles(string path, IReadOnlyList<string>? extensions, bool enableCaseSensitiveExtensions, bool recursive);
/// <summary>
/// Gets the file system entries.
@@ -186,7 +185,7 @@ namespace MediaBrowser.Model.IO
/// <returns>IEnumerable&lt;System.String&gt;.</returns>
IEnumerable<string> GetFilePaths(string path, bool recursive = false);
IEnumerable<string> GetFilePaths(string path, string[] extensions, bool enableCaseSensitiveExtensions, bool recursive);
IEnumerable<string> GetFilePaths(string path, string[]? extensions, bool enableCaseSensitiveExtensions, bool recursive);
/// <summary>
/// Gets the file system entry paths.

View File

@@ -15,7 +15,7 @@ namespace MediaBrowser.Model.IO
/// </summary>
/// <param name="shortcutPath">The shortcut path.</param>
/// <returns>System.String.</returns>
string Resolve(string shortcutPath);
string? Resolve(string shortcutPath);
/// <summary>
/// Creates the specified shortcut path.

View File

@@ -9,7 +9,7 @@ namespace MediaBrowser.Model.IO
{
public interface IStreamHelper
{
Task CopyToAsync(Stream source, Stream destination, int bufferSize, Action onStarted, CancellationToken cancellationToken);
Task CopyToAsync(Stream source, Stream destination, int bufferSize, Action? onStarted, CancellationToken cancellationToken);
Task CopyToAsync(Stream source, Stream destination, int bufferSize, int emptyReadLimit, CancellationToken cancellationToken);

View File

@@ -51,6 +51,8 @@ namespace MediaBrowser.Model.MediaInfo
public string ShowName { get; set; }
public string ForcedSortName { get; set; }
public int? IndexNumber { get; set; }
public int? ParentIndexNumber { get; set; }

View File

@@ -1,4 +1,3 @@
#nullable enable
#pragma warning disable CS1591
using System;

View File

@@ -1,5 +1,3 @@
#nullable enable
using System;
namespace MediaBrowser.Model.Plugins

View File

@@ -1,5 +1,3 @@
#nullable enable
namespace MediaBrowser.Model.Plugins
{
/// <summary>

View File

@@ -1,75 +0,0 @@
#nullable disable
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Querying
{
public class EpisodeQuery
{
public EpisodeQuery()
{
Fields = Array.Empty<ItemFields>();
}
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
/// <value>The user identifier.</value>
public string UserId { get; set; }
/// <summary>
/// Gets or sets the season identifier.
/// </summary>
/// <value>The season identifier.</value>
public string SeasonId { get; set; }
/// <summary>
/// Gets or sets the series identifier.
/// </summary>
/// <value>The series identifier.</value>
public string SeriesId { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is missing.
/// </summary>
/// <value><c>null</c> if [is missing] contains no value, <c>true</c> if [is missing]; otherwise, <c>false</c>.</value>
public bool? IsMissing { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is virtual unaired.
/// </summary>
/// <value><c>null</c> if [is virtual unaired] contains no value, <c>true</c> if [is virtual unaired]; otherwise, <c>false</c>.</value>
public bool? IsVirtualUnaired { get; set; }
/// <summary>
/// Gets or sets the season number.
/// </summary>
/// <value>The season number.</value>
public int? SeasonNumber { get; set; }
/// <summary>
/// Gets or sets the fields.
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
/// <summary>
/// Gets or sets the start index.
/// </summary>
/// <value>The start index.</value>
public int? StartIndex { get; set; }
/// <summary>
/// Gets or sets the limit.
/// </summary>
/// <value>The limit.</value>
public int? Limit { get; set; }
/// <summary>
/// Gets or sets the start item identifier.
/// </summary>
/// <value>The start item identifier.</value>
public string StartItemId { get; set; }
}
}

View File

@@ -1,47 +0,0 @@
#nullable disable
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Querying
{
public class MovieRecommendationQuery
{
public MovieRecommendationQuery()
{
ItemLimit = 10;
CategoryLimit = 6;
Fields = Array.Empty<ItemFields>();
}
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
/// <value>The user identifier.</value>
public string UserId { get; set; }
/// <summary>
/// Gets or sets the parent identifier.
/// </summary>
/// <value>The parent identifier.</value>
public string ParentId { get; set; }
/// <summary>
/// Gets or sets the item limit.
/// </summary>
/// <value>The item limit.</value>
public int ItemLimit { get; set; }
/// <summary>
/// Gets or sets the category limit.
/// </summary>
/// <value>The category limit.</value>
public int CategoryLimit { get; set; }
/// <summary>
/// Gets or sets the fields.
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
}
}

View File

@@ -13,6 +13,7 @@ namespace MediaBrowser.Model.Querying
EnableImageTypes = Array.Empty<ImageType>();
EnableTotalRecordCount = true;
DisableFirstEpisode = false;
NextUpDateCutoff = DateTime.MinValue;
}
/// <summary>
@@ -75,5 +76,10 @@ namespace MediaBrowser.Model.Querying
/// Gets or sets a value indicating whether do disable sending first episode as next up.
/// </summary>
public bool DisableFirstEpisode { get; set; }
/// <summary>
/// Gets or sets a value indicating the oldest date for a show to appear in Next Up.
/// </summary>
public DateTime NextUpDateCutoff { get; set; }
}
}

View File

@@ -1,64 +0,0 @@
#nullable disable
#pragma warning disable CS1591
using System;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Querying
{
public class UpcomingEpisodesQuery
{
public UpcomingEpisodesQuery()
{
EnableImageTypes = Array.Empty<ImageType>();
}
/// <summary>
/// Gets or sets the user id.
/// </summary>
/// <value>The user id.</value>
public string UserId { get; set; }
/// <summary>
/// Gets or sets the parent identifier.
/// </summary>
/// <value>The parent identifier.</value>
public string ParentId { get; set; }
/// <summary>
/// Gets or sets the start index. Use for paging.
/// </summary>
/// <value>The start index.</value>
public int? StartIndex { get; set; }
/// <summary>
/// Gets or sets the maximum number of items to return.
/// </summary>
/// <value>The limit.</value>
public int? Limit { get; set; }
/// <summary>
/// Gets or sets the fields to return within the items, in addition to basic information.
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [enable images].
/// </summary>
/// <value><c>null</c> if [enable images] contains no value, <c>true</c> if [enable images]; otherwise, <c>false</c>.</value>
public bool? EnableImages { get; set; }
/// <summary>
/// Gets or sets the image type limit.
/// </summary>
/// <value>The image type limit.</value>
public int? ImageTypeLimit { get; set; }
/// <summary>
/// Gets or sets the enable image types.
/// </summary>
/// <value>The enable image types.</value>
public ImageType[] EnableImageTypes { get; set; }
}
}

View File

@@ -1,22 +0,0 @@
#pragma warning disable CS1591
namespace MediaBrowser.Model.Sync
{
public enum SyncCategory
{
/// <summary>
/// The latest.
/// </summary>
Latest = 0,
/// <summary>
/// The next up.
/// </summary>
NextUp = 1,
/// <summary>
/// The resume.
/// </summary>
Resume = 2
}
}

View File

@@ -1,135 +0,0 @@
#nullable disable
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Sync
{
public class SyncJob
{
public SyncJob()
{
RequestedItemIds = Array.Empty<Guid>();
}
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public string Id { get; set; }
/// <summary>
/// Gets or sets the device identifier.
/// </summary>
/// <value>The device identifier.</value>
public string TargetId { get; set; }
/// <summary>
/// Gets or sets the name of the target.
/// </summary>
/// <value>The name of the target.</value>
public string TargetName { get; set; }
/// <summary>
/// Gets or sets the quality.
/// </summary>
/// <value>The quality.</value>
public string Quality { get; set; }
/// <summary>
/// Gets or sets the bitrate.
/// </summary>
/// <value>The bitrate.</value>
public int? Bitrate { get; set; }
/// <summary>
/// Gets or sets the profile.
/// </summary>
/// <value>The profile.</value>
public string Profile { get; set; }
/// <summary>
/// Gets or sets the category.
/// </summary>
/// <value>The category.</value>
public SyncCategory? Category { get; set; }
/// <summary>
/// Gets or sets the parent identifier.
/// </summary>
/// <value>The parent identifier.</value>
public string ParentId { get; set; }
/// <summary>
/// Gets or sets the current progress.
/// </summary>
/// <value>The current progress.</value>
public double? Progress { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the status.
/// </summary>
/// <value>The status.</value>
public SyncJobStatus Status { get; set; }
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
/// <value>The user identifier.</value>
public string UserId { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [unwatched only].
/// </summary>
/// <value><c>true</c> if [unwatched only]; otherwise, <c>false</c>.</value>
public bool UnwatchedOnly { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [synchronize new content].
/// </summary>
/// <value><c>true</c> if [synchronize new content]; otherwise, <c>false</c>.</value>
public bool SyncNewContent { get; set; }
/// <summary>
/// Gets or sets the item limit.
/// </summary>
/// <value>The item limit.</value>
public int? ItemLimit { get; set; }
/// <summary>
/// Gets or sets the requested item ids.
/// </summary>
/// <value>The requested item ids.</value>
public Guid[] RequestedItemIds { get; set; }
/// <summary>
/// Gets or sets the date created.
/// </summary>
/// <value>The date created.</value>
public DateTime DateCreated { get; set; }
/// <summary>
/// Gets or sets the date last modified.
/// </summary>
/// <value>The date last modified.</value>
public DateTime DateLastModified { get; set; }
/// <summary>
/// Gets or sets the item count.
/// </summary>
/// <value>The item count.</value>
public int ItemCount { get; set; }
public string ParentName { get; set; }
public string PrimaryImageItemId { get; set; }
public string PrimaryImageTag { get; set; }
}
}

View File

@@ -1,15 +0,0 @@
#pragma warning disable CS1591
namespace MediaBrowser.Model.Sync
{
public enum SyncJobStatus
{
Queued = 0,
Converting = 1,
ReadyToTransfer = 2,
Transferring = 3,
Completed = 4,
CompletedWithError = 5,
Failed = 6
}
}

View File

@@ -1,20 +0,0 @@
#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Sync
{
public class SyncTarget
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public string Id { get; set; }
}
}

View File

@@ -11,12 +11,12 @@ namespace MediaBrowser.Model.Tasks
/// <summary>
/// Fires when the trigger condition is satisfied and the task should run.
/// </summary>
event EventHandler<EventArgs> Triggered;
event EventHandler<EventArgs>? Triggered;
/// <summary>
/// Gets or sets the options of this task.
/// Gets the options of this task.
/// </summary>
TaskOptions TaskOptions { get; set; }
TaskOptions TaskOptions { get; }
/// <summary>
/// Stars waiting for the trigger action.

View File

@@ -1,4 +1,3 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
@@ -16,7 +15,6 @@ namespace MediaBrowser.Model.Updates
public PackageInfo()
{
Versions = Array.Empty<VersionInfo>();
Id = string.Empty;
Category = string.Empty;
Name = string.Empty;
Overview = string.Empty;
@@ -65,7 +63,7 @@ namespace MediaBrowser.Model.Updates
/// </summary>
/// <value>The name.</value>
[JsonPropertyName("guid")]
public string Id { get; set; }
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the versions.

View File

@@ -1,5 +1,3 @@
#nullable enable
using System.Text.Json.Serialization;
using SysVersion = System.Version;

View File

@@ -1,24 +0,0 @@
#nullable disable
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.Users
{
public class UserAction
{
public string Id { get; set; }
public string ServerId { get; set; }
public Guid UserId { get; set; }
public Guid ItemId { get; set; }
public UserActionType Type { get; set; }
public DateTime Date { get; set; }
public long? PositionTicks { get; set; }
}
}