mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-19 22:20:33 +01:00
Merge branch 'master' into userdb-efcore
# Conflicts: # Emby.Server.Implementations/Library/UserManager.cs # Jellyfin.Data/Jellyfin.Data.csproj # MediaBrowser.Api/UserService.cs # MediaBrowser.Controller/Library/IUserManager.cs
This commit is contained in:
23
MediaBrowser.Model/Configuration/SyncplayAccess.cs
Normal file
23
MediaBrowser.Model/Configuration/SyncplayAccess.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// Class PublicUserDto. Its goal is to show only public information about a user
|
||||
/// </summary>
|
||||
public class PublicUserDto : IItemDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the primary image tag.
|
||||
/// </summary>
|
||||
/// <value>The primary image tag.</value>
|
||||
public string PrimaryImageTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance has password.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance has password; otherwise, <c>false</c>.</value>
|
||||
public bool HasPassword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance has configured password.
|
||||
/// Note that in this case this method should not be here, but it is necessary when changing password at the
|
||||
/// first login.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance has configured password; otherwise, <c>false</c>.</value>
|
||||
public bool HasConfiguredPassword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the primary image aspect ratio.
|
||||
/// </summary>
|
||||
/// <value>The primary image aspect ratio.</value>
|
||||
public double? PrimaryImageAspectRatio { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
return Name ?? base.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,8 +34,22 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <value>The language.</value>
|
||||
public string Language { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color transfer.
|
||||
/// </summary>
|
||||
/// <value>The color transfer.</value>
|
||||
public string ColorTransfer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color primaries.
|
||||
/// </summary>
|
||||
/// <value>The color primaries.</value>
|
||||
public string ColorPrimaries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color space.
|
||||
/// </summary>
|
||||
/// <value>The color space.</value>
|
||||
public string ColorSpace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -44,11 +58,28 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <value>The comment.</value>
|
||||
public string Comment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the time base.
|
||||
/// </summary>
|
||||
/// <value>The time base.</value>
|
||||
public string TimeBase { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the codec time base.
|
||||
/// </summary>
|
||||
/// <value>The codec time base.</value>
|
||||
public string CodecTimeBase { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the title.
|
||||
/// </summary>
|
||||
/// <value>The title.</value>
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the video range.
|
||||
/// </summary>
|
||||
/// <value>The video range.</value>
|
||||
public string VideoRange
|
||||
{
|
||||
get
|
||||
@@ -60,7 +91,8 @@ namespace MediaBrowser.Model.Entities
|
||||
|
||||
var colorTransfer = ColorTransfer;
|
||||
|
||||
if (string.Equals(colorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(colorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(colorTransfer, "arib-std-b67", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "HDR";
|
||||
}
|
||||
@@ -70,7 +102,9 @@ namespace MediaBrowser.Model.Entities
|
||||
}
|
||||
|
||||
public string localizedUndefined { get; set; }
|
||||
|
||||
public string localizedDefault { get; set; }
|
||||
|
||||
public string localizedForced { get; set; }
|
||||
|
||||
public string DisplayTitle
|
||||
@@ -197,34 +231,34 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
if (i.IsInterlaced)
|
||||
{
|
||||
return "1440I";
|
||||
return "1440i";
|
||||
}
|
||||
return "1440P";
|
||||
return "1440p";
|
||||
}
|
||||
if (width >= 1900 || height >= 1000)
|
||||
{
|
||||
if (i.IsInterlaced)
|
||||
{
|
||||
return "1080I";
|
||||
return "1080i";
|
||||
}
|
||||
return "1080P";
|
||||
return "1080p";
|
||||
}
|
||||
if (width >= 1260 || height >= 700)
|
||||
{
|
||||
if (i.IsInterlaced)
|
||||
{
|
||||
return "720I";
|
||||
return "720i";
|
||||
}
|
||||
return "720P";
|
||||
return "720p";
|
||||
}
|
||||
if (width >= 700 || height >= 440)
|
||||
{
|
||||
|
||||
if (i.IsInterlaced)
|
||||
{
|
||||
return "480I";
|
||||
return "480i";
|
||||
}
|
||||
return "480P";
|
||||
return "480p";
|
||||
}
|
||||
|
||||
return "SD";
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.4" />
|
||||
<PackageReference Include="System.Globalization" Version="4.3.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="4.7.1" />
|
||||
<PackageReference Include="System.Text.Json" Version="4.7.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace MediaBrowser.Model.Net
|
||||
{ ".m3u8", "application/x-mpegURL" },
|
||||
{ ".map", "application/x-javascript" },
|
||||
{ ".mobi", "application/x-mobipocket-ebook" },
|
||||
{ ".opf", "application/oebps-package+xml" },
|
||||
{ ".pdf", "application/pdf" },
|
||||
{ ".rar", "application/vnd.rar" },
|
||||
{ ".srt", "application/x-subrip" },
|
||||
@@ -99,6 +100,7 @@ namespace MediaBrowser.Model.Net
|
||||
{ ".ssa", "text/x-ssa" },
|
||||
{ ".css", "text/css" },
|
||||
{ ".csv", "text/csv" },
|
||||
{ ".edl", "text/plain" },
|
||||
{ ".rtf", "text/rtf" },
|
||||
{ ".txt", "text/plain" },
|
||||
{ ".vtt", "text/vtt" },
|
||||
|
||||
40
MediaBrowser.Model/SyncPlay/GroupInfoView.cs
Normal file
40
MediaBrowser.Model/SyncPlay/GroupInfoView.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Class GroupInfoView.
|
||||
/// </summary>
|
||||
public class GroupInfoView
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the group identifier.
|
||||
/// </summary>
|
||||
/// <value>The group identifier.</value>
|
||||
public string GroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the playing item id.
|
||||
/// </summary>
|
||||
/// <value>The playing item id.</value>
|
||||
public string PlayingItemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the playing item name.
|
||||
/// </summary>
|
||||
/// <value>The playing item name.</value>
|
||||
public string PlayingItemName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position ticks.
|
||||
/// </summary>
|
||||
/// <value>The position ticks.</value>
|
||||
public long PositionTicks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the participants.
|
||||
/// </summary>
|
||||
/// <value>The participants.</value>
|
||||
public IReadOnlyList<string> Participants { get; set; }
|
||||
}
|
||||
}
|
||||
26
MediaBrowser.Model/SyncPlay/GroupUpdate.cs
Normal file
26
MediaBrowser.Model/SyncPlay/GroupUpdate.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Class GroupUpdate.
|
||||
/// </summary>
|
||||
public class GroupUpdate<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the group identifier.
|
||||
/// </summary>
|
||||
/// <value>The group identifier.</value>
|
||||
public string GroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the update type.
|
||||
/// </summary>
|
||||
/// <value>The update type.</value>
|
||||
public GroupUpdateType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the data.
|
||||
/// </summary>
|
||||
/// <value>The data.</value>
|
||||
public T Data { get; set; }
|
||||
}
|
||||
}
|
||||
53
MediaBrowser.Model/SyncPlay/GroupUpdateType.cs
Normal file
53
MediaBrowser.Model/SyncPlay/GroupUpdateType.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum GroupUpdateType.
|
||||
/// </summary>
|
||||
public enum GroupUpdateType
|
||||
{
|
||||
/// <summary>
|
||||
/// 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>
|
||||
LibraryAccessDenied
|
||||
}
|
||||
}
|
||||
22
MediaBrowser.Model/SyncPlay/JoinGroupRequest.cs
Normal file
22
MediaBrowser.Model/SyncPlay/JoinGroupRequest.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Class JoinGroupRequest.
|
||||
/// </summary>
|
||||
public class JoinGroupRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Group id.
|
||||
/// </summary>
|
||||
/// <value>The Group id to join.</value>
|
||||
public Guid GroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the playing item id.
|
||||
/// </summary>
|
||||
/// <value>The client's currently playing item id.</value>
|
||||
public Guid PlayingItemId { get; set; }
|
||||
}
|
||||
}
|
||||
34
MediaBrowser.Model/SyncPlay/PlaybackRequest.cs
Normal file
34
MediaBrowser.Model/SyncPlay/PlaybackRequest.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Class PlaybackRequest.
|
||||
/// </summary>
|
||||
public class PlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the request type.
|
||||
/// </summary>
|
||||
/// <value>The request type.</value>
|
||||
public PlaybackRequestType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets when the request has been made by the client.
|
||||
/// </summary>
|
||||
/// <value>The date of the request.</value>
|
||||
public DateTime? When { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position ticks.
|
||||
/// </summary>
|
||||
/// <value>The position ticks.</value>
|
||||
public long? PositionTicks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ping time.
|
||||
/// </summary>
|
||||
/// <value>The ping time.</value>
|
||||
public long? Ping { get; set; }
|
||||
}
|
||||
}
|
||||
33
MediaBrowser.Model/SyncPlay/PlaybackRequestType.cs
Normal file
33
MediaBrowser.Model/SyncPlay/PlaybackRequestType.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum PlaybackRequestType
|
||||
/// </summary>
|
||||
public enum PlaybackRequestType
|
||||
{
|
||||
/// <summary>
|
||||
/// 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>
|
||||
UpdatePing = 5
|
||||
}
|
||||
}
|
||||
38
MediaBrowser.Model/SyncPlay/SendCommand.cs
Normal file
38
MediaBrowser.Model/SyncPlay/SendCommand.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Class SendCommand.
|
||||
/// </summary>
|
||||
public class SendCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the group identifier.
|
||||
/// </summary>
|
||||
/// <value>The group identifier.</value>
|
||||
public string GroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the UTC time when to execute the command.
|
||||
/// </summary>
|
||||
/// <value>The UTC time when to execute the command.</value>
|
||||
public string When { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position ticks.
|
||||
/// </summary>
|
||||
/// <value>The position ticks.</value>
|
||||
public long? PositionTicks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the command.
|
||||
/// </summary>
|
||||
/// <value>The command.</value>
|
||||
public SendCommandType Command { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the UTC time when this command has been emitted.
|
||||
/// </summary>
|
||||
/// <value>The UTC time when this command has been emitted.</value>
|
||||
public string EmittedAt { get; set; }
|
||||
}
|
||||
}
|
||||
21
MediaBrowser.Model/SyncPlay/SendCommandType.cs
Normal file
21
MediaBrowser.Model/SyncPlay/SendCommandType.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum SendCommandType.
|
||||
/// </summary>
|
||||
public enum SendCommandType
|
||||
{
|
||||
/// <summary>
|
||||
/// 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>
|
||||
Seek = 2
|
||||
}
|
||||
}
|
||||
20
MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs
Normal file
20
MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace MediaBrowser.Model.SyncPlay
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UtcTimeResponse.
|
||||
/// </summary>
|
||||
public class UtcTimeResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the UTC time when request has been received.
|
||||
/// </summary>
|
||||
/// <value>The UTC time when request has been received.</value>
|
||||
public string RequestReceptionTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the UTC time when response has been sent.
|
||||
/// </summary>
|
||||
/// <value>The UTC time when response has been sent.</value>
|
||||
public string ResponseTransmissionTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -85,6 +85,12 @@ namespace MediaBrowser.Model.Users
|
||||
public string AuthenticationProviderId { get; set; }
|
||||
public string PasswordResetProviderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating what SyncPlay features the user can access.
|
||||
/// </summary>
|
||||
/// <value>Access level to SyncPlay features.</value>
|
||||
public SyncPlayAccess SyncPlayAccess { get; set; }
|
||||
|
||||
public UserPolicy()
|
||||
{
|
||||
IsHidden = true;
|
||||
@@ -130,6 +136,7 @@ namespace MediaBrowser.Model.Users
|
||||
EnableContentDownloading = true;
|
||||
EnablePublicSharing = true;
|
||||
EnableRemoteAccess = true;
|
||||
SyncPlayAccess = SyncPlayAccess.CreateAndJoinGroups;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user