Jump to content

embyforkodi (next-gen) 6.X.X support


quickmic

Recommended Posts

quickmic
Posted (edited)
2 hours ago, linds1234 said:

I've tested exactly this scenario already.

NAS Already On -> Turn on Kodi Box -> Connects to Emby and Syncs Changes (via initial sync)

Turn Off NAS -> Turn Back On NAS -> Add new Content to Emby Library -> New Content does not show in Kodi, ever. Unless its rebooted. It's ability to communicate via the websocket connection is gone.

So to summarise, there's 2 problems:

1.) As you've mentioned, and as I've proven, If the NAS is offline when Kodi boots up, it will never re-establish its session.

In this exact scenario, on the NUC running 4.1.21, once the NAS boots up, you'll see a info popup along the lines of "Connected to Emby".  So its much more robust in that respect. That behaviour needs changing, I think a decent amount of people out there won't be running their NAS 24/7 to always have it online ready for Kodi.

2.) If both the Kodi Box and the NAS are on, and working happily with websocket updates, but then the NAS is turned off and back on again, that connectivity is broken until Kodi is restarted. 

 

 

 

I performed some tests

According to my review, the websocket connection is online!

Check the kodi log after nas down/up:

2022-03-31 16:54:23.196 T:10433    INFO <general>: INFO: Emby.hooks.websocket: --->[ websocket reconnecting ]
2022-03-31 16:54:25.204 T:10433    INFO <general>: INFO: Emby.hooks.websocket: ---<[ websocket reconnecting ]

 

I didn't shutdown the server for hours. Maybe this is a problem, but a simple shutdown wait 1-2 minutes and restart works perfectly.

Please perform a test:

Kodi on, nas on.

nas off -> wait 1-2 minutes -> nas on

grab the Kodi log for review.

 

btw, startup re-connection will be "fixed" in next version.

 

Attached a log from my test (with the startup fix).

As you can see several "[ INIT EMBYCLIENT: ]" because I started Kodi before I started the server.

here was the server online

"2022-03-31 16:49:08.830 T:10216    INFO <general>: INFO: EMBY.emby.emby: ---[ START EMBYCLIENT: 2a38697ffc1b428b943aa1b6014e2263 ]---"

Then I power off the server 2 times: Websocket logs:

2022-03-31 16:50:33.819 T:10433    INFO <general>: INFO: Emby.hooks.websocket: --->[ websocket reconnecting ]
2022-03-31 16:50:35.822 T:10433    INFO <general>: INFO: Emby.hooks.websocket: ---<[ websocket reconnecting ]
2022-03-31 16:54:23.196 T:10433    INFO <general>: INFO: Emby.hooks.websocket: --->[ websocket reconnecting ]
2022-03-31 16:54:25.204 T:10433    INFO <general>: INFO: Emby.hooks.websocket: ---<[ websocket reconnecting ]

Everything fine so far.

 

 

 

 

 

kodi.log

Edited by quickmic
Link to comment
Share on other sites

quickmic

There is one edge case I could imagine. As you shutdown your nas and not the Emby server, there is no shutdown notification from Emby server send to Kodi.

This means, there is no "startup" sync initiated when the server is back online. Actually this is also on purpose. There cannot be any changes on server due to turned off, but:

If the server synced a new content right before shutdown and had no time to send new content to Kodi via websocket, the init sync is not triggered when the server is back online. -> totally edge case, but this could result in un-synced content.

Link to comment
Share on other sites

DiscoDuck79
20 minutes ago, quickmic said:

There is one edge case I could imagine. As you shutdown your nas and not the Emby server, there is no shutdown notification from Emby server send to Kodi.

This means, there is no "startup" sync initiated when the server is back online. Actually this is also on purpose. There cannot be any changes on server due to turned off, but:

If the server synced a new content right before shutdown and had no time to send new content to Kodi via websocket, the init sync is not triggered when the server is back online. -> totally edge case, but this could result in un-synced content.

The issue @linds1234 is experiencing seems very similar to

