Opened 18 years ago
Closed 18 years ago
#1585 closed patch (fixed)
Change permissions on preview .png files
Reported by: | Owned by: | danielk | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
See http://www.gossamer-threads.com/lists/mythtv/dev/191628#191628
This patch implements these changes to the PreviewGenerator? save functionality:
- After updating the preview .png file, change its permissions to 0666 so that other processes running as different UIDs can update it if they need to.
- If saving the file failes, and the .png file exists, attempt to save the preview to .png.new, and then move it over the old .png file. Also set perms to 0666.
- If both of the above fail, and !localOnly, use RemotePreviewRun? to ask the backend to do it for us.
It might be better to do the third test in the Run() method so that LocalPreviewRun? never invokes RemotePreviewRun? itself, I can adapt it if desired.
The part of the message above that I haven't addressed is the possibility that a remote backend is attempting to update the preview and fails (it will have localOnly set, so won't fall back to RemotePreviewRun?). Doing so would require changing the definition of the localOnly argument, and then verifying that the backend that invoked us isn't the backend that recorded the show. Of course, if the backend that recorded the show fails to update the .png, there are probably bigger issues... :-)
danielk is the only one who has touched previewgenerator.cpp, so assigning to him.
patch to previewgenerator.cpp