Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,682

    One plugin, 2 skins?

    I'm implementing a 'party' mode for MaterialSkin - sort of like iPeng Party. The general idea is that Material will have 2 skin entries in the "Interface" section; "Material Skin" and "Material Skin (Party)" When the user selects "Material Skin (Party)" as the default skin other user's can then just navigate to "http : // server:9000" and "Material Skin (Party)" would then redirect to "http : // server:9000/material/?party".

    The issue I have is registering 2 skins from the one plugin. Currently the plugin has "MaterialSkin/HTML/material/" - which the UI displays as "Material Skin". But how can I register a second? I've hacked around this by creating a "MaterialSkin/HTML/Material Skin (Party)/" folder - and the Interface sections shows this as "Material Skin (Party)", as I think its just using the directory name. However this leads to translation issues - as this new name is non-translatable.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

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

    One plugin, 2 skins?

    > The issue I have is registering 2 skins from the one plugin. Currently
    > the plugin has "MaterialSkin/HTML/material/" - which the UI displays as
    > "Material Skin". But how can I register a second? I've hacked around


    Just create another subfolder called "party" or whatever. Then define
    string tokens in strings.txt for "PARTY_SKIN" etc.?

  3. #3
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,682
    Quote Originally Posted by mherger View Post
    > The issue I have is registering 2 skins from the one plugin. Currently
    > the plugin has "MaterialSkin/HTML/material/" - which the UI displays as
    > "Material Skin". But how can I register a second? I've hacked around


    Just create another subfolder called "party" or whatever. Then define
    string tokens in strings.txt for "PARTY_SKIN" etc.?
    If I name the folder "party" then that is what LMS shows. Perhaps I was not clear in my initial request.

    I have:
    Code:
    MaterialSkin/
        Plugin.pm
        HTML/
            material/
                index.html
            material-party/
                index.html
        strings.txt
    With the above the skin selector ("Web Interface") in the "Interface" settings page shows; material-party, Material Skin, Light, Classic, Default. Its this "material-party" that I want translated to "Material Skin (Party)". If I name the folder "Material Skin (Party)" then its shown as is, but is obviously not translated.

    "material-party/index.html" is very simple and all it does is re-redirect the page to "/material/?party" - as the main skin contains all the code. I only want a second skin so that it can be set as the default.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

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

    One plugin, 2 skins?

    > With the above the skin selector ("Web Interface") in the "Interface"
    > settings page shows; material-party, Material Skin, Light, Classic,
    > Default. Its this "material-party" that I want translated to "Material
    > Skin (Party)". If I name the folder "Material Skin (Party)" then its
    > shown as is, but is obviously not translated.


    As I said you'll have to create an entry PARTY_SKIN or whatever in
    strings.txt. And as I don't know how that would work with a hyphen I
    recommended using just "party", not "material-part". Eg. there's no
    folder called "Light", but it's "EN", with a string token EN_SKIN with
    the value "Light". The name shown in LMS would be the value from
    strings.txt, not the folder name - if such a token could be found.

    Oh, the mapping is pretty simple:
    https://github.com/Logitech/slimserv...anager.pm#L111

    Which means you better stick with just a few latin characters, nothing else.

  5. #5
    Senior Member
    Join Date
    Mar 2017
    Posts
    3,682
    Quote Originally Posted by mherger View Post
    As I said you'll have to create an entry PARTY_SKIN or whatever in
    strings.txt.
    Ah, thanks! Works great.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

Posting Permissions

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