jsutula;136357 Wrote: 
> 
> I have two issues maybe someone could help me with:
> I'm using a deprecated function to get the datasource: 
> my $ds  = Slim::Music::Info::getCurrentDataStore();
> Can someone instruct me in the correct usage of Slim:Schema to retrieve
> the data store?
> 
> Also, I don't think I'm retrieving parameters correctly from my
> callback function...has the order or number changed with the new beta?
> I just need the $client variable filled, but it appears that it is
> empty when I try to use it.
> 


To get a track from a URL:
$track = Slim::Schema->resultset('Track')->objectForUrl($url);
To get a list of genre names from a track:
map {my $gen = $_; $gen->name()} ($track->genres())

To get the params from a command callback:
sub gotCommand($)
{
my $request = shift;
my $client = $request->client();
# Parameter - filename of track being played
my $filename = $request->getParam('_path');
#or
my @params = $request->renderAsArray();
}

James


-- 
James
------------------------------------------------------------------------
James's Profile: http://forums.slimdevices.com/member.php?userid=189
View this thread: http://forums.slimdevices.com/showthread.php?t=27318

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to