mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-06 07:48:50 +01:00
update connect
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Model.ApiClient
|
||||
{
|
||||
public class ConnectionResult
|
||||
{
|
||||
public ConnectionState State { get; set; }
|
||||
public ServerInfo ServerInfo { get; set; }
|
||||
public List<ServerInfo> Servers { get; set; }
|
||||
public IApiClient ApiClient { get; set; }
|
||||
|
||||
public ConnectionResult()
|
||||
{
|
||||
State = ConnectionState.Unavailable;
|
||||
Servers = new List<ServerInfo>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace MediaBrowser.Model.ApiClient
|
||||
{
|
||||
Unavailable = 1,
|
||||
ServerSignIn = 2,
|
||||
SignedIn = 3
|
||||
SignedIn = 3,
|
||||
ServerSelection = 4
|
||||
}
|
||||
}
|
||||
@@ -1350,5 +1350,12 @@ namespace MediaBrowser.Model.ApiClient
|
||||
/// </summary>
|
||||
/// <returns>Task<DevicesOptions>.</returns>
|
||||
Task<DevicesOptions> GetDevicesOptions();
|
||||
|
||||
/// <summary>
|
||||
/// Opens the web socket.
|
||||
/// </summary>
|
||||
/// <param name="webSocketFactory">The web socket factory.</param>
|
||||
/// <param name="keepAliveTimerMs">The keep alive timer ms.</param>
|
||||
void OpenWebSocket(Func<IClientWebSocket> webSocketFactory, int keepAliveTimerMs = 60000);
|
||||
}
|
||||
}
|
||||
54
MediaBrowser.Model/ApiClient/IClientWebSocket.cs
Normal file
54
MediaBrowser.Model/ApiClient/IClientWebSocket.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using MediaBrowser.Model.Net;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Model.ApiClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface IClientWebSocket
|
||||
/// </summary>
|
||||
public interface IClientWebSocket : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Occurs when [closed].
|
||||
/// </summary>
|
||||
event EventHandler Closed;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the state.
|
||||
/// </summary>
|
||||
/// <value>The state.</value>
|
||||
WebSocketState State { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Connects the async.
|
||||
/// </summary>
|
||||
/// <param name="url">The URL.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task ConnectAsync(string url, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the receive action.
|
||||
/// </summary>
|
||||
/// <value>The receive action.</value>
|
||||
Action<byte[]> OnReceiveBytes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the on receive.
|
||||
/// </summary>
|
||||
/// <value>The on receive.</value>
|
||||
Action<string> OnReceive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sends the async.
|
||||
/// </summary>
|
||||
/// <param name="bytes">The bytes.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="endOfMessage">if set to <c>true</c> [end of message].</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task SendAsync(byte[] bytes, WebSocketMessageType type, bool endOfMessage, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
@@ -53,5 +53,17 @@ namespace MediaBrowser.Model.ApiClient
|
||||
/// </summary>
|
||||
/// <returns>Task<ConnectionResult>.</returns>
|
||||
Task<ConnectionResult> Logout();
|
||||
|
||||
/// <summary>
|
||||
/// Logins to connect.
|
||||
/// </summary>
|
||||
/// <returns>Task.</returns>
|
||||
Task LoginToConnect(string username, string password);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the active api client instance
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
IApiClient CurrentApiClient { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace MediaBrowser.Model.ApiClient
|
||||
public String UserId { get; set; }
|
||||
public String AccessToken { get; set; }
|
||||
public List<WakeOnLanInfo> WakeOnLanInfos { get; set; }
|
||||
public DateTime DateLastAccessed { get; set; }
|
||||
|
||||
public ServerInfo()
|
||||
{
|
||||
|
||||
11
MediaBrowser.Model/Connect/ConnectAuthorization.cs
Normal file
11
MediaBrowser.Model/Connect/ConnectAuthorization.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
namespace MediaBrowser.Model.Connect
|
||||
{
|
||||
public class ConnectAuthorization
|
||||
{
|
||||
public string ConnectUserId { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string ImageUrl { get; set; }
|
||||
public string Id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,10 @@ namespace MediaBrowser.Model.Connect
|
||||
/// <summary>
|
||||
/// The linked user
|
||||
/// </summary>
|
||||
LinkedUser = 1,
|
||||
LinkedUser = 0,
|
||||
/// <summary>
|
||||
/// The guest
|
||||
/// </summary>
|
||||
Guest = 2
|
||||
Guest = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,35 @@
|
||||
using System;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Session;
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Devices
|
||||
{
|
||||
public class DeviceInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// Gets or sets the name of the reported.
|
||||
/// </summary>
|
||||
/// <value>The name of the reported.</value>
|
||||
public string ReportedName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the custom.
|
||||
/// </summary>
|
||||
/// <value>The name of the custom.</value>
|
||||
public string CustomName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the camera upload path.
|
||||
/// </summary>
|
||||
/// <value>The camera upload path.</value>
|
||||
public string CameraUploadPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name { get; set; }
|
||||
public string Name
|
||||
{
|
||||
get { return string.IsNullOrEmpty(CustomName) ? ReportedName : CustomName; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier.
|
||||
/// </summary>
|
||||
|
||||
17
MediaBrowser.Model/Devices/DeviceOptions.cs
Normal file
17
MediaBrowser.Model/Devices/DeviceOptions.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
namespace MediaBrowser.Model.Devices
|
||||
{
|
||||
public class DeviceOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the custom.
|
||||
/// </summary>
|
||||
/// <value>The name of the custom.</value>
|
||||
public string CustomName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the camera upload path.
|
||||
/// </summary>
|
||||
/// <value>The camera upload path.</value>
|
||||
public string CameraUploadPath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -232,6 +232,7 @@ namespace MediaBrowser.Model.Dto
|
||||
/// Gets or sets the recursive unplayed item count.
|
||||
/// </summary>
|
||||
/// <value>The recursive unplayed item count.</value>
|
||||
[Obsolete]
|
||||
public int? RecursiveUnplayedItemCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
<Compile Include="ApiClient\HttpResponseEventArgs.cs" />
|
||||
<Compile Include="ApiClient\IApiClient.cs" />
|
||||
<Compile Include="ApiClient\ApiClientExtensions.cs" />
|
||||
<Compile Include="ApiClient\IClientWebSocket.cs" />
|
||||
<Compile Include="ApiClient\IConnectionManager.cs" />
|
||||
<Compile Include="ApiClient\IDevice.cs" />
|
||||
<Compile Include="ApiClient\IServerEvents.cs" />
|
||||
@@ -95,7 +96,9 @@
|
||||
<Compile Include="Configuration\PeopleMetadataOptions.cs" />
|
||||
<Compile Include="Configuration\XbmcMetadataOptions.cs" />
|
||||
<Compile Include="Configuration\SubtitlePlaybackMode.cs" />
|
||||
<Compile Include="Connect\ConnectAuthorization.cs" />
|
||||
<Compile Include="Connect\UserLinkType.cs" />
|
||||
<Compile Include="Devices\DeviceOptions.cs" />
|
||||
<Compile Include="Devices\LocalFileInfo.cs" />
|
||||
<Compile Include="Devices\DeviceInfo.cs" />
|
||||
<Compile Include="Devices\DevicesOptions.cs" />
|
||||
|
||||
Reference in New Issue
Block a user