10#include <QCoreApplication>
13#include <QProcessEnvironment>
20#include "libmythbase/mythconfig.h"
25#include "libmythbase/mythversion.h"
32int main(
int argc,
char *argv[])
53 QCoreApplication a(argc, argv);
57 QString path = QCoreApplication::applicationDirPath();
59 QString(
"%1/../Resources/lib/%2:/../Resources/lib/%2/site-packages:/../Resources/lib/%2/lib-dynload:%3")
61 .arg(QFileInfo(PYTHON_EXE).fileName())
62 .arg(QProcessEnvironment::systemEnvironment().value(
"PYTHONPATH"))
63 .toUtf8().constData(), 1);
75 if (!context.Init(
false))
77 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
85 std::unique_ptr<LookerUpper> lookup {
new LookerUpper};
87 LOG(VB_GENERAL, LOG_INFO,
88 "Testing grabbers and metadata sites for functionality...");
91 LOG(VB_GENERAL, LOG_INFO,
92 "All grabbers tested and working. Continuing...");
103 LOG(VB_GENERAL, LOG_INFO,
104 QString(
"No valid job found for jobid: %1")
109 lookup->HandleSingleRecording(chanid, starttime,
120 lookup->HandleAllRecordingRules();
125 lookup->HandleAllArtwork(
false);
129 lookup->HandleAllArtwork(
true);
135 lookup->HandleAllRecordings(
cmdline.
toBool(
"refresh-rules"));
138 while (lookup->StillWorking())
141 qApp->processEvents();
144 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