Skip to content

Commit 4699246

Browse files
committed
Adapted code style
1 parent 1699519 commit 4699246

4 files changed

Lines changed: 21 additions & 29 deletions

File tree

‎SpotifyAPI.Example/WebControl.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private void authButton_Click(object sender, EventArgs e)
128128

129129
private async void RunAuthentication()
130130
{
131-
WebApiFactory webApiFactory = new WebApiFactory(
131+
WebAPIFactory webApiFactory = new WebAPIFactory(
132132
"http://localhost",
133133
8000,
134134
"26d287105e31491889f3cd293d85bfea",

‎SpotifyAPI/Local/SpotifyLocalAPI.cs‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,9 @@ public ISynchronizeInvoke SynchronizingObject
6060

6161
public event EventHandler<TrackTimeChangeEventArgs> OnTrackTimeChange;
6262

63-
public SpotifyLocalAPI()
63+
public SpotifyLocalAPI(int timerIntervall = 50)
6464
{
6565
_rh = new RemoteHandler();
66-
67-
AttachTimer(50);
68-
}
69-
70-
public SpotifyLocalAPI(int timerIntervall)
71-
{
72-
_rh = new RemoteHandler();
73-
7466
AttachTimer(timerIntervall);
7567
}
7668

‎SpotifyAPI/SpotifyAPI.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
</Compile>
5959
<Compile Include="Local\Models\SpotifyUri.cs" />
6060
<Compile Include="Local\VolumeMixerControl.cs" />
61-
<Compile Include="Web\Auth\WebApiFactory.cs" />
61+
<Compile Include="Web\Auth\WebAPIFactory.cs" />
6262
<Compile Include="Web\Enums\TimeRangeType.cs" />
6363
<Compile Include="Web\IClient.cs" />
6464
<Compile Include="Local\Models\CFID.cs" />

‎SpotifyAPI/Web/Auth/WebApiFactory.cs‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@
66

77
namespace SpotifyAPI.Web.Auth
88
{
9-
public class WebApiFactory
9+
public class WebAPIFactory
1010
{
11-
private readonly string m_RedirectUrl;
12-
private readonly int m_ListeningPort;
13-
private readonly string m_ClientId;
14-
private readonly TimeSpan m_Timeout;
15-
private Scope m_Scope;
11+
private readonly string _redirectUrl;
12+
private readonly int _listeningPort;
13+
private readonly string _clientId;
14+
private readonly TimeSpan _timeout;
15+
private readonly Scope _scope;
1616

17-
public WebApiFactory(string redirectUrl, int listeningPort, string clientId, Scope scope, TimeSpan timeout)
17+
public WebAPIFactory(string redirectUrl, int listeningPort, string clientId, Scope scope, TimeSpan timeout)
1818
{
19-
m_RedirectUrl = redirectUrl;
20-
m_ListeningPort = listeningPort;
21-
m_ClientId = clientId;
22-
m_Scope = scope;
23-
m_Timeout = timeout;
19+
_redirectUrl = redirectUrl;
20+
_listeningPort = listeningPort;
21+
_clientId = clientId;
22+
_scope = scope;
23+
_timeout = timeout;
2424
}
2525

2626
public Task<SpotifyWebAPI> GetWebApi()
2727
{
2828
var authentication = new ImplicitGrantAuth
2929
{
30-
RedirectUri = $"{m_RedirectUrl}:{m_ListeningPort}",
31-
ClientId = m_ClientId,
32-
Scope = m_Scope,
30+
RedirectUri = $"{_redirectUrl}:{_listeningPort}",
31+
ClientId = _clientId,
32+
Scope = _scope,
3333
State = "XSS"
3434
};
3535

@@ -43,13 +43,13 @@ public Task<SpotifyWebAPI> GetWebApi()
4343

4444
try
4545
{
46-
authentication.StartHttpServer(m_ListeningPort);
46+
authentication.StartHttpServer(_listeningPort);
4747

4848
authentication.DoAuth();
4949

50-
authenticationWaitFlag.WaitOne(m_Timeout);
50+
authenticationWaitFlag.WaitOne(_timeout);
5151
if (spotifyWebApi == null)
52-
throw new TimeoutException($"No valid response received for the last {m_Timeout.TotalSeconds} seconds");
52+
throw new TimeoutException($"No valid response received for the last {_timeout.TotalSeconds} seconds");
5353
}
5454
finally
5555
{

0 commit comments

Comments
 (0)