jellyfin-kodi icon indicating copy to clipboard operation
jellyfin-kodi copied to clipboard

Kodi Sync Queue keeps getting disabled

Open davidfrickert opened this issue 3 years ago • 13 comments

Describe the bug I enable kodi sync queue plugin, then restart kodi, it starts syncinc, all good. Then, I play some videos, and close kodi. Later in the day, or another day even, I open kodi again to watch some more stuff. Kodi sync queue plugin is disabled. I have to enable it again.

Repeat this every time. All other settings are intact.

To Reproduce

  1. Enable kodi sync queue
  2. Close kodi
  3. Open kodi. Addon will start syncing
  4. Play some videos
  5. Close kodi
  6. (wait...)
  7. Open kodi to watch more videos
  8. Kodi sync queue is disabled???
  9. Enable kodi sync queue
  10. Repeat

Expected behavior Kodi Sync queue stays enabled

Logs

Screenshots

System (please complete the following information):

  • OS: Android 10 - MIUI 12.0.3
  • Jellyfin Version: 10.7.2
  • Kodi Version: 19.0
  • Addon Version: 0.7.2+py3
  • Playback Mode: Add-On

Additional context This only seems to happen on android. On desktop it stays enabled.

davidfrickert avatar May 06 '21 16:05 davidfrickert

Just wondering: Did you also enable the kodi plugin on the jellyfin server?

venomousZealot avatar May 06 '21 23:05 venomousZealot

Is this the plugin in the server getting disabled, or the setting in the addon within Kodi that's getting changed?

If the setting ever gets changed in Kodi to be disabled, you should get a popup dialog indicating so.

mcarlton00 avatar May 07 '21 01:05 mcarlton00

Yeah, the kodi sync queue plugin is always enabled in jellyfin server, no problems there. The setting in kodi addon just keeps getting disabled. It's really weird. I initially suspected the settings were getting resetted. But no, every other settings stays the same. "Enable Kodi Sync Queue" just gets disabled sometimes-

I don't get any popup, its just that sometimes i start kodi, and i notice the "jellyfin addon started" popup.. Then i wait for sync to start... and it doesn't start. then i check addon settings => Enable Kodi Sync Queue is disabled for some weird reason

I'll add as well, i use multiple devices to watch, sometimes phone (android), sometimes PC (Windows 10), sometimes raspberry pi (arch linux).

Maybe something related to that?

davidfrickert avatar May 07 '21 10:05 davidfrickert

I'm having the same exact issue. Using on Nvidia Shield.

dbluegmc avatar May 07 '21 16:05 dbluegmc

I've seen this happen with a Libreelec 9.2.6 on a Raspberry Pi 4. With the same server and a client with same Libreelec version but on an Intel NUC (Generic x86-x64) no problem whatsoever.

  • Jellyfin Server: 10.7.2
  • Jellyfin Plugin (Kodi Sync Queue): 6.0.0.0
  • Kodi Version: 18.9 (Libreelec 9.2.6)
  • Addon Version: 0.7.2+py2
  • Playback Mode: Add-On

jfranki avatar May 10 '21 07:05 jfranki

The only way I see in the code that the setting can get flipped is if we can't reach the plugin for some reason, but anytime that happens you _should be given a dialog box saying that's the reason.

Refs:

This is called when the setting is changed manually from the addon menu. https://github.com/jellyfin/jellyfin-kodi/blob/b6cd28e39c56ec95db1a019747a75e017b45b1e9/jellyfin_kodi/entrypoint/service.py#L376-L380

and this is called when we try to reach out to the server for updates, but can't reach the Kodi Sync Queue plugin https://github.com/jellyfin/jellyfin-kodi/blob/b6cd28e39c56ec95db1a019747a75e017b45b1e9/jellyfin_kodi/library.py#L359-L364

So I'm really confused how this could possibly be happening silently.

mcarlton00 avatar May 15 '21 14:05 mcarlton00

@mcarlton00 I've seen the notification pop. I have kodi on a tablet, watched some stuff with jellyfin, then left it open in the background. Time passed, then watched some stuff in phone kodi. Then time passed more, and I went back to tablet, opened kodi from background and I get a popup telling me to install kodi sync queue plugin, and then I checked the kodi sync queue option is disabled. Could this be a network problem? I have the kodi sync queue plugin installed like always, so its weird to see this popup.

davidfrickert avatar May 18 '21 13:05 davidfrickert

I noticed the same behavior. Sync gets disabled, but I never received a popup about the change. Device is also an nvidia shield pro (2019). I was running Version: 10.7.2 and just updated to Version: 10.7.5. Will report back in case it was fixed in between. Kodi version is matrix (19.1)

hillbicks avatar Jun 01 '21 18:06 hillbicks

@mcarlton00 https://github.com/jellyfin/jellyfin-kodi/blob/b6cd28e39c56ec95db1a019747a75e017b45b1e9/jellyfin_kodi/jellyfin/api.py#L260-L265 This seems to be the problematic code just from looking at it.

This doesn't seem right. Generally a "pokemon try-catch" is not a good practice. And this one especially seems weird. It doesn't even look at the response of the call to Jellyfin API. So, if the request fails, it marks companion missing, which is a super weird behaviour.

Probably, in the android apps, when they are on background, this request fails and the code marks the companion as missing and disables Kodi Sync Queue, which is a super janky behaviour.

Can this be changed?

I can help fixing this, if contributions are accepted.

davidfrickert avatar Jul 10 '21 17:07 davidfrickert

Probably, in the android apps, when they are on background, this request fails

This is my guess. Some power saving feature where network ability is turned off when they're in the background. It's weird because my understanding is that this check should only be happening on Kodi startup, so you wouldn't think it could happen in the background. I just don't have a ton of free time available right now so haven't gotten around to doing a deep dive into figuring out what's wrong.

It seems like a decent place to start debugging. If you wanna take a stab at it, then by all means go ahead. Any contributions are welcome. Especially since I haven't managed to replicate this myself yet, but my only android system is my mobile phone and it doesn't see much Kodi use. If you have any questions feel free to put them here or drop by our chat and ping me there. https://jellyfin.org/contact/

mcarlton00 avatar Jul 11 '21 14:07 mcarlton00

I’m getting this as well. Kodi running on a Sony Android TV connected to a NAS running Jellyfin via WiFi.

Maybe there could be an option to disable check_companion_installed?

tomislav avatar Aug 05 '21 10:08 tomislav

https://github.com/jellyfin/jellyfin-kodi/blob/b6cd28e39c56ec95db1a019747a75e017b45b1e9/jellyfin_kodi/jellyfin/api.py#L260-L265

This seems to be the problematic code just from looking at it.

This doesn't seem right. Generally a "pokemon try-catch" is not a good practice. And this one especially seems weird. It doesn't even look at the response of the call to Jellyfin API. So, if the request fails, it marks companion missing, which is a super weird behaviour.

That is indeed a problematic try-except, and should be checking for (presumably) a 200 successful request or 404 not found, assuming nothing changed from last time if it reaches a timeout or some such (potentially with a re-try)

oddstr13 avatar Oct 11 '21 21:10 oddstr13

I've been getting this from time to time for a long time, presumably during server updates the client sometimes disable the plug-in. A bit annoying for me having to spend 15m resync everything but I know how to do it.

My real issues is remote users who stop getting updates and don't know how to reenable it, until the next time I'm in their house and notice their Kodi is stuck 3 months in the past.

Could the plug-in not disable itself, but instead retry after a restart ? That way updates would just be delayed instead of lost forever.

Ulrar avatar Jul 22 '22 18:07 Ulrar