Skip to content

Commit cc26950

Browse files
authored
Merge pull request #3 from Garulf/dev
Fix uninstalled filter & Missing Playnite file message
2 parents 74fc4d8 + 1eca14f commit cc26950

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Name": "Playnite",
55
"Description": "Search and launch your Playnite library.",
66
"Author": "Garulf",
7-
"Version": "1.1.0",
7+
"Version": "1.2.0",
88
"Language": "python",
99
"Website": "https://github.com/Garulf/playnite-plugin",
1010
"IcoPath": "./icon.png",

plugin/main.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,22 @@ def load_settings(self):
2626
self.playnite_path = str(pn.DATA_FOLDER)
2727
self.settings['playnite_path'] = str(pn.DATA_FOLDER)
2828
self.hide_uninstalled = self.settings.get('hide_uninstalled', True)
29-
if not Path(self.playnite_path).exists():
30-
self.add_item(
31-
title='Library file not found!',
32-
subtitle="Please set the path to Playnite\'s data directory in settings.",
33-
icon=ICON_SETTINGS,
34-
method=self.open_setting_dialog
35-
)
36-
self.add_item(
37-
title='Install FlowLauncherExporter plugin.',
38-
subtitle='FlowLauncherExporter plugin is required to use this plugin.',
39-
icon='',
40-
method=self.uri,
41-
parameters=[PLUGIN_URI]
4229

43-
)
30+
def missing_library(self):
31+
self.add_item(
32+
title='Library file not found!',
33+
subtitle="Please set the path to Playnite\'s data directory in settings.",
34+
icon=ICON_SETTINGS,
35+
method=self.open_setting_dialog
36+
)
37+
self.add_item(
38+
title='Install FlowLauncherExporter plugin.',
39+
subtitle='FlowLauncherExporter plugin is required to use this plugin.',
40+
icon='',
41+
method=self.uri,
42+
parameters=[PLUGIN_URI]
43+
44+
)
4445

4546
def main_search(self, query):
4647
for game in self.games:
@@ -82,13 +83,14 @@ def install_filter(self):
8283
self.games = [game for game in self.games if not game.is_installed]
8384

8485
def uninstalled_filter(self):
85-
self.games = [game for game in self.games if game.is_installed or game.install_directory != None]
86+
self.games = [game for game in self.games if game.is_installed and (game.install_directory != None or game.install_directory != "")]
8687

8788
def query(self, query):
8889
self.load_settings()
8990
try:
9091
self.games = pn.import_games(self.playnite_path)
9192
except FileNotFoundError:
93+
self.missing_library()
9294
return
9395
if query.startswith(SOURCE_FILTER):
9496
query = query[len(SOURCE_FILTER):]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
git+git://github.com/garulf/[email protected].3#egg=flox
1+
git+git://github.com/garulf/[email protected].4#egg=flox

0 commit comments

Comments
 (0)