Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use direct_paths with library, shim and Jellyfin on the same PC #316

Closed
qwerty12 opened this issue Feb 19, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@qwerty12
Copy link

Describe the bug
When enabling direct_paths (and remote_direct_paths as it seems to be needed), the shim won't start mpv with the path of a local file that is otherwise accessible.

I do not know if this causes breakage in other situations like actually playing a file remotely over a share, but wrapping the Path following line with a str() solved this for me:

return pathlib.Path(self.media_source["Path"])

To Reproduce
Steps to reproduce the behavior:

  1. Install the Jellyfin server on a Windows PC and add a local folder to its library
  2. Install the Jellyfin mpv shim on the same computer and add the local server
  3. Edit conf.json and set both direct_paths and remote_direct_paths to true
  4. See error

Expected behavior
mpv starts playing the file directly

Desktop (please complete the following information):

  • OS: Windows 11 21H2
  • Version: 2.4.2

Since I am running the mpv shim from source (in a clean venv) so I could modify files as needed, information on that:

  • Python: 3.11.2
  • Packages: Pillow-9.4.0 certifi-2022.12.7 charset-normalizer-3.0.1 idna-3.4 jellyfin-apiclient-python-1.9.2 jellyfin-mpv-shim-2.4.2 pystray-0.19.4 python-mpv-1.0.1 python-mpv-jsonipc-1.1.14 requests-2.28.2 six-1.16.0 urllib3-1.26.14 websocket-client-1.5.1

Error Messages
An excerpt follows (my apologies in advance if you need the full thing):

2023-02-19 14:06:26,343 [   DEBUG] media: Using remote direct path.
2023-02-19 14:06:26,344 [    INFO] mpv: trickplay: Clearing trickplay.
2023-02-19 14:06:26,344 [   ERROR] websocket: error from callback <function WSClient.run.<locals>.<lambda> at 0x000001EC185F76A0>: Object of type WindowsPath is not JSON serializable
2023-02-19 14:06:26,344 [   ERROR] JELLYFIN.jellyfin_apiclient_python.ws_client: Object of type WindowsPath is not JSON serializable
2023-02-19 14:06:26,344 [   DEBUG] event_handler: Unhandled Event WebSocketError: Object of type WindowsPath is not JSON serializable
@qwerty12 qwerty12 added the bug Something isn't working label Feb 19, 2023
@iwalton3
Copy link
Member

Your fix indeed looks correct. The path was failing to get converted to a string for external mpv, so adding the explicit conversion will fix the issue.

@qwerty12
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants