Skip to content

Commit

Permalink
Use locale-independent mdfind query
Browse files Browse the repository at this point in the history
Apparently the `kind:Application` type of mdfind query is per-locale (so if you have Japanese added as one of your locales, you could also type `種類:アプリ` and it would work just as well).  This also means that if the user *doesn't* have English set as one of their locales, `kind:Application` doesn't work.
  • Loading branch information
TellowKrinkle committed May 2, 2019
1 parent 426f0c3 commit 19ec2c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gameScanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,12 @@ def findPossibleGamePaths(gameName):
if gameName == "Higurashi":
allPossibleGamePaths.extend(
x for x in subprocess
.check_output(["mdfind", "kind:Application", "Higurashi"])
.check_output(["mdfind", "kMDItemContentType == com.apple.application-bundle && ** == '*Higurashi*'"])
.decode("utf-8")
.split("\n") if x
)
elif gameName == "Umineko":
for gamePath in subprocess.check_output(["mdfind", "kind:Application", "Umineko"]).decode("utf-8").split("\n"):
for gamePath in subprocess.check_output(["mdfind", "kMDItemContentType == com.apple.application-bundle && ** == '*Umineko*'"]).decode("utf-8").split("\n"):
# GOG installer makes a `.app` that contains the actual game at `/Contents/Resources/game`
gogPath = os.path.join(gamePath, "Contents/Resources/game")
if os.path.exists(gogPath):
Expand Down

0 comments on commit 19ec2c4

Please sign in to comment.