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")
252 std::this_thread::sleep_for(1s);
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 actors.reserve(actors.size() + gueststars.size());
443 for (
const auto& actor : std::as_const(gueststars))
444 actors.append(actor);
447 cl.reserve(actors.size());
448 for (
const auto& actor : std::as_const(actors))
449 cl.append(actor.name);
452 cast.reserve(cl.size());
453 for (
const auto& name : std::as_const(cl))
455 QString cn = name.trimmed();
458 cast.emplace_back(-1, cn);
462 metadata->SetCast(cast);
467 video_genres.reserve(genres.size());
468 for (
const auto& str : std::as_const(genres))
470 QString genre_name = str.trimmed();
471 if (!genre_name.isEmpty())
473 video_genres.emplace_back(-1, genre_name);
477 metadata->SetGenres(video_genres);
482 video_countries.reserve(countries.size());
483 for (
const auto& str : std::as_const(countries))
485 QString country_name = str.trimmed();
486 if (!country_name.isEmpty())
488 video_countries.emplace_back(-1, country_name);
492 metadata->SetCountries(video_countries);
497 if (!coverurl.path().isEmpty())
498 metadata->SetCoverFile(coverurl.path().remove(0,1));
501 if (!fanarturl.path().isEmpty())
502 metadata->SetFanart(fanarturl.path().remove(0,1));
505 if (!bannerurl.path().isEmpty())
506 metadata->SetBanner(bannerurl.path().remove(0,1));
509 if (!sshoturl.path().isEmpty())
510 metadata->SetScreenshot(sshoturl.path().remove(0,1));
512 metadata->SetProcessed(
true);
513 metadata->UpdateDatabase();
517 QCoreApplication::postEvent(parent(),
538 else if (lul.count() == 1)
594 QCoreApplication::postEvent(parent(),
604 QList<int> moves = vsc->m_moved;
605 QList<int> deletions = vsc->m_deleted;
609 LOG(VB_GENERAL, LOG_INFO,
610 QString(
"Video Scan Complete: a(%1) m(%2) d(%3)")
611 .arg(additions.count()).arg(moves.count())
612 .arg(deletions.count()));
616 QCoreApplication::postEvent(parent(),
623 LOG(VB_GENERAL, LOG_INFO,
624 QString(
"Video Scan Complete: a(%1) m(%2) d(%3)")
625 .arg(additions.count()).arg(moves.count())
626 .arg(deletions.count()));
632 for (
int id : std::as_const(additions))
637 Lookup(metadata,
true,
true);
687 int ruleepisode = rule->m_episode;
697 else if (ruleepisode == 0 && pginfo->
GetEpisode() == 0 &&
702 else if (ruleepisode > 0 && pginfo->
GetSubtitle().isEmpty())
767 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()