Announcement

Collapse
No announcement yet.

titleformat: any way to know which device requested it?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AF1
    replied
    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.

    Leave a comment:


  • AF1
    replied
    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.

    Leave a comment:


  • mherger
    replied
    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.

    Leave a comment:


  • AF1
    replied
    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.

    Leave a comment:


  • mherger
    replied
    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?

    Leave a comment:


  • AF1
    replied
    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.

    Leave a comment:


  • titleformat: any way to know which device requested 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).
Working...
X