Not sure it can be done with a one liner, because you first need a path
to or id of the current song, then a second query gets the songinfo.

I haven't coded with PowerShell in a while, but there's the
Invoke-Webrequest method that will allow you to post both queries, then
PS can easily parse the json return objects.

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7.2

The queries are documented here:
http://<LMS Server IP>:9000/html/docs/cli-api.html

Here's how I do it from an RPi in the C language:

(mac is the macId of the player, tags is an optional list of tags
to be returned)


sprintf(query,"{"id":1,"method":"slim.request","params":["%s",["path","?"]]}",mac);
post(host,port,query,decoded,2048);

... (grab the _path result from the returned json into a var named
p) ...


sprintf(query,"{"method":"slim.request","params":["%s",["songinfo",0,99,"url:%s","tags:%s"]]}",mac,p,tags);

post(host,port,query,decoded,2048);

... (grab the name/value pairs from the returned json for album,
artist, etc.)

Here's a typical result:

id=-1173897872
title=It's You or No One
artist=Lurlean Hunter
duration=191
samplesize=16
coverart=0
artwork_url=http://resources.tidal.com/images/66aeadee/09e1/43c4/ab0d/a007c1f240c2/1280x1280.jpg
album=Lonesome Gal
info_link=plugins/wimp/trackinfo.html
type=FLAC
bitrate=424kbps
samplerate=44100
url=wimp://11062173.flac
year=0



piTouch™ w/JustBoom DigiHat -> RME ADI-2 DAC FS -> JBL 305P MkII
monitors; LMS 8.2 on piCorePlayer/Pi 4;  Material Skin.
------------------------------------------------------------------------
chicks's Profile: http://forums.slimdevices.com/member.php?userid=71798
View this thread: http://forums.slimdevices.com/showthread.php?t=115989

_______________________________________________
Squeezecenter mailing list
Squeezecenter@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/squeezecenter

Reply via email to