Skip to content

Commit adeac7b

Browse files
author
Johnny @PC
committed
Simplified String -> string
1 parent c8637e3 commit adeac7b

33 files changed

Lines changed: 343 additions & 343 deletions

‎SpotifyAPI/Local/Models/CFID.cs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ namespace SpotifyAPI.Local.Models
88
internal class Cfid
99
{
1010
public Error Error { get; set; }
11-
public String Token { get; set; }
12-
public String Version { get; set; }
13-
public String ClientVersion { get; set; }
11+
public string Token { get; set; }
12+
public string Version { get; set; }
13+
public string ClientVersion { get; set; }
1414
public Boolean Running { get; set; }
1515
}
1616

@@ -19,7 +19,7 @@ internal class Cfid
1919
/// </summary>
2020
internal class Error
2121
{
22-
public String Type { get; set; }
23-
public String Message { get; set; }
22+
public string Type { get; set; }
23+
public string Message { get; set; }
2424
}
2525
}

‎SpotifyAPI/Local/Models/SpotifyResource.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ namespace SpotifyAPI.Local.Models
66
public class SpotifyResource
77
{
88
[JsonProperty("name")]
9-
public String Name { get; set; }
9+
public string Name { get; set; }
1010

1111
[JsonProperty("uri")]
12-
public String Uri { get; set; }
12+
public string Uri { get; set; }
1313

1414
[JsonProperty("location")]
1515
public TrackResourceLocation Location { get; set; }

‎SpotifyAPI/Local/Models/SpotifyUri.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public SpotifyUri(string uriBase, string uriType, string uriId)
2121

2222
public static SpotifyUri Parse(string uri)
2323
{
24-
if (String.IsNullOrEmpty(uri))
24+
if (string.IsNullOrEmpty(uri))
2525
throw new ArgumentNullException("Uri");
2626

2727
string[] props = uri.Split(':');

‎SpotifyAPI/Local/Models/Track.cs‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public bool IsAd()
4343
/// </summary>
4444
/// <param name="size">AlbumArtSize (160,320,640)</param>
4545
/// <returns>A String, which is the URL to the Albumart</returns>
46-
public String GetAlbumArtUrl(AlbumArtSize size)
46+
public string GetAlbumArtUrl(AlbumArtSize size)
4747
{
4848
if (AlbumResource.Uri == null || !AlbumResource.Uri.Contains("spotify:album:") || AlbumResource.Uri.Contains("spotify:album:0000000000000000000000"))
4949
return "";
@@ -63,7 +63,7 @@ public String GetAlbumArtUrl(AlbumArtSize size)
6363
albumsize = 640;
6464
break;
6565
}
66-
String raw;
66+
string raw;
6767
using (WebClient wc = new WebClient())
6868
{
6969
wc.Proxy = null;
@@ -92,7 +92,7 @@ public async Task<Bitmap> GetAlbumArtAsync(AlbumArtSize size)
9292
using (WebClient wc = new WebClient())
9393
{
9494
wc.Proxy = null;
95-
String url = GetAlbumArtUrl(size);
95+
string url = GetAlbumArtUrl(size);
9696
if (url == "")
9797
return null;
9898
var data = await wc.DownloadDataTaskAsync(url);
@@ -113,7 +113,7 @@ public async Task<byte[]> GetAlbumArtAsByteArrayAsync(AlbumArtSize size)
113113
using (WebClient wc = new WebClient())
114114
{
115115
wc.Proxy = null;
116-
String url = GetAlbumArtUrl(size);
116+
string url = GetAlbumArtUrl(size);
117117
if (url == "")
118118
return null;
119119
return await wc.DownloadDataTaskAsync(url);
@@ -130,8 +130,8 @@ public Bitmap GetAlbumArt(AlbumArtSize size)
130130
using (WebClient wc = new WebClient())
131131
{
132132
wc.Proxy = null;
133-
String url = GetAlbumArtUrl(size);
134-
if (String.IsNullOrEmpty(url))
133+
string url = GetAlbumArtUrl(size);
134+
if (string.IsNullOrEmpty(url))
135135
return null;
136136
var data = wc.DownloadData(url);
137137
using (MemoryStream ms = new MemoryStream(data))
@@ -151,8 +151,8 @@ public byte[] GetAlbumArtAsByteArray(AlbumArtSize size)
151151
using (WebClient wc = new WebClient())
152152
{
153153
wc.Proxy = null;
154-
String url = GetAlbumArtUrl(size);
155-
if (String.IsNullOrEmpty(url))
154+
string url = GetAlbumArtUrl(size);
155+
if (string.IsNullOrEmpty(url))
156156
return null;
157157
return wc.DownloadData(url);
158158
}

‎SpotifyAPI/Local/Models/TrackResourceLocation.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ namespace SpotifyAPI.Local.Models
66
public class TrackResourceLocation
77
{
88
[JsonProperty("og")]
9-
public String Og { get; set; }
9+
public string Og { get; set; }
1010
}
1111
}

‎SpotifyAPI/Local/RemoteHandler.cs‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ namespace SpotifyAPI.Local
1010
{
1111
internal class RemoteHandler
1212
{
13-
public String OauthKey { get; private set; }
14-
public String CfidKey { get; private set; }
13+
public string OauthKey { get; private set; }
14+
public string CfidKey { get; private set; }
1515

16-
public const String Host = "SpotifyAPI.spotilocal.com";
16+
public const string Host = "SpotifyAPI.spotilocal.com";
1717

1818
internal Boolean Init()
1919
{
2020
OauthKey = GetOAuthKey();
2121
CfidKey = GetCfid();
22-
return !String.IsNullOrEmpty(CfidKey);
22+
return !string.IsNullOrEmpty(CfidKey);
2323
}
2424

2525
internal async void SendPauseRequest()
@@ -32,21 +32,21 @@ internal async void SendPlayRequest()
3232
await QueryAsync("remote/pause.json?pause=false", true, true, -1);
3333
}
3434

35-
internal async void SendPlayRequest(String url, String context = "")
35+
internal async void SendPlayRequest(string url, string context = "")
3636
{
3737
// TODO: instead of having an empty context, one way to fix the bug with the playback time beyond the length of a song would be to provide a 1-song context, and it would be fixed.
3838
await QueryAsync($"remote/play.json?uri={url}&context={context}", true, true, -1);
3939
}
4040

41-
internal async void SendQueueRequest(String url)
41+
internal async void SendQueueRequest(string url)
4242
{
4343
await QueryAsync("remote/play.json?uri=" + url + "?action=queue", true, true, -1);
4444
}
4545

4646
internal StatusResponse GetNewStatus()
4747
{
48-
String response = Query("remote/status.json", true, true, -1);
49-
if (String.IsNullOrEmpty(response))
48+
string response = Query("remote/status.json", true, true, -1);
49+
if (string.IsNullOrEmpty(response))
5050
{
5151
return null;
5252
}
@@ -57,15 +57,15 @@ internal StatusResponse GetNewStatus()
5757
return raw[0];
5858
}
5959

60-
internal String GetOAuthKey()
60+
internal string GetOAuthKey()
6161
{
62-
String raw;
62+
string raw;
6363
using (WebClient wc = new WebClient())
6464
{
6565
raw = wc.DownloadString("http://open.spotify.com/token");
6666
}
67-
Dictionary<String, object> dic = JsonConvert.DeserializeObject<Dictionary<String, object>>(raw);
68-
return dic == null ? "" : (String)dic["t"];
67+
Dictionary<string, object> dic = JsonConvert.DeserializeObject<Dictionary<string, object>>(raw);
68+
return dic == null ? "" : (string)dic["t"];
6969
}
7070

7171
internal string GetCfid()
@@ -115,7 +115,7 @@ internal string Query(string request, bool oauth, bool cfid, int wait)
115115
}
116116
catch
117117
{
118-
return String.Empty;
118+
return string.Empty;
119119
}
120120

121121
return response;
@@ -156,7 +156,7 @@ internal async Task<string> QueryAsync(string request, bool oauth, bool cfid, in
156156
}
157157
catch
158158
{
159-
return String.Empty;
159+
return string.Empty;
160160
}
161161

162162
return response;

‎SpotifyAPI/Local/SpotifyLocalAPI.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ internal void PressKey(byte keyCode)
261261
/// <remarks>
262262
/// Contexts are basically a queue in spotify. a song can be played within a context, meaning that hitting next / previous would lead to another song. Contexts are leveraged by widgets as described in the "Multiple tracks player" section of the following documentation page: https://developer.spotify.com/technologies/widgets/spotify-play-button/
263263
/// </remarks>
264-
public void PlayURL(String uri, String context = "")
264+
public void PlayURL(string uri, string context = "")
265265
{
266266
_rh.SendPlayRequest(uri, context);
267267
}
@@ -271,7 +271,7 @@ public void PlayURL(String uri, String context = "")
271271
/// </summary>
272272
/// <param name="uri">The Spotify URI</param>
273273
[Obsolete("This method doesn't work with the current spotify version.")]
274-
public void AddToQueue(String uri)
274+
public void AddToQueue(string uri)
275275
{
276276
_rh.SendQueueRequest(uri);
277277
}

‎SpotifyAPI/Local/VolumeMixerControl.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace SpotifyAPI.Local
77
{
88
internal static class VolumeMixerControl
99
{
10-
private const String SpotifyProcessName = "spotify";
10+
private const string SpotifyProcessName = "spotify";
1111

1212
internal static float GetSpotifyVolume()
1313
{

‎SpotifyAPI/Web/Auth/AutorizationCodeAuth.cs‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public class AutorizationCodeAuth
1717

1818
private SimpleHttpServer _httpServer;
1919
private Thread _httpThread;
20-
public String ClientId { get; set; }
21-
public String RedirectUri { get; set; }
22-
public String State { get; set; }
20+
public string ClientId { get; set; }
21+
public string RedirectUri { get; set; }
22+
public string State { get; set; }
2323
public Scope Scope { get; set; }
2424
public Boolean ShowDialog { get; set; }
2525

@@ -33,7 +33,7 @@ public class AutorizationCodeAuth
3333
/// </summary>
3434
public void DoAuth()
3535
{
36-
String uri = GetUri();
36+
string uri = GetUri();
3737
Process.Start(uri);
3838
}
3939

@@ -55,7 +55,7 @@ public Token RefreshToken(string refreshToken, string clientSecret)
5555
{"refresh_token", refreshToken}
5656
};
5757

58-
String response;
58+
string response;
5959
try
6060
{
6161
byte[] data = wc.UploadValues("https://accounts.spotify.com/api/token", "POST", col);
@@ -72,7 +72,7 @@ public Token RefreshToken(string refreshToken, string clientSecret)
7272
}
7373
}
7474

75-
private String GetUri()
75+
private string GetUri()
7676
{
7777
StringBuilder builder = new StringBuilder("https://accounts.spotify.com/authorize/?");
7878
builder.Append("client_id=" + ClientId);
@@ -121,7 +121,7 @@ public void StopHttpServer()
121121
/// <param name="code">The gathered code from the response</param>
122122
/// <param name="clientSecret">Your Client-Secret, don't provide it if this is running on a client!</param>
123123
/// <returns></returns>
124-
public Token ExchangeAuthCode(String code, String clientSecret)
124+
public Token ExchangeAuthCode(string code, string clientSecret)
125125
{
126126
using (WebClient wc = new WebClient())
127127
{
@@ -136,7 +136,7 @@ public Token ExchangeAuthCode(String code, String clientSecret)
136136
{"client_secret", clientSecret}
137137
};
138138

139-
String response;
139+
string response;
140140
try
141141
{
142142
byte[] data = wc.UploadValues("https://accounts.spotify.com/api/token", "POST", col);
@@ -156,8 +156,8 @@ public Token ExchangeAuthCode(String code, String clientSecret)
156156

157157
public struct AutorizationCodeAuthResponse
158158
{
159-
public String Code { get; set; }
160-
public String State { get; set; }
161-
public String Error { get; set; }
159+
public string Code { get; set; }
160+
public string State { get; set; }
161+
public string Error { get; set; }
162162
}
163163
}

‎SpotifyAPI/Web/Auth/ClientCredentialsAuth.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ namespace SpotifyAPI.Web.Auth
1212
public class ClientCredentialsAuth
1313
{
1414
public Scope Scope { get; set; }
15-
public String ClientId { get; set; }
16-
public String ClientSecret { get; set; }
15+
public string ClientId { get; set; }
16+
public string ClientSecret { get; set; }
1717

1818
/// <summary>
1919
/// Starts the auth process and

0 commit comments

Comments
 (0)