PDA

View Full Version : Retrieving Actual Title Via CLI



Geoff B
2005-06-24, 11:01
Hi all,

I'm trying to retrieve information about the currently-playing track,
using the CLI. I can get artist, genre, etc with no problems - but as
soon as I try to get the track title, it gives me the fully-formatted
line including track number, artist, etc.

I've tried the following CLI command:
aa:bb:cc:dd:ee:ff title ?
(where aa:bb:cc:dd:ee:ff is my player's MAC address)

I get back:
aa:bb:cc:dd:ee:ff title 10. Deed I Do - Diana Krall - All For You

What I really want back is:
aa:bb:cc:dd:ee:ff title All For You

I really don't want to pick apart the response string to pull the
title out, since the format could change, and some artists and some
track names include hyphens in their names (so there's no reliable
delimiter for the track name).

I'm sure this is simple - can anyone tell me the sequence of CLI
commands to do this?

Cheers
Geoff

Jeff Coffler
2005-06-25, 13:34
From: "Geoff B" <geoffbon (AT) gmail (DOT) com>

>I'm trying to retrieve information about the currently-playing track,
>using the CLI. I can get artist, genre, etc with no problems - but as
>soon as I try to get the track title, it gives me the fully-formatted
>line including track number, artist, etc.

I get back just the track title. You know that you could use tags to limit
what's returned, right? Use the tags and say that you want only the title -
and that's all you get.

-- Jeff

Fred
2005-06-26, 12:53
> From: Jeff Coffler <jeff-list-slimdev (AT) taltos (DOT) com>
>
>> From: "Geoff B" <geoffbon (AT) gmail (DOT) com>
>
>
>> I'm trying to retrieve information about the currently-playing track,
>> using the CLI. I can get artist, genre, etc with no problems -
>> but as
>> soon as I try to get the track title, it gives me the fully-formatted
>> line including track number, artist, etc.
>>
>
> I get back just the track title. You know that you could use tags
> to limit what's returned, right? Use the tags and say that you
> want only the title - and that's all you get.
>

Jeff, Geoff is talking about the title command, not status or any
other extended call.

Geoff, yes it is potentially an issue. title returns the title as
formatted for the player (i.e. as displayed); other calls do not. So
three solutions:

(a) we consider it is a bug and I fix it for 6.1. In any case the doc
should be clear about it and I doubt it is.
(b) you use "<playerid> playlist title <N> ?", where <N> is the value
returned by "<playerid> playlist index ?" .
(c) you use "status" and get all such fields (and more) in one shot

HTH

Fred

Geoff B
2005-07-07, 10:07
On 6/26/05, Frédéric Thomas <fred (AT) thomascorner (DOT) com> wrote:
> Geoff, yes it is potentially an issue. title returns the title as
> formatted for the player (i.e. as displayed); other calls do not. So
> three solutions:
>
> (a) we consider it is a bug and I fix it for 6.1. In any case the doc
> should be clear about it and I doubt it is.
> (b) you use "<playerid> playlist title <N> ?", where <N> is the value
> returned by "<playerid> playlist index ?" .
> (c) you use "status" and get all such fields (and more) in one shot

Hi Fred,
In fact, I found solution (b) independently, but am having some
problems with the reliability of the connection to Slim - but that may
be down to the C# TCPClient I'm using (which has to go through a SSH
tunnel), so I'll keep working on it to make it more robust. It's
having sporadic problems with messed up responses from SlimServer.

I also think that your point (a) is correct though; asking for the
title should return the *title* of the track, i.e. the value obtained
from the track's TITLE tag field. Maybe a new call is needed to
continue the existing functionality, something like "FormattedTitle"?

Cheers
Geoff

Fred
2005-07-07, 13:40
> I also think that your point (a) is correct though; asking for the
> title should return the *title* of the track, i.e. the value obtained
> from the track's TITLE tag field. Maybe a new call is needed to
> continue the existing functionality, something like "FormattedTitle"?


Problem with that is that it breaks clients out there relying on the
fact that title returns formatted title. Since this is a new 6.0
behaviour (5.4 used to return the "pure" title), I guess we can
consider it a real bug and fix it.

If anyone needs the formatted title then please use bugzilla for an
enhancement request for 6.2.

Fred