Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Jul 2010
    Location
    Oz
    Posts
    272

    titleformat: any way to know which device requested it?

    Hi.

    $ratingchar = HTML::Entities::decode_entities('★');

    I'd like to use the unicode character 'BLACK STAR' (U+2605) in a titleformat that displays the track rating in (black) stars (and possibly append it to the track title). The 'normal' text star is quite tiny that's why I was thinking of the 2605 black star character.

    The problem is that all devices with jivelite (Touch, Radio, Squeezeplay, piCorePlayer) can't display this character. I'm guessing because it's probably not included in the FreeSans font.

    LMS web UI, Material skin, Softsqueeze, Boom and probably SB Classic and Transporter display this character without any problems.

    Since I can't think of a way to make jivelite devices display this character I thought maybe I can return different characters if I know which device requested the titleformat.

    But the function called via Slim::Music::TitleFormatter::addFormat only seems to get a track object from the server, nothing else. Is there any way to know which device requested the titleformat?

    Thank you.

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,569

    titleformat: any way to know which devicerequested it?

    > Since I can't think of a way to make jivelite devices display this
    > character I thought maybe I can return different characters if I know
    > which device requested the titleformat.


    At which point would you need to know the device? Are you using some
    custom formatter in a plugin?

  3. #3
    Senior Member
    Join Date
    Jul 2010
    Location
    Oz
    Posts
    272
    Quote Originally Posted by mherger View Post
    > Since I can't think of a way to make jivelite devices display this
    > character I thought maybe I can return different characters if I know
    > which device requested the titleformat.


    At which point would you need to know the device? Are you using some
    custom formatter in a plugin?
    No, this would have been like: if device = jivelite device (touch, pCP, radio, squeezeplay...) then deliver normal text star character otherwise deliver blackstar 2605 character (that is not part of jivelite's default FreeSans font).
    But I've made peace with it. If people prefer the backstar 2605 rating star character (like me) they just need to install a different font on their jivelite devices (l did that) and then switch a setting.

    But I have one more question about titleformats:

    Let's say I have defined a title format "TITLE RATINGSTARS" in settings > interface and the RATINGSTARS is supplied by my plugin.
    Now I play a playlist in the LMS web UI. Then I rate a song of that current playlist somewhere else (outside the LMS web UI).

    Is there a way to 'force' a refresh of the title format (content) so the new value is displayed more or less right away?

    I've noticed the title format content in the LMS web UI is updated shortly after I've paused/started/stopped any song in that playlist.

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,569

    titleformat: any way to know which devicerequested it?

    > IS THERE A WAY TO 'FORCE' A REFRESH OF THE TITLE FORMAT (CONTENT) SO THE
    > NEW VALUE IS DISPLAYED MORE OR LESS RIGHT AWAY?


    $client->currentPlaylistChangeTime( Time::HiRes::time() );

    That should invalidate the cache.

  5. #5
    Senior Member
    Join Date
    Jul 2010
    Location
    Oz
    Posts
    272
    Quote Originally Posted by mherger View Post
    $client->currentPlaylistChangeTime( Time::HiRes::time() );

    That should invalidate the cache.
    Thank you. Actually, currentPlaylistChangeTime didn't work for me but currentPlaylistUpdateTime did for some reason. Didn't find anything else that worked either, so that's cool.

  6. #6
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,569

    titleformat: any way to know which devicerequested it?

    >> $client->currentPlaylistChangeTime( Time::HiRes::time() );
    >>
    >> That should invalidate the cache.

    >
    > Thank you. Actually, currentPlaylist*Change*Time didn't work for me but
    > currentPlaylist*Update*Time did for some reason. Didn't find anything
    > else that worked either, so that's cool.


    Whatever works :-). FWIW: I'm actually a bit confused that you'd need to
    hack this, as there should be a check for external formatters (see
    https://github.com/Logitech/slimserv...laylist.pm#L77).

  7. #7
    Senior Member
    Join Date
    Jul 2010
    Location
    Oz
    Posts
    272
    Quote Originally Posted by mherger View Post
    >> $client->currentPlaylistChangeTime( Time::HiRes::time() );
    >>
    >> That should invalidate the cache.

    >
    > Thank you. Actually, currentPlaylist*Change*Time didn't work for me but
    > currentPlaylist*Update*Time did for some reason. Didn't find anything
    > else that worked either, so that's cool.


    Whatever works :-). FWIW: I'm actually a bit confused that you'd need to
    hack this, as there should be a check for external formatters (see
    https://github.com/Logitech/slimserv...laylist.pm#L77).
    That's just me being impatient, wanting changed rating values to show right away in the current playlist. It seems that it usually takes some event (trackchange/pause/stop...) to trigger a title format (value) update.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •