kaaholst / android-squeezer

Remote control for your Logitech Media Server ("Squeezeserver" etc) and players.
Apache License 2.0
75 stars 15 forks source link

Classical Works #818

Open darrell-k opened 2 months ago

darrell-k commented 2 months ago

Hi,

We've just added functionality for browsing/searching/playing classical music by Work into LMS 9.0.

The browsing and searching in Squeezer is working fine (except it's not picking up the icon for the Works entry in the main menu, even though it's just the existing playlist icon for now in the menu definitions in Browselibrary.pm).

But adding works tracks to the playlist is adding everything on the album, rather than the tracks for the selected work - this may be because there are 2 new parameters, work_id and grouping, which should be passed in the playlistcontrol command if they exist in the response from the albums command,

Or is there something I have missed on the LMS side? (very likely!)

There is a test album here: https://github.com/darrell-k/darrell-k.github.io/blob/main/testmusic3.zip It contains 3 works, one of which has 2 separate performances (which is where the "grouping" tag comes in).

Many thanks, Darrell

kaaholst commented 2 months ago

Hi Darrell,

Thanks for the message, I'll be happy to help if I can.

Based on your description, I think this should be possible. I don't know how it works on the LMS, but in the JSON you send to the client, you define the actions we send back to LMS when an item is selected. These actions can contain parameters that are part of what we send back. So it seems you should define parameters for work_id and grouping in the JSON for action you send to the client.

The protocol for this is described here: https://lyrion.org/reference/slimbrowse/

This documentation is currently not complete. Michael asked me to document the missing parts. In the meantime, you can look here, how this protocol is currently interpreted by Squeezer. If you follow the protocol it should work in all Jive based clients, including, squeezeplay, jivelite, Squeeze Radio, ...

The basic idea with this protocol is that the client sends a request and displays the response. The items in the response defines new requests, which the user can select. This means that the client does not what the action actually is or does, and thus you should be able to achieve what you want without the need to modify the clients.

From your description, is sounds like you use "goAction": "playControl" in the item loop. This normally has "itemsParams": "playControlParams" in its parameters in the base fields. In this case, you would need to add the work_id and grouping to the playControlParams section in each item. You can also put the JSON in this thread, then I can have a look.

darrell-k commented 2 months ago

Thanks for the reply. Debugging on the LMS side this is what I see:

