mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2025-01-11 14:07:47 +00:00
Added Async and new Helper Docs
This commit is contained in:
parent
c3e8a33db8
commit
8d4f15a28f
@ -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
|
##API-Reference
|
||||||
@ -120,3 +131,6 @@ if (profile.HasError())
|
|||||||
###Tracks
|
###Tracks
|
||||||
* [GetSeveralTracks](/SpotifyWebAPI/tracks#getseveraltracks)
|
* [GetSeveralTracks](/SpotifyWebAPI/tracks#getseveraltracks)
|
||||||
* [GetTrack](/SpotifyWebAPI/tracks#gettrack)
|
* [GetTrack](/SpotifyWebAPI/tracks#gettrack)
|
||||||
|
|
||||||
|
###Util
|
||||||
|
* [Utility-Functions](/SpotifyWebAPI/util)
|
||||||
|
15
docs/SpotifyWebAPI/util.md
Normal file
15
docs/SpotifyWebAPI/util.md
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
````
|
@ -14,6 +14,7 @@ pages:
|
|||||||
- ['SpotifyWebAPI/profiles.md', 'SpotifyWebAPI', '- Profiles']
|
- ['SpotifyWebAPI/profiles.md', 'SpotifyWebAPI', '- Profiles']
|
||||||
- ['SpotifyWebAPI/search.md', 'SpotifyWebAPI', '- Search']
|
- ['SpotifyWebAPI/search.md', 'SpotifyWebAPI', '- Search']
|
||||||
- ['SpotifyWebAPI/tracks.md', 'SpotifyWebAPI', '- Tracks']
|
- ['SpotifyWebAPI/tracks.md', 'SpotifyWebAPI', '- Tracks']
|
||||||
|
- ['SpotifyWebAPI/util.md', 'SpotifyWebAPI', '- Util']
|
||||||
- ['SpotifyLocalAPI/index.md', 'SpotifyLocalAPI', 'SpotifyLocalAPI']
|
- ['SpotifyLocalAPI/index.md', 'SpotifyLocalAPI', 'SpotifyLocalAPI']
|
||||||
repo_url: 'https://github.com/JohnnyCrazy/SpotifyAPI-NET'
|
repo_url: 'https://github.com/JohnnyCrazy/SpotifyAPI-NET'
|
||||||
site_author: 'JohnnyCrazy'
|
site_author: 'JohnnyCrazy'
|
||||||
|
Loading…
Reference in New Issue
Block a user