11#if QT_VERSION >= QT_VERSION_CHECK(6,5,0)
12#include <QtEnvironmentVariables>
14#include <QCoreApplication>
17#include <QProcessEnvironment>
24#include "libmythbase/mythconfig.h"
29#include "libmythbase/mythversion.h"
36int main(
int argc,
char *argv[])
57 QCoreApplication a(argc, argv);
61 QString path = QCoreApplication::applicationDirPath();
63 QString(
"%1/../Resources/lib/%2:%1/../Resources/lib/%2/site-packages:%1/../Resources/lib/%2/lib-dynload:%3")
65 .arg(QFileInfo(PYTHON_EXE).fileName())
66 .arg(QProcessEnvironment::systemEnvironment().value(
"PYTHONPATH"))
67 .toUtf8().constData());
79 if (!context.Init(
false))
81 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
89 std::unique_ptr<LookerUpper> lookup = std::make_unique<LookerUpper>();
91 LOG(VB_GENERAL, LOG_INFO,
92 "Testing grabbers and metadata sites for functionality...");
95 LOG(VB_GENERAL, LOG_INFO,
96 "All grabbers tested and working. Continuing...");
107 LOG(VB_GENERAL, LOG_INFO,
108 QString(
"No valid job found for jobid: %1")
113 lookup->HandleSingleRecording(chanid, starttime,
124 lookup->HandleAllRecordingRules();
129 lookup->HandleAllArtwork(
false);
133 lookup->HandleAllArtwork(
true);
139 lookup->HandleAllRecordings(
cmdline.
toBool(
"refresh-rules"));
142 while (lookup->StillWorking())
144 std::this_thread::sleep_for(1s);
145 qApp->processEvents();
148 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