Skip to content

Commit 3afbea3

Browse files
author
Johnny @PC
committed
Updated to support latest features (Changelog-date: February 11th, 2015)
1 parent 9d01d3a commit 3afbea3

16 files changed

Lines changed: 262 additions & 58 deletions

‎SpotifyAPI/SpotifyAPI.csproj‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,13 @@
6363
<Compile Include="SpotifyWebAPI\AlbumType.cs" />
6464
<Compile Include="SpotifyWebAPI\AutorizationCodeAuth.cs" />
6565
<Compile Include="SpotifyWebAPI\ClientCredentialsAuth.cs" />
66+
<Compile Include="SpotifyWebAPI\FollowType.cs" />
6667
<Compile Include="SpotifyWebAPI\ImplicitGrantAuth.cs" />
68+
<Compile Include="SpotifyWebAPI\Models\ArrayResponse.cs" />
6769
<Compile Include="SpotifyWebAPI\Models\BasicModel.cs" />
70+
<Compile Include="SpotifyWebAPI\Models\Category.cs" />
71+
<Compile Include="SpotifyWebAPI\Models\CategoryList.cs" />
72+
<Compile Include="SpotifyWebAPI\Models\CategoryPlaylist.cs" />
6873
<Compile Include="SpotifyWebAPI\Models\FeaturedPlaylists.cs" />
6974
<Compile Include="SpotifyWebAPI\Models\FullAlbum.cs" />
7075
<Compile Include="SpotifyWebAPI\Models\FullArtist.cs" />

‎SpotifyAPI/SpotifyWebAPI/AutorizationCodeAuth.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private String GetUri()
6767
builder.Append("&response_type=code");
6868
builder.Append("&redirect_uri=" + RedirectUri);
6969
builder.Append("&state=" + State);
70-
builder.Append("&scope=" + Scope.GetScopeValue(" "));
70+
builder.Append("&scope=" + Scope.GetStringAttribute(" "));
7171
builder.Append("&show_dialog=" + ShowDialog.ToString());
7272
return builder.ToString();
7373
}

‎SpotifyAPI/SpotifyWebAPI/ClientCredentialsAuth.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public Token DoAuth()
2626

2727
NameValueCollection col = new NameValueCollection();
2828
col.Add("grant_type","client_credentials");
29-
col.Add("scope", Scope.GetScopeValue(" "));
29+
col.Add("scope", Scope.GetStringAttribute(" "));
3030

3131
byte[] data = null;
3232
try
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace SpotifyAPI.SpotifyWebAPI
8+
{
9+
[Flags]
10+
public enum FollowType
11+
{
12+
[StringAttribute("artist")]
13+
ARTIST = 1,
14+
[StringAttribute("user")]
15+
USER = 2
16+
}
17+
}

‎SpotifyAPI/SpotifyWebAPI/ImplicitGrantAuth.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private String GetUri()
3636
builder.Append("&response_type=token");
3737
builder.Append("&redirect_uri=" + RedirectUri);
3838
builder.Append("&state=" + State);
39-
builder.Append("&scope=" + Scope.GetScopeValue(" "));
39+
builder.Append("&scope=" + Scope.GetStringAttribute(" "));
4040
builder.Append("&show_dialog=" + ShowDialog.ToString());
4141
return builder.ToString();
4242
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using Newtonsoft.Json.Linq;
7+
8+
namespace SpotifyAPI.SpotifyWebAPI.Models
9+
{
10+
public class ListResponse<T> : BasicModel
11+
{
12+
public List<T> List { get; set; }
13+
}
14+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using Newtonsoft.Json;
7+
8+
namespace SpotifyAPI.SpotifyWebAPI.Models
9+
{
10+
public class Category : BasicModel
11+
{
12+
[JsonProperty("href")]
13+
public String Href { get; set; }
14+
[JsonProperty("icons")]
15+
public List<Image> Icons { get; set; }
16+
[JsonProperty("id")]
17+
public String Id { get; set; }
18+
[JsonProperty("name")]
19+
public String Name { get; set; }
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using Newtonsoft.Json;
7+
8+
namespace SpotifyAPI.SpotifyWebAPI.Models
9+
{
10+
public class CategoryList : BasicModel
11+
{
12+
[JsonProperty("categories")]
13+
public Paging<Category> Categories { get; set; }
14+
}
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using Newtonsoft.Json;
7+
8+
namespace SpotifyAPI.SpotifyWebAPI.Models
9+
{
10+
public class CategoryPlaylist : BasicModel
11+
{
12+
[JsonProperty("playlists")]
13+
public Paging<SimplePlaylist> Playlists { get; set; }
14+
}
15+
}

‎SpotifyAPI/SpotifyWebAPI/Models/FullTrack.cs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,17 @@ public class FullTrack : BasicModel
4444
public String Type { get; set; }
4545
[JsonProperty("uri")]
4646
public String Uri { get; set; }
47+
48+
/// <summary>
49+
/// Only filled when the "market"-parameter was supplied!
50+
/// </summary>
51+
[JsonProperty("is_playable")]
52+
public Boolean? IsPlayable { get; set; }
53+
54+
/// <summary>
55+
/// Only filled when the "market"-parameter was supplied!
56+
/// </summary>
57+
[JsonProperty("linked_from")]
58+
public LinkedFrom LinkedFrom { get; set; }
4759
}
4860
}

0 commit comments

Comments
 (0)