11#include <QCoreApplication>
14#include <QProcessEnvironment>
21#include "libmythbase/mythconfig.h"
26#include "libmythbase/mythversion.h"
33int main(
int argc,
char *argv[])
54 QCoreApplication a(argc, argv);
58 QString path = QCoreApplication::applicationDirPath();
60 QString(
"%1/../Resources/lib/%2:/../Resources/lib/%2/site-packages:/../Resources/lib/%2/lib-dynload:%3")
62 .arg(QFileInfo(PYTHON_EXE).fileName())
63 .arg(QProcessEnvironment::systemEnvironment().value(
"PYTHONPATH"))
64 .toUtf8().constData(), 1);
76 if (!context.Init(
false))
78 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
86 std::unique_ptr<LookerUpper> lookup = std::make_unique<LookerUpper>();
88 LOG(VB_GENERAL, LOG_INFO,
89 "Testing grabbers and metadata sites for functionality...");
92 LOG(VB_GENERAL, LOG_INFO,
93 "All grabbers tested and working. Continuing...");
104 LOG(VB_GENERAL, LOG_INFO,
105 QString(
"No valid job found for jobid: %1")
110 lookup->HandleSingleRecording(chanid, starttime,
121 lookup->HandleAllRecordingRules();
126 lookup->HandleAllArtwork(
false);
130 lookup->HandleAllArtwork(
true);
136 lookup->HandleAllRecordings(
cmdline.
toBool(
"refresh-rules"));
139 while (lookup->StillWorking())
141 std::this_thread::sleep_for(1s);
142 qApp->processEvents();
145 LOG(VB_GENERAL, LOG_NOTICE,
"MythMetadataLookup run complete.");
static bool GetJobInfoFromID(int jobID, int &jobType, uint &chanid, QDateTime &recstartts)
static void CopyRuleInetrefsToRecordings()
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
int toInt(const QString &key) const
Returns stored QVariant as an integer, falling to default if not provided.
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
int ConfigureLogging(const QString &mask="general", bool progress=false)
Read in logging options and initialize the logging interface.
static void PrintVersion(void)
Print application version information.
QDateTime toDateTime(const QString &key) const
Returns stored QVariant as a QDateTime, falling to default if not provided.
uint toUInt(const QString &key) const
Returns stored QVariant as an unsigned integer, falling to default if not provided.
void PrintHelp(void) const
Print command line option help.
Startup context for MythTV.
static void load(const QString &module_name)
Load a QTranslator for the user's preferred language.
@ GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.
@ GENERIC_EXIT_OK
Exited with no error.
@ GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
@ GENERIC_EXIT_NOT_OK
Exited with error.
static constexpr const char * MYTH_APPNAME_MYTHMETADATALOOKUP
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythCommFlagCommandLineParser cmdline