diff --git a/syncplay/constants.py b/syncplay/constants.py index caddbaa..c608a97 100644 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -60,25 +60,25 @@ VLC_MIN_VERSION = "2.0.0" VLC_INTERFACE_MIN_VERSION = "0.2.1" CONTROLLED_ROOMS_MIN_VERSION = "1.3.0" MPC_PATHS = [ - r"C:\Program Files (x86)\MPC-HC\mpc-hc.exe", - r"C:\Program Files\MPC-HC\mpc-hc.exe", - r"C:\Program Files\MPC-HC\mpc-hc64.exe", - r"C:\Program Files\Media Player Classic - Home Cinema\mpc-hc.exe", - r"C:\Program Files\Media Player Classic - Home Cinema\mpc-hc64.exe", - r"C:\Program Files (x86)\Media Player Classic - Home Cinema\mpc-hc.exe", - r"C:\Program Files (x86)\K-Lite Codec Pack\Media Player Classic\mpc-hc.exe", - r"C:\Program Files\K-Lite Codec Pack\Media Player Classic\mpc-hc.exe", - r"C:\Program Files (x86)\Combined Community Codec Pack\MPC\mpc-hc.exe", - r"C:\Program Files\Combined Community Codec Pack\MPC\mpc-hc.exe", - r"C:\Program Files\MPC HomeCinema (x64)\mpc-hc64.exe", + r"c:\program files (x86)\mpc-hc\mpc-hc.exe", + r"c:\program files\mpc-hc\mpc-hc.exe", + r"c:\program files\mpc-hc\mpc-hc64.exe", + r"c:\program files\media player classic - home cinema\mpc-hc.exe", + r"c:\program files\media player classic - home cinema\mpc-hc64.exe", + r"c:\program files (x86)\media player classic - home cinema\mpc-hc.exe", + r"c:\program files (x86)\k-lite codec pack\media player classic\mpc-hc.exe", + r"c:\program files\k-lite codec pack\media Player classic\mpc-hc.exe", + r"c:\program files (x86)\combined community codec pack\mpc\mpc-hc.exe", + r"c:\program files\combined community codec pack\mpc\mpc-hc.exe", + r"c:\program files\mpc homecinema (x64)\mpc-hc64.exe", ] MPLAYER_PATHS = ["mplayer2", "mplayer"] -MPV_PATHS = ["mpv", "/opt/mpv/mpv", r"C:\Program Files\mpv\mpv.exe", r"C:\Program Files\mpv-player\mpv.exe", - r"C:\Program Files (x86)\mpv\mpv.exe", r"C:\Program Files (x86)\mpv-player\mpv.exe", +MPV_PATHS = ["mpv", "/opt/mpv/mpv", r"c:\program files\mpv\mpv.exe", r"c:\program files\mpv-player\mpv.exe", + r"c:\program Files (x86)\mpv\mpv.exe", r"c:\program Files (x86)\mpv-player\mpv.exe", "/Applications/mpv.app/Contents/MacOS/mpv"] VLC_PATHS = [ - r"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe", - r"C:\Program Files\VideoLAN\VLC\vlc.exe", + r"c:\program files (x86)\videolan\vlc\vlc.exe", + r"c:\program files\videolan\vlc\vlc.exe", "/usr/bin/vlc", "/usr/bin/vlc-wrapper", "/Applications/VLC.app/Contents/MacOS/VLC", diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index dc2db7e..8f7df17 100644 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -77,13 +77,22 @@ class ConfigDialog(QtGui.QDialog): if "http://" in path: return True + def safenormcaseandpath(self, path): + if self._isURL(path): + return path + else: + return os.path.normcase(os.path.normpath(path)) + def _tryToFillPlayerPath(self, playerpath, playerpathlist): settings = QSettings("Syncplay", "PlayerList") settings.beginGroup("PlayerList") savedPlayers = settings.value("PlayerList", []) if not isinstance(savedPlayers, list): savedPlayers = [] - playerpathlist = list(set(os.path.normcase(os.path.normpath(path)) for path in set(playerpathlist + savedPlayers))) + else: + for i, savedPlayer in enumerate(savedPlayers): + savedPlayers[i] = self.safenormcaseandpath(savedPlayer) + playerpathlist = list(set(playerpathlist + savedPlayers)) settings.endGroup() foundpath = "" @@ -103,9 +112,11 @@ class ConfigDialog(QtGui.QDialog): self.executablepathCombobox.addItem(foundpath) for path in playerpathlist: - if self._isURL(playerpath): - foundpath = path - self.executablepathCombobox.addItem(path) + if self._isURL(path): + if foundpath == "": + foundpath = path + if path != playerpath: + self.executablepathCombobox.addItem(path) elif os.path.isfile(path) and os.path.normcase(os.path.normpath(path)) != os.path.normcase(os.path.normpath(foundpath)): self.executablepathCombobox.addItem(path) @@ -114,12 +125,8 @@ class ConfigDialog(QtGui.QDialog): if foundpath != "": settings.beginGroup("PlayerList") - if self._isURL(foundpath): - playerpathlist.append(foundpath) - settings.setValue("PlayerList", list(set(path) for path in set(playerpathlist))) - else: - playerpathlist.append(os.path.normcase(os.path.normpath(foundpath))) - settings.setValue("PlayerList", list(set(os.path.normcase(os.path.normpath(path)) for path in set(playerpathlist)))) + playerpathlist.append(self.safenormcaseandpath(foundpath)) + settings.setValue("PlayerList", list(set(playerpathlist))) settings.endGroup() return foundpath