Skip to content

Commit

Permalink
Add support for mpv installer from microsoft store
Browse files Browse the repository at this point in the history
  • Loading branch information
soredake committed Jan 5, 2024
1 parent b8de12f commit f8bffa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions syncplay/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def getValueForOS(constantDict):
try:
import os
MPVNET_PATHS.append(os.path.expandvars(r'%LOCALAPPDATA%\Microsoft\WindowsApps\mpvnet.exe'))
MPV_PATHS.append(os.path.expandvars(r'%LOCALAPPDATA%\Microsoft\WindowsApps\mpv.exe'))
except:
pass
VLC_PATHS = [
Expand Down
7 changes: 4 additions & 3 deletions syncplay/players/mpv.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from syncplay.players.basePlayer import BasePlayer
from syncplay.utils import isURL, findResourcePath
from syncplay.utils import isMacOS, isWindows, isASCII
from syncplay.utils import playerPathExists
from syncplay.vendor.python_mpv_jsonipc.python_mpv_jsonipc import MPV

class MpvPlayer(BasePlayer):
Expand Down Expand Up @@ -90,11 +91,11 @@ def isValidPlayerPath(path):

@staticmethod
def getExpandedPath(playerPath):
if not os.path.isfile(playerPath):
if os.path.isfile(playerPath + "mpv.exe"):
if not playerPathExists(playerPath):
if playerPathExists(playerPath + "mpv.exe"):
playerPath += "mpv.exe"
return playerPath
elif os.path.isfile(playerPath + "\\mpv.exe"):
elif playerPathExists(playerPath + "\\mpv.exe"):
playerPath += "\\mpv.exe"
return playerPath
if os.access(playerPath, os.X_OK):
Expand Down

0 comments on commit f8bffa3

Please sign in to comment.