Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 4 of 4
  1. #1
    jvromans@squirrel.nl
    Guest

    JSON API and tagged parameters

    According to the description, I can specify a 'tags' parameter to control
    what items are requested. For example in a 'songinfo' query:

    { id: 2,
    method: 'slim.request',
    params: [ 'xx:xx:xx:xx:xx:xx',
    [ 'songinfo', 0, 20, 'track_id:706768', 'tags:aelc' ] ]
    }

    Is the resultant information always returned in the same order? I.e.
    [0] is rescan if rescanning, otherwise

    result: {
    songinfo_loop: [
    { id: 706768 },
    { title: 'One Minute You\'re Here' },
    { artist: 'Bruce Springsteen' },
    { album_id: 56866 },
    { album: 'Letter To You' },
    { coverid: 'ad4f99cf' }
    ]
    }

    [0] is id
    [1] is title
    [2] is artist ('a')
    [3] is album_id ('e')
    [4] is album ('l')
    [5] is coverid ('c')

    [0] and [1] are fixed(?), the rest is in the order requested(?).

    If so, why not return a single object:

    result: {
    songinfo_loop: {
    id: 706768,
    title: 'One Minute You\'re Here',
    artist: 'Bruce Springsteen',
    album_id: 56866,
    album: 'Letter To You',
    coverid: 'ad4f99cf'
    }
    }

    -- Johan

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

    JSON API and tagged parameters

    > [0] is id
    > [1] is title
    > [2] is artist ('a')
    > [3] is album_id ('e')
    > [4] is album ('l')
    > [5] is coverid ('c')
    >
    > [0] and [1] are fixed(?), the rest is in the order requested(?).
    >
    > If so, why not return a single object:


    I wouldn't rely on the position. Use the value's key instead. But I
    don't have a response for your "why" question. And as the hardware
    clients most likely never will see an update to their firmware, this is
    not going to change.

    --

    Michael

  3. #3
    jvromans@squirrel.nl
    Guest

    JSON API and tagged parameters

    On Mon, 2 Nov 2020 14:32:44 +0100, Michael Herger <slim (AT) herger (DOT) net> wrote:

    > I wouldn't rely on the position.


    Not even for "scanning" being element 0 ?

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

    JSON API and tagged parameters

    >> I wouldn't rely on the position.
    >
    > Not even for "scanning" being element 0 ?


    Ok, I'll try to be clearer: do NOT rely on the position. Parse the date
    and use the key.

    --

    Michael

Posting Permissions

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