tnychn / mpv-discord

🎈 A cross-platform Discord Rich Presence integration for mpv with no external dependencies.
MIT License
172 stars 14 forks source link

A default binary_path located at the mpv config path without the need to manually edit it in every time. Potentially fixes #12, #22 and #33 #35

Open TheBluuDot opened 2 years ago

TheBluuDot commented 2 years ago

This PR can eliminate the need to manually specify binary_path in discord.conf if the Go binary is being extracted to the default config location in mpv. It uses the "expand-path" mpv property to get the location of mpv configuration location from "~~home/" and concatenates it with the platform specific location (/bin/windows/mpv-discord.exe in this case) specified in script-opts/discord.conf. This will potentially solve #12, #22 and #33 by making the installation process more convenient. Although one potential pitfall would be having to maintain 3 different discord.conf files for each platform. ver and uname with io.popen() could be used as a workaround to that but it greatly impacts the launch time for mpv. Basically,

Pros:

Cons:

TheBluuDot commented 2 years ago

I have found a way to get platform detection to work now so the disadvantage mentioned earlier is redundant. No changes to discord.conf are needed anymore nor is there any need to maintain three different versions of discord.conf.