Python Pypresence better integration#15
Open
StratusFearMe21 wants to merge 6 commits intocniw:masterfrom
Open
Conversation
cniw
reviewed
Oct 12, 2020
mpv-discordRPC/main.lua
Outdated
| {repeatable=false}) | ||
|
|
||
| -- run `main` function | ||
| io.popen('python3 "/media/isaac/Games/Home/isaac/.config/mpv/scripts/mpv-discordRPC/python-pypresence.py" &') |
Owner
There was a problem hiding this comment.
Please don't use hard coded file path.
just use python instead of python3 explicitly
Author
There was a problem hiding this comment.
When I used python instead of python3 it gave me errors about pypresense not existing, and when I installed it with pip it gave me invalid syntax errors. I guess that could just be a Linux thing
Author
|
sorry, I was editing an outdated version. Should be fixed now. I also changed the filenames. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! It's difficult to get two languages to work together in harmony but I think I have a solution that would allow more people to use this plugin. I was having a problem where your plugin would clog up discord by opening too many instances of python at once and not closing them properly. But my solution allows for python to only be opened once, and then closed only when mpv is finished. It makes lua write to a plain text file in /dev/shm (A linux directory that writes directly to RAM) and then have python read that file every 4 seconds (to avoid asyncio problems) and update discord accordingly. At the moment my implementation only works with Linux because /dev/shm doesn't exist in Windows. But that directory should be able to be easily replaced by a variable in the config file (I don't know how those work yet so I couldn't implement it).