Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 76

Hybrid View

  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,323

    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,323

    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.

Posting Permissions

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