jellyfin / jellyfin-mpv-shim

MPV Cast Client for Jellyfin
Other
1.64k stars 93 forks source link

Reconnect to MPV IPC socket #233

Open bedrin opened 3 years ago

bedrin commented 3 years ago

I'm running jellyfin-mpv-shim and mpv in two separate docker containers.

Related configuration is as below:

{
    "mpv_ext": true,
    "mpv_ext_ipc": "/tmp/mpv/mpvsocket",
    "mpv_ext_no_ovr": false,
    "mpv_ext_path": null,
    "mpv_ext_start": false,
    "mpv_log_level": "debug"
}

Everything works like a charm, but if I restart mpv container, jellyfin-mpv-shim doesn't reconnect to it:

Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/dist-packages/jellyfin_mpv_shim/timeline.py", line 32, in run
    self.send_timeline()
  File "/usr/local/lib/python3.9/dist-packages/jellyfin_mpv_shim/timeline.py", line 56, in send_timeline
    playerManager.send_timeline()
  File "/usr/local/lib/python3.9/dist-packages/jellyfin_mpv_shim/utils.py", line 54, in _synchronizer
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/jellyfin_mpv_shim/player.py", line 873, in send_timeline
    and not self._player.playback_abort
  File "/usr/local/lib/python3.9/dist-packages/python_mpv_jsonipc.py", line 628, in __getattr__
    return self.command("get_property", name.replace("_", "-"))
  File "/usr/local/lib/python3.9/dist-packages/python_mpv_jsonipc.py", line 624, in command
    return self.mpv_inter.command(command, *args)
  File "/usr/local/lib/python3.9/dist-packages/python_mpv_jsonipc.py", line 323, in command
    self.socket.send({"command":command_list, "request_id": command_id})
  File "/usr/local/lib/python3.9/dist-packages/python_mpv_jsonipc.py", line 160, in send
    raise BrokenPipeError("socket is closed")
BrokenPipeError: socket is closed
iwalton3 commented 3 years ago

Somewhat related to https://github.com/jellyfin/jellyfin-mpv-shim/issues/66