When I kill my container it doesn't issue the shutdown command in the Emby server and does a "dirty exit", I assume the same happens if the NAS is powering down.

@linds1234 Have you tried to execute Shutdown Emby from the Emby server control panel and check on your client if you get a popup that the server is offline? Then restart the NAS and start the Emby server and see if the client reconnects.

  • Like 1
Link to comment
Share on other sites

quickmic
Posted (edited)
9 minutes ago, DiscoDuck79 said:

The issue @linds1234 is experiencing seems very similar to

When I kill my container it doesn't issue the shutdown command in the Emby server and does a "dirty exit", I assume the same happens if the NAS is powering down.

@linds1234 Have you tried to execute Shutdown Emby from the Emby server control panel and check on your client if you get a popup that the server is offline? Then restart the NAS and start the Emby server and see if the client reconnects.

Exactly, it could be related to this issue. I'm currently working on a better server online detection for 7.x. If it works, I'll backport that.

Does your log include...

2022-03-31 16:50:33.819 T:10433    INFO <general>: INFO: Emby.hooks.websocket: --->[ websocket reconnecting ]
2022-03-31 16:50:35.822 T:10433    INFO <general>: INFO: Emby.hooks.websocket: ---<[ websocket reconnecting ]

...on a hard shutdown?

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

DiscoDuck79
8 minutes ago, quickmic said:

Exactly, it could be related to this issue. I'm currently working on a better server online detection for 7.x. If it works, I'll backport that.

Does your log include...

2022-03-31 16:50:33.819 T:10433    INFO <general>: INFO: Emby.hooks.websocket: --->[ websocket reconnecting ]
2022-03-31 16:50:35.822 T:10433    INFO <general>: INFO: Emby.hooks.websocket: ---<[ websocket reconnecting ]

...on a hard shutdown?

Just tested, I have 2 of the 7.x clients at home and both connected again as described in your post. I have 1 of the 6.x remotely connected with a VPN that I also checked, that did not.

However..... Afterwards I updated an episode on the server, this was not synced to the 7.x clients. I can play unchanged content on the server, but the episode I updated failed and in the log it displays the name of the old replaced mkv.

  • Thanks 1
Link to comment
Share on other sites

jimbobjones

@quickmic

it happened again today. Kodi was on, emby was on, an episode came into Emby and 1.5hrs later wasn't showing up in in Kodi.

I forgot to disable the language preference manager addon which was crashing, but posting logs anyway. I really doubt this is causing emby not to sync.

After a reboot, the episode was there 'UPDATE episode [43/104/1473/1503] 16987: What's for Dinner?' - which is severance s1e8

kodi.log kodi.old.log

Edited by jimbobjones
Link to comment
Share on other sites

quickmic
1 hour ago, jimbobjones said:

@quickmic

it happened again today. Kodi was on, emby was on, an episode came into Emby and 1.5hrs later wasn't showing up in in Kodi.

I forgot to disable the language preference manager addon which was crashing, but posting logs anyway. I really doubt this is causing emby not to sync.

After a reboot, the episode was there 'UPDATE episode [43/104/1473/1503] 16987: What's for Dinner?' - which is severance s1e8

kodi.log 77.31 kB · 0 downloads kodi.old.log 296.93 kB · 1 download

Thanks for the log, this helps and I think already see the issue.

When I search for the ID "16987" in kodi.old.log I see the websocket received the update:

2022-04-01 12:29:39.319 T:12468    INFO <general>: INFO: Emby.hooks.websocket: [ LibraryChanged ] {'FoldersAddedTo': ['16542'], 'FoldersRemovedFrom': [], 'ItemsAdded': ['16987'], 'ItemsRemoved': [], 'ItemsUpdated': [], 'CollectionFolders': ['f137a2dd21bbc1b99aa5c0f6bf02a805', '6c2a057148b4d7c20a207c789aba6d07', 'bce6ab2f862d8111846735d20a46b29a'], 'IsEmpty': False

 

This means the websocket is working correctly but sync was in pause mode:

2022-04-01 12:29:39.333 T:12468    INFO <general>: INFO: EMBY.database.library: [ worker update sync paused ]

 

So it's not related to a websocket issue, must be something else.

Sync pause is only active when playback is on and should sync the episode after playback stop.

 

The stop was initiated here:

2022-04-01 13:58:08.294 T:3911     INFO <general>: INFO: EMBY.hooks.player: [ onPlayBackStopped ]

 

1h 20 Minutes after the msg was received. Not sure, but I thing you didn't play (or paused) a video between 12:29:39 and 13:58:08 right?

Later I'll review the log again and let you know of the findings.

 

 

 

Link to comment
Share on other sites

jimbobjones
51 minutes ago, quickmic said:

1h 20 Minutes after the msg was received. Not sure, but I thing you didn't play (or paused) a video between 12:29:39 and 13:58:08 right?

Later I'll review the log again and let you know of the findings.

well a game was being streamed by the NBA International addon during that time. Nothing emby related, and it started at about 11am

On another occasion I mentioned previously a show was not in kodi  6 hours after importing into emby - maybe something causes it to be paused and then it doesn't resume when it should.

Edited by jimbobjones
Link to comment
Share on other sites

quickmic
Posted (edited)
1 hour ago, jimbobjones said:

well a game was being streamed by the NBA International addon during that time. Nothing emby related, and it started at about 11am

On another occasion I mentioned previously a show was not in kodi  6 hours after importing into emby - maybe something causes it to be paused and then it doesn't resume when it should.

Well, it doesn't matter how the playback was started. The sync is paused when playback is active on Kodi. It's not exclusive for Emby content.

Sync needs access to Kodi's native database and also uses (cpu) resources etc. Therefore it's disabled while playback is active. (Same in 4.x but there was an option to enable sync while playback in progress).

Quote

On another occasion I mentioned previously a show was not in kodi  6 hours after importing into emby - maybe something causes it to be paused and then it doesn't resume when it should.

I think it's the same reason, but I need also a log for such a case.

When it happens again, please stop the playback and wait a few minutes. This should start the sync. If not, send me the log for review.

I can also add the option to sync while playback in progress, but first I need to determine what actually happens.

Edited by quickmic
Link to comment
Share on other sites

jimbobjones
58 minutes ago, quickmic said:

When it happens again, please stop the playback and wait a few minutes. This should start the sync. If not, send me the log for review.

will do

58 minutes ago, quickmic said:

I can also add the option to sync while playback in progress, but first I need to determine what actually happens

I'd definitely use that if it were an option. 

Link to comment
Share on other sites

linds1234
16 hours ago, DiscoDuck79 said:

Have you tried to execute Shutdown Emby from the Emby server control panel and check on your client if you get a popup that the server is offline? Then restart the NAS and start the Emby server and see if the client reconnects.

Hi @DiscoDuck79

I've actually converted over to Jellyfin now so its a bit tricky to test this. Sorry... only just saw this message 😕 

 

Edited by linds1234
typo
Link to comment
Share on other sites

On 3/28/2022 at 11:32 AM, quickmic said:

Currently I cannot reproduce the trakt issue.

I need exact details.

General info. The plugin doesn't communicate with trakt. It reports the progress to Emby server and Emby server syncs with trakt.

Emby-server movie status should match trakt. A testcase can be designed, by monitoring Emby server movie status. That's what I did, and no issue in my case.

Restarted Kodi, no plugins installed (beside next-gen otherwise stock).

Start a movie, seek to 1 minute, wait 10 seconds, stop the movie.

Kodi reports unwatched and not in progress. Emby server unwatched, no progress and trakt does also reflect Emby server status. Everything is fine, so please send me exact instructions and very important. Use stock Kodi for tests otherwise it's always guessing what causes an issue.

Use a PC, Mac, Linux to perform tests.

 

Just to confirm: did you test with native or addon mode? My wife just started a movie for less than a minute and the movie was marked as ‘watched’. This is with native mode. Will test more this weekend.

I would send you Emby’s log but it’s so so huge.

  • Like 1
Link to comment
Share on other sites

quickmic

New version available 6.2.15: (in beta repo)

delta changelog:

modify reconnect on Kodi start
fix subtitle issue for dynamic content
add option to sync during playback

 

6.2.14 pushed to stable repo

 

Link to comment
Share on other sites

quickmic
19 hours ago, markdj said:

Just to confirm: did you test with native or addon mode? My wife just started a movie for less than a minute and the movie was marked as ‘watched’. This is with native mode. Will test more this weekend.

I would send you Emby’s log but it’s so so huge.

I'll perform a test in native mode. Maybe this causes the issue.

Link to comment
Share on other sites

jimbobjones

hey @quickmic

running 6.2.15 (sync during playback not enabled)

Streamed NBA via addon -> added 2 new episodes to Emby -> stopped NBA -> 1 hour later, episodes not in kodi -> Rebooted -> Both episodes now added (EMBY.core.tvshows: ADD episode [54/123/1470/1499] 17032: Episode #2.5 and EMBY.core.tvshows: ADD episode [54/123/1471/1500] 17033: Episode #2.4)

hopefully this helps get it fixed

kodi.old.log kodi.log

  • Like 1
Link to comment
Share on other sites

quickmic
Posted (edited)
8 hours ago, jimbobjones said:

hey @quickmic

running 6.2.15 (sync during playback not enabled)

Streamed NBA via addon -> added 2 new episodes to Emby -> stopped NBA -> 1 hour later, episodes not in kodi -> Rebooted -> Both episodes now added (EMBY.core.tvshows: ADD episode [54/123/1470/1499] 17032: Episode #2.5 and EMBY.core.tvshows: ADD episode [54/123/1471/1500] 17033: Episode #2.4)

hopefully this helps get it fixed

kodi.old.log 165.93 kB · 2 downloads kodi.log 77.94 kB · 0 downloads

I continue review, but I assume it's related to the nba plugin. This plugin or another plugin causes issues on your box.

Something is spamming your log. There are gazillion of...

"EXCEPTION: XBMC is not playing any file"

 

I see in the log, playback stopped and next-gen plugin also detected that but not updated.

Two possible reasons: Plugin detects that playback is still in progress even Kodi reported it was stopped or something (other plugin or Kodi) has the database exclusively locked.

log has no detailed infos here

 

btw, why have you "trakt" installed on Kodi? Are you also using trakt on emby server? This will mess the sync. However.

I'm 99% sure this is not an issue of the next-gen plugin. Please use stock skin, disable ALL plugins beside next-gen and nba an test again.

Maybe it's better, to test the same scenario on a PC with a fresh installation.

e.g.

why you have both versions installed:

plugin.video.emby v4.1.22

plugin.video.emby-next-gen v6.2.15

This can cause issues. I hope at least one of them are disabled.

 

 

Not sure, but maybe problem if it communicates with emby server as well:

plugin.video.plexkodiconnect

 

 

As mentioned

"languagepreferencemanager" crashed.

 

Edited by quickmic
Link to comment
Share on other sites

jimbobjones
59 minutes ago, quickmic said:

This can cause issues. I hope at least one of them are disabled.

yeah old Emby was disabled, removed it now. I use Trakt in Kodi, not in Emby - had issues previously. Plexkodiconnect also disabled, and now removed. I tried changing skins and disabling language preference manager and it still did it (and the logs still show "EXCEPTION: XBMC is not playing any file" heh). Although haven't disabled every other addon yet, as there are quite a lot that Aeon Nox Silvo uses, and others.

59 minutes ago, quickmic said:

Two possible reasons: Plugin detects that playback is still in progress even Kodi reported it was stopped or something (other plugin or Kodi) has the database exclusively locked.

log has no detailed infos here

FYI when enabling sync during playback in 6.2.15, it syncs new episodes fine when streaming with NBA addon.

 

Edited by jimbobjones
  • Thanks 1
Link to comment
Share on other sites

quickmic
20 minutes ago, jimbobjones said:

FYI when enabling sync during playback in 6.2.15, it syncs new episodes fine when streaming with NBA addon.

 

That's some progress, but still. I'll continue review and hope I find the root cause.

Link to comment
Share on other sites

Embyjunky
On 3/28/2022 at 3:10 AM, quickmic said:

Do you have any of these characters as a (Emby) library name? If yes, rename the library:

 / (forward slash)
 < (less than)
  > (greater than)
  : (colon - sometimes works, but is actually NTFS Alternate Data Streams)
  " (double quote)
  / (forward slash)
  \ (backslash)
  | (vertical bar or pipe)
  ? (question mark)
  * (asterisk)

 

There is a bug if you using them as a lib name, I'll fix it in next version.

Can you please also add [ and ] as well?

for example:

Fairy Tail - s01e08 - 08 [720p]

 

Link to comment
Share on other sites

quickmic
4 hours ago, Embyjunky said:

Can you please also add [ and ] as well?

for example:

Fairy Tail - s01e08 - 08 [720p]

 

Why? [] are valid characters for filenames.

Link to comment
Share on other sites

Mister D

Is there a way to update a version of a show with a new version without having to re scan the entire database? For example, I have a 480p version of a show that I replace with a 1080p version.

In Emby, I wouldn't have to do anything. The show would just be updated with the new version. Movies in Kodi are currently working like this. However, TV shows keep the old version and add the new version. This requires me to either manually delete each episode or repair/update the library which takes several hours to rescan all my shows.

Is there a way to have the TV show automatically refresh and remove the old version? 

Edited by Mister D
Link to comment
Share on other sites

quickmic
3 hours ago, Mister D said:

Is there a way to update a version of a show with a new version without having to re scan the entire database? For example, I have a 480p version of a show that I replace with a 1080p version.

In Emby, I wouldn't have to do anything. The show would just be updated with the new version. Movies in Kodi are currently working like this. However, TV shows keep the old version and add the new version. This requires me to either manually delete each episode or repair/update the library which takes several hours to rescan all my shows.

Is there a way to have the TV show automatically refresh and remove the old version? 

This bug is on my todo list.

Maybe you can remove the episode via context menu. Take a of the existing episode before you try. Actually the delete function is used for deleting the FILE but also removes the db records.

 

Link to comment
Share on other sites

Mister D
11 hours ago, quickmic said:

This bug is on my todo list.

Maybe you can remove the episode via context menu. Take a of the existing episode before you try. Actually the delete function is used for deleting the FILE but also removes the db records.

 

Good to know. Hopefully, this fix gets implemented pretty soon. Using the context menu works for some of the smaller TV shows I replace but for series with between 26 and sometimes hundreds of episodes, it can be a pain to try and do that with a remote one by one.

Link to comment
Share on other sites

quickmic
32 minutes ago, Mister D said:

Good to know. Hopefully, this fix gets implemented pretty soon. Using the context menu works for some of the smaller TV shows I replace but for series with between 26 and sometimes hundreds of episodes, it can be a pain to try and do that with a remote one by one.

Do you have a test case for me. A simple replacement seems to work fine.

Link to comment
Share on other sites

Mister D
3 hours ago, quickmic said:

Do you have a test case for me. A simple replacement seems to work fine.

Most recent examples for me were I Dream of Jeannie and 3rd Rock From the Sun. I had some old .avi versions that I replaced with higher resolution .mkv versions and in both cases, both sets of episodes would show in Kodi. This would also affect the Continue Watching and Up Next widgets where the old version of an episode would show up and fail to play back because the file no longer exists in my Emby library. If I tried deleting the show from the Kodi library it would be deleted but it would never get re-added with a sync so I would then have to run either the Update or Repair library function which takes a while since I have a little over 1300 TV shows.

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...