Good day !
I know this might sound really simple, but for some reason it simply doesn't work :/ I've built an app that searches for songs and returns a list of them, then I'd like to be able to either queue or play a song by sending back the ID of the song. Sounds straight-forward. I'm using the .net wrapper (XbmcJson) which turns commands to/from json, so here's what the code looks like in there:
So I simply pass in "null, {id}, null, null", which means it'll send out a command to add the track to the playlist. I first clear the playlist, then add the track, then hit play as there didn't seem to be a "play" method in the wrapper api I'm using (I've already changed a bunch of things in it, so if there's a better way I don't mind adding the code).
Anybody know why that wouldn't work ? I've also tried sending in the file path (although that's kind of an ugly solution I'd like to avoid because the client doesn't have the full path, and when the ID gets sent it, I then have to re-query for the path, too many roundtrips).
Thanks,
Eric.
I know this might sound really simple, but for some reason it simply doesn't work :/ I've built an app that searches for songs and returns a list of them, then I'd like to be able to either queue or play a song by sending back the ID of the song. Sounds straight-forward. I'm using the .net wrapper (XbmcJson) which turns commands to/from json, so here's what the code looks like in there:
Code:
public void Add(string file, int? songId, int? artistId, int? albumId)
{
var args = new JObject();
if (file != null)
args.Add(new JProperty("file", file));
if (songId != null)
args.Add(new JProperty("songid", songId));
if (artistId != null)
args.Add(new JProperty("artistid", artistId));
if (albumId != null)
args.Add(new JProperty("albumid", albumId));
Client.Invoke("AudioPlaylist.Add", args);
}
So I simply pass in "null, {id}, null, null", which means it'll send out a command to add the track to the playlist. I first clear the playlist, then add the track, then hit play as there didn't seem to be a "play" method in the wrapper api I'm using (I've already changed a bunch of things in it, so if there's a better way I don't mind adding the code).
Anybody know why that wouldn't work ? I've also tried sending in the file path (although that's kind of an ugly solution I'd like to avoid because the client doesn't have the full path, and when the ID gets sent it, I then have to re-query for the path, too many roundtrips).
Thanks,
Eric.