Jump to content

Emby for kodi keeps querying for resources of already removed media


Recommended Posts

Angelblue05
Posted

Run a manual sync. Does that resolve the issue?

talentless
Posted

The error was still there after a manual sync.

 

But then I tinkered a bit with the skin settings in a way that skin shortcuts might have been rebuilt and it's no longer there. Using Titan skin, I would have guessed the skin, or any component other than emby plugin itself, would always access a cached copy of artwork in the local database, a not query emby server for it directly.

  • Like 1
talentless
Posted

I spoke to soon, is is back at it. Enabling debug logs does not show anything revealing.

 

I looked for reference on kodi database, and it's there in the Texture13.db:

383|http://10.8.1.12:8096/emby/Items/3af37eab28a01f458559095957281366/Images/Logo/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=6f6b0b840ba4886349e889b353bb2520|c/cfffc192.png|d1503680740s149287|

Shouldn't old references be purged from that database?

Angelblue05
Posted

It is already in place. I'm not sure how this could have happened without your log at the time this item was deleted. Do you delete stuff often?

 

 

Sent from my iPhone using Tapatalk

talentless
Posted (edited)

It looks like when emby removed the item, it did not catch all cached artwork:

13:59:40.530 T:3153064944  NOTICE: EMBY.websocket_client -> Message: {"MessageType":"LibraryChanged","Data":{"FoldersAddedTo":[],"FoldersRemovedFrom":["235f76fa1c5f7117a052a91d1173ed9e"],"ItemsAdded":[],"ItemsRemoved":["3af37eab28a01f458559095957281366"],"ItemsUpdated":[]}}
13:59:40.530 T:3153064944  NOTICE: EMBY.librarysync -> Queue remove: [u'3af37eab28a01f458559095957281366']
13:59:40.622 T:3136287728  NOTICE: EMBY.database -> opened: /home/osmc/.kodi/userdata/Database/emby.db - 3410870736
13:59:40.623 T:3136287728  NOTICE: EMBY.database -> Verifying emby DB
13:59:40.628 T:3136287728  NOTICE: EMBY.database -> opened: /home/osmc/.kodi/userdata/Database/MyVideos107.db - 3750122224
13:59:40.645 T:3136287728  NOTICE: EMBY.database -> opened: /home/osmc/.kodi/userdata/Database/MyMusic60.db - 3750122656
13:59:40.757 T:3136287728  NOTICE: EMBY.objects.movies -> Removing movieid: 28 fileid: 28
13:59:40.769 T:3136287728  NOTICE: EMBY.database -> opened: /home/osmc/.kodi/userdata/Database/Textures13.db - 3310968512
13:59:40.823 T:3136287728  NOTICE: EMBY.artwork -> Deleting cached thumbnail: /home/osmc/.kodi/userdata/Thumbnails/e/e5662d90.jpg
13:59:40.897 T:3136287728  NOTICE: EMBY.database -> number of rows updated: 2
13:59:41.049 T:3136287728  NOTICE: EMBY.database -> commit: /home/osmc/.kodi/userdata/Database/Textures13.db
13:59:41.051 T:3136287728  NOTICE: EMBY.database -> closing: /home/osmc/.kodi/userdata/Database/Textures13.db - 3310968512
13:59:41.077 T:3136287728  NOTICE: EMBY.database -> opened: /home/osmc/.kodi/userdata/Database/Textures13.db - 3310968512
13:59:41.083 T:3136287728  NOTICE: EMBY.artwork -> Deleting cached thumbnail: /home/osmc/.kodi/userdata/Thumbnails/6/6d1060af.jpg
13:59:41.108 T:3136287728  NOTICE: EMBY.database -> number of rows updated: 2
13:59:41.337 T:3136287728  NOTICE: EMBY.database -> commit: /home/osmc/.kodi/userdata/Database/Textures13.db
13:59:41.339 T:3136287728  NOTICE: EMBY.database -> closing: /home/osmc/.kodi/userdata/Database/Textures13.db - 3310968512
13:59:41.420 T:3136287728  NOTICE: EMBY.objects.movies -> Deleted movie 3af37eab28a01f458559095957281366 from kodi database
13:59:41.421 T:3136287728  NOTICE: EMBY.database -> closing: /home/osmc/.kodi/userdata/Database/MyMusic60.db - 3750122656
13:59:41.422 T:3136287728  NOTICE: EMBY.database -> number of rows updated: 43
13:59:41.563 T:3136287728  NOTICE: EMBY.database -> commit: /home/osmc/.kodi/userdata/Database/MyVideos107.db
13:59:41.563 T:3136287728  NOTICE: EMBY.database -> closing: /home/osmc/.kodi/userdata/Database/MyVideos107.db - 3750122224
13:59:41.571 T:3136287728  NOTICE: EMBY.database -> number of rows updated: 1
13:59:41.588 T:3136287728  NOTICE: EMBY.database -> commit: /home/osmc/.kodi/userdata/Database/emby.db
13:59:41.589 T:3136287728  NOTICE: EMBY.database -> closing: /home/osmc/.kodi/userdata/Database/emby.db - 3410870736
13:59:41.590 T:3136287728  NOTICE: EMBY.librarysync -> Updating emby database.
13:59:41.591 T:3136287728  NOTICE: EMBY.librarysync -> New sync time: client time -2 min: 2017-08-27T11:57:41Z
13:59:41.626 T:3136287728  NOTICE: EMBY.librarysync -> Updating video library.
13:59:41.722 T:3233264624  NOTICE: VideoInfoScanner: Starting scan ..
13:59:41.809 T:3794605040  NOTICE: EMBY.kodimonitor -> Method: VideoLibrary.OnScanStarted Data: null
13:59:41.824 T:3233264624  NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 00:00
13:59:41.924 T:3794605040  NOTICE: EMBY.kodimonitor -> Method: VideoLibrary.OnScanFinished Data: null

