Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontends: better support for mpv.net #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stax76
Copy link

@stax76 stax76 commented Jan 4, 2024

I submit this pull request to improve mpv.net support. It works without the need of user configuration.

@dyphire
Copy link
Contributor

dyphire commented Mar 24, 2024

A simpler and more effective patch:

---
 thumbfast.lua | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/thumbfast.lua b/thumbfast.lua
index fce7f6e..c7c7ab7 100644
--- a/thumbfast.lua
+++ b/thumbfast.lua
@@ -275,6 +275,13 @@ options.scale_factor = math.floor(options.scale_factor)
 
 local mpv_path = options.mpv_path
 
+if mpv_path == "mpv" then
+    local frontend_name = mp.get_property_native("user-data/frontend/name")
+    if frontend_name == "mpv.net" then
+        mpv_path = mp.get_property_native("user-data/frontend/process-path")
+    end
+end
+
 if mpv_path == "mpv" and os_name == "darwin" and unique then
     -- TODO: look into ~~osxbundle/
     mpv_path = string.gsub(subprocess({"ps", "-o", "comm=", "-p", tostring(unique)}).stdout, "[\n\r]", "")
@@ -520,10 +527,6 @@ local function spawn(time)
                             end
                         else
                             mp.commandv("show-text", "thumbfast: ERROR! cannot create mpv subprocess", 5000)
-                            if os_name == "windows" then
-                                mp.commandv("script-message-to", "mpvnet", "show-text", "thumbfast: ERROR! install standalone mpv, see README", 5000, 20)
-                                mp.commandv("script-message", "mpv.net", "show-text", "thumbfast: ERROR! install standalone mpv, see README", 5000, 20)
-                            end
                         end
                     else
                         mp.commandv("show-text", "thumbfast: ERROR! cannot create mpv subprocess", 5000)
-- 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants