applemusicrp icon indicating copy to clipboard operation
applemusicrp copied to clipboard

Crashes on song title >128 characters

Open JadenAnjara opened this issue 2 years ago • 8 comments

Hello, I've noticed the app sometimes crashing on certain musics. It has happened on some of the Apple Music Music Mix lists so I don't know if it's related to the musics not being in my library (but it doesn't seem to be the case as I'm listening to non library music without the app crashing) but that brings me to the second type of crash: titles. I don't know if it's the special character of the title ( called "¿") or the length of the album title Music to listen to~dance to~blaze to~pray to~feed to~sleep to~talk to~grind to~trip to~breathe to~help to~hurt to~scroll to~roll to~love to~hate to~learn Too~plot to~play to~be to~feel to~breed to~sweat to~dream to~hide to~live to~die to~GO TO but something in this music is definitely breaking the app (or Discord limitations maybe). I don't think it's the author as all the other Bring Me The Horizon songs seem to work fine

JadenAnjara avatar Oct 20 '22 02:10 JadenAnjara

Are you using Windows or macOS?

wxllow avatar Oct 20 '22 20:10 wxllow

Using Windows 10, Build 19044

JadenAnjara avatar Oct 21 '22 17:10 JadenAnjara

I figured out the issue, the state has to be <128 characters. I will fix this as soon as I can :)

pypresence.exceptions.ServerError: Child "activity" fails because child "state" fails because "state" length must be less than or equal to 128 characters long

wxllow avatar Oct 22 '22 19:10 wxllow

To be honest that's an edge case XD Nice figuring it out tho !

JadenAnjara avatar Oct 22 '22 21:10 JadenAnjara

Hi, absolutely love the work! Any updates on this bug?

Ammar360 avatar Apr 24 '23 00:04 Ammar360

@@ -67,10 +67,10 @@ def get_rp(info, statuses):

    formatting_args = {
        "status": "Playing" if info[0] == "PLAYING" else "Paused",
        "state": info[0][:125] + "..." if len(info[0]) > 128 else info[0],
        "song": info[1][:125] + "..." if len(info[1]) > 128 else info[1],
        "artist": info[2][:125] + "..." if len(info[2]) > 128 else info[2],
        "album": info[3][:125] + "..." if len(info[3]) > 128 else info[3],
    }

    # Format arguments

I wonder if this code would help solve your code, and you could push out a new release? I tried to make my own pull and compile it but it was missing a lot of the necessary libraries

Ammar360 avatar Jun 13 '23 00:06 Ammar360

@@ -67,10 +67,10 @@ def get_rp(info, statuses):

    formatting_args = {
        "status": "Playing" if info[0] == "PLAYING" else "Paused",
        "state": info[0][:125] + "..." if len(info[0]) > 128 else info[0],
        "song": info[1][:125] + "..." if len(info[1]) > 128 else info[1],
        "artist": info[2][:125] + "..." if len(info[2]) > 128 else info[2],
        "album": info[3][:125] + "..." if len(info[3]) > 128 else info[3],
    }

    # Format arguments

I wonder if this code would help solve your code, and you could push out a new release? I tried to make my own pull and compile it but it was missing a lot of the necessary libraries

hmm that probably would fix it!

wxllow avatar Jun 16 '23 18:06 wxllow

Awesome, let me know if that works! Looking forward to the next release because this bug is single-handedly driving me the most crazy lol.

Ammar360 avatar Jun 24 '23 16:06 Ammar360