When handling a specific media item, it looks to be specifically looking only for fanart and poster artwork types, whereas when syncing the whole cache, it handles all type of artwork types (artwork.py, _cache_all_video_entries, add_update_art, delete_artwork).Meaning that when syncing is caching all artwork types, but when removing it only removes poster and fanart.

Edited by talentless
  • Like 1
Angelblue05
Posted (edited)

Ok thanks for reporting back. But it's not really the issue here. Only posters and backdrop are actually cached, so it's appropriate only those two types cached files were deleted. However, urls for the rest of the artwork is linked to the item entry in the MyVideosxx.db. When removing the item entry, the urls should automatically drop from the database. This is something that should require no involvement from the add-on. I will have to test this.

Edited by Angelblue05
talentless
Posted

Sorry If I am wrong, might be because I don't have the complete picture, but just want to make sure that I understand too.

 

* On file artwork.py, method _cache_all_video_entries surely looks like is caching ALL type of artwork. As I mentioned, there seem some disparity between that method, and add_update_art and delete_artwork methods which do explicitly only handle backdrop and posters. 

* You mention that the urls should be dropped from the database without involvement from the addon. Yet the addon is involved in dropping some of them. Whats the criteria as to what should be dropped by the addon and what not? I have interpreted that url pointing to emby server could be responsibility from the addon to drop. 

Angelblue05
Posted

No problem. I wrote most of artwork.py. Only fanart and posters are actually cached. The rest of the artwork is just added to the database as urls. The addon does not cache them. If you are looking at the code in artwork.py, check line 419-420.

 

The addon doesn't actually remove any urls because they are suppose to drop automatically from the database when the item they are associated to are deleted.

 

 

Sent from my iPhone using Tapatalk

Angelblue05
Posted

But you are right, if you run the task "force cache all artwork" via launching the emby addon, it will cache everything but actors. But again, this would only effect actual artwork file saved in the kodi directory, the actually url should still drop regardless, and basically all that would be left behind is the file without a url. Anyway I'll test on my side.

 

 

Sent from my iPhone using Tapatalk

talentless
Posted

Hmm I see that. What about lines 170 and then 185.

talentless
Posted (edited)

Ok! I will make sure to trace this next time I remove something.

Edited by talentless
Angelblue05
Posted

Hmm I see that. What about lines 170 and then 185.

Yes, that only runs if you actually run the "force cache all artwork" option.

 

Thanks for bringing this up to my attention though. If you look at 381-392 - this image_url is what Kodi uses to find the artwork. That's what is not dropping. If you open your Myvideosxx.db with a database viewer like dbbrowser. Under the table "art" you will find the url emby is complaining about.

 

 

Sent from my iPhone using Tapatalk

talentless
Posted

I have never triggered the option "force cache all artwork".

 

Also let me clarify that the problem is not caused by anything leftover in the Myvideosxx.db; but in the TexturesXX.db texture table. This is removed in artwork.py delete_cached_artwork method (441-462) but only for poster and fanart (437, 438).

 

 

My TexturesXX.db texture table is full of non poster and fanart emby url entries:

sqlite> select Textures13db.texture.url, MyVideos107db.art.type from Textures13db.texture left join MyVideos107db.art on Textures13db.texture.url=MyVideos107db.art.url;
...
http://10.8.1.12:8096/emby/Items/738a416eb4c8719f105c4722e1b7a6f5/Images/Backdrop/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=c9d57d717b6b07fbd251c54fb70a69a2|fanart
http://10.8.1.12:8096/emby/Items/738a416eb4c8719f105c4722e1b7a6f5/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=3a052013772a50743ee28cb5b68659f8|poster
http://10.8.1.12:8096/emby/Items/738a416eb4c8719f105c4722e1b7a6f5/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=3a052013772a50743ee28cb5b68659f8|thumb
http://10.8.1.12:8096/emby/Items/77b72ad27eb2d64d822e8597550ae73b/Images/Backdrop/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=459098f4fb9b9932fc4490be6b3bb256|fanart
http://10.8.1.12:8096/emby/Items/77b72ad27eb2d64d822e8597550ae73b/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=01642287d9950fcd971032bce40159ed|poster
http://10.8.1.12:8096/emby/Items/77b72ad27eb2d64d822e8597550ae73b/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=01642287d9950fcd971032bce40159ed|thumb
http://10.8.1.12:8096/emby/Items/793db4c4b7826a74e62fa50184712308/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=f187f8175186320f5d379551ffe0125b|thumb
http://10.8.1.12:8096/emby/Items/84ea8184fc403c6127b1eb6d1a3db45c/Images/Backdrop/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=407e7bb19d9032f131a92673f3dcd296|fanart
http://10.8.1.12:8096/emby/Items/84ea8184fc403c6127b1eb6d1a3db45c/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=8ec75d8c58c62e40423e08721d708597|poster
http://10.8.1.12:8096/emby/Items/84ea8184fc403c6127b1eb6d1a3db45c/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=8ec75d8c58c62e40423e08721d708597|thumb
http://10.8.1.12:8096/emby/Items/863dd417a7d58013ce90aa2d4784d56f/Images/Backdrop/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=b457abf73581cfcace1479159868a3bd|fanart
http://10.8.1.12:8096/emby/Items/863dd417a7d58013ce90aa2d4784d56f/Images/Backdrop/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=b457abf73581cfcace1479159868a3bd|fanart
http://10.8.1.12:8096/emby/Items/863dd417a7d58013ce90aa2d4784d56f/Images/Logo/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=5c10c0bd145ed5f6ea879cdcbe80e9cd|clearlogo
http://10.8.1.12:8096/emby/Items/863dd417a7d58013ce90aa2d4784d56f/Images/Logo/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=5c10c0bd145ed5f6ea879cdcbe80e9cd|clearlogo
http://10.8.1.12:8096/emby/Items/863dd417a7d58013ce90aa2d4784d56f/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=6f150a34147de49a5f746b90b1017576|poster
http://10.8.1.12:8096/emby/Items/863dd417a7d58013ce90aa2d4784d56f/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=6f150a34147de49a5f746b90b1017576|poster
http://10.8.1.12:8096/emby/Items/863dd417a7d58013ce90aa2d4784d56f/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=6f150a34147de49a5f746b90b1017576|thumb
http://10.8.1.12:8096/emby/Items/863dd417a7d58013ce90aa2d4784d56f/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=6f150a34147de49a5f746b90b1017576|thumb
http://10.8.1.12:8096/emby/Items/89a64f0e6165a4e668c2b9e124f85c43/Images/Backdrop/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=47ee02e90a61c7a333e7ee3f79de93b1|fanart
http://10.8.1.12:8096/emby/Items/89a64f0e6165a4e668c2b9e124f85c43/Images/Logo/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=6cddc187768f6a558709311dc3a8db1c|clearlogo
http://10.8.1.12:8096/emby/Items/89a64f0e6165a4e668c2b9e124f85c43/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=dba9e3071805d4d8c3c07702a36af984|poster
http://10.8.1.12:8096/emby/Items/89a64f0e6165a4e668c2b9e124f85c43/Images/Primary/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=dba9e3071805d4d8c3c07702a36af984|thumb
http://10.8.1.12:8096/emby/Items/89a64f0e6165a4e668c2b9e124f85c43/Images/Thumb/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=1a23653e3fc38044a76e907a9e166eed|landscape
http://10.8.1.12:8096/emby/Items/8a39d6f8f1d3bda39439883282919816/Images/Backdrop/0?MaxWidth=10000&MaxHeight=10000&Format=original&Tag=43eecb05aa658b2d74f2cf4e5613f324|fanart
...

So if I never triggered the "force cache all artwork" function (but I DO have the sync option "force artwork caching" enabled, is it the same thing?) and otherwise the addon wont put those there, what is doing it?

Angelblue05
Posted

Ok I'll have a look. Thanks. And no, the setting is something different. The setting only plays when adding content to kodi.

 

 

Sent from my iPhone using Tapatalk

Guest
This topic is now closed to further replies.
×
×
  • Create New...