greendoescode / vlc-rpc

Discord rich presence for VLC media player. This is a fork of PigPogs VLC RPC, adding automatic album art.
MIT License
15 stars 3 forks source link

Fixed crashing on large files, special characters #13

Closed sdasda7777 closed 1 year ago

sdasda7777 commented 1 year ago

Now it actually won't crash due to large file not being loaded yet. The JSON encode you used was just a hack that might have worked with small files, but it still crashed if the file took longer to load than it took to encode the JSON, which is very much possible for larger files or slow storage.

Also fixed that thing with special characters, I think.

greendoescode commented 1 year ago

Thanks, I'll update the code with a few minor fixes.

greendoescode commented 1 year ago

When playing videos, it still trys to fetch album art, this in turn causes an error because undefined isn't a string. You can fix this by making undefined a string, and then just replacing anything that goes display_artist === undefined to display_artist === "undefined"

greendoescode commented 1 year ago

Lines 197, 198 and 91 also still use old methods, removed in your PR (artist, meta.artist)