forked from JohnnyCrazy/SpotifyAPI-NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (28 loc) · 793 Bytes
/
Program.cs
File metadata and controls
32 lines (28 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using SpotifyAPI.Web;
using System;
using System.Threading.Tasks;
using SpotifyAPI.Local;
using SpotifyAPI.Local.Models;
namespace SpotifyAPI.Example
{
public class Program
{
private static SpotifyLocalAPI _spotify;
public static void Main(string[] args)
{
Start();
Console.ReadLine();
}
public static async Task Start()
{
Console.WriteLine("Starting...");
_spotify = new SpotifyLocalAPI();
while (!await _spotify.Connect())
{
await _spotify.Connect();
}
StatusResponse status = await _spotify.GetStatus(); // never pass the while....
Console.WriteLine(status.Track.TrackResource.Name);
}
}
}