For the attached log, you would have seen the following:
text:
Rescanning library...
Updating library: New episodeid 7349 [Marvel's Agents of S.H.I.E.L.D. S07E02 (Know Your Onions)]
Updating library: New episodeid 7349 [Marvel's Agents of S.H.I.E.L.D. S07E02 (Know Your Onions)]
Updating library: New episodeid 7350 [Blindspot S05E04 (And My Axe!)]
Updating library: New episodeid 7350 [Blindspot S05E04 (And My Axe!)]
For episodeid 7349, there are 2 update notifications output by Kodi (and present in the log):
text:
2020-06-11 20:50:37.442386:MainThread: libRescan.PARSING JSON DATA: {"jsonrpc":"2.0","method":"VideoLibrary.OnUpdate","params":{"data":{"item":{"id":7349,"type":"episode"},"transaction":true},"sender":"xbmc"}}
2020-06-11 20:50:37.500667:MainThread: libRescan.PARSING JSON DATA: {"jsonrpc":"2.0","method":"VideoLibrary.OnUpdate","params":{"data":{"added":true,"item":{"id":7349,"type":"episode"},"transaction":true},"sender":"xbmc"}}
which confirms that Kodi 18 is sending a second
VideoLibrary.OnUpdate
notification - the only difference between the 2 notifications is that the second notification includes
"added":true
. This is meant to represent that the notification corresponds with a
"newly added item", which is clearly not the case.
This doesn't happen with Kodi 19 on my system (MySQL) - only a single
VideoLibrary.OnUpdate
notification is output by Kodi:
text:
2020-06-17 18:19:18.044178:MainThread: libRescan.PARSING JSON DATA: {"jsonrpc":"2.0","method":"VideoLibrary.OnUpdate","params":{"data":{"added":true,"item":{"id":32491,"type":"episode"},"transaction":true},"sender":"xbmc"}}
which is correct, as per the intention of the
"added"
property.
So my suspicion is that this is/was a bug in Kodi 18, but has been fixed in Kodi 19 (can't find the actual fix - it may have been fixed accidentally...).
I could possibly add a fix to the script that ignores one of the notifications for pre-Kodi 19 clients but that's a bit of an ugly fix for what is a cosmetic issue caused by the client and that is (hopefully) already fixed.
Are you able to test with Kodi 19? Be aware of the Python3 change, so don't test on a system you care about!