[mythtv] PreviewGenerator path on remote systems

Steve Bower sbower at cisco.com
Sat Apr 1 16:09:29 UTC 2006


>>>> I wrote in another thread:
> Right now there's a bug that prevents the update from being attempted
> (and therefore looping) on remote machines in many cases, but I'll
> talk about that in a separate thread...  :-)

Now that the .png permissions are open (thanks Daniel!), it's time to
fix the path that PreviewGenerator uses to access the recording on
remote systems.

It currently tries to find the recording locally this way:

    // Try to find a local means to access file...
    QString baseName = programInfo.GetRecordBasename();
    QString prefix   = gContext->GetSetting("RecordFilePrefix");
    QString localFN  = QString("%1/%2").arg(prefix).arg(baseName);
    if (!QFileInfo(localFN).exists())
        return; // didn't find file locally, must use remote backend

This doesn't work on any system that has a RecordFilePrefix setting
that's different from the backend that recorded the program (or that's
empty, like a dedicated frontend).

The ProgramInfo::GetPlaybackURL method does some pretty exhaustive
checks to see if the recording is available locally (including checking
the RecordFilePrefix for the correct backend), so it's probably best
just to use that, and see if it found the file locally:

    // GetPlaybackURL returns a local filename if one exists
    QString localFN = programInfo.GetPlaybackURL();
    if ( ! (localFN.left(1) == "/" && QFileInfo(localFN).exists()))
        return; // didn't find file locally, must use remote backend

I'll open a ticket with this patch this weekend.

If there's interest in applying this to the -fixes branch (which I think
would be good), it must be accompanied by the .png permissions patch as
well.  Otherwise, any remote frontend will generate a new preview
snapshot, fail to update the file, and keep trying to do so for as long
as the program is selected in the Watch Recordings screen.

These two patches also allow a remote backend to update the snapshot
after finishing commflagging from the jobqueue (this is the situation
that first brought the issue to my attention).

Let me know if you have any comments or concerns!

  Thanks,
    Steve.
-- 
Steve Bower - IT/EHS Unix Administrator - sbower at cisco.com
The ideas presented herein aren't necessarily the ideas presented herein.


More information about the mythtv-dev mailing list