Author Topic: MusicBee API  (Read 288321 times)

Pako

  • Full Member
  • ***
  • Posts: 132
I have one question, respectively a feature request.
It is possible (using a single API call) to obtain information string such as "128k MP3 Radio Stream" in the attached picture (from track details)?
If not, I think it would be very nice improvement.


Thanks, Pako

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34362
there isnt a direct way but you could construct it yourself using:
FilePropertyType.Kind
FilePropertyType.Bitrate

Pako

  • Full Member
  • ***
  • Posts: 132
there isnt a direct way but you could construct it yourself using:
FilePropertyType.Kind
FilePropertyType.Bitrate
Yes, in that case it would be relatively easy.
But if it's not a stream, it's a lot more complicated.
And I even have to first find out which case it is (stream or file).
So (given that MusicBee has always this string already constructed),
I thought it would be worthwhile to incorporate new functionality.


Thanks, Pako

Pako

  • Full Member
  • ***
  • Posts: 132
Maybe this gives the impression that I'm lazy write a bit of extra code.
This is not so. I just thought that such a feature would welcome more developers (not just me).
BTW - I'm working on a web UI for EventGhost plugin. I'm almost done.
Here you can see how it looks:

You can see that the "info string" I was able to build.
However, I stumbled upon the fact that the "FilePropertyType.Kind" returns something like "Stream", "MP3 Stream" and the like.
The word Radio I have to add yourself.
I have a question: It can be any other than Radio stream?
If yes, how I can know that it is just Radio ?

Pako

Pako

  • Full Member
  • ***
  • Posts: 132
there isnt a direct way but you could construct it yourself using:
FilePropertyType.Kind
FilePropertyType.Bitrate
So as I now realized it is not as easy as it seemed.
If you choose (in MusicBee) a language other than English, then it's a little confusing.

Thus behaves string FilePropertyType.Kind:
1) Radio Stream
MusicBee: correctly translated by language file
API: "Stream" (untranslated)
2) Web Stream

MB: correctly translated by language file
API: incorrectly translated by language file (aka "audio file")

It is also a problem with the string "Unknown Bitrate".
MusicBee does not display it, but the API returns it (untranslated).
I'm actually glad it is untranslated, because in that case I can filter it.
If it was translated, is there any way to find the corresponding expression in the currently selected language?
Something like GetLocalisedString("Main.msg.UnBitrate#")  ?

I hope I wrote it clearly.
Pako

boroda

  • Sr. Member
  • ****
  • Posts: 4620

Pako

  • Full Member
  • ***
  • Posts: 132
I happened to noticed that also notifikacion window shows the wrong kind (untranslated):


Pako

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34362
I am not aware of any having developed an artwork retrieval plugin but i will mention that for v2.2 the API has changed so the expected result returned by the plugin is a web link rather than the bass64 string for the downloaded picture. This is for multi-threading changes being made to artwork retrieval.
If this does affect anyone, please let me know

kelsos

  • Sr. Member
  • ****
  • Posts: 302
Steven are you talking about this call
Code
 mbApiInterface.NowPlaying_GetDownloadedArtwork()
If yes I use the base64 at some points in the remote plugin but I could easily add some check for api version and handle it differently on the newer versions.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34362
no i am refering to a plugin dedicated to providing artwork to MusicBee. Yours retrieves artwork from MusicBee and is not impacted.
As a side note, i suggest you use the url based versions of the artwork retrieval as that should be more effecient (MB usually already has the artwork written to a temporary file so passing a link to that is much faster)

boroda

  • Sr. Member
  • ****
  • Posts: 4620
What is the result of NowPlaying_GetDuration() and Player_GetPosition()? Number of seconds?

kelsos

  • Sr. Member
  • ****
  • Posts: 302


boroda

  • Sr. Member
  • ****
  • Posts: 4620
Steven, is there any way of getting currently displayed rotating artist picture? NowPlaying_GetArtistPicture() returns only 1st artist picture from rotating ones.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34362
Steven, is there any way of getting currently displayed rotating artist picture? NowPlaying_GetArtistPicture() returns only 1st artist picture from rotating ones.
use NowPlaying_GetArtistPictureUrls(true, urls[]) to get them all the locally stored ones but there is no way to get the current active one