00001
00002 #include <QDateTime>
00003 #include <QString>
00004
00005
00006 #include "mythlogging.h"
00007
00008
00009 #include "mythutil.h"
00010
00011 bool GetProgramInfo(const MythUtilCommandLineParser &cmdline,
00012 ProgramInfo &pginfo)
00013 {
00014 if (!cmdline.toBool("chanid"))
00015 {
00016 LOG(VB_GENERAL, LOG_ERR, "No chanid specified");
00017 return false;
00018 }
00019
00020 if (!cmdline.toBool("starttime"))
00021 {
00022 LOG(VB_GENERAL, LOG_ERR, "No start time specified");
00023 return false;
00024 }
00025
00026 uint chanid = cmdline.toUInt("chanid");
00027 QDateTime starttime = cmdline.toDateTime("starttime");
00028 QString startstring = starttime.toString("yyyyMMddhhmmss");
00029
00030 const ProgramInfo tmpInfo(chanid, starttime);
00031
00032 if (!tmpInfo.GetChanID())
00033 {
00034 LOG(VB_GENERAL, LOG_ERR,
00035 QString("No program data exists for channel %1 at %2")
00036 .arg(chanid).arg(startstring));
00037 return false;
00038 }
00039
00040 pginfo = tmpInfo;
00041
00042 return true;
00043 }
00044
00045