Jump to content

Anyone else with really slow Emby syncs to Kodi?


sross44

Recommended Posts

quickmic

On Kodi startup sync: Boxsets are updated if Emby server reports changes.

For realtime sync, each changed content will be checked if assigned to a boxset.

Link to comment
Share on other sites

d0ogie
Posted (edited)
10 minutes ago, quickmic said:

For realtime sync, each changed content will be checked if assigned to a boxset.

Yes this behavior makes perfect sense. However it seems to actually be doing something like this (given the time taken per movie, and the log):

-Client wakes from sleep (Kodi already running)
  -Ask Emby server for updates
  -n number of Movies need to update (for what it's worth - this seems to be mainly Subtitle downloads right now, as the library is not significantly changing otherwise)
  -update Movie metadata
     -evaluate need to update Boxsets for this movie -> always returns "you need to update ALL boxsets" # bug?
     -update ALL boxsets, add relevant movies to each, move to next movie in queue

Let me see if I can change the movie library significantly enough to trigger an update on Kodi, and then we can try to better prove my theory.
I will also move over to the 10.x.x branch.

Edited by d0ogie
  • Like 1
Link to comment
Share on other sites

d0ogie

Doing some simultaneous testing.
Scenarios are..
-add new Movie that is also part of an existing Collection
-allow regular Subtitle Download task to run (trigger is default=24 hours)

-1. Windows, Kodi 21.0, E4KNG 10.0.18
-Movies are added as expected, ~seconds after the Emby server has added them.
-Sets do not seem to be updated automatically. Refresh Boxsets option fixes this. (I don't care, much - this is fine)
-Subtitle Download task does not seem to cause a need to Sync at all (good?).

-2. Android (NVIDIA Shield), Kodi 20.5, E4KNG 9.4.21
-Movies are added as expected, ~seconds after the Emby server has added them.
-ALL Sets are refreshed with every singular Movie update, per the log.
-Subtitle Download task on server causes a need to Sync on this client - usually around 400-500 movies or roughly 1/3 of the complete library.

So - much improved with version 10.0.18 of the add-on. Will need to get moving on an upgrade across the house.

  • Like 1
Link to comment
Share on other sites

quickmic
2 hours ago, d0ogie said:

-1. Windows, Kodi 21.0, E4KNG 10.0.18
-Movies are added as expected, ~seconds after the Emby server has added them.
-Sets do not seem to be updated automatically. Refresh Boxsets option fixes this. (I don't care, much - this is fine)
-Subtitle Download task does not seem to cause a need to Sync at all (good?).

Was this a realtime sync, means Kodi was online all the time?

Link to comment
Share on other sites

d0ogie
13 hours ago, quickmic said:

Was this a realtime sync, means Kodi was online all the time?

Yes, correct, Kodi was up and online in-UI (as opposed to playing video) throughout the changes on the server. Tasks were correctly detected via websocket (library scan in progress, for example). Once the server was done, the client picked up the changes correctly, except for the modification to the Collection.

I will need to repeat this test specifically and collect some logs again, as the client was up for hours and the log was a mess.

Link to comment
Share on other sites

quickmic
22 hours ago, d0ogie said:

-1. Windows, Kodi 21.0, E4KNG 10.0.18
-Movies are added as expected, ~seconds after the Emby server has added them.
-Sets do not seem to be updated automatically. Refresh Boxsets option fixes this. (I don't care, much - this is fine)
-Subtitle Download task does not seem to cause a need to Sync at all (good?).

I think I found the problem. You really added a movie, not just assigned a movie to a collection? I wasn't aware it's possible doing that at in one step.

BoxSet/Collection updates for realtime sync only triggered for updated content. Not new content.

I'll fix that in next version, but please check.

  • Like 1
Link to comment
Share on other sites

quickmic
Posted (edited)

How 10.X works:

 

Realtime updates (Emby via websocket) do not report boxsets/collections changes directly, just e.g. a movie has changed. The plugin tries to detect the assign boxsets/collections by movie's ParentId.

It queries all boxsets from the ParentId and updates them all.

 

e.g. "Alien" boxset/collection change... Emby would report 3 movie changes

The ParentId is usually the subfolder of a movie.

/movies/Alien 1/Alien1.mkv

/movies/Alien 2/Alien2.mkv

/movies/Alien 3/Alien3.mkv

 

In this example ParentId would point to "/movies/Alien 1/", "/movies/Alien 2/", "/movies/Alien 3/"

At the moment the plugin would update the "Alien" boxset/collection 3 times cause 3 movies had changed. I need to find a way to de-double these updates, however..

 

If ParentId points to a folder with multiple movies and multiple boxsets/collections assigned like...

/movies/Alien1.mkv

/movies/Alien2.mkv

/movies/Alien3.mkv

/movies/Back to the future1.mkv

/movies/Back to the future2.mkv

/movies/Back to the future3.mkv

...it would update both boxsets/collections. "Alien" and "Back to the future" even "Back to the future" has not changed.

 

If you have many boxsets/collections in a ParentId's location, it could take quite some time to update them all.

 

Edited by quickmic
  • Like 1
Link to comment
Share on other sites

quickmic

Next version will de-double the boxset/collection updates....

  • Like 1
Link to comment
Share on other sites

d0ogie

Awesome!! That's great!

Yes to be clear - the feature I am using is (in Emby Server, under my Movies library):

Quote

 

Import collection information from metadata downloaders

When enabled, this will import collection information from your enabled metadata downloaders. This may cause unwanted collections to be automatically created. Disabling will prevent future collections from being automatically created, but will not delete existing ones.

 

 
..so if I have, say, Beverly Hills Cop 1 and 2 in the library, then I add 3, that movie will also be added to the existing Beverly Hills Cop collection, thanks to the metadata.
I understand the Emby for Kodi behavior perfectly now thanks to your explanation, and can now follow along in the code. Many thanks for taking time out to do that, it is much appreciated.
 
It is very tricky logic to de-dupe the boxset updates correctly. Since I don't have a PR for you I'll donate instead. Awesome work.
  • Thanks 1
Link to comment
Share on other sites

quickmic

I think I found another issue... Happens when folders are updated, I'll check and add another fix in next version.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...