Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Replace old references with current ones; remove dead code #1

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

chaosinnovator
Copy link

Not 100% sure if this has exact parity with the server's API, but it builds and works.

Copy link
Member

@Bond-009 Bond-009 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the Uri changes?

Jellyfin.ApiClient/ApiWebSocket.cs Show resolved Hide resolved
Jellyfin.ApiClient/ApiWebSocket.cs Show resolved Hide resolved
Jellyfin.ApiClient/BaseApiClient.cs Show resolved Hide resolved
Jellyfin.ApiClient/ApiWebSocket.cs Outdated Show resolved Hide resolved
Jellyfin.ApiClient/ApiWebSocket.cs Outdated Show resolved Hide resolved
Jellyfin.ApiClient/Model/ConnectionResult.cs Show resolved Hide resolved
Jellyfin.ApiClient/Net/NetworkConnection.cs Outdated Show resolved Hide resolved
Jellyfin.ApiClient/WebSocket/WebSocketMessageType.cs Outdated Show resolved Hide resolved
Jellyfin.ApiClient/WebSocket/WebSocketState.cs Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Jellyfin.ApiClient/ApiClient.cs Outdated Show resolved Hide resolved
Copy link
Member

@Bond-009 Bond-009 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do a quick overview of the diff if you do find+replace changes to prevent having to wait for review to find out about little unintended changes. ;)

Jellyfin.ApiClient/ApiClient.cs Outdated Show resolved Hide resolved
Jellyfin.ApiClient/ApiClient.cs Outdated Show resolved Hide resolved
{
/// <summary>
/// Provides api methods centered around an HttpClient
/// </summary>
public partial class ApiClient : BaseApiClient, IApiClient
{
public event EventHandler<GenericEventArgs<RemoteLogoutReason>> RemoteLoggedOut;
public event EventHandler<GenericEventArgs<AuthenticationResult>> Authenticated;
public event EventHandler<GenericEventArgs<AuthenticationResult>> OnAuthenticated;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this get changed?

}

var dict = new QueryStringDictionary { };
var dict = new NameValueCollection { };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var dict = new NameValueCollection { };
var dict = new NameValueCollection();

{
if (query == null)
{
throw new ArgumentNullException("query");
}

var dict = new QueryStringDictionary { };
var dict = new NameValueCollection{ };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var dict = new NameValueCollection{ };
var dict = new NameValueCollection();

{
if (query == null)
{
throw new ArgumentNullException("query");
}

var dict = new QueryStringDictionary { };
var dict = new NameValueCollection { };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var dict = new NameValueCollection { };
var dict = new NameValueCollection();

@@ -1173,7 +1109,7 @@ public Task SendMessageCommandAsync(string sessionId, MessageCommand command)

if (command.TimeoutMs.HasValue)
{
cmd.Arguments["Timeout"] = command.TimeoutMs.Value.ToString(CultureInfo.InvariantCulture);
cmd.Arguments["Timeout"] = command.TimeoutMs?.ToString(CultureInfo.InvariantCulture);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

@@ -98,7 +97,7 @@ private async void Receive()
}
catch (Exception ex)
{
_logger.ErrorException("Error receiving web socket message", ex);
_logger.LogError("Error receiving web socket message", ex);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_logger.LogError("Error receiving web socket message", ex);
_logger.LogError(ex, "Error receiving web socket message");

{
_logger.Warn("Unrecognized WebSocketMessageType: {0}", type.ToString());
_logger.LogWarning("Unrecognized WebSocketMessageType: {0}", type.ToString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_logger.LogWarning("Unrecognized WebSocketMessageType: {0}", type.ToString());
_logger.LogWarning("Unrecognized WebSocketMessageType: {0}", type);

{
_logger.Warn("Unrecognized WebSocketState: {0}", _client.State.ToString());
_logger.LogWarning("Unrecognized WebSocketState: {0}", _client.State.ToString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_logger.LogWarning("Unrecognized WebSocketState: {0}", _client.State.ToString());
_logger.LogWarning("Unrecognized WebSocketState: {0}", _client.State);


_socket.Open();

_socket.Opened += (sender, args) => taskCompletionSource.TrySetResult(true);
_socket.Closed += _socket_Closed;
_socket.Closed += Socket_Closed;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_socket.Closed += Socket_Closed;
_socket.Closed += OnSocketClosed;


_socket.MessageReceived += websocket_MessageReceived;
_socket.MessageReceived += Websocket_MessageReceived;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_socket.MessageReceived += Websocket_MessageReceived;
_socket.MessageReceived += OnWebsocketMessageReceived;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants