Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 8 123 ... LastLast
Results 1 to 10 of 76
  1. #1

    CLI interface limitations - workarounds?

    I am developping a web player for LMS and there are a number of things i would like to do which do not seem to be possible using the CLI interfaces. As a workaround, so far, i am using the CLI API to obtain all the albums/tracks/artists in my library, which i store in an indexeddb database and use with alasql in javascript. I may have missed something however...

    Here is what i would like to do:

    - display/search artists by role (album or track artists vs composers vs conductors) and genre. I cannot seem to find any way to get information on the role of an artist aside for compiling all the tracks. This is a pitty, since the LMS SQLite database actually contains a table of artsist by role. Moreover, in the tracks, multiple artists within a role are concatenated with a comma as a seperator, and splitting them up is not very fast.

    - display albums with the full artists tag (seems the CLI interface only gets the first one). The full list of artists only seem to be available in the tracks search. Ex: having configured "/" as the separator in my library if i have an album with "Duke Ellington / John Coltrane" as album artist, the albums API only returns "Duke Ellington" in the albumartist..

    Any suggestions would be welcome.
    Last edited by hopkins; 2019-03-10 at 07:50.

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

    CLI interface limitations - workarounds?

    > - display/search artists by role (album or track artists vs composers vs
    > conductors) and genre. I cannot seem to find any way to get information
    > on the role of an artist aside for compiling all the tracks.


    Did you try the artists query with the role_id parameter?

    > - display albums with the full artists tag (seems the CLI interface only
    > gets the first one). The full list of artists only seem to be available
    > in the tracks search.


    Did you try the albums query with the a, aa, s, and/or ss tags?

    http://htmlpreview.github.io/?https:...s/cli-api.html

    --

    Michael

  3. #3
    Great thanks, will try that. I had not seen the 7.9 updates to the CLI interfaces.

  4. #4
    I have another "noob" question. Is it ok to call the CLI functions in javascript in synchronous mode or is it recommended to do it asynchronously ?

    Ex: if I want to list all albums by an artist, with another artist as a composer (hypothetical search) - it seems a little complicated to code all this in asynch mode...
    Or, another example, I want to search for all artists that contain "duke" in their name and list all albums (so I would have x artists returned, and for each would call the "albums" request).
    Last edited by hopkins; 2019-03-12 at 13:29.

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

    CLI interface limitations - workarounds?

    > I have another "noob" question. Is it ok to call the CLI functions in
    > javascript in synchronous mode or is it recommended to do it
    > asynchronously ?


    Doesn't matter from the server's point of view. That's a client side
    question.

    > Ex: if I want to list all albums by an artist, with another artist as a
    > composer (hypothetical search) - it seems a little complicated to code
    > all this in asynch mode...


    Sometimes things are more complicated than you'd want, but inevitable.
    Using sync calls you could lock up your frontend for the time taken to
    respond to your request. Imagine LMS takes two seconds to answer. During
    that time the UI wouldn't process anything. JS is single-threaded.

    Do async calls. There are libraries to ease the pain of the callback hell.

    --

    Michael

  6. #6
    Quote Originally Posted by mherger View Post
    > I have another "noob" question. Is it ok to call the CLI functions in
    > javascript in synchronous mode or is it recommended to do it
    > asynchronously ?


    Doesn't matter from the server's point of view. That's a client side
    question.

    > Ex: if I want to list all albums by an artist, with another artist as a
    > composer (hypothetical search) - it seems a little complicated to code
    > all this in asynch mode...


    Sometimes things are more complicated than you'd want, but inevitable.
    Using sync calls you could lock up your frontend for the time taken to
    respond to your request. Imagine LMS takes two seconds to answer. During
    that time the UI wouldn't process anything. JS is single-threaded.

    Do async calls. There are libraries to ease the pain of the callback hell.

    --

    Michael
    Thanks, have started working on it - in asynch mode, and will see if I need to get into complex searches.

    I two more small questions:

    - is there any reason why the "New Music Limit" setting should be kept to a low number (100, 200...), aside for responsiveness in the app ? Are there any issues on the server side ?

    - I would be nice to get information on the number of albums by artist, for sorting purposes. Is that somethings that could be integrated in the "artists" request in a future release ?

  7. #7
    Thanks - have started working on it in asynch mode, and will see if I need to get into complex searches.

    I have two more small questions:

    - is there any reason why the "New Music Limit" setting should be kept low, aside for responsiveness in the app ? Are there any issues server-side ?

    - it would be nice to have an album count per artist (for sorting purposes). Is that something that could be implemented in a future version of the CLI interfaces ?

    And another actually: are the images coming from the Music Album Information plugin (available through the address /imageproxy/mai/artist/<artistID>/image.png) resized by the server ?
    Last edited by hopkins; 2019-03-13 at 02:32.

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

    CLI interface limitations - workarounds?

    > - is there any reason why the "New Music Limit" setting should be kept
    > low, aside for responsiveness in the app ? Are there any issues
    > server-side ?


    I think it's really only performance.

    > - it would be nice to have an album count per artist (for sorting
    > purposes). Is that something that could be implemented in a future
    > version of the CLI interfaces ?


    As part of the "artists" query? Hmm... it could probably be done. But
    after all these years I sometimes wonder why this request had not come
    up before. Can the challenge be answered differently?...

    --

    Michael

  9. #9
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,324
    Quote Originally Posted by hopkins View Post
    And another actually: are the images coming from the Music Album Information plugin (available through the address /imageproxy/mai/artist/<artistID>/image.png) resized by the server ?
    Any request to the image proxy would accept resizing parameters. But the raw URL you post would not be resized. You'd get that 40MB scan of a LP cover, if that was what the plugin found.
    Michael

    http://www.herger.net/slim-plugins - Spotty, MusicArtistInfo

  10. #10
    Quote Originally Posted by mherger View Post
    >

    > - it would be nice to have an album count per artist (for sorting
    > purposes). Is that something that could be implemented in a future
    > version of the CLI interfaces ?


    As part of the "artists" query? Hmm... it could probably be done. But
    after all these years I sometimes wonder why this request had not come
    up before. Can the challenge be answered differently?...

    --

    Michael
    It is just one way of sorting information, but I do not see how that could be done without complicated processing on the client side. I just thought this could be "simple" to add on the server side, but if not it is not "fundamental" - more of a "nice to have"...

Posting Permissions

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