jellyfin / jellyfin-mpv-shim

MPV Cast Client for Jellyfin
Other
1.5k stars 88 forks source link

Restarting MPV Shim never works because of cred.json #331

Open xNinjaKittyx opened 1 year ago

xNinjaKittyx commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

Once MPV Shim closes, I'm never able to successfully come back up unless I manually go and delete conf.json and recreate it again.

This might be a separate issue, but I also see run.exe persisting after closing the application.

To Reproduce Steps to reproduce the behavior:

  1. Open MPV Shim
  2. Input credentials
  3. It works
  4. Close MPV Shim
  5. Restart MPV Shim
  6. No window opens, only the tray opens.
  7. Tray right click menu shows the options but none of them do anything.
  8. Deleting conf.json and then letting mpv shim recreate it again will work.

Expected behavior Restart should just work.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Error Messages Please provide logs, as they are often needed for me to understand and quickly troubleshoot the issue. You can read instructions for how to do so here: https://github.com/iwalton3/jellyfin-mpv-shim/wiki/Sending-Logs

I don't really see any errors, but I do see this which is different than normal I think.

2023-03-31 22:08:10,515 [   DEBUG] urllib3.connectionpool: Starting new HTTPS connection (1): <redacted>:443
2023-03-31 22:08:10,531 [    INFO] websocket: Websocket connected
2023-03-31 22:08:10,531 [    INFO] JELLYFIN.jellyfin_apiclient_python.ws_client: --->[ websocket ]
2023-03-31 22:08:10,531 [   DEBUG] event_handler: Unhandled Event WebSocketConnect: None

Conf.json looks like this

[{"address": "https://<redacted>", "Name": "<redacted>", "Id": "<redacted>", "DateLastAccessed": "2023-03-09T22:16:08Z", "UserId": "<redacted>", "AccessToken": "<redacted>", "Users": [{"Id": "<redacted>", "IsSignedInOffline": true}], "uuid": "bf80797e-85ec-4a76-bbc4-2516d712db83", "username": "admin", "connected": true}]
qvattr0 commented 8 months ago

I'm having the same issue. Were you able to find any alternative solutions to this bug?

iwalton3 commented 8 months ago

Are you deleting conf.json or cred.json?

qvattr0 commented 8 months ago

Are you deleting conf.json or cred.json?

I deleted conf.json to fix the issue.

iwalton3 commented 8 months ago

Each time you delete the config file it generates a new unique client id. I am honestly surprised it works at all after doing that.

qvattr0 commented 8 months ago

Each time you delete the config file it generates a new unique client id. I am honestly surprised it works at all after doing that.

I suppose that's strange. I've spent a really long time trying to debug MPV yesterday and I remember that uninstalling the software did not fix the problem. Only after deleted conf.json and re-adding my server was I able to have it work properly again. I've tried restarting my PC after fixing the issue (also quitting the application and relaunching it) to ensure that the issue does not arise again, and I've confirmed that it doesn't.

I'll include some of my observations from my experience yesterday to offer some potentially useful insight toward finding the root of this bug.

iwalton3 commented 8 months ago

For OSC you need to disable the custom MPV Shim OSC by setting thumbnail_osc_builtin to false in conf.json.

qvattr0 commented 8 months ago

For OSC you need to disable the custom MPV Shim OSC by setting thumbnail_osc_builtin to false in conf.json.

Wait, the MPV Shim has a custom OSC? Do you mean the one in the picture I attached below? Given how "barebones" it looks, I thought it might be the default OSC.

image

iwalton3 commented 8 months ago

Yup it is custom. It is a very minimal fork which adds support for thumbfast thumbnails. Jellyfin MPV Shim comes with a thumbfast compatibility layer which can load chapter images or JellyScrub seek thumbnail previews from your Jellyfin server.

qvattr0 commented 8 months ago

What does osc=no do then? Remove the menu (c key) from appearing?

iwalton3 commented 8 months ago

osc=no disables the built in OSC provided by MPV, which is also the default. You can disable the OSC completely via conf.json. The MPV Shim OSC is loaded as a lua script since there is no way to override the MPV OSC otherwise.

qvattr0 commented 8 months ago

I see, that makes sense. Thank you!

iwalton3 commented 8 months ago

Please open new issues for better tracking

PanoptesDreams commented 7 months ago

Just experienced this. Fix is deleting conf.json in '%appdata%\jellyfin-mpv-shim'.

You will also need to remove the configured server and reconnect.

This is a long standing, persistent issue that has plagued me a lot in the past.