slonopot / Museexmatch

Musixmatch lyrics provider for MusicBee.
23 stars 0 forks source link

Plugin crashes when Beenius enabled #2

Closed skarsudo closed 4 months ago

skarsudo commented 4 months ago

Windows 10 Home, latest version at 11 MAR 2024 MusicBee Portabe 3.5.8698 (latest for now)

  1. Install Beenius into MusicBee, enable it
  2. Install Museexmatch into MusicBee, enable it
  3. Launch MusicBee
  4. See an error message (not always, with about 70% chance) crashhh
  5. In MusicBee > Preferences > Plugins we see that Museexmatch was automatically turned off (and Beenius is still running OK) image

    Assumption 1:

    This both plugins are using common files, which all are stored in ../MusicBee/Plugins/:

    • NLog.dll
    • Topten.JsonKit.dll

Maybe the problem is that they try to access these files at the same time, but Beenius does it first? But how can we explain cases when Museexmatch starts normally without errors?


Assumption 2:

Maybe Beenius isn't involved at all and Museexmatch crashes on its own?

slonopot commented 4 months ago

Are you able to access Musixmatch in your browser? Your IP may be banned if you use a trash VPN, at least it's the case with Genius.

Since you are using a portable version, your plugin directories are still system ones, make sure you either place your updated plugins in %appdata% or use a bat loader that overwrites the variable before launching musicbee so it loads the files from the correct location. I've forced all locations to %appdata% in the latest version since relative paths are a bad practice, here's the loader that might help.

Last, delete a line with the token from the configuration or delete the file itself and launch the app again. It will create a new token, maybe yours is dead and is being incorrectly handled.

If it doesn't help, I'll take a more thorough look. Mine was working fine last time I checked.

skarsudo commented 4 months ago

Solved! 10 restarts - zero crashes.

Yeah, I can access Musixmatch freely without VPN

Just copied all the .dll and .conf files of both plugins to C:\Users\User\AppData\Roaming\MusicBee\Plugins\ and it worked! I didn't have to delete the .conf files (because of broken token) - just moved them to where you said. Besides, the token is only in beenius.conf, but Museexmatch was crashing.

Thanks alot for such quick support! 🤍

It's sad that relative paths are a bad practice(( After all, the portable version was made with the expectation that you can move a fully customized MusicBee with all plugins to another computer in one 'drag and drop' and don't bother about it. And now I have to make a separate readme with an instruction how to correctly transfer just these 2 plugins.

Is there an option to choose at will whether you want to use relative paths (for portable users) or absolute paths (for all others) ?

slonopot commented 4 months ago

Good.

I am unaware of any adequate ways to determine current location of the dll/executable, all the hacks with working paths are hella unreliable. Usually the portable apps overwrites the %appdata% variable to contain the expected path nearby the main executable and later the modules should be able to use this variable for storage location path. There should not be a distinction between portable and installed versions, plugin should just assume %appdata%/MusicBee/ exists and writable. MusicBee Portable does not do that for some unknown reason and thus can't be 100% portable. Since MusicBee is closed source and developer resources do not exist, I may only offer a custom launcher that will overwrite the variables and launch the musicbee process. If done properly, such session will have %appdata% in the working directory of the portable application and the plugins will be able to access configuration files locally. Try it, maybe it will help you to some extent.

skarsudo commented 4 months ago

Oh, that's how it is... Really complicated. Thanks for the explanation!