Skip to content

Commit

Permalink
previewgen: Fix handling of --infile
Browse files Browse the repository at this point in the history
Currently if the infile name looks like a myth recording title with a valid
channel ID and start time then the file is only searched for in the
recordings folder and so is consequently not found.

This fix checks if the file exists and if so doesn't attempt to extract
the channel ID and start time with the result that the file is not searched for in the recordings folder.

Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
  • Loading branch information
Lawrence Rust authored and stuartm committed Nov 23, 2012
1 parent b7a1bd2 commit 542dc7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/programs/mythpreviewgen/main.cpp
Expand Up @@ -96,7 +96,7 @@ int preview_helper(uint chanid, QDateTime starttime,
if (setpriority(PRIO_PROCESS, 0, 9))
LOG(VB_GENERAL, LOG_ERR, "Setting priority failed." + ENO);

if (!chanid || !starttime.isValid())
if (!QFileInfo(infile).isReadable() && (!chanid || !starttime.isValid()))
ProgramInfo::QueryKeyFromPathname(infile, chanid, starttime);

ProgramInfo *pginfo = NULL;
Expand Down

0 comments on commit 542dc7f

Please sign in to comment.