Artist & AlbumArtist - multi values and JSON

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • d6jg
    Senior Member
    • Feb 2011
    • 8652

    Artist & AlbumArtist - multi values and JSON

    > ...and (surprise, surprise) Apple's WebKit does not support the reg-exp
    > required! For IOS/macOS I'm just splitting on ","


    Yeah, I believe it didn't like the negative backtrack operator or similar...

    --

    Michael
    Jim



    VB2.4 storage QNAP TS419p (NFS)
    Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
    Office Joggler & Pi3 -> Onkyo CRN775 -> Celestion F10s
    Dining Room 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 > Denon RCFN8 -> Wharfedale Modus Cubes
  • d6jg
    Senior Member
    • Feb 2011
    • 8652

    #2
    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
    Jim



    VB2.4 storage QNAP TS419p (NFS)
    Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
    Office Joggler & Pi3 -> Onkyo CRN775 -> Celestion F10s
    Dining Room 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 > Denon RCFN8 -> Wharfedale Modus Cubes

    Comment

    • mherger
      Babelfish's Best Boy
      • Apr 2005
      • 24099

      #3
      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
      Michael

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

      Comment

      • d6jg
        Senior Member
        • Feb 2011
        • 8652

        #4
        Originally posted by mherger
        > 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.
        Jim



        VB2.4 storage QNAP TS419p (NFS)
        Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
        Office Joggler & Pi3 -> Onkyo CRN775 -> Celestion F10s
        Dining Room 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 > Denon RCFN8 -> Wharfedale Modus Cubes

        Comment

        • cpd73
          Senior Member
          • Mar 2017
          • 5007

          #5
          Originally posted by mherger
          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.

          Originally posted by mherger
          What's the exact query Material uses?
          For 'New Music' Material uses:

          Code:
          ["albums",0,25000,"sort:new","wantMetadata:1","tags:ajlsyKSE","menu:1"]
          Originally posted by mherger
          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.

          Comment

          • d6jg
            Senior Member
            • Feb 2011
            • 8652

            #6
            Originally posted by cpd73
            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?
            Jim



            VB2.4 storage QNAP TS419p (NFS)
            Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
            Office Joggler & Pi3 -> Onkyo CRN775 -> Celestion F10s
            Dining Room 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 > Denon RCFN8 -> Wharfedale Modus Cubes

            Comment

            • mherger
              Babelfish's Best Boy
              • Apr 2005
              • 24099

              #7
              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...



              > 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
              Michael

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

              Comment

              • d6jg
                Senior Member
                • Feb 2011
                • 8652

                #8
                Originally posted by mherger
                > ["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...



                > 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?
                Jim



                VB2.4 storage QNAP TS419p (NFS)
                Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
                Office Joggler & Pi3 -> Onkyo CRN775 -> Celestion F10s
                Dining Room 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 > Denon RCFN8 -> Wharfedale Modus Cubes

                Comment

                • cpd73
                  Senior Member
                  • Mar 2017
                  • 5007

                  #9
                  Originally posted by mherger
                  > ["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.

                  Originally posted by mherger


                  > 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.

                  Comment

                  • cpd73
                    Senior Member
                    • Mar 2017
                    • 5007

                    #10
                    Originally posted by d6jg
                    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.

                    Comment

                    • mherger
                      Babelfish's Best Boy
                      • Apr 2005
                      • 24099

                      #11
                      Artist &amp; 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
                      Michael

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

                      Comment

                      • cpd73
                        Senior Member
                        • Mar 2017
                        • 5007

                        #12
                        Originally posted by mherger
                        /(?<!\s),(?!\s)/
                        I was about to say...

                        Assuming this is what is used in the default web UI, this does not work. I created an mp3 with artist="a, b;c" - so 2 artists "a, b" and "c". The Default web UI shows "a, b, c" in now-playing/queue, but has hover/underline for "a" and "b" but not "c" - thinking there are 2 artists "a" and "b"

                        ...which is true, but I also noticed the queue has underline for "a, b" and "c". So, queue splits correctly, now-playing does not.
                        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

                        • cpd73
                          Senior Member
                          • Mar 2017
                          • 5007

                          #13
                          Originally posted by mherger
                          The artists here would be "a, b,c", and the regex makes sure it splits
                          on the comma without the spaces.
                          Nope, just checked, and for status messages its definitely "a, b, c" - with spaces. But, as I said, in default web UI now-playing does not split correctly queue does.
                          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

                          • d6jg
                            Senior Member
                            • Feb 2011
                            • 8652

                            #14
                            Originally posted by cpd73
                            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.
                            I’m not saying separate the values as I agree it’s impossible
                            I’m saying use a choice of 2 different json calls

                            Example of artist with a ,
                            Crosby, Stills, Nash & Young
                            although most would be happy to show it as
                            Crosby Stills Nash & Young
                            Jim



                            VB2.4 storage QNAP TS419p (NFS)
                            Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
                            Office Joggler & Pi3 -> Onkyo CRN775 -> Celestion F10s
                            Dining Room 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 > Denon RCFN8 -> Wharfedale Modus Cubes

                            Comment

                            • d6jg
                              Senior Member
                              • Feb 2011
                              • 8652

                              #15
                              Sorry to bring up a can of worms gents
                              Jim



                              VB2.4 storage QNAP TS419p (NFS)
                              Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
                              Office Joggler & Pi3 -> Onkyo CRN775 -> Celestion F10s
                              Dining Room 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 > Denon RCFN8 -> Wharfedale Modus Cubes

                              Comment

                              Working...