Opened 14 years ago

Closed 14 years ago

#7615 closed defect (fixed)

MythUI fails to update cache for images in storage groups

Reported by: Robin Hill <myth@…> Owned by: cpinkham
Priority: minor Milestone: 0.24
Component: MythTV - User Interface Library Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The MythUI code to check whether a cached image is out-of-date only works with local images (as it checks the modification time of the files). This check fails for images in storage groups, so these never get updated (unless the cache is cleared).

The attached patch retrieves the modification time from the backend for images in storage groups.

Attachments (2)

myth_imagecache.diff (2.9 KB) - added by Robin Hill <myth@…> 14 years ago.
Patch to lookup modification time for images in storage groups
myth_imagecache2.diff (3.1 KB) - added by Robin Hill <myth@…> 14 years ago.
Replacement patch eliminating redundant backend calls

Download all attachments as: .zip

Change History (7)

Changed 14 years ago by Robin Hill <myth@…>

Attachment: myth_imagecache.diff added

Patch to lookup modification time for images in storage groups

comment:1 Changed 14 years ago by Robin Hill <myth@…>

Here's an updated patch. This reduces the number of backend calls by first checking whether the image is in the memory cache and has a last-update time less than 2 seconds ago (this value may need fine-tuning but seemed a good starting point). This prevents repeated calls for every time the image is used (e.g. for every cover shot in a season directory).

Changed 14 years ago by Robin Hill <myth@…>

Attachment: myth_imagecache2.diff added

Replacement patch eliminating redundant backend calls

comment:2 Changed 14 years ago by stuartm

Milestone: unknown0.23
Owner: changed from stuartm to cpinkham
Status: newassigned

Reassigning to Chris as the SG expert.

comment:3 Changed 14 years ago by cpinkham

Milestone: 0.230.24

I'm going to push this to 0.24. The only way to fix this without a non-intrusive patch is to add some form of RemoteFile::Stat(), but since RemoteFile? does not have access to the main connection back to the master backend, this would mean that we would have to open and close a backend connection for each image we were checking.

I already have most of a patch completed to move the main backend connection into libmythdb so that RemoteFile? and libmythui can take advantage of it. This is part of a larger project I'm working on to create a directory caching/monitoring subsystem in Myth for various reasons. That will eventually be the solution to this ticket, so I'm leaving this open for now, but pushing off till 0.24.

The attached patch can not be used because it creates a circular dependency. libmyth depends on libmythui, so code in libmythui should not depend on code in libmyth.

comment:4 Changed 14 years ago by cpinkham

Version: 0.22head

comment:5 Changed 14 years ago by cpinkham

Resolution: fixed
Status: assignedclosed

(In [25230]) Check the last modified timestamp of remote myth:// images so that we can refresh them when needed.

Also allow the QUERY_SG_FILEINFO backend command to take the master's IP address as well as hostname.

In combination with [25229], this fixes #7615 using a different patch that uses the new RemoteFile::LastModified?() to do the check.

Note: See TracTickets for help on using tickets.