From 05721ef9f720007294cdaa1696b22462f8e590a8 Mon Sep 17 00:00:00 2001 From: Jonas Dellinger Date: Mon, 15 Jan 2018 23:32:21 +0100 Subject: [PATCH] Added missing docs --- .../docs/SpotifyWebAPI/personalization.md | 63 +++++++++++++++++++ SpotifyAPI.Docs/mkdocs.yml | 1 + SpotifyAPI/Web/SpotifyWebAPI.cs | 1 - 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 SpotifyAPI.Docs/docs/SpotifyWebAPI/personalization.md diff --git a/SpotifyAPI.Docs/docs/SpotifyWebAPI/personalization.md b/SpotifyAPI.Docs/docs/SpotifyWebAPI/personalization.md new file mode 100644 index 00000000..a5927ff1 --- /dev/null +++ b/SpotifyAPI.Docs/docs/SpotifyWebAPI/personalization.md @@ -0,0 +1,63 @@ +## GetUsersTopTracks + +> Get the current user’s top tracks based on calculated affinity. + +**Parameters** + +|Name|Description|Example| +|--------------|-------------------------|-------------------------| +|[timeRange]| Over what time frame the affinities are compute. | `TimeRangeType.MediumTerm` +|[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20` +|[offset]| The index of the first entity to return. Default: 0 (i.e., the first track). Use with limit to get the next set of entities. | `0` + +Returns a [FullTrack](https://developer.spotify.com/web-api/object-model/#track-object-full) wrapped inside a [Paging-object](https://developer.spotify.com/web-api/object-model/#paging-object) + +**Usage** + +``` +Paging tracks = _spotify.GetUsersTopTracks(); +tracks.Items.ForEach(item => Console.WriteLine(item.Name)); //Display all fetched Track-Names (max 20) +Console.WriteLine(tracks.Total.ToString()) //Display total album track count +``` + +--- +## GetUsersTopArtists +> Get the current user’s top artists based on calculated affinity. + +**Parameters** + +|Name|Description|Example| +|--------------|-------------------------|-------------------------| +|[timeRange]| Over what time frame the affinities are compute. | `TimeRangeType.MediumTerm` +|[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20` +|[offset]| The index of the first entity to return. Default: 0 (i.e., the first track). Use with limit to get the next set of entities. | `0` + +Returns a [FullArtist](https://developer.spotify.com/web-api/object-model/#artist-object-full) wrapped inside a [Paging-object](https://developer.spotify.com/web-api/object-model/#paging-object) + +**Usage** +``` +Paging artists = _spotify.GetUsersTopArtists(); +artists.Items.ForEach(item => Console.WriteLine(item.Name)); //Display all fetched Artist-Names (max 20) +``` + +--- +## GetUsersRecentlyPlayedTracks +> Get tracks from the current user’s recent play history. + +**Parameters** + +|Name|Description|Example| +|--------------|-------------------------|-------------------------| +|[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20` +|[after]| Returns all items after (but not including) this cursor position. | `DateTime.Now.AddDays(-1)` +|[before]| Returns all items before (but not including) this cursor position. | `DateTime.Now.AddDays(-1)` + +Returns a `PlayHistory` wrapped inside a [CursorPaging-object](https://developer.spotify.com/web-api/object-model/#cursor-based-paging-object) + +**Usage** +``` +CursorPaging histories = _spotify.GetUsersRecentlyPlayedTracks(); +histories.Items.ForEach(item => Console.WriteLine(item.Track.Name)); +``` + +--- diff --git a/SpotifyAPI.Docs/mkdocs.yml b/SpotifyAPI.Docs/mkdocs.yml index 0bc0322c..0212d9f3 100644 --- a/SpotifyAPI.Docs/mkdocs.yml +++ b/SpotifyAPI.Docs/mkdocs.yml @@ -11,6 +11,7 @@ pages: - '- Browse': 'SpotifyWebAPI/browse.md' - '- Follow': 'SpotifyWebAPI/follow.md' - '- Library': 'SpotifyWebAPI/library.md' + - '- Personalization': 'SpotifyWebAPI/personalization.md' - '- Player': 'SpotifyWebAPI/player.md' - '- Playlists': 'SpotifyWebAPI/playlists.md' - '- Profiles': 'SpotifyWebAPI/profiles.md' diff --git a/SpotifyAPI/Web/SpotifyWebAPI.cs b/SpotifyAPI/Web/SpotifyWebAPI.cs index 5b99d3ee..a4319209 100644 --- a/SpotifyAPI/Web/SpotifyWebAPI.cs +++ b/SpotifyAPI/Web/SpotifyWebAPI.cs @@ -2148,7 +2148,6 @@ namespace SpotifyAPI.Web response.Item2.AddResponseInfo(response.Item1); lastError = response.Item2.Error; - triesLeft -= 1; } while (UseAutoRetry && triesLeft > 0 && lastError != null && RetryErrorCodes.Contains(lastError.Status));