user1481929
user1481929

Reputation: 21

Spotify .Net Library

Is there a Reliable, working and well documented .Net Spotify Library ? I have been fiddling with shapotify and libspotify-sharp and no luck so far !

I'm trying to create a new playlist then load it to Spotify Client.. This is what I have tried so far with sharpotify

using Sharpotify;  
public JsonResult AddList(string list, string name)
{  
SpotifyConnection connection = new SpotifyConnection(new harpotify.Cache.FileCache(),new TimeSpan(0,1,0));  
string username = "username";  
string password = "password";  
bool result = false;  
try  
{  
 connection.Login(username, password);  
 Sharpotify.Media.Playlist playlist = connection.PlaylistCreate(name);  
 String [] tracks = list.Split(';');  
 for (int i = 0; i < tracks.Length; i++)  
 {  
  if(tracks[i] != string.Empty){  
   Sharpotify.Media.Track t = new Sharpotify.Media.Track(tracks[i]);  
   if (t != null){  
    playlist.Tracks.Add(t);  
   }  
 }  
 }  
 result = true;  
}  
catch (Sharpotify.Exceptions.AuthenticationException ex)  
{  
 connection.Close();  
 result = false;  
}  
catch (Exception ex)  
{  
connection.Close();  
result = false;  
}
return Json(result, JsonRequestBehavior.AllowGet);            
}

Upvotes: 2

Views: 2047

Answers (2)

Zach Aikman
Zach Aikman

Reputation: 11

Have you looked at libspotify.NET? It looks like it's relatively up to date, compared to Sharpotify.

Upvotes: 1

Se&#231;kin
Se&#231;kin

Reputation: 2826

It might not meet your requirements, but you might consider looking at Sharpotify. From its page:

Sharpotify is a Spotify library in C#. It is based in Jotify and SharPot projects. It is not a libspotify wrapper, It is a full .Net Spotify protocol implementation.

Beware, though, that as of July 2012, the latest release is more than 2 years old; it may no longer be actively maintained.

Upvotes: 0

Related Questions