Skip to content
Browse files

Alter mythcommflag --video behavior

In --video mode, mythcommflag currently requires a myth:// URI, absolute
file path or path relative from the current directory.  This adds a
fallthrough behavior where if a local path cannot be found, it attempts
to access it as a myth:// URI at the local hostname.  This is half of
the fix for #9435, the second half will require ProgramInfo to properly
store seekdata for such files.

Refs #9435
  • Loading branch information...
1 parent 037ba2a commit 546af2ff5921d245496998dddb59e44b72b185d9 @wagnerrp wagnerrp committed Jul 23, 2011
Showing with 15 additions and 5 deletions.
  1. +15 −5 mythtv/programs/mythcommflag/main.cpp
View
20 mythtv/programs/mythcommflag/main.cpp
@@ -998,15 +998,25 @@ static int FlagCommercials(QString filename, int jobid,
static int RebuildSeekTable(ProgramInfo *pginfo, int jobid)
{
+ QString filename = get_filename(pginfo);
+
if (!DoesFileExist(pginfo))
{
- LOG(VB_GENERAL, LOG_ERR,
- "Unable to find file in defined storage paths.");
- return GENERIC_EXIT_PERMISSIONS_ERROR;
+ // file not found on local filesystem
+ // assume file is in Video storage group on local backend
+ // and try again
+
+ filename = QString("myth://Video@%1/%2")
+ .arg(gCoreContext->GetHostName()).arg(filename);
+ pginfo->SetPathname(filename);
+ if (!DoesFileExist(pginfo))
+ {
+ LOG(VB_GENERAL, LOG_ERR,
+ "Unable to find file in defined storage paths.");
+ return GENERIC_EXIT_PERMISSIONS_ERROR;
+ }
}
- QString filename = get_filename(pginfo);
-
RingBuffer *tmprbuf = RingBuffer::Create(filename, false);
if (!tmprbuf)
{

0 comments on commit 546af2f

Please sign in to comment.
Something went wrong with that request. Please try again.