Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146

    CLI command : number of Favorite

    Hello,

    how to know the number of favorites you have stored ?

    "info total favorites" doesn't exist.

    Thanks

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

    CLI command : number of Favorite

    > "info total favorites" doesn't exist.

    "favorites items 0 10" would give you a "count" element in the response.
    That probably comes closest.

  3. #3
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Quote Originally Posted by mherger View Post
    > "info total favorites" doesn't exist.

    "favorites items 0 10" would give you a "count" element in the response.
    That probably comes closest.
    I saw this command, but with radio stations as favorites it send a very very long message!

    I would table to create a table with all favorites stations name. If I now the length of the favorite I can ask the only the station name

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,776
    Asking for one item should only give you one item back:

    Code:
     % curl -sX POST -d '{"id":0,"params":["",["favorites", "items", 0, 1]],"method":"slim.request"}' http://musicpi.local:9000/jsonrpc.js | jq .
    {
      "result": {
        "count": 14,
        "loop_loop": [
          {
            "id": "8ee3b9b5.0",
            "name": "SRF3",
            "type": "audio",
            "image": "....../image.png",
            "isaudio": 1,
            "hasitems": 0
          }
        ],
        "title": "Favoriten"
      },
      "id": 0,
      "method": "slim.request",
      "params": [
        "",
        [
          "favorites",
          "items",
          "0",
          "1"
        ]
      ]
    }
    Despite the "count" of 14.
    Michael

    "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
    (LMS: Settings/Information)

  5. #5
    Senior Member
    Join Date
    Jan 2022
    Location
    Switzerland
    Posts
    146
    Quote Originally Posted by mherger View Post
    Despite the "count" of 14.
    Count is perfect ! Thanks !

Posting Permissions

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