This is an extract from the titles_loop returned by LMS when browsing a classical work:

 _results      => {
                     titles_loop => [
                           {
                             # tied Tie::IxHash
                             album         => "Zinman: Beethoven Symphonies",
                             artist        => "Vienna Philharmonic",
                             artist_id     => 2918,
                             artist_ids    => 2918,
                             band          => "Vienna Philharmonic",
                             band_ids      => 2918,
                             bitrate       => "446kbps VBR",
                             composer      => "Ludwig van Beethoven",
                             composer_ids  => 2919,
                             conductor     => "David Zinman",
                             conductor_ids => 2920,
                             disc          => 1,
                             disccount     => 1,
                             duration      => 15,
                             filesize      => 838_777,
                             genre         => "Classical",
                             grouping      => "",
                             id            => 13_884,
                             remote        => 0,
                             title         => "II. Poco sostenuto \x{2013} Vivace",
                             type          => "flc",
                             url           => "file:///home/darrell/testmusic3/Ludwig%20van%20Beethoven%3B%20Tonhalle-Orchester%20Z%C3%BCrich,%20David%20Zinman/Disc_1_-_05_-_Symphonie_nr._7_A%E2%80%90Dur,_op._92-_I._Poco_sostenuto_%E2%80%93_Vivace.flac",
                             work          => "Symphony No. 7 in A major, Op. 92",
                             work_id      => 847,
                             year          => 1995,
                           },

See the new values grouping and work_id.

Here is the subsequent playlistcontrol command sent by Squeezer:


[24-04-09 15:04:43.5764] Slim::Control::Commands::playlistcontrolCommand (1850) DK request=bless({
  _ae_callback  => sub { "???" },
  _cb_enable    => 1,
  _clientid     => "00:04:20:12:4b:74",
  _connectionid => "022ce728",
  _func         => sub { "???" },
  _isQuery      => 0,
  _langoverride => undef,
  _needClient   => 1,
  _params       => {
                     album_id => 735,
                     cmd => "load",
                     library_id => "91b427f1",
                     menu => 1,
                     useContextMenu => 1,
                   },
  _request      => ["playlistcontrol"],
  _requeststr   => "playlistcontrol",
  _results      => {},
  _source       => "/022ce728/slim/request/117|372||022ce728|Squeezer-squeezer/2.3.5",
  _status       => 1,
  _useixhash    => 0,
}, "Slim::Control::Request")

This needs to include the work_id and (if populated) grouping values from titles_loop to be set in the params, otherwise the whole album is added to the playlist.

The same applies to albums_loop when it contains work_id and grouping.

And currently, trying to add a work to the playlist (from the works list which has returned the works_loop to Squeezer (see below) causes Squeezer to hang: it should in this case create the playlistcontrol command with the composer_id and work_id parameters.

                     works_loop => [
                           {
                             composer    => "Franz Liszt",
                             composer_id => 2915,
                             image       => "f72d4899",
                             textkey     => "F",
                             work        => "Etudes d'Execution Transcendante",
                             work_id     => 848,
                           },
                           {
                             composer    => "Franz Liszt",
                             composer_id => 2915,
                             image       => "f72d4899",
                             textkey     => "F",
                             work        => "Valse oubli\xE9e",
                             work_id     => 847,
                           },

Thanks again.

kaaholst commented 2 months ago

From these snippets, I'm not able to tell why the work_id and grouping doesn't work. They seem to be from some LMS internals. This runs on the server. Clients like Squeezer only have access to what is sent over the network. The protocol specification for this is here: https://lyrion.org/reference/slimbrowse/

In the LMS web-interface please select Settings/Advanced/Logging and raise the "(network.cometd) - Cometd protocol logging" log-level to Debug.

After you test your lists, inspect the log, it will contain the JSON which is sent and received. You can then paste it here if you like.

Regarding whether Squeezer hangs, I'm guessing (hoping) it doesn't hang, but just doesn't show anything because there is no item_loop, as required by the specification. There seem to be a "works_loop" instead.

darrell-k commented 2 months ago

Apologies if I'm missing something obvious, but I'm struggling with this.

Here is the JSON sent to Squeezer when opening the album header menu for a classical work:

[24-04-09 21:18:50.7337] Slim::Web::Cometd::sendHTTPResponse (741) Sending Cometd chunk (192.168.1.244:52380):
[
  {
    "channel": "/ac197c1a/slim/request/210",
    "data": {
      "base": {
        "actions": {
          "set-preset-3": {
            "cmd": [
              "jivefavorites",
              "set_preset",
              "key:3"
            ],
            "player": "0",
            "itemsParams": "presetParams"
          },
          "go": {
            "nextWindow": "nowPlaying",
            "player": "0",
            "params": {
              "menu": "1",
              "cmd": "load",
              "library_id": "91b427f1",
              "album_id": "735",
              "grouping": "1975 Performance",
              "work_id": "853",
              "artist_id": "2920",
              "sort": "albumtrack",
              "composer_id": "2919"
            },
            "cmd": [
              "playlistcontrol"
            ],
            "itemsParams": "playallParams"
          },
          "set-preset-9": {
            "itemsParams": "presetParams",
            "cmd": [
              "jivefavorites",
              "set_preset",
              "key:9"
            ],
            "player": "0"
          },
          "set-preset-1": {
            "player": "0",
            "cmd": [
              "jivefavorites",
              "set_preset",
              "key:1"
            ],
            "itemsParams": "presetParams"
          },
          "set-preset-4": {
            "itemsParams": "presetParams",
            "player": "0",
            "cmd": [
              "jivefavorites",
              "set_preset",
              "key:4"
            ]
          },
          "set-preset-5": {
            "itemsParams": "presetParams",
            "player": "0",
            "cmd": [
              "jivefavorites",
              "set_preset",
              "key:5"
            ]
          },
          "add-hold": {
            "itemsParams": "commonParams",
            "cmd": [
              "playlistcontrol"
            ],
            "player": "0",
            "params": {
              "menu": "1",
              "cmd": "insert"
            }
          },
          "set-preset-2": {
            "itemsParams": "presetParams",
            "player": "0",
            "cmd": [
              "jivefavorites",
              "set_preset",
              "key:2"
            ]
          },
          "set-preset-6": {
            "cmd": [
              "jivefavorites",
              "set_preset",
              "key:6"
            ],
            "player": "0",
            "itemsParams": "presetParams"
          },
          "set-preset-7": {
            "cmd": [
              "jivefavorites",
              "set_preset",
              "key:7"
            ],
            "player": "0",
            "itemsParams": "presetParams"
          },
          "add": {
            "params": {
              "library_id": "91b427f1",
              "menu": "1",
              "cmd": "add",
              "work_id": "853",
              "grouping": "1975 Performance",
              "album_id": "735",
              "composer_id": "2919",
              "artist_id": "2920",
              "sort": "albumtrack"
            },
            "player": "0",
            "cmd": [
              "playlistcontrol"
            ],
            "itemsParams": "addallParams"
          },
          "playControl": {
            "itemsParams": "playControlParams",
            "window": {
              "isContextMenu": "1"
            },
            "cmd": [
              "browselibrary",
              "items"
            ],
            "params": {
              "work_id": "853",
              "_index": "0",
              "useContextMenu": "1",
              "artist_id": "2920",
              "library_id": "91b427f1",
              "menu": "1",
              "mode": "tracks",
              "grouping": "1975 Performance",
              "album_id": "735",
              "_quantity": "512",
              "composer_id": "2919"
            },
            "player": "0"
          },
          "more": {
            "window": {
              "isContextMenu": "1"
            },
            "itemsParams": "commonParams",
            "cmd": [
              "trackinfo",
              "items"
            ],
            "player": "0",
            "params": {
              "menu": "1",
              "library_id": "91b427f1",
              "album_id": "735",
              "grouping": "1975 Performance",
              "work_id": "853",
              "artist_id": "2920",
              "composer_id": "2919"
            }
          },
          "set-preset-8": {
            "itemsParams": "presetParams",
            "player": "0",
            "cmd": [
              "jivefavorites",
              "set_preset",
              "key:8"
            ]
          },
          "play": {
            "nextWindow": "nowPlaying",
            "player": "0",
            "params": {
              "menu": "1",
              "cmd": "load",
              "library_id": "91b427f1",
              "album_id": "735",
              "grouping": "1975 Performance",
              "work_id": "853",
              "artist_id": "2920",
              "sort": "albumtrack",
              "composer_id": "2919"
            },
            "cmd": [
              "playlistcontrol"
            ],
            "itemsParams": "playallParams"
          },
          "set-preset-0": {
            "player": "0",
            "cmd": [
              "jivefavorites",
              "set_preset",
              "key:0"
            ],
            "itemsParams": "presetParams"
          }
        }
      },
      "offset": "0",
      "count": "4",
      "item_loop": [
        {
          "style": "itemplay",
          "playallParams": {
            "play_index": "0"
          },
          "presetParams": {
            "favorites_url": "file:///home/darrell/testmusic3/Ludwig%20van%20Beethoven%3B%20Tonhalle-Orchester%20Z%C3%BCrich,%20David%20Zinman/Disc_1_-_01_-_Symphonie_nr._5_c%E2%80%90Moll,_op._67-_I._Allegro_con_brio.flac",
            "favorites_type": "audio",
            "favorites_title": "I. Allegro con brio"
          },
          "type": "audio",
          "text": "I. Allegro con brio",
          "commonParams": {
            "track_id": "13880"
          },
          "goAction": "play"
        },
        {
          "commonParams": {
            "track_id": "13881"
          },
          "goAction": "play",
          "style": "itemplay",
          "playallParams": {
            "play_index": "1"
          },
          "text": "II. Andante con moto",
          "presetParams": {
            "favorites_title": "II. Andante con moto",
            "favorites_type": "audio",
            "favorites_url": "file:///home/darrell/testmusic3/Ludwig%20van%20Beethoven%3B%20Tonhalle-Orchester%20Z%C3%BCrich,%20David%20Zinman/Disc_1_-_02_-_Symphonie_nr._5_c%E2%80%90Moll,_op._67-_II._Andante_con_moto.flac"
          },
          "type": "audio"
        },
        {
          "text": "III. Allegro",
          "type": "audio",
          "presetParams": {
            "favorites_url": "file:///home/darrell/testmusic3/Ludwig%20van%20Beethoven%3B%20Tonhalle-Orchester%20Z%C3%BCrich,%20David%20Zinman/Disc_1_-_03_-_Symphonie_nr._5_c%E2%80%90Moll,_op._67-_III._Allegro.flac",
            "favorites_title": "III. Allegro",
            "favorites_type": "audio"
          },
          "playallParams": {
            "play_index": "2"
          },
          "style": "itemplay",
          "goAction": "play",
          "commonParams": {
            "track_id": "13882"
          }
        },
        {
          "playallParams": {
            "play_index": "3"
          },
          "style": "itemplay",
          "type": "audio",
          "presetParams": {
            "favorites_url": "file:///home/darrell/testmusic3/Ludwig%20van%20Beethoven%3B%20Tonhalle-Orchester%20Z%C3%BCrich,%20David%20Zinman/Disc_1_-_04_-_Symphonie_nr._5_c%E2%80%90Moll,_op._67-_IV._Allegro.flac",
            "favorites_type": "audio",
            "favorites_title": "IV. Allegro"
          },
          "text": "IV. Allegro",
          "commonParams": {
            "track_id": "13883"
          },
          "goAction": "play"
        }
      ],
      "window": {
        "windowStyle": "text_list"
      }
    },
    "ext": {
      "priority": ""
    },
    "id": "738"
  }
]

I then click on "Play" and this is the message sent back to LMS:

[24-04-09 21:21:13.6999] Slim::Web::Cometd::handler (150) Cometd request (192.168.1.244:52488): [
  {
    channel => "/slim/request",
    clientId => "ac197c1a",
    data => {
          request  => [
                        "00:04:20:12:4b:74",
                        [
                          "playlistcontrol",
                          "useContextMenu:1",
                          "library_id:91b427f1",
                          "album_id:735",
                          "cmd:load",
                          "menu:1",
                          "artist_id:2920",
                        ],
                      ],
          response => "/ac197c1a/slim/request/226",
        },
    id => 794,
  },
]

This does not contain the work_id and grouping parameters which were sent by LMS (see above JSON) with the result that the whole album is added to the playlist, not just the tracks associated with the work_id and grouping qualifiers.

kaaholst commented 2 months ago

Thanks, this was the JSON I requested. A few things confuse me, though. I am uncertain what “when opening the album header menu” means? Also, I don't see an item with text “Play” in the JSON. I see 4 entries:

All of which will execute the play action when tapped, because they have "goAction": "play". The playaction is defined in the base fields, and has work_id and grouping parameters, so they should be sent back to LMS. Also, the play action has "itemsParams": "playallParams" and each item has a playallParamssection with play index, which will be added to the parameters in the base action. E.g. “I. Allegro con brio” has:

          "playallParams": {
            "play_index": "0"
          },

If possible, please send screenshots, I think they will be helpful.

darrell-k commented 2 months ago

NOTE: we are re-using the albums query for the Works display - without work_id or work_id and grouping, it behaves as before, showing the whole album. With work_id, or work_id and grouping, it shows only tracks matching those parameters.

First I navigate to the albums view of a Work via the new Works menu - this shows only the album tracks matching the work_id and the grouping values (in this case, 4 of the 17 tracks on the album). I click on the menu at the top (see pointer in screenshot):

image

Which opens this:

image

I click on "Play", which adds all 17 tracks to the playlist, not just the 4 specified by the work_id and grouping parameters:

image

kaaholst commented 2 months ago

I see now it makes sense!

Then I need the JSON which the result of executing the m̀ore action of the header Item. This is also the same JSON you would get from selecting the 3-dot menu to the right of this item in the previous screen. The JSON is quite long, so you can advantageously fold it using GitHub syntax. This can be tricky, so don't spend too much time on it!

darrell-k commented 2 months ago

Here's the request from Squeezer:

[24-04-10 12:07:27.9214] Slim::Web::Cometd::handler (150) Cometd request (192.168.1.244:55744): [
  {
    channel => "/slim/request",
    clientId => "98f6289f",
    data => {
          request  => [
                        "00:04:20:12:4b:74",
                        [
                          "albuminfo",
                          "items",
                          0,
                          512,
                          "work_id:1962",
                          "useContextMenu:1",
                          "library_id:91b427f1",
                          "album_id:1308",
                          "menu:1",
                          "grouping:1975 Performance",
                          "composer_id:4911",
                          "xmlBrowseInterimCM:1",
                        ],
                      ],
          response => "/98f6289f/slim/request/6",
        },
    id => 539,
  },
]
and the response... ``` [ { "channel": "/98f6289f/slim/request/6", "data": { "title": "Zinman: Beethoven Symphonies", "count": "18", "offset": "0", "window": { "windowStyle": "text_list" }, "item_loop": [ { "actions": { "play": { "params": { "library_id": "91b427f1", "album_id": "1308", "menu": "1", "cmd": "add" }, "cmd": [ "playlistcontrol" ], "player": "0", "nextWindow": "nowPlaying" }, "go": { "params": { "library_id": "91b427f1", "album_id": "1308", "menu": "1", "cmd": "add" }, "cmd": [ "playlistcontrol" ], "nextWindow": "parent", "player": "0" }, "add": { "player": "0", "cmd": [ "playlistcontrol" ], "params": { "library_id": "91b427f1", "album_id": "1308", "menu": "1", "cmd": "add" } } }, "addAction": "go", "type": "text", "style": "item_add", "text": "Add to End" }, { "style": "item_insert", "type": "text", "text": "Play Next", "addAction": "go", "actions": { "add": { "player": "0", "cmd": [ "playlistcontrol" ], "params": { "library_id": "91b427f1", "menu": "1", "album_id": "1308", "cmd": "insert" } }, "play": { "params": { "library_id": "91b427f1", "menu": "1", "album_id": "1308", "cmd": "insert" }, "cmd": [ "playlistcontrol" ], "nextWindow": "nowPlaying", "player": "0" }, "go": { "params": { "library_id": "91b427f1", "menu": "1", "album_id": "1308", "cmd": "insert" }, "cmd": [ "playlistcontrol" ], "nextWindow": "parent", "player": "0" } } }, { "style": "itemplay", "type": "text", "text": "Play", "addAction": "go", "actions": { "play": { "nextWindow": "nowPlaying", "player": "0", "params": { "cmd": "load", "album_id": "1308", "menu": "1", "library_id": "91b427f1" }, "cmd": [ "playlistcontrol" ] }, "go": { "cmd": [ "playlistcontrol" ], "params": { "cmd": "load", "album_id": "1308", "menu": "1", "library_id": "91b427f1" }, "player": "0", "nextWindow": "nowPlaying" } } }, { "actions": { "go": { "player": "0", "params": { "isContextMenu": "1", "url": "db:album.title=Zinman%3A%20Beethoven%20Symphonies&contributor.name=Tonhalle-Orchester%20Z%C3%BCrich", "title": "Zinman: Beethoven Symphonies" }, "cmd": [ "jivefavorites", "add" ] } }, "type": "text", "style": "item_fav", "text": "Save to Favorites", "addAction": "go" }, { "actions": { "add-hold": { "player": "0", "params": { "menu": "1", "library_id": "91b427f1", "artist_id": "4910", "cmd": "insert" }, "cmd": [ "playlistcontrol" ] }, "play": { "params": { "cmd": "load", "library_id": "91b427f1", "menu": "1", "artist_id": "4910" }, "cmd": [ "playlistcontrol" ], "nextWindow": "nowPlaying", "player": "0" }, "go": { "params": { "library_id": "91b427f1", "mode": "albums", "menu": "1", "artist_id": "4910" }, "cmd": [ "browselibrary", "items" ], "player": "0" }, "more": { "player": "0", "window": { "isContextMenu": "1" }, "params": { "artist_id": "4910", "menu": "1", "library_id": "91b427f1" }, "cmd": [ "artistinfo", "items" ] }, "add": { "params": { "menu": "1", "library_id": "91b427f1", "artist_id": "4910", "cmd": "add" }, "cmd": [ "playlistcontrol" ], "player": "0" } }, "type": "playlist", "text": "Artist: Vienna Philharmonic" }, { "actions": { "more": { "window": { "isContextMenu": "1" }, "player": "0", "cmd": [ "artistinfo", "items" ], "params": { "menu": "1", "library_id": "91b427f1", "artist_id": "4913" } }, "add": { "params": { "cmd": "add", "library_id": "91b427f1", "menu": "1", "artist_id": "4913" }, "cmd": [ "playlistcontrol" ], "player": "0" }, "go": { "player": "0", "params": { "artist_id": "4913", "menu": "1", "mode": "albums", "library_id": "91b427f1" }, "cmd": [ "browselibrary", "items" ] }, "add-hold": { "player": "0", "params": { "artist_id": "4913", "library_id": "91b427f1", "menu": "1", "cmd": "insert" }, "cmd": [ "playlistcontrol" ] }, "play": { "nextWindow": "nowPlaying", "player": "0", "cmd": [ "playlistcontrol" ], "params": { "cmd": "load", "artist_id": "4913", "library_id": "91b427f1", "menu": "1" } } }, "text": "Artist: Tonhalle-Orchester Zürich", "type": "playlist" }, { "type": "text", "style": "itemNoAction", "text": "Band/Orchestra: Vienna Philharmonic", "action": "none" }, { "style": "itemNoAction", "type": "text", "text": "Band/Orchestra: Tonhalle-Orchester Zürich", "action": "none" }, { "action": "none", "type": "text", "style": "itemNoAction", "text": "Composer: Ludwig van Beethoven" }, { "action": "none", "text": "Conductor: David Zinman", "style": "itemNoAction", "type": "text" }, { "text": "Album: Zinman: Beethoven Symphonies", "type": "playlist", "actions": { "add": { "params": { "cmd": "add", "album_id": "1308", "menu": "1" }, "cmd": [ "playlistcontrol" ], "player": "0" }, "more": { "params": { "menu": "1", "album_id": "1308" }, "cmd": [ "albuminfo", "items" ], "player": "0", "window": { "isContextMenu": "1" } }, "go": { "player": "0", "params": { "mode": "tracks", "library_id": "91b427f1", "menu": "1", "album_id": "1308" }, "cmd": [ "browselibrary", "items" ] }, "add-hold": { "cmd": [ "playlistcontrol" ], "params": { "cmd": "insert", "album_id": "1308", "menu": "1" }, "player": "0" }, "play": { "params": { "menu": "1", "album_id": "1308", "cmd": "load" }, "cmd": [ "playlistcontrol" ], "nextWindow": "nowPlaying", "player": "0" } } }, { "actions": { "more": { "params": { "menu": "1", "year": "2006" }, "cmd": [ "yearinfo", "items" ], "player": "0", "window": { "isContextMenu": "1" } }, "add": { "player": "0", "params": { "cmd": "add", "year": "2006", "menu": "1" }, "cmd": [ "playlistcontrol" ] }, "play": { "params": { "menu": "1", "cmd": "load", "year": "2006" }, "cmd": [ "playlistcontrol" ], "nextWindow": "nowPlaying", "player": "0" }, "add-hold": { "player": "0", "params": { "menu": "1", "year": "2006", "cmd": "insert" }, "cmd": [ "playlistcontrol" ] }, "go": { "cmd": [ "browselibrary", "items" ], "params": { "mode": "albums", "menu": "1", "year": "2006" }, "player": "0" } }, "text": "Year: 2006", "type": "playlist" }, { "action": "none", "text": "Disc: 1/1", "style": "itemNoAction", "type": "text" }, { "action": "none", "text": "Duration: 4:15", "style": "itemNoAction", "type": "text" }, { "actions": { "go": { "params": { "item_id": "350c15bb.14", "menu": "albuminfo" }, "cmd": [ "albuminfo", "items" ] } }, "addAction": "go", "text": "Artist information", "type": "outline" }, { "actions": { "go": { "params": { "menu": "albuminfo", "item_id": "350c15bb.15" }, "cmd": [ "albuminfo", "items" ] } }, "addAction": "go", "type": "outline", "text": "Album information" }, { "actions": { "go": { "params": { "slideshow": "1", "menu": "albuminfo", "item_id": "350c15bb.16" }, "cmd": [ "albuminfo", "items" ] } }, "addAction": "go", "text": "Local artwork", "type": "slideshow" }, { "text": "On Qobuz", "addAction": "go", "actions": { "go": { "params": { "item_id": "350c15bb.17", "menu": "albuminfo" }, "cmd": [ "albuminfo", "items" ] } } } ], "base": { "actions": { "more": { "cmd": [ "albuminfo", "items" ], "itemsParams": "params", "params": { "menu": "albuminfo" }, "window": { "isContextMenu": "1" }, "player": "0" }, "add": { "player": "0", "params": { "menu": "albuminfo" }, "itemsParams": "params", "cmd": [ "albuminfo", "playlist", "add" ] }, "playControl": { "params": { "_index": "0", "album_id": "1308", "work_id": "1962", "useContextMenu": "1", "_quantity": "512", "xmlBrowseInterimCM": "1", "menu": "1", "library_id": "91b427f1", "composer_id": "4911", "grouping": "1975 Performance" }, "itemsParams": "playControlParams", "cmd": [ "albuminfo", "items" ], "player": "0", "window": { "isContextMenu": "1" } }, "play": { "params": { "menu": "albuminfo" }, "itemsParams": "params", "cmd": [ "albuminfo", "playlist", "play" ], "nextWindow": "nowPlaying", "player": "0" }, "add-hold": { "params": { "menu": "albuminfo" }, "cmd": [ "albuminfo", "playlist", "insert" ], "itemsParams": "params", "player": "0" }, "go": { "params": { "menu": "albuminfo" }, "itemsParams": "params", "cmd": [ "albuminfo", "items" ] } } } }, "ext": { "priority": "" }, "id": "539" } ] ```
kaaholst commented 2 months ago

Alright, so the “Play” item has no goAction value and no do action, so it will execute the go action when selected. The go action is defined in the item, so it will overwrite any definition there may have been in the base section. The definition of the goaction in the item doesn't have work_id or grouping parameters, so they are not sent to the server. You can either define those parameters in the go action or define / use an action from base with them and other common parameters, and then complete the parameters in the item using the itemsParams mechanism. See e.g. playControl in base. Then you also have to define a playControlParams section in the item. (because the base action has "itemsParams": "playControlParams").

Hope this helps!

Play item ``` { "style": "itemplay", "type": "text", "text": "Play", "addAction": "go", "actions": { "play": { "nextWindow": "nowPlaying", "player": "0", "params": { "cmd": "load", "album_id": "1308", "menu": "1", "library_id": "91b427f1" }, "cmd": [ "playlistcontrol" ] }, "go": { "cmd": [ "playlistcontrol" ], "params": { "cmd": "load", "album_id": "1308", "menu": "1", "library_id": "91b427f1" }, "player": "0", "nextWindow": "nowPlaying" } } } ```
darrell-k commented 2 months ago

Hi,

Just to let you know this is fixed (in my fork of slimserver only, for now). Still a couple of other issues, but you've given me enough info to work it out now. Many thanks.

kaaholst commented 2 months ago

Thanks for the update, good to hear it's working for you.

Maybe you're already on top of this, but I suggest that when an item in the classical work list is selected, it shall work like “play from here”. That is all items in the playing queue (current playlist) has all items from the list, and playing starts from the selected item. So if the first item is selected, it's the same as selecting “Play” from the context menu (more action) of the header item. That way, the user doesn't have to find out about the 3-dot buttons. If “defeat-touch-…” is active, then, it can display a context menu where the user can select what to play. See screenshot. I think this is how Michael implemented it in the Spotify plugin, and Philippe in the Deezer plugin.

Let me know if you need any help with the icon for the Works entry in the main menu.

darrell-k commented 2 months ago

Actually, the 3 dot button for Works was what I mentioned was hanging before. The reason for this is that there is no workinfo request defined: LMS logs this: [{"error":"invalid request: Unknown in dispatch table","id":"18","channel":"/slim/request","successful":false}]

Anyway, I've got rid of workinfo, it would be of no use as the only "info" we have about a work is the name and composer (which are already displayed) and the albums containing the work (which you see by clicking the work, in order to select a a particular performance). The "3 dots" now just opens the "Play/Add to playlist/Play after current song" menu, so the user can play all versions of the work that they have, which is what we want.

We have got a new works icon now, but it doesn't exactly fit the Squeezer theme:

image