Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 5 123 ... LastLast
Results 1 to 10 of 43
  1. #1
    Senior Member
    Join Date
    Feb 2011
    Location
    Cheshire, UK
    Posts
    5,451

    Artist & AlbumArtist - multi values and JSON

    Iíll try to keep this brief

    There is a notable difference between Material and Default when browsing by album. Essentially the difference is that Material uses a json call that returns only the first value for AlbumArtist where the tag / database contains multi values.
    Default shows all values.
    This is a display difference only but a very welcome one (to me) as I use multi value tagging to index albums against multiple artists but donít wish to see all of these artists when browsing.

    I had thought that the json call was returning an array and that by accident of design Craig was extracting value 1 only but it seems this is not the case. The json returns value 1 only.

    My question - is there a similar json call available at Artist level such that (optionally) only value 1 could be displayed in the Queue and Now Playing areas.

    Here Craig has confirmed that the call used in Material returns a comma separated list of all values rather than simply value 1. It is not possible to extract value 1 as it itself may contain a ,

    You will gather that in the case of compilation albums I use multi values at Artist level to achieve the indexing Iím looking for but it causes a display issue.

    I should add that others have stated they like to see all values at Artist level in Queue and Now Playing so we need 2 calls available which can be switchable inside Material.

    Thanks
    VB2.4 storage QNAP TS419p (NFS)
    Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
    Office Joggler & Pi3 -> Denon RCD N8 -> Celestion F10s
    Dining Room SB Boom
    Kitchen UE Radio (upgraded to SB Radio)
    Bedroom (Bedside) Pi Zero+DAC ->ToppingTP21 ->AKG Headphones
    Bedroom (TV) & Bathroom SB Touch ->Denon AVR ->Mordaunt Short M10s + Kef ceiling speakers
    Guest Room Joggler > Topping Amp -> Wharfedale Modus Cubes
    Everything controlled by iPeng & Material on iOS

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

    Artist & AlbumArtist - multi values and JSON

    > This is a display difference only but a very welcome one (to me) as I
    > use multi value tagging to index albums against multiple artists but
    > don’t wish to see all of these artists when browsing.


    Where would you see multiple artists in the default skin? In the albums
    view I only have one artist (the album artist) even if I tag tracks with
    multiple artists.

    > I had thought that the json call was returning an array and that by
    > accident of design Craig was extracting value 1 only but it seems this
    > is not the case. The json returns value 1 only.


    What's the exact query Material uses?

    > I should add that others have stated they like to see all values at
    > Artist level in Queue and Now Playing so we need 2 calls available which
    > can be switchable inside Material.


    If the default UI shows multiple artists, then Material can, too.

    --

    Michael

  3. #3
    Senior Member
    Join Date
    Feb 2011
    Location
    Cheshire, UK
    Posts
    5,451
    Quote Originally Posted by mherger View Post
    > This is a display difference only but a very welcome one (to me) as I
    > use multi value tagging to index albums against multiple artists but
    > don’t wish to see all of these artists when browsing.


    Where would you see multiple artists in the default skin? In the albums
    view I only have one artist (the album artist) even if I tag tracks with
    multiple artists.

    > I had thought that the json call was returning an array and that by
    > accident of design Craig was extracting value 1 only but it seems this
    > is not the case. The json returns value 1 only.


    What's the exact query Material uses?

    > I should add that others have stated they like to see all values at
    > Artist level in Queue and Now Playing so we need 2 calls available which
    > can be switchable inside Material.


    If the default UI shows multiple artists, then Material can, too.

    --

    Michael
    Iíll post screenshots etc a bit later but itís the other way round.
    VB2.4 storage QNAP TS419p (NFS)
    Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
    Office Joggler & Pi3 -> Denon RCD N8 -> Celestion F10s
    Dining Room SB Boom
    Kitchen UE Radio (upgraded to SB Radio)
    Bedroom (Bedside) Pi Zero+DAC ->ToppingTP21 ->AKG Headphones
    Bedroom (TV) & Bathroom SB Touch ->Denon AVR ->Mordaunt Short M10s + Kef ceiling speakers
    Guest Room Joggler > Topping Amp -> Wharfedale Modus Cubes
    Everything controlled by iPeng & Material on iOS

  4. #4
    Senior Member
    Join Date
    Mar 2017
    Posts
    2,609
    Quote Originally Posted by mherger View Post
    Where would you see multiple artists in the default skin? In the albums
    view I only have one artist (the album artist) even if I tag tracks with
    multiple artists.
    There might be other places, but if you look in 'New Music' then the Default UI shows all album-artists for an album, Material shows just one.

    Quote Originally Posted by mherger View Post
    What's the exact query Material uses?
    For 'New Music' Material uses:

    Code:
    ["albums",0,25000,"sort:new","wantMetadata:1","tags:ajlsyKSE","menu:1"]
    Quote Originally Posted by mherger View Post
    If the default UI shows multiple artists, then Material can, too.
    Material does for queue and now-playing, just not in browse. In the queue you see all artists comma-separated. This, however, is as its passed by LMS. I think the query was about showing just the main artist. As LMS uses a comma separated list then a client cannot split this list - as you can't be sure the comma is a separator, or is part of an (unlikely) artist name.

    (Note, I have no issue with the current LMS responses - I'm just answering the above)
    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.

  5. #5
    Senior Member
    Join Date
    Feb 2011
    Location
    Cheshire, UK
    Posts
    5,451
    Quote Originally Posted by cpd73 View Post
    There might be other places, but if you look in 'New Music' then the Default UI shows all album-artists for an album, Material shows just one.



    For 'New Music' Material uses:

    Code:
    ["albums",0,25000,"sort:new","wantMetadata:1","tags:ajlsyKSE","menu:1"]


    Material does for queue and now-playing, just not in browse. In the queue you see all artists comma-separated. This, however, is as its passed by LMS. I think the query was about showing just the main artist. As LMS uses a comma separated list then a client cannot split this list - as you can't be sure the comma is a separator, or is part of an (unlikely) artist name.

    (Note, I have no issue with the current LMS responses - I'm just answering the above)
    Craigís explanation is correct.

    IF you tag AlbumArtist on a multi value basis under Albums & New Music Material shows value 1 only. It is always the first value entered in your tagging. Presumably the scanner inputs them in the same order.
    In default all values are shown.
    The way Material displays it is logical (to me). The Json call Craig refers to pulls on value 1.
    The other values are used for indexing only and this approach indexes the album under all of the values in AlbumArtist.

    I do not use multi values at Artist level except for compilation albums. Here if I use multiple values for a given track the indexing is also correct but both Material & Default put all values into the Queue & Now Playing areas.

    From my perspective (but not others) Iíd like to see value 1 only at Queue & Now Playing level.

    Is there a json call that does this and if it does exist can it be a switchable display option in Material?

    Do you now need screenshots Michael or is this clearer?
    VB2.4 storage QNAP TS419p (NFS)
    Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
    Office Joggler & Pi3 -> Denon RCD N8 -> Celestion F10s
    Dining Room SB Boom
    Kitchen UE Radio (upgraded to SB Radio)
    Bedroom (Bedside) Pi Zero+DAC ->ToppingTP21 ->AKG Headphones
    Bedroom (TV) & Bathroom SB Touch ->Denon AVR ->Mordaunt Short M10s + Kef ceiling speakers
    Guest Room Joggler > Topping Amp -> Wharfedale Modus Cubes
    Everything controlled by iPeng & Material on iOS

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

    Artist & AlbumArtist - multi values and JSON

    > ["albums",0,25000,"sort:new","wantMetadata:1","tags :ajlsyKSE","menu:1"]

    The default handler uses "aa" instead of just "a", and "SS" for "S". And
    then yes, it does split the artist names by the comma...

    https://github.com/Logitech/slimserv...brary.pm#L1461

    > As LMS uses a comma separated list then a client cannot split this list
    > - as you can't be sure the comma is a separator, or is part of an
    > (unlikely) artist name.


    I'm surprised this hasn't lead to issues before! TBH I don't even fully
    understand the regex I'm using for the splitting:

    /(?<!\s),(?!\s)/

    I'd have to look it up!... but I believe it does some backtracking to
    filter out commas with whitespace around them or something.

    --

    Michael

  7. #7
    Senior Member
    Join Date
    Feb 2011
    Location
    Cheshire, UK
    Posts
    5,451
    Quote Originally Posted by mherger View Post
    > ["albums",0,25000,"sort:new","wantMetadata:1","tags :ajlsyKSE","menu:1"]

    The default handler uses "aa" instead of just "a", and "SS" for "S". And
    then yes, it does split the artist names by the comma...

    https://github.com/Logitech/slimserv...brary.pm#L1461

    > As LMS uses a comma separated list then a client cannot split this list
    > - as you can't be sure the comma is a separator, or is part of an
    > (unlikely) artist name.


    I'm surprised this hasn't lead to issues before! TBH I don't even fully
    understand the regex I'm using for the splitting:

    /(?<!\s),(?!\s)/

    I'd have to look it up!... but I believe it does some backtracking to
    filter out commas with whitespace around them or something.

    --

    Michael
    If I am reading this correctly then it appears that what Iím asking for isnít that difficult to achieve at all.

    On the unlikely event of commas inside a single tag value I saw (and corrected) one that dbPoweramp offered me only yesterday but I would be quite happy to remove any from my tagging if it proved to be a problem but Iím not sure it would be as I have a feeling that the regex works.

    Is a switchable value 1 / all values display option in Q and Now Playing now possible Craig?

  8. #8
    Senior Member
    Join Date
    Mar 2017
    Posts
    2,609
    Quote Originally Posted by mherger View Post
    > ["albums",0,25000,"sort:new","wantMetadata:1","tags :ajlsyKSE","menu:1"]

    The default handler uses "aa" instead of just "a", and "SS" for "S". And
    then yes, it does split the artist names by the comma...
    Yeah, I can see that now. Not 100% sure I see the need for multiple album-artists, but that's personal preference I guess.

    Quote Originally Posted by mherger View Post
    https://github.com/Logitech/slimserv...brary.pm#L1461

    > As LMS uses a comma separated list then a client cannot split this list
    > - as you can't be sure the comma is a separator, or is part of an
    > (unlikely) artist name.


    I'm surprised this hasn't lead to issues before! TBH I don't even fully
    understand the regex I'm using for the splitting:

    /(?<!\s),(?!\s)/

    I'd have to look it up!... but I believe it does some backtracking to
    filter out commas with whitespace around them or something.
    No expert, but I don't see how this could reliable work. If I have ArtistA="a, b" and ArtistB="c", then artists="a, b, c" - no way to split that. into "a, b" and "c" (And, yes I know a comma in an artist name is highly unlikely).

    Code:
    use Data::Dumper qw(Dumper);
    my $str="a, b, c";
    my @parts = split /(?<!\s),(?!\s)/, $str;
    print Dumper \@parts;
    produces:

    Code:
    $VAR1 = [
              'a, b, c'
            ];
    I see no way, looking at songinfo, to just get main composer, artist, etc. i.e. the equivalent of "a"=single album artist, "aa"=all album artists. But, I'm not sure I see this an an issue for the queue/now-playing - there I would want all shown.
    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.

  9. #9
    Senior Member
    Join Date
    Mar 2017
    Posts
    2,609
    Quote Originally Posted by d6jg View Post
    Is a switchable value 1 / all values display option in Q and Now Playing now possible Craig?
    No, because you cannot reliably split the list. You can only split if you assume comma is never in one of the strings - that might break for others. Still, I'm not sure I want extra processing on every queue/song update to process the artist, composer, conductor, and band lists.

    The AlbumArtist case in the albums list is easy enough - that is just using a different "tags" parameter.
    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.

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

    Artist & AlbumArtist - multi values and JSON

    > No expert, but I don't see how this could reliable work. If I have
    > ArtistA="a, b" and ArtistB="c", then artists="a, b, c" - no way to split
    > that. into "a, b" and "c" (And, yes I know a comma in an artist name is
    > highly unlikely).


    The artists here would be "a, b,c", and the regex makes sure it splits
    on the comma without the spaces. So... it would still fail if your first
    artist was "a,b", rather than "a, b". But that's even more unlikely to
    happen. Overall it's a hack, but it seems to be working reasonably well :-).

    --

    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
  •