Skip to content

Commit

Permalink
Added Async and new Helper Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyCrazy committed Nov 7, 2015
1 parent c3e8a33 commit 8d4f15a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/SpotifyWebAPI/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ if (profile.HasError())
}
```

##Asynchronous
Every API-Call now has an asynchronous method. Just append `Async` to the Method-Name.
Example:
```cs
public async void Test()
{
var profile = await _spotify.GetPrivateProfileAsync();
Console.WriteLine(profile.DisplayName);
}
```

---

##API-Reference
Expand Down Expand Up @@ -120,3 +131,6 @@ if (profile.HasError())
###Tracks
* [GetSeveralTracks](/SpotifyWebAPI/tracks#getseveraltracks)
* [GetTrack](/SpotifyWebAPI/tracks#gettrack)

###Util
* [Utility-Functions](/SpotifyWebAPI/util)
15 changes: 15 additions & 0 deletions docs/SpotifyWebAPI/util.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
##Paging-Methods
The `SpotifyWebAPI` features two paging-helper Methods, `GetNextPage()` and `GetPreviousPage()`.
Both are an easy way to receive the next/previous page of a Paging-Object.

Sample:
````csharp
var playlistTracks = _spotify.GetPlaylistTracks("1122095781", "4EcNf2l8rXInbJOf3tQdgU", "", 50);
while (true)
{
Console.WriteLine(playlistTracks.Items.Count);
if (!playlistTracks.HasNextPage())
break;
playlistTracks = _spotify.GetNextPage(playlistTracks);
}
````
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pages:
- ['SpotifyWebAPI/profiles.md', 'SpotifyWebAPI', '- Profiles']
- ['SpotifyWebAPI/search.md', 'SpotifyWebAPI', '- Search']
- ['SpotifyWebAPI/tracks.md', 'SpotifyWebAPI', '- Tracks']
- ['SpotifyWebAPI/util.md', 'SpotifyWebAPI', '- Util']
- ['SpotifyLocalAPI/index.md', 'SpotifyLocalAPI', 'SpotifyLocalAPI']
repo_url: 'https://github.com/JohnnyCrazy/SpotifyAPI-NET'
site_author: 'JohnnyCrazy'
Expand Down

0 comments on commit 8d4f15a

Please sign in to comment.