Announcement

Collapse
No announcement yet.

Announce: Material Skin

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

    delete
    Last edited by shinedou; 2021-10-19, 03:26. Reason: delete

    Comment


      Originally posted by shinedou View Post
      Code:
          {
            "title":"Artist Radio",
            "script":"lmsCommand('$ID', ['dynamicplaylist', 'playlist', 'play', 'dpldefault_zz_CONTEXTMENU_for_selected_artist_a01_songs_random', 'dynamicplaylist_parameter_1:$ARTISTID']); setTimeout(() => lmsCommand('$ID', ['dynamicplaylist', 'playlist', 'stop']), 10000)",
            "icon":"queue_music"
          },
      I think the replacement of "$ID" only works for the fist occurance - will fix for next release. For now, however, you could just use a variable. e.g. (untested):

      Code:
       {
            "title":"Artist Radio",
            "script":"let artistRadioId=$ID; lmsCommand(artistRadioId, ['dynamicplaylist', 'playlist', 'play', 'dpldefault_zz_CONTEXTMENU_for_selected_artist_a01_songs_random', 'dynamicplaylist_parameter_1:$ARTISTID']); setTimeout(() => lmsCommand(artistRadioId, ['dynamicplaylist', 'playlist', 'stop']), 10000)",
            "icon":"queue_music"
          }
      To wait until a command finishes you should use:
      Code:
      lmsCommand('', [...]).then(({data}) => {
          // Next command here...
      });
      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.

      Comment


        Android 12 update appeared on my Pixel phone today. Material seems to have come through it fine. There is a small change in behavior of "Material as screensaver", though. When woken up, rather than waking direct to Material there is a very slight delay as Material sweeps in from the right. I think I prefer the old behavior, but I'll get used to the new way.

        Comment


          Originally posted by cpd73 View Post
          I think the replacement of "$ID" only works for the fist occurance - will fix for next release. For now, however, you could just use a variable. e.g. (untested):

          [code]
          {
          "title":"Artist Radio",
          "script":"let artistRadioId=$ID; lmsCommand(artistRadioId, ['dynamicplaylist', 'playlist', 'play', 'dpldefault_zz_CONTEXTMENU_for_selected_artist_a01 _songs_random', 'dynamicplaylist_parameter_1:$ARTISTID']); setTimeout(() => lmsCommand(artistRadioId, ['dynamicplaylist', 'playlist', 'stop']), 10000)",
          "icon":"queue_music"
          }
          I tried using a variable as you suggested above but it did not work. It gave many json errors in the dev terminal but I didn't have time to go through them. I will try to get you an example of the errors later. Either way for the moment luckily using $ID and then $NAME is working for what I wanted to do.

          Also using the "lmscommand": method is working on 2.7.1

          Comment


            Originally posted by shinedou View Post
            I tried using a variable as you suggested above but it did not work. It gave many json errors in the dev terminal but I didn't have time to go through them. I will try to get you an example of the errors later. Either way for the moment luckily using $ID and then $NAME is working for what I wanted to do.

            Also using the "lmscommand": method is working on 2.7.1
            $ID should have been in quotes - e.g. '$ID'
            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.

            Comment


              2.7.2 Release

              Bug-fix release, changes:
              1. Translation updates.
              2. When replacing strings in custom actions replace all occurances.
              3. Handle 'nextWindow' when browsing if no items are returned.
              4. Update Roboto fonts.
              5. Allow multiple characters when jumping in list via keypress.
              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.

              Comment


                Craig, Thanks for your input on my other thread to use material skin actions.json to execute a shell script.

                I have now created file named "actions.json" within a "material-skin" sub-folder in my LMS's preferences folder - a simple iframe/weblink to see if the link is displayed under the top level of the main menu (accessed via the three-dotted icon top right). However I still dont see the links getting displayed. Wondering if I am doing something wrong here as Material is not picking up the .json. I have tried restarting the server a few times.

                I have LMS(V 8.1.1) and Squeezelite running on a raspberry pi(3b) with nanosound DAC2 .

                Code:
                {
                  "system":[
                    {
                      "title":"A page to embed in Material",
                      "iframe":"http://www.nhk.jp",
                      "locked":true,
                      "icon":"link",
                      "toolbar":{
                        "title":"Title \u2022 $NAME"
                      }
                    {
                      "title":"NHK - A page to launch in a new window/tab",
                      "weblink":"http://www.nhk.jp"
                    },
                  ],
                 }

                Comment


                  Originally posted by sh1ntomi View Post
                  Craig, Thanks for your input on my other thread to use material skin actions.json to execute a shell script.

                  I have now created file named "actions.json" within a "material-skin" sub-folder in my LMS's preferences folder - a simple iframe/weblink to see if the link is displayed under the top level of the main menu (accessed via the three-dotted icon top right). However I still dont see the links getting displayed. Wondering if I am doing something wrong here as Material is not picking up the .json. I have tried restarting the server a few times.

                  I have LMS(V 8.1.1) and Squeezelite running on a raspberry pi(3b) with nanosound DAC2 .
                  I think you have your commas in the wrong place.

                  Try this...
                  Code:
                  {
                    "system":[
                      {
                        "title":"A page to embed in Material",
                        "iframe":"http://www.nhk.jp",
                        "locked":true,
                        "icon":"link",
                        "toolbar":{
                          "title":"Title \u2022 $NAME"
                        },
                      {
                        "title":"NHK - A page to launch in a new window/tab",
                        "weblink":"http://www.nhk.jp"
                      }
                    ]
                   }
                  you need a comma after the bracket }, when there is a separate command in a section and the final bracket in the section will not have a comma }

                  Also there should not be a comma after the last ] unless you are going to ad another section such as Artist
                  Last edited by shinedou; 2021-10-24, 03:58.

                  Comment


                    In my special case of playing an Audiobook, can the skip back/forward buttons be modified to jump 15 or 30 secs rather than next/previous track?

                    I thought there was a setting to adjust this but I can't find it.
                    ------------------------------------------------------------------------------------

                    Comment


                      Originally posted by castalla View Post
                      In my special case of playing an Audiobook, can the skip back/forward buttons be modified to jump 15 or 30 secs rather than next/previous track?

                      I thought there was a setting to adjust this but I can't find it.
                      You need to long-press (press and hold) the buttons for this.
                      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.

                      Comment


                        Originally posted by shinedou View Post
                        I think you have your commas in the wrong place.
                        That was the problem..thanks.

                        Any suggestions on how I can get the exit status of the shell script back to the squeezelite UI screen.

                        Comment


                          Originally posted by sh1ntomi View Post
                          That was the problem..thanks.

                          Any suggestions on how I can get the exit status of the shell script back to the squeezelite UI screen.
                          Onto squeezelite UI? No idea. To send a notification to Material you can use its notification mechanism - see https://github.com/CDrummond/lms-mat...-Notifications e.g. with CURL:

                          Code:
                          curl 'http://localhost:9000/jsonrpc.js' --data-raw '{"id":0,"method":"slim.request","params":["",["material-skin", "send-notif", "type:alert", "msg:Hello world"]]}'
                          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.

                          Comment


                            Any chance of adding this to Material Skin

                            I use Material Skin on my phone almost exclusively to control my SB's and love it. Is there any chance of adding a button or menu option to cycle through the available 'Now Playing' views in piCorePlayer? Same as the 'Now Playing' button on the SB remotes.

                            Thanks for any consideration.

                            Howard

                            Comment


                              Originally posted by Howard Passman View Post
                              Is there any chance of adding a button or menu option to cycle through the available 'Now Playing' views in piCorePlayer? Same as the 'Now Playing' button on the SB remotes.
                              You mean add a button to control Jivelite? I have no such device, so would have no idea how this could be done. Still, having one UI to control another seems a bit odd. You can however, probably use Material's custom actions to achieve this. For more details refer to see https://github.com/CDrummond/lms-mat...-Customisation
                              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.

                              Comment


                                Ya know, I'm not sure where the 'Now Playing' screen saver resides. The VU meters are in Jivelite, but I'm not sure that's where the screen savers are controlled from. I know that the SB remote as for the SB3, etc. have a button that changes the screen screen view on most of the Squeeze boxes inclusive of the Transporter. It's the same function if you are using a touch screen and you touch the middle of the screen.

                                Anyway, I'll take a peak at the link you supplied, although I am a complete luddite, maybe I can figure something out.

                                Thanks,

                                Howard



                                Originally posted by cpd73 View Post
                                You mean add a button to control Jivelite? I have no such device, so would have no idea how this could be done. Still, having one UI to control another seems a bit odd. You can however, probably use Material's custom actions to achieve this. For more details refer to see https://github.com/CDrummond/lms-mat...-Customisation

                                Comment

                                Working...
                                X