Image caching problem

plugin-dev

#1

Hi,



Making progress on my plugin but hitting a snag that looks (to the naive eye) like it's something to do with images and caching.



I'm creating a list of directory items by, in a loop, calling



dir.Append(Function(DirectoryItem(Channel, title=title), breadcrumb=title, url=url))



which works fine. However, when I attempt to add a thumbnail image to the item with



dir.Append(Function(DirectoryItem(Channel, title=title, thumb=thumb), breadcrumb=title, url=url))



where thumb is a url to an image on the web site I'm parsing.



I'm seeing a couple of odd things:

* First, all my directory items have the same image, rather than their specific thumb. The parsed urls are different.

* If I remove the thumb=thumb to attempt to remove the thumbnail the image remains in the info list.



Again, I'm sure it's something obvious so pointers would be great.



Also, I can't get rid of the background art I tried once by specifying in the AddPrefixHandler. Similar issue/misunderstanding?



thanks

Jonny


#2

[quote name='Jonny Wray' post='40460' date='May 19 2009, 06:45 PM']
* First, all my directory items have the same image, rather than their specific thumb. The parsed urls are different.

[/quote]




The thumbs are computed and stored based on the URL of the each item itself (the key) rather than the thumb URLs themselves. It's possible that you had incorrect data and they got cached incorrectly. Try clearing out ~/Library/Application Support/Plex/userdata/Thumbnails/Video (assuming it's a video plug-in) and restart Plex.


[quote name='Jonny Wray' post='40460' date='May 19 2009, 06:45 PM']
* If I remove the thumb=thumb to attempt to remove the thumbnail the image remains in the info list.

[/quote]




That points to it having been incorrectly cached.


[quote name='Jonny Wray' post='40460' date='May 19 2009, 06:45 PM']
Also, I can't get rid of the background art I tried once by specifying in the AddPrefixHandler. Similar issue/misunderstanding?

[/quote]




It could be, yeah; the backgrounds live in the ...thumbnails/Programs/Fanart directory, you can clear them out.



Sorry for the trouble :)


#3

Thanks for the reply. Not so much trouble as me not understanding the caching mechanism or how to clear it out. That should be enough to get me over this hump.



Thanks,

Jonny.


[quote name='elan' post='40466' date='May 20 2009, 07:33 AM']
The thumbs are computed and stored based on the URL of the each item itself (the key) rather than the thumb URLs themselves. It's possible that you had incorrect data and they got cached incorrectly. Try clearing out ~/Library/Application Support/Plex/userdata/Thumbnails/Video (assuming it's a video plug-in) and restart Plex.







That points to it having been incorrectly cached.







It could be, yeah; the backgrounds live in the ...thumbnails/Programs/Fanart directory, you can clear them out.



Sorry for the trouble :)

[/quote]