Skip to content

Commit 095967f

Browse files
author
Johnny @PC
committed
Fixed wrong limit calculation. (I think I was drunk or something...)
1 parent 85a7bf6 commit 095967f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

SpotifyAPI/Web/SpotifyWebBuilder.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public string GetSeveralArtists(List<String> ids)
180180
/// <remarks>AUTH NEEDED</remarks>
181181
public string GetFeaturedPlaylists(String locale = "", String country = "", DateTime timestamp = default(DateTime), int limit = 20, int offset = 0)
182182
{
183-
limit = Math.Max(limit, 50);
183+
limit = Math.Min(limit, 50);
184184
StringBuilder builder = new StringBuilder(APIBase + "/browse/featured-playlists");
185185
builder.Append("?limit=" + limit);
186186
builder.Append("&offset=" + offset);
@@ -203,7 +203,7 @@ public string GetSeveralArtists(List<String> ids)
203203
/// <remarks>AUTH NEEDED</remarks>
204204
public string GetNewAlbumReleases(String country = "", int limit = 20, int offset = 0)
205205
{
206-
limit = Math.Max(limit, 50);
206+
limit = Math.Min(limit, 50);
207207
StringBuilder builder = new StringBuilder(APIBase + "/browse/new-releases");
208208
builder.Append("?limit=" + limit);
209209
builder.Append("&offset=" + offset);
@@ -297,7 +297,7 @@ public string GetCategoryPlaylists(String categoryId, String country = "", int l
297297
/// <remarks>AUTH NEEDED</remarks>
298298
public string GetFollowedArtists(int limit = 20, String after = "")
299299
{
300-
limit = Math.Max(limit, 50);
300+
limit = Math.Min(limit, 50);
301301
const FollowType followType = FollowType.Artist; //currently only artist is supported.
302302
StringBuilder builder = new StringBuilder(APIBase + "/me/following?type=" + followType.GetStringAttribute(""));
303303
builder.Append("&limit=" + limit);
@@ -496,7 +496,7 @@ public string GetPlaylist(String userId, String playlistId, String fields = "",
496496
/// <remarks>AUTH NEEDED</remarks>
497497
public string GetPlaylistTracks(String userId, String playlistId, String fields = "", int limit = 100, int offset = 0, String market = "")
498498
{
499-
limit = Math.Max(limit, 100);
499+
limit = Math.Min(limit, 100);
500500
StringBuilder builder = new StringBuilder(APIBase + "/users/" + userId + "/playlists/" + playlistId + "/tracks");
501501
builder.Append("?fields=" + fields);
502502
builder.Append("&limit=" + limit);

0 commit comments

Comments
 (0)