37 (QEvent::Type) QEvent::registerEventType();
49 (QEvent::Type) QEvent::registerEventType();
61 (QEvent::Type) QEvent::registerEventType();
70 (QEvent::Type) QEvent::registerEventType();
111 bool getimages,
bool allowgeneric)
121 lookup->SetData(QVariant::fromValue(recrule));
122 lookup->SetAutomatic(automatic);
123 lookup->SetHandleImages(getimages);
124 lookup->SetAllowGeneric(allowgeneric);
126 lookup->SetTitle(recrule->
m_title);
129 lookup->SetSeason(recrule->
m_season);
139 bool getimages,
bool allowgeneric)
149 lookup->SetData(QVariant::fromValue(pginfo));
150 lookup->SetAutomatic(automatic);
151 lookup->SetHandleImages(getimages);
152 lookup->SetAllowGeneric(allowgeneric);
154 lookup->SetTitle(pginfo->
GetTitle());
167 bool getimages,
bool allowgeneric)
177 lookup->SetData(QVariant::fromValue(metadata));
178 lookup->SetAutomatic(automatic);
179 lookup->SetHandleImages(getimages);
180 lookup->SetAllowGeneric(allowgeneric);
181 lookup->SetHost(metadata->
GetHost());
182 lookup->SetTitle(metadata->
GetTitle());
184 lookup->SetSeason(metadata->
GetSeason());
208 const QString& subtitle,
209 const QString& inetref,
212 const QString& grabber,
219 lookup->SetAutomatic(
false);
220 lookup->SetHandleImages(
false);
221 lookup->SetAllowGeneric(allowgeneric);
222 lookup->SetTitle(title);
223 lookup->SetSubtitle(subtitle);
224 lookup->SetSeason(season);
225 lookup->SetEpisode(episode);
226 lookup->SetInetref(inetref);
227 if (grabber.toLower() ==
"movie")
229 else if (grabber.toLower() ==
"tv" ||
230 grabber.toLower() ==
"television")
253 QCoreApplication::processEvents();
275 LOG(VB_GENERAL, LOG_WARNING,
"Could not retrieve list of "
276 "available backends.");
301 QCoreApplication::postEvent(parent(),
315 if (!coverartlist.empty())
318 info.url = coverartlist.takeFirst().url;
323 if (!fanartlist.empty())
328 if (season > 0 && season <= fanartlist.count())
330 info.url = fanartlist.takeAt(index).url;
335 if (!bannerlist.empty())
338 info.url = bannerlist.takeFirst().url;
345 if (!screenshotlist.empty())
348 info.url = screenshotlist.takeFirst().url;
361 QCoreApplication::postEvent(parent(),
372 QCoreApplication::postEvent(parent(),
382 QCoreApplication::postEvent(parent(),
399 if (metadata->GetTagline().isEmpty())
402 metadata->SetYear(lookup->
GetYear());
403 if (metadata->GetReleaseDate() == QDate())
406 metadata->GetDirector().isEmpty())
409 if (director.count() > 0)
410 metadata->SetDirector(director.takeFirst().name);
412 if (metadata->GetStudio().isEmpty())
415 if (studios.count() > 0)
416 metadata->SetStudio(studios.takeFirst());
419 metadata->GetPlot().isEmpty())
421 if (metadata->GetUserRating() == 0)
425 if (metadata->GetLength() == 0min)
427 if (metadata->GetSeason() == 0)
428 metadata->SetSeason(lookup->
GetSeason());
429 if (metadata->GetEpisode() == 0)
431 if (metadata->GetHomepage().isEmpty())
442 for (
const auto& actor : std::as_const(gueststars))
443 actors.append(actor);
448 for (
const auto& actor : std::as_const(actors))
449 cl.append(actor.name);
451 for (
const auto& name : std::as_const(cl))
453 QString cn = name.trimmed();
456 cast.emplace_back(-1, cn);
460 metadata->SetCast(cast);
466 for (
const auto& str : std::as_const(genres))
468 QString genre_name = str.trimmed();
469 if (!genre_name.isEmpty())
471 video_genres.emplace_back(-1, genre_name);
475 metadata->SetGenres(video_genres);
481 for (
const auto& str : std::as_const(countries))
483 QString country_name = str.trimmed();
484 if (!country_name.isEmpty())
486 video_countries.emplace_back(-1, country_name);
490 metadata->SetCountries(video_countries);
495 if (!coverurl.path().isEmpty())
496 metadata->SetCoverFile(coverurl.path().remove(0,1));
499 if (!fanarturl.path().isEmpty())
500 metadata->SetFanart(fanarturl.path().remove(0,1));
503 if (!bannerurl.path().isEmpty())
504 metadata->SetBanner(bannerurl.path().remove(0,1));
507 if (!sshoturl.path().isEmpty())
508 metadata->SetScreenshot(sshoturl.path().remove(0,1));
510 metadata->SetProcessed(
true);
511 metadata->UpdateDatabase();
515 QCoreApplication::postEvent(parent(),
536 else if (lul.count() == 1)
592 QCoreApplication::postEvent(parent(),
602 QList<int> moves = vsc->m_moved;
603 QList<int> deletions = vsc->m_deleted;
607 LOG(VB_GENERAL, LOG_INFO,
608 QString(
"Video Scan Complete: a(%1) m(%2) d(%3)")
609 .arg(additions.count()).arg(moves.count())
610 .arg(deletions.count()));
614 QCoreApplication::postEvent(parent(),
621 LOG(VB_GENERAL, LOG_INFO,
622 QString(
"Video Scan Complete: a(%1) m(%2) d(%3)")
623 .arg(additions.count()).arg(moves.count())
624 .arg(deletions.count()));
630 for (
int id : std::as_const(additions))
635 Lookup(metadata,
true,
true);
679 int ruleepisode = rule->m_episode;
689 else if (ruleepisode == 0 && pginfo->
GetEpisode() == 0 &&
694 else if (ruleepisode > 0 && pginfo->
GetSubtitle().isEmpty())
759 if (inetref.isEmpty() || inetref ==
"00000000" ||
static const Type kEventType
static const Type kEventType
bool isRunning(void) const
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
QString GetMasterHostName(void)
Holds information on recordings and videos.
uint GetRecordingRuleID(void) const
uint GetEpisode(void) const
QString GetInetRef(void) const
CategoryType QueryCategoryType(void) const
Queries recordedprogram to get the category_type of the recording.
QString GetTitle(void) const
CategoryType GetCategoryType(void) const
QString GetSubtitle(void) const
uint GetSeason(void) const
Internal representation of a recording rule, mirrors the record table.
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
virtual int IncrRef(void)
Increments reference count.
static QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
static const Type kEventType
void SetDirs(QStringList dirs)
void SetHosts(const QStringList &hosts)
const QString VIDEO_PLOT_DEFAULT
const QString VIDEO_RATING_DEFAULT
const QString VIDEO_DIRECTOR_UNKNOWN
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
bool RemoteGetActiveBackends(QStringList *list)
return list of backends currently connected to the master
QStringList GetVideoDirs()