getmusicbee.com

MusicBee & Add-Ons => Customizations => Plugins => Topic started by: cleaninfla on February 02, 2021, 02:40:16 PM

Title: Enhanced Discord Presence
Post by: cleaninfla on February 02, 2021, 02:40:16 PM
This is the first plugin i wrote for MusicBee, It enables Discord Rich Presence and allows you to automatically upload and use your album artwork, Show time remaining, play / pause status, artist and track name.

https://github.com/maybeclean/musicbee-rich-presence
https://github.com/maybeclean/musicbee-rich-presence/releases/tag/v1.1

*Discord has a max size of 300 for assets meaning you can have 298 artworks including play / pause icons or 300 without. This is an internal limitation and cannot be bypassed.
**Characters from other languages (Japanese for example) might not pass Discord's asset regex and fail to upload artwork, currently looking for a work around.
***This plugin uses a publicly exposed portion of the Discord API (/assets) to upload images and does not violate any ToS or agreement because of that.

(https://i.imgur.com/F3udPi3.png)
Title: Re: Enhanced Discord Presence
Post by: mantecademani on February 03, 2021, 07:08:14 PM
Hey, just managed to get this plugin working for the most part, but I ran into one issue. I'm getting a ["String value did not match validation regex."] error in the log file whenever I play a song from the Owl City album "Maybe I'm Dreaming". Any idea what it could be. Not a huge deal, but would be nice to figure out. Awesome job with the plugin though, really nice to have the album art in discord!
Title: Re: Enhanced Discord Presence
Post by: cleaninfla on February 03, 2021, 09:06:06 PM
Hey, just managed to get this plugin working for the most part, but I ran into one issue. I'm getting a ["String value did not match validation regex."] error in the log file whenever I play a song from the Owl City album "Maybe I'm Dreaming". Any idea what it could be. Not a huge deal, but would be nice to figure out. Awesome job with the plugin though, really nice to have the album art in discord!

That issue is because of Discord's internal regex not allowing some symbols, i've updated the repo so single and double quotes are changed to '_' which Discord supports and that should fix your issue.
Title: Re: Enhanced Discord Presence
Post by: mantecademani on February 04, 2021, 01:49:18 AM
Hey, just managed to get this plugin working for the most part, but I ran into one issue. I'm getting a ["String value did not match validation regex."] error in the log file whenever I play a song from the Owl City album "Maybe I'm Dreaming". Any idea what it could be. Not a huge deal, but would be nice to figure out. Awesome job with the plugin though, really nice to have the album art in discord!

That issue is because of Discord's internal regex not allowing some symbols, i've updated the repo so single and double quotes are changed to '_' which Discord supports and that should fix your issue.

That seems to have done it, thanks!
Title: Re: Enhanced Discord Presence
Post by: cleaninfla on April 30, 2021, 11:47:35 PM
Precompiled Binaries are now available at GitHub with full functionality https://github.com/maybeclean/musicbee-rich-presence/releases/tag/v1.0
Title: Re: Enhanced Discord Presence
Post by: kick12134 on May 03, 2021, 04:29:13 AM
Hey there, I tried this plugin but when I tried to activate it in musicbee it gives me an "Unable to initialise plugin: mb_discordrichpresence.dll" error
Title: Re: Enhanced Discord Presence
Post by: cleaninfla on May 08, 2021, 03:56:52 AM
This has been fixed with the latest commit, binaries have been updated aswell. Feel free to redownload them and try it out.
Title: Re: Enhanced Discord Presence
Post by: HOX on May 09, 2021, 08:21:20 AM
Is it should work with portable version?
Title: Re: Enhanced Discord Presence
Post by: cleaninfla on May 09, 2021, 07:11:44 PM
Plugin should work fine with portable, only difference is that you would drag the plugin files to the plugin folder in your portable folder. Everything else is the exact same following the readme.
Title: Re: Enhanced Discord Presence
Post by: Shingo on May 10, 2021, 12:13:23 PM
Hey, I downloaded the latest binaries (v1.1) and followed the instructions in the readme, but I still get the same error as kick12134.

My MusicBee version is 3.4.7792.
Title: Re: Enhanced Discord Presence
Post by: diozzz on May 10, 2021, 05:07:08 PM
Hello, I tried to enable the plugin but it gives me an "Exception has been thrown by the target of an invocation" error message.
Also, Here is the error logs.

Code
2021/05/11 0:10:30 - 10.0.19042.0 - 3.4.7764.37422D - System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: The format of value '' is invalid.
   at System.Net.Http.Headers.HttpHeaderParser.ParseValue(String value, Object storeValue, Int32& index)
   at System.Net.Http.Headers.HttpHeaders.ParseAndAddValue(String name, HeaderStoreItemInfo info, String value)
   at System.Net.Http.Headers.HttpHeaders.Add(String name, String value)
   at MusicBeePlugin.Plugin.Initialise(IntPtr apiInterfacePtr)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at #=z_aDAVc7sMkwkYxQETg==..ctor(#=zoKrwgApZgrrQua03HQ== #=zmYRlZmg=)
Title: Re: Enhanced Discord Presence
Post by: sadpengu on May 10, 2021, 08:00:03 PM
Have the same issue as above!
 Looking forward to a fix :)
Title: Re: Enhanced Discord Presence
Post by: chiascuro on June 06, 2021, 07:23:13 AM
I'm sure you can get around the 300 image restriction if it was possible to use multiple developer applications, after all you can have over 20 developer applications on one Discord account alone.

To fix the issue with foreign characters not being accepted by Discord's asset regex and fail to upload, you could instead create a database and assign each album a string of numbers(+letters) instead of the actual name for assets (this would also be beneficial for albums from separate artists that by chance have the same album name).

Otherwise great plugin and when those 2 things get fixed/added it's gonna be perfect! Thank you for your efforts
Title: Re: Enhanced Discord Presence
Post by: pachi_87 on June 17, 2021, 01:02:44 AM
so my player is showing weird characters next to the track and artist tags
(https://i.imgur.com/o9fmUmP.png)
Title: Re: Enhanced Discord Presence
Post by: draykid on June 22, 2021, 04:19:08 PM
Do you know why I get an error "Failed to find .LDB files to obtain Auth Token" when I try to add the plugin?
Title: Re: Enhanced Discord Presence
Post by: SOTC on August 24, 2021, 11:28:33 PM
I really don't know why, but mine isn't working.
I created the aplication on Discord, added the .PNGs for play/pause, copied the AppID and inserted in MusicBee,
restarted and i'm not getting any errors but still the Rich Presence doesn't show up.
I've seen that kanjis can be problematic, but i tested with safe titles and still doesn't appear.
Discord Stable 94599 - MusicBee 3.4.7805 - Windows 10
Any help?
(https://i.imgur.com/5kE2ezw.png)
Title: Re: Enhanced Discord Presence
Post by: SOTC on August 26, 2021, 02:43:09 PM
I tried to reinstall it and now i'm having this error:
English: It was not possible to load the file ou assembly 'xxxxxx' or one of it's dependencies.
The system couldn't find the specified file.
(https://i.imgur.com/zTF8P3P.png)
Title: Re: Enhanced Discord Presence
Post by: Shingo on August 29, 2021, 06:28:22 PM
I installed the newest build and it works now, nice!

The only issue I have is that cover art doesn't show up at first if it's new, probably needs time to get uploaded I guess.

(https://i.imgur.com/q6fnoNA.jpg)

BTW it would be cool to be able to customize which tags get fetched, for example having something else instead of the genre between the brackets while mouse hovering on the cover art.
Title: Re: Enhanced Discord Presence
Post by: heyman111 on September 02, 2021, 03:15:45 AM
Can someone please explain the process of what to do in the Discord developer portal? I've installed the plugin, made an application on Discord, copied the ID into the settings on MusicBee, but I have no idea what to do next.
Title: Re: Enhanced Discord Presence
Post by: Shingo on September 02, 2021, 10:05:51 AM
Can someone please explain the process of what to do in the Discord developer portal? I've installed the plugin, made an application on Discord, copied the ID into the settings on MusicBee, but I have no idea what to do next.

From the developer portal page, just go to "Rich Presence > Art Assets" from the menu on the left and upload two images named "playing" and "paused", which will show up over the bottom right corner of the album's cover art.
Title: Re: Enhanced Discord Presence
Post by: heyman111 on September 02, 2021, 10:26:06 PM
Can someone please explain the process of what to do in the Discord developer portal? I've installed the plugin, made an application on Discord, copied the ID into the settings on MusicBee, but I have no idea what to do next.

From the developer portal page, just go to "Rich Presence > Art Assets" from the menu on the left and upload two images named "playing" and "paused", which will show up over the bottom right corner of the album's cover art.

I've done that but it keeps saying "Failed Artwork Upload for *albumname*"
Title: Re: Enhanced Discord Presence
Post by: stitch on September 06, 2021, 04:17:14 PM
I love this addon so far, a few issues I have though are that it sometimes uploads multiple pictures for the same album and I have to manually delete the duplicates. I also wish that if one hits the max upload limit of 300, it defaults to using the MusicBee icon, instead of being blank.
Title: Re: Enhanced Discord Presence
Post by: Shingo on September 07, 2021, 05:34:06 PM
Can someone please explain the process of what to do in the Discord developer portal? I've installed the plugin, made an application on Discord, copied the ID into the settings on MusicBee, but I have no idea what to do next.

From the developer portal page, just go to "Rich Presence > Art Assets" from the menu on the left and upload two images named "playing" and "paused", which will show up over the bottom right corner of the album's cover art.

I've done that but it keeps saying "Failed Artwork Upload for *albumname*"

I don't know how to help you with that then, sorry!

I love this addon so far, a few issues I have though are that it sometimes uploads multiple pictures for the same album and I have to manually delete the duplicates.

That happens to me too, basically every time I listen to multiple songs from the same album while it's still uploading the album art. Avoiding that is the only way I've found as a workaround for now until it's eventually fixed.
Title: Re: Enhanced Discord Presence
Post by: heyman111 on September 28, 2021, 02:21:54 AM
Anyone know why I get this error when I try to install the plugin?

2021-09-07 03:01:02 - 10.0.17763.0 - 3.4.7848.25737P - System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\User\AppData\Roaming\discordptb\Local Storage\leveldb'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)
   at System.IO.DirectoryInfo.GetFiles(String searchPattern)
   at Utils.DiscordToken.GetAuthToken()
   at MusicBeePlugin.Plugin.Initialise(IntPtr apiInterfacePtr)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at #=zLk3E4bFQvZcnxfIySg==..ctor(#=zGS7Y5W9EqD$bsYFYfA== #=zcXGEDzQ=)
Title: Re: Enhanced Discord Presence
Post by: SonicRings on September 28, 2021, 11:54:20 AM
The concept of this is very promising. Do you by any chance have the knowledge to implement this feature in sll552's version of the plugin? https://github.com/sll552/DiscordBee/issues/87

If you can make a fork and make it so you can select which albums display their artwork as per my open issue, that'd be great!
Title: Re: Enhanced Discord Presence
Post by: Chaython on November 21, 2021, 10:32:49 PM
The plugin is syncing album art to the discord app but not showing presence in discord.