Garulf / Playnite-Plugin

Search and launch your Playnite library.
10 stars 1 forks source link

TypeError #12

Closed apotenza92 closed 2 years ago

apotenza92 commented 2 years ago

Please type any relevant information here

Followed instructions - installed playnite extension and installed flow launcher extension - nothing works.

Trace Log

``` Traceback (most recent call last): File C:\Users\apote\AppData\Roaming\FlowLauncher\Plugins\Playnite-1.5.3\lib\flox\launcher.py, line 43, in __call__ results = request_method(*request_parameters) or self._results File C:\Users\apote\AppData\Roaming\FlowLauncher\Plugins\Playnite-1.5.3\lib\flox\__init__.py, line 118, in _query self.query(query) File C:\Users\apote\AppData\Roaming\FlowLauncher\Plugins\Playnite-1.5.3\plugin\main.py, line 98, in query self.games = pn.import_games(self.playnite_path) File C:\Users\apote\AppData\Roaming\FlowLauncher\Plugins\Playnite-1.5.3\plugin\playnite.py, line 13, in import_games library_file = Path(data_folder, 'ExtensionsData', SCRIPT_NAME, file_name) File pathlib.py, line 1041, in __new__ File pathlib.py, line 682, in _from_parts File pathlib.py, line 666, in _parse_args TypeError: expected str, bytes or os.PathLike object, not NoneType ```

Garulf commented 2 years ago

Hi there,

Do you know if you are running Playnite in portable mode? You may need to point the Playnite plugin to your Playnite's installation if you have it installed this way. Otherwise the plugin assumes it's installed in non-portable mode.

You can adjust this in Flow Launchers settings under plugins and scrolling until you find this plugin.

apotenza92 commented 2 years ago

My Playnite is installed in non-portable mode. What do I input for the Playnite User Directory? Would it be: C:\Users\apote\AppData\Roaming\Playnite or C:\Users\apote\AppData\Local\Playnite or C:\Users\apote\AppData\Roaming\Playnite\Extensions\FlowLauncherExporter ? If I use this method do I even need to use the Playnite extension at all?

apotenza92 commented 2 years ago

I just tried inputting any paths. But the moment I type 'pn' into FlowLauncher the path is instantly deleted from the settings and I get the same error as above. I'm on Windows 11 btw if that makes any difference.

apotenza92 commented 2 years ago

I tried uninstalling Playnite and Flow Launcher and starting fresh. Same issue still occurs. From what I can tell also anytime I run the 'pn' command the entire plugin resets itself - even if I do something like unchecking the 'Hide Uninstalled' the moment I run 'pn' it resets to being checked. Something strange is going on.

apotenza92 commented 2 years ago

After a bit more digging and looking through the plugin.log it seems it's an issue with the flox launcher.py file? 19:57:18 ERROR (launcher.py): expected str, bytes or os.PathLike object, not NoneType Traceback (most recent call last): File "C:\Users\apote\AppData\Roaming\FlowLauncher\Plugins\Playnite-1.5.3\lib\flox\launcher.py", line 43, in __call__ results = request_method(*request_parameters) or self._results File "C:\Users\apote\AppData\Roaming\FlowLauncher\Plugins\Playnite-1.5.3\lib\flox\__init__.py", line 118, in _query self.query(query) File "C:\Users\apote\AppData\Roaming\FlowLauncher\Plugins\Playnite-1.5.3\plugin\main.py", line 98, in query self.games = pn.import_games(self.playnite_path) File "C:\Users\apote\AppData\Roaming\FlowLauncher\Plugins\Playnite-1.5.3\plugin\playnite.py", line 13, in import_games library_file = Path(data_folder, 'ExtensionsData', SCRIPT_NAME, file_name) File "pathlib.py", line 1041, in __new__ File "pathlib.py", line 682, in _from_parts File "pathlib.py", line 666, in _parse_args TypeError: expected str, bytes or os.PathLike object, not NoneType

Garulf commented 2 years ago

It's not finding a file at that path. Have you activated the plugin in Playnite? It can be activated in its own menu or by manually refreshing your library.

apotenza92 commented 2 years ago

Yep everything's activated and tried restarting the process a few times. No luck unfortunately.

Garulf commented 2 years ago

I think I know what's going on. I'll take a look tonight.

apotenza92 commented 2 years ago

Oh great thanks! Here's a screenshot I just took showing the relevant installed locations of things and the Playnite extension. image

Garulf commented 2 years ago

If I'm right you should be able to completely exit Flow Launcher by right-clicking it's icon in the Task Tray and hitting exit.

Once you do that navigate to your Flow Launcher's "Settings" folder (%appdata%/FlowLauncher/Settings/Playnite-Plugin) and opening the .json file in there and manually typing your Playnites installation path.

Should look something like this:

{
    "playnite_path": "c:/Users/Garulf/appdata/Roaming/Playnite"
}

Sorry if any of these paths don't 100% match up I'm not at my PC at the moment and I'm basing these paths off memory.

apotenza92 commented 2 years ago

It worked!

For record:

  1. Quit Flow Launcher using taskbar Exit.
  2. Edit Settings.json, location: C:\Users\apote\AppData\Roaming\FlowLauncher\Settings\Plugins\Playnite
  3. Manually add path: "playnite_path": "C:\\Users\\apote\\AppData\\Roaming\\Playnite"
  4. Relaunch Flow Launcher
  5. Profit

image

I'm not a programmer but I think the issue with changing the path in the Flow Launcher settings may have something to do with JSON escape characters. If I were to copy paste the path from explorer into Flow Launcher settings you'd have single '\' lines, but if I manually put it into the JSON I need to use doubles? I'm assuming you will fix up the automated process at some point, but good to know it wasn't just my system going crazy.

Cheers!

Driek123 commented 2 years ago

Hi, I'm facing a similar issue and the solution of manually editing the settings.json file didn't work.

A couple quirks on my setup:

As far as I know, my json is valid. It currently looks like:

{ "playnite_path": "e:\\program files\\playnite", "hide_uninstalled": "true" }

I wonder if it's the separate drive that's messing with the detection. Or the space in the name or something else. I do have the corresponding playnite extension installed already.

Garulf commented 2 years ago

Hi @Driek123

The path should be equivalent to:

C:/Users/%USERNAME%/AppData/Roaming/Playnite

Obviously you'd have to use your portable folder path.

You may run into issues with this plugin and Scoop but I'm working on the fix.

Driek123 commented 2 years ago

Hey mate, the path that I've mentioned is my portable folder path (e:\program files\playnite). I have nothing playnite-related in %appdata% for the record.

Update: I reinstalled flow-launcher with the installer instead & copypasted my userdata folder over wholesale, and now it's working perfectly without any need for json editing. So it does seem that it's something up with doing it through scoop where the userdata folder is not in the documented 2 locations (either appdata or localappdata for portable according to flow-launcher's readme). Tricky.

Thanks for making this plugin, now I can skip out on installing multiple game launcher plugins lol