Author Topic: MusicBee API  (Read 320715 times)

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
would it be better to leave it to the lyrics plugin developers to remove any bracketed text in the track title at their choice?
My personal opinion based on the workings of Lyrics Reloaded and my library:

Leaving it unaltered would be a plus for web scrapers.
Changing it would be a plus for API-based plugins.

The reason it was done in the first case was to handle the cases where track titles contain an artist name or comments
Still valid reasons to this day, I would think.
I'm not sure how popular the following tagging structure is, but my title tags always contain guest artists in the form of (feat. A, B & C).
That's over 90% of my music and I doubt most databases recognize such titles.

__________

It's worth noting that your approach to situations like this over the years has been to introduce alternative methods rather than revamp existing behaviour in fear of breaking functionality elsewhere.
I think that approach has worked tremendously in the name of backwards compatibility.

So what I would suggest instead, is adding support for the sourceFileUrl parameter like Charlie pointed out.
That way, whoever wants the original title can seamlessly get the tag themselves using this (incomplete) parameter.
Strength and Honour (2025)


vidz97

  • Newbie
  • *
  • Posts: 10
This latest 3.5 release produces the following error:

MusicBee v3.5.8877.29160D  (Win10.0), 21 Apr 2024 21:38:

Code
System.InvalidCastException: Unable to cast object of type '#=zb1GcBWSkGkmiEXINZQ==' to type 'System.String'.
   at #=zrbDttskFerZnvGPRu7vQSrLiIig0.#=z5dkWyXz0a43S.#=zgWcTkwjOfOtS8mGbXg==(Object #=zIOqGacA=)
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)


CharlieJiang

  • Jr. Member
  • **
  • Posts: 25
Confirmed to be working, thanks Steven and Mayibongwe!
宇宙に始まりはあるが、終わりはない。 ---無限

slonopot

  • Jr. Member
  • **
  • Posts: 95
would it be better to leave it to the lyrics plugin developers to remove any bracketed text in the track title at their choice?
The reason it was done in the first case was to handle the cases where track titles contain an artist name or comments

Just make it an option during plugin initialization for compatibility, maybe there are plugins that will never be updated and changing the default behavior would affect the amount of successful results. For example, my plugins gradually broaden the query if no good results were found on the first try, it removes additional features that might be contained in tha Artist field. I don't mind updating the logic to first try as-is and later strip the parts I find unnecessary

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 34974
would it be better to leave it to the lyrics plugin developers to remove any bracketed text in the track title at their choice?
The reason it was done in the first case was to handle the cases where track titles contain an artist name or comments

Just make it an option during plugin initialization for compatibility, maybe there are plugins that will never be updated and changing the default behavior would affect the amount of successful results. For example, my plugins gradually broaden the query if no good results were found on the first try, it removes additional features that might be contained in tha Artist field. I don't mind updating the logic to first try as-is and later strip the parts I find unnecessary
the default behaviour of removing the brackets is unchanged. What has changed is the url field is populated so you can use that to re-query the original title tag and use as you want

boroda

  • Hero Member
  • *****
  • Posts: 5200
Steven is this possible for plugin hotkeys?

All the functions needed to set up the hotkey as a plugin were already available, so I have created one here:
https://getmusicbee.com/forum/index.php?topic=41310.0
That's some impressively fast and good service/solution.

Just a thought about it from a technical perspective:
Perhaps it would be useful if it allowed for having separate icons for disabled and enabled status?
Like this:


Not sure if that's even possible for a shortcut like this one (and I personally don't care since I wouldn't use this feature) but I thought to mention it anyway.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Hi,

When you delete a track from the library you are given 2 options.
1. Delete from Library only - This doesn't trigger a notification as far as I can tell.

2. Delete from Library and Computer - This triggers FileDeleting and FileDeleted.

Could it be changed so option 1 also triggers those notifications or another notification added like "FileRemovedFromLibrary" to handle this event.

Is there a link for the latest MusicbeeInterface file? I think the link the OP is probably a bit out of date. Mine has comments regarding version 57 so that's what I'm currently running.

Thanks.

edit: Also I think I may have asked this before but would you prefer new threads to be created for issues/requests like this instead of all dumped in here?
Last Edit: August 11, 2024, 08:46:34 AM by BoringName

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 34974
I did something for boroda very recently and added these notifications in v3.6
Code
    FileRemovedFromLibrary = 44
    FileRemovedFromInbox = 45
    FileRenamed = 46
i havent made the updated interface file available but you could just add them manually to the list of notification types

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Do I get extra points for guessing the name correctly?

That did the trick. Thanks.


Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
edit: Also I think I may have asked this before but would you prefer new threads to be created for issues/requests like this instead of all dumped in here?
My personal opinion:
While in recent times, this thread hasn't gotten bombarded with tens of +1s or multiple topics being discussed at once, I would suggest new topics be opened.
I have witnessed Steven replying to old topics (even threads without replies) and rarely on old requests where he has to dig (or remember to dig) through posts.
Strength and Honour (2025)

boroda

  • Hero Member
  • *****
  • Posts: 5200
Steven, could you provide a button mouse-over color via Setting_GetSkinElementColour() function? if it's not too hard (i believe it shouldn't).

boroda

  • Hero Member
  • *****
  • Posts: 5200
Steven, could you share the latest "MusicBeeInterface.cs" file? at this moment i'm only interested in new custom tags (16+), which are already available in MB 3.6 UI.

also, i would like to query MB version. more precisely, to query if it's 3.5 or 3.6. there is already api function for this, i just don't know the latest MB version definition constants.
Last Edit: September 04, 2024, 05:19:31 AM by boroda

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
Link from Steven which got deleted along with a couple of recent forum posts:

Quote from: Steven
https://mega.nz/file/osd0ASwL#8gVCjINGiit2r860NVJv8uiMkTpURyKRCQr8BoHzi-4

look for the MusicBeeVersion function in the interface file
you will need to use the latest v3.6 patch version for it to detect v3.6
Strength and Honour (2025)