60#define LOC_MML QString("Manual Metadata Lookup: ")
69 if (num == i)
return true;
84 connect(&m_levelCheck,
86 this, &ParentalLevelNotifyContainer::OnResultReady);
93 m_levelCheck.Check(m_level.GetLevel(), level.
GetLevel());
110 if (lastLevel != m_level)
112 emit SigLevelChanged();
138 const QStringList &in_dirs, QString &image,
139 QString title,
int season,
140 const QString &host,
const QString& sgroup,
141 int episode = 0,
bool isScreenshot =
false)
143 QStringList search_dirs(in_dirs);
145 search_dirs += qfi.absolutePath();
146 if (title.contains(
"/"))
147 title.replace(
"/",
"-");
149 const QString base_name = qfi.completeBaseName();
150 QList<QByteArray> image_types = QImageReader::supportedImageFormats();
152 using image_type_list = std::set<QString>;
153 image_type_list image_exts;
157 if (sgroup ==
"Coverart")
159 if (sgroup ==
"Fanart")
161 if (sgroup ==
"Screenshots")
162 suffix =
"screenshot";
163 if (sgroup ==
"Banners")
166 for (
const auto & itype : std::as_const(image_types))
167 image_exts.insert(QString(itype).toLower());
171 QStringList hostFiles;
174 const QString hntm(
"%2.%3");
176 for (
const auto & ext : image_exts)
179 if (episode > 0 || season > 0)
183 sfn += hntm.arg(QString(
"%1 Season %2x%3_%4")
184 .arg(title, QString::number(season),
185 QString::number(episode), suffix),
190 sfn += hntm.arg(QString(
"%1 Season %2_%3")
191 .arg(title, QString::number(season),
199 sfn += hntm.arg(base_name + QString(
"_%1").arg(suffix),
201 sfn += hntm.arg(video_uid + QString(
"_%1").arg(suffix),
205 for (
const auto & str : std::as_const(sfn))
207 if (hostFiles.contains(str))
216 const QString fntm(
"%1/%2.%3");
218 for (
const auto & dir : std::as_const(search_dirs))
220 if (dir.isEmpty())
continue;
222 for (
const auto & ext : image_exts)
225 if (season > 0 || episode > 0)
230 QString(
"%1 Season %2x%3_%4")
231 .arg(title, QString::number(season),
232 QString::number(episode),
239 QString(
"%1 Season %2_%3")
240 .arg(title, QString::number(season),
248 base_name + QString(
"_%1").arg(suffix),
251 video_uid + QString(
"_%1").arg(suffix),
255 for (
const auto &
file : std::as_const(sfn))
272 const int WATCHED_WATERMARK = 10000;
280 QElapsedTimer playing_time;
284 playing_time.start();
291 if (!playing_time.hasExpired(WATCHED_WATERMARK))
294 item = (item->GetChildID() > 0)
295 ? video_list.
byID(item->GetChildID())
308 m_fanartTimer.stop();
309 m_fanartTimer.disconnect(
this);
316 connect(&m_fanartTimer, &
QTimer::timeout,
this, &FanartLoader::fanartLoad);
320 bool wasActive = m_fanartTimer.isActive();
324 m_fanartTimer.stop();
331 QMutexLocker locker(&m_fanartLock);
333 if (
filename != m_fanart->GetFilename())
336 m_fanartTimer.stop();
342 m_fanartTimer.setSingleShot(
true);
343 m_fanartTimer.start(300ms);
360 QMutexLocker locker(&m_fanartLock);
369 bool m_bConnected {
false};
376 virtual void handleText(
const QString &name,
const QString &value) = 0;
377 virtual void handleState(
const QString &name,
const QString &value) = 0;
387 void handleText(
const QString &name,
const QString &value)
override
392 void handleState(
const QString &name,
const QString &value)
override
394 handleText(name, value);
403 if (name !=
"fanart")
434 void handleText(
const QString &name,
const QString &value)
override
436 m_item->SetText(value, name);
439 void handleState(
const QString &name,
const QString &value)
override
441 m_item->DisplayState(value, name);
445 [[maybe_unused]]
const QString &
filename)
override
456 using valuelist = std::map<QString, QString>;
476 tmp[
"coverart"] = coverfile;
478 tmp[
"coverfile"] = coverfile;
480 QString screenshotfile;
493 tmp[
"screenshot"] = screenshotfile;
495 tmp[
"screenshotfile"] = screenshotfile;
510 tmp[
"banner"] = bannerfile;
512 tmp[
"bannerfile"] = bannerfile;
527 tmp[
"fanart"] = fanartfile;
529 tmp[
"fanartfile"] = fanartfile;
533 tmp[
"userratingstate"] =
543 m_vallist(values), m_dest(
d) {}
545 void handleImage(
const QString &name)
547 m_dest.handleImage(name, m_vallist[name]);
550 void handleState(
const QString &name)
552 m_dest.handleState(name, m_vallist[name]);
555 valuelist &m_vallist;
561 h.handleImage(
"coverart");
562 h.handleImage(
"screenshot");
563 h.handleImage(
"banner");
564 h.handleImage(
"fanart");
566 h.handleState(
"trailerstate");
567 h.handleState(
"userratingstate");
568 h.handleState(
"watchedstate");
569 h.handleState(
"videolevel");
577 if (!metadata || (!item && !screen))
587 item->DisplayState(bookmarkState,
"bookmarkstate");
588 item->SetProgress1(0, showProgress ? 100 : 0, watchedPercent);
592 CheckedSet(screen,
"bookmarkstate", bookmarkState);
593 auto *watchedProgress =
dynamic_cast<MythUIProgressBar *
>(screen->GetChild(
"watchedprogressbar"));
596 watchedProgress->
Set(0, showProgress ? 100 : 0, watchedPercent);
645 ScreenCopyDest
dest(
this);
668 bool handled =
false;
669 for (
const auto &
action : std::as_const(actions))
717 const parental_level_map::value_type &rhs)
719 return lhs.first.length() >= rhs.first.length();
734 QString ratingstring =
736 .arg(sl.GetLevel()));
737 QStringList ratings =
738 ratingstring.split(
':', Qt::SkipEmptyParts);
739 auto to_pl = [sl](
const auto &
rating)
740 {
return parental_level_map::value_type(
rating, sl.GetLevel()); };
741 std::transform(ratings.cbegin(), ratings.cend(),
783 if (
rating.indexOf(
p->first) != -1)
858 QObject(QCoreApplication::instance()),
896 GetNumSetting(
"VideoDefaultParentalLevel",
911 if (metadata && metadata->GetFilename() ==
filename)
979 QString windowName =
"videogallery";
980 bool flatlistDefault =
false;
985 windowName =
"browser";
986 flatlistDefault =
true;
989 windowName =
"gallery";
997 windowName =
"manager";
998 flatlistDefault =
true;
1071 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen '" + windowName +
"'");
1162 QString message = tr(
"The video scan found no files, have you "
1163 "configured a video storage group?");
1222 QStringList lastTreeNodePath =
gCoreContext->
GetSetting(
"mythvideo.VideoTreeLastActive",
"").split(
"\n");
1226 if (!lastTreeNodePath.isEmpty())
1229 for (
int i = 0; i < lastTreeNodePath.size(); i++)
1233 if (node !=
nullptr)
1238 if (node->
GetText().compare(lastTreeNodePath.at(i)) == 0)
1244 i < lastTreeNodePath.size()-1)
1250 if (lastTreeNodePath.at(i) == lastTreeNodePath.last())
1251 selectedNode = node;
1261 using MGTreeChildList = QList<MythGenericTree *>;
1264 for (
auto * child : std::as_const(*lchildren))
1266 if (child !=
nullptr)
1272 item->SetData(QVariant::fromValue(child));
1276 if (child == selectedNode)
1301 metadata->
toMap(metadataMap);
1305 MythUIButtonListItemCopyDest
dest(item);
1311 if (parent && metadata && ((QString::compare(parent->
GetText(),
1312 metadata->
GetTitle(), Qt::CaseInsensitive) == 0) ||
1313 parent->
GetText().startsWith(tr(
"Season"), Qt::CaseInsensitive)))
1315 else if (metadata && !metadata->
GetSubtitle().isEmpty())
1325 if (!screenshot.isEmpty() && parent && metadata &&
1326 ((QString::compare(parent->
GetText(),
1327 metadata->
GetTitle(), Qt::CaseInsensitive) == 0) ||
1328 parent->
GetText().startsWith(tr(
"Season"), Qt::CaseInsensitive)))
1334 if (coverimage.isEmpty())
1339 int nodeInt = node->
getInt();
1341 if (coverimage.isEmpty() && nodeInt ==
kSubFolder)
1344 item->
SetImage(coverimage,
"coverart");
1346 if (screenshot.isEmpty() && nodeInt ==
kSubFolder)
1349 item->
SetImage(screenshot,
"screenshot");
1351 if (banner.isEmpty() && nodeInt ==
kSubFolder)
1356 if (fanart.isEmpty() && nodeInt ==
kSubFolder)
1431 QString result =
"";
1433 LOG(VB_GENERAL, LOG_DEBUG, QString(
"RemoteImageCheck(%1)").arg(
filename));
1438 if (!dirs.isEmpty())
1440 for (
const auto & dir : std::as_const(dirs))
1443 QString path = sgurl.path();
1445 QString fname = QString(
"%1/%2").arg(path,
filename);
1447 QStringList list( QString(
"QUERY_SG_FILEQUERY") );
1454 if (!ok || list.at(0).startsWith(
"SLAVE UNREACHABLE"))
1456 LOG(VB_GENERAL, LOG_WARNING,
1457 QString(
"Backend : %1 currently Unreachable. Skipping "
1458 "this one.") .arg(host));
1462 if ((!list.isEmpty()) && (list.at(0) == fname))
1465 if (!result.isEmpty())
1468 LOG(VB_GENERAL, LOG_DEBUG,
1469 QString(
"RemoteImageCheck(%1) res :%2: :%3:")
1470 .arg(fname).arg(result).arg(dir));
1490 int nodeInt = node->
getInt();
1505 if (folder_path.startsWith(
"myth://"))
1506 folder_path = folder_path.right(folder_path.length()
1507 - folder_path.lastIndexOf(
"//") - 1);
1509 QString
filename = QString(
"%1/folder").arg(folder_path);
1512 LOG(VB_GENERAL, LOG_DEBUG,
1513 QString(
"GetCoverImage host : %1 prefix : %2 file : %3")
1517 QStringList test_files;
1518 test_files.append(
filename +
".png");
1519 test_files.append(
filename +
".jpg");
1520 test_files.append(
filename +
".jpeg");
1521 test_files.append(
filename +
".gif");
1524 for (
auto imagePath : std::as_const(test_files))
1527 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Cover check :%1 : ").arg(imagePath));
1530 bool foundCover =
false;
1531 if (!host.isEmpty())
1534 imagePath.replace(
"//",
"/");
1535 prefix.replace(
"//",
"/");
1536 imagePath = imagePath.right(imagePath.length() - (
prefix.length() + 1));
1539 if (!tmpCover.isEmpty())
1542 imagePath = tmpCover;
1552 icon_file = imagePath;
1558 if (icon_file.isEmpty())
1560 QStringList imageTypes {
"*.png",
"*.jpg",
"*.jpeg",
"*.gif" };
1563 if (!host.isEmpty())
1569 if (!dirs.isEmpty())
1571 for (
const auto & dir : std::as_const(dirs))
1574 QString path = sgurl.path();
1576 QString subdir = folder_path.right(folder_path.length() - (
prefix.length() + 1));
1578 path = path +
"/" + subdir;
1580 QStringList tmpList;
1585 for (
const auto & pattern : std::as_const(imageTypes))
1587 auto rePattern = QRegularExpression::wildcardToRegularExpression(pattern);
1588 QRegularExpression rx {
1589 rePattern.mid(2,rePattern.size()-4),
1590 QRegularExpression::CaseInsensitiveOption };
1591 QStringList matches = tmpList.filter(rx);
1592 if (!matches.isEmpty())
1595 fList.append(subdir +
"/" + matches.at(0).split(
"::").at(1));
1608 QDir vidDir(folder_path);
1609 vidDir.setNameFilters(imageTypes);
1610 fList = vidDir.entryList();
1614 if (icon_file.isEmpty())
1619 for (
int i = 0; i < list_count; i++)
1627 if (!metadata->
GetHost().isEmpty() &&
1632 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1635 icon_file = test_file;
1642 if (!test_file.isEmpty() &&
1645 icon_file = test_file;
1655 if (!fList.isEmpty())
1659 icon_file = QString(
"%1/%2").arg(folder_path, fList.at(0));
1668 if (!icon_file.isEmpty())
1670 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Found Image : %1 :")
1675 LOG(VB_GENERAL, LOG_DEBUG,
1676 QString(
"Could not find folder cover Image : %1 ")
1718 const QString& gpnode,
int levels)
1720 if (!node ||
type.isEmpty())
1728 QList<MythGenericTree *> subDirs;
1729 static constexpr int maxRecurse { 1 };
1731 for (
int i = 0; i < list_count; i++)
1743 const QString& host = metadata->
GetHost();
1744 const QString& title = metadata->
GetTitle();
1746 if (
type ==
"Coverart" && !host.isEmpty() &&
1752 else if (
type ==
"Coverart")
1757 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1759 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1761 icon_file = test_file;
1765 if (
type ==
"Fanart" && !host.isEmpty() &&
1771 else if (
type ==
"Fanart")
1776 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1778 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1780 icon_file = test_file;
1784 if (
type ==
"Banners" && !host.isEmpty() &&
1790 else if (
type ==
"Banners")
1795 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1797 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1799 icon_file = test_file;
1803 if (
type ==
"Screenshots" && !host.isEmpty() &&
1809 else if (
type ==
"Screenshots")
1814 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1816 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1818 icon_file = test_file;
1824 if (icon_file.isEmpty() && !subDirs.isEmpty())
1827 int subDirCount = subDirs.count();
1828 for (
int i = 0; i < subDirCount; i ++)
1830 if (levels < maxRecurse)
1834 if (!test_file.isEmpty())
1836 icon_file = test_file;
1852 const int nodeInt = node->
getInt();
1892 const int nodeInt = node->
getInt();
1903 !metadata->
GetBanner().startsWith(
"/") &&
1927 const int nodeInt = node->
getInt();
1938 !metadata->
GetFanart().startsWith(
"/") &&
1965 QStringList actions;
1968 for (
int i = 0; i < actions.size() && !handled; i++)
1970 const QString&
action = actions[i];
1980 else if (
action ==
"INCPARENT")
1984 else if (
action ==
"DECPARENT")
1993 else if (
action ==
"FILTER")
1997 else if (
action ==
"MENU")
2002 else if (
action ==
"PLAYALT")
2008 else if (
action ==
"DOWNLOADDATA")
2013 else if (
action ==
"INCSEARCH")
2017 else if (
action ==
"ITEMDETAIL")
2021 else if (
action ==
"DELETE")
2030 else if (
action ==
"ESCAPE")
2050 for (
int i = 0; i < actions.size() && !handled; i++)
2052 const QString&
action = actions[i];
2053 if (
action ==
"PLAYBACK")
2076 const QString& message = title;
2079 "mythvideobusydialog");
2097 QString msg = tr(
"Fetching details for %1")
2102 desc = tr(
"Season %1, Episode %2")
2122 msg = tr(
"Retrieved details for %1").arg(metadata->
GetTitle());
2126 msg = tr(
"Failed to retrieve details for %1").arg(metadata->
GetTitle());
2131 desc = tr(
"Season %1, Episode %2")
2157 const QString& message = title;
2161 if (okPopup->Create())
2171 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Jumping to: %1").arg(
string));
2174 QList<MythGenericTree*> *children =
nullptr;
2175 QMap<int, QString> idTitle;
2182 for (
auto * child : std::as_const(*children))
2184 QString title = child->GetText();
2185 int id = child->getPosition();
2186 idTitle.insert(
id, title);
2213 QStringList childList;
2214 QList<MythGenericTree*> *children =
nullptr;
2220 for (
auto * child : std::as_const(*children))
2222 childList << child->GetText();
2228 tr(
"Video Search"), childList,
false,
"");
2230 if (searchDialog->Create())
2239 delete searchDialog;
2249 bool handled =
false;
2336 metadata->
toMap(metadataMap);
2346 ScreenCopyDest
dest(
this);
2401 if (metadata->
GetWatched() != metadataNew->GetWatched())
2403 metadata->
SetWatched(metadataNew->GetWatched());
2421 label = tr(
"Video Options\n%1\n%2").arg(metadata->
GetTitle(),
2426 label = tr(
"Video Options\n%1").arg(metadata->
GetTitle());
2431 label = tr(
"Video Options");
2487 label = tr(
"Playback Options\n%1").arg(metadata->
GetTitle());
2505 QString trailerFile = metadata->
GetTrailer();
2507 (!metadata->
GetHost().isEmpty() && !trailerFile.isEmpty()))
2521 QString label = tr(
"Video Display Menu");
2554 if (which ==
"display")
2565 QString label = tr(
"Change View");
2601 QString label = tr(
"Video Settings");
2660 QString label = tr(
"Browse By");
2703 QString label = tr(
"Video Info");
2715 if (!metadata->
GetCast().empty())
2730 QString label = tr(
"Manage Video Details");
2815 int nodeInt = node->
getInt();
2983 if (mythvideo->Create())
2989 screenStack->
PopScreen(
this,
false,
false);
2994 ShowOkPopup(tr(
"An error occurred when switching views."));
3008 if (plotdialog->Create())
3046 if (castdialog->Create())
3065 if (browser.isEmpty())
3067 ShowOkPopup(tr(
"No browser command set! MythVideo needs MythBrowser "
3068 "installed to display the homepage."));
3072 if (browser.toLower() ==
"internal")
3078 QString cmd = browser;
3079 cmd.replace(
"%ZOOM%", zoom);
3080 cmd.replace(
"%URL%", url);
3081 cmd.replace(
'\'',
"%27");
3082 cmd.replace(
"&",
"\\&");
3083 cmd.replace(
";",
"\\;");
3118 const int WATCHED_WATERMARK = 10000;
3121 QElapsedTimer playing_time;
3127 if (node && !(node->
getInt() >= 0))
3134 bool video_started =
false;
3136 while (i < list_count &&
3137 (!video_started || playing_time.hasExpired(WATCHED_WATERMARK)))
3146 playing_time.start();
3147 video_started =
true;
3162 [[maybe_unused]]
const QString &fqDirName)
override
3168 const QString &fqFileName,
3169 [[maybe_unused]]
const QString &extension,
3170 [[maybe_unused]]
const QString &host)
override
3172 m_fileList.push_back(fqFileName);
3199 if (!metadata)
return;
3202 GetSetting(
"mythvideo.TrailersDir"));
3207 const int trailersToPlay =
3211 while (!
trailers.isEmpty() && i < trailersToPlay)
3216 LOG(VB_GENERAL, LOG_DEBUG,
3217 QString(
"Random trailer to play will be: %1").arg(trailer));
3232 if (!metadata)
return;
3278 if (filterdialog->Create())
3297 int nodeInt = node->
getInt();
3318 if (list.count() > 1)
3320 auto *metadata = list[0]->GetData().value<
VideoMetadata *>();
3326 Qt::QueuedConnection);
3328 if (resultsdialog->Create())
3362 metadata->SetProcessed(
true);
3363 metadata->UpdateDatabase();
3365 LOG(VB_GENERAL, LOG_INFO,
3366 QString(
"No results found for %1 %2 %3").arg(lookup->
GetTitle())
3374 QString
id = dce->
GetId();
3376 if (
id ==
"scanprompt")
3378 int result = dce->GetResult();
3410 if (item !=
nullptr)
3431 QMap<int, int> idPosition;
3435 for (
auto * child : std::as_const(*children))
3437 int nodeInt = child->getInt();
3444 int position = child->getPosition();
3445 int id = listmeta->
GetID();
3446 idPosition.insert(
id, position);
3480 using MGTreeChildList = QList<MythGenericTree *>;
3483 LOG(VB_GENERAL, LOG_DEBUG,
3484 QString(
"Fetching details in %1").arg(node->
GetText()));
3486 for (
auto * child : std::as_const(*lchildren))
3525 if(!lookup->GetInetref().isEmpty() && lookup->GetInetref() !=
"00000000")
3528 QString(
"Selected Item: Type: %1%2 : Subtype: %3%4%5 : InetRef: %6")
3534 lookup->GetInetref()));
3543 QString(
"Selected Item has no InetRef Number!"));
3556 curshowlevel += amount;
3576 "mythvideoeditmetadata", metadata,
3581 if (md_editor->Create())
3592 QString message = tr(
"Are you sure you want to permanently delete:\n%1")
3597 if (confirmdialog->Create())
3629 QString message = tr(
"Failed to delete file");
3634 if (confirmdialog->Create())
3657 QStringList cover_dirs;
3663 QString title = metadata->
GetTitle();
3665 QString host = metadata->
GetHost();
3672 cover_dirs, cover_file, title,
3673 season, host,
"Coverart", episode))
3680 QStringList fanart_dirs;
3683 QString fanart_file;
3688 fanart_dirs, fanart_file, title,
3689 season, host,
"Fanart", episode))
3696 QStringList banner_dirs;
3699 QString banner_file;
3704 banner_dirs, banner_file, title,
3705 season, host,
"Banners", episode))
3712 QStringList screenshot_dirs;
3715 QString screenshot_file;
3720 screenshot_dirs, screenshot_file, title,
3721 season, host,
"Screenshots", episode,
3741 metadata->SetTitle(lookup->
GetTitle());
3744 if (metadata->GetTagline().isEmpty())
3746 if (metadata->GetYear() == 1895 || metadata->GetYear() == 0)
3747 metadata->SetYear(lookup->
GetYear());
3748 if (metadata->GetReleaseDate() == QDate())
3751 metadata->GetDirector().isEmpty())
3754 if (director.count() > 0)
3755 metadata->SetDirector(director.takeFirst().name);
3757 if (metadata->GetStudio().isEmpty())
3760 if (studios.count() > 0)
3761 metadata->SetStudio(studios.takeFirst());
3764 metadata->GetPlot().isEmpty())
3766 if (metadata->GetUserRating() == 0)
3770 if (metadata->GetLength() == 0min)
3772 if (metadata->GetSeason() == 0)
3773 metadata->SetSeason(lookup->
GetSeason());
3774 if (metadata->GetEpisode() == 0)
3776 if (metadata->GetHomepage().isEmpty())
3787 for (
const auto & name : std::as_const(gueststars))
3788 actors.append(name);
3793 for (
const auto & person : std::as_const(actors))
3794 cl.append(person.name);
3796 for (
const auto & name : std::as_const(cl))
3798 QString cn = name.trimmed();
3801 cast.emplace_back(-1, cn);
3805 metadata->SetCast(cast);
3811 for (
const auto & name : std::as_const(genres))
3813 QString genre_name = name.trimmed();
3814 if (!genre_name.isEmpty())
3816 video_genres.emplace_back(-1, genre_name);
3820 metadata->SetGenres(video_genres);
3826 for (
const auto & name : std::as_const(countries))
3828 QString country_name = name.trimmed();
3829 if (!country_name.isEmpty())
3831 video_countries.emplace_back(-1, country_name);
3835 metadata->SetCountries(video_countries);
3836 metadata->SetProcessed(
true);
3838 metadata->UpdateDatabase();
3841 if (item !=
nullptr)
3857 QString message = tr(
"There are no videos in the database, would you like "
3858 "to scan your video directories now?");
3860 dialog->SetReturnEvent(
this,
"scanprompt");
3861 if (dialog->Create())
3867#include "videodlg.moc"
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
static const Type kEventType
void getExtensionIgnoreList(ext_ignore_list &ext_ignore) const
std::vector< std::pair< QString, bool > > ext_ignore_list
static FileAssociations & getFileAssociation()
static const Type kEventType
Dialog asking for user confirmation.
void SaveSetting(const QString &key, int newValue)
void TVPlaybackAborted(void)
QString GetSetting(const QString &key, const QString &defaultval="")
void TVPlaybackStopped(void)
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
int GetNumSetting(const QString &key, int defaultval=0)
static void ClearBackendServerPortCache()
bool GetBoolSetting(const QString &key, bool defaultval=false)
Basic menu dialog, message and a list of options.
void Closed(QString, int)
bool Create(void) override
MythGenericTree * getVisibleChildAt(uint reference) const
QVariant GetData(void) const
QString GetText(const QString &name="") const
MythGenericTree * getParent(void) const
QStringList getRouteByString(void)
MythGenericTree * getChildAt(uint reference) const
void deleteNode(MythGenericTree *child)
int childCount(void) const
MythGenericTree * getSelectedChild(bool onlyVisible=false) const
uint visibleChildCount() const
void becomeSelectedChild(void)
MythGenericTree * getChildByName(const QString &a_name) const
QList< MythGenericTree * > * getAllChildren() const
MythScreenStack * GetMainStack()
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MythScreenStack * GetStack(const QString &Stackname)
bool HandleMedia(const QString &Handler, const QString &Mrl, const QString &Plot="", const QString &Title="", const QString &Subtitle="", const QString &Director="", int Season=0, int Episode=0, const QString &Inetref="", std::chrono::minutes LenMins=2h, const QString &Year="1895", const QString &Id="", bool UseBookmarks=false)
void AllowInput(bool Allow)
void UnRegister(void *from, int id, bool closeimemdiately=false)
Unregister the client.
int Register(void *from)
An application can register in which case it will be assigned a reusable screen, which can be modifie...
bool Queue(const MythNotification ¬ification)
Queue a notification Queue() is thread-safe and can be called from anywhere.
void SetId(int Id)
Contains the application registration id.
void SetParent(void *Parent)
Contains the parent address. Required if id is set Id provided must match the parent address as provi...
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Screen in which all other widgets are contained and rendered.
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
MythScreenStack * GetScreenStack() const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
bool Create(void) override
virtual void SetTextFromMap(const InfoMap &infoMap)
Image widget, displays a single image or multiple images in sequence.
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
void Reset(void) override
Reset the image back to the default defined in the theme.
void Set(int start, int total, int used)
Provide a dialog to quickly find an entry in a list.
virtual void SetVisible(bool visible)
void SigResultReady(bool passwordValid, ParentalLevel::Level newLevel)
Utility class to query playback state from database.
void Initialize()
Initializes playback state from database.
void Update(const QString &filename)
Updates playback state of video with specified filename.
bool AlwaysShowWatchedProgress() const
Returns cached setting "AlwaysShowWatchedProgress".
bool HasBookmark(const QString &filename) const
Query bookmark of video with the specified filename.
uint GetWatchedPercent(const QString &filename) const
Query watched percent of video with the specified filename.
static void ClearGroupToUseCache(void)
static QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
static bool rating_to_pl_greater(const parental_level_map::value_type &lhs, const parental_level_map::value_type &rhs)
VideoDialogPrivate(const VideoListPtr &videoList, VideoDialog::DialogType type, VideoDialog::BrowseType browse)
PlaybackState m_playbackState
parental_level_map m_ratingToPl
static VideoDialog::VideoListDeathDelayPtr m_savedPtr
void AutomaticParentalAdjustment(VideoMetadata *metadata)
std::list< std::pair< QString, ParentalLevel::Level > > parental_level_map
static void DelayVideoListDestruction(const VideoListPtr &videoList)
VideoDialog::DialogType m_type
QString m_lastTreeNodePath
ParentalLevelNotifyContainer m_parentalLevel
VideoDialog::BrowseType m_browse
QMap< QString, int > m_notifications
MythGenericTree * m_currentNode
MythGenericTree * m_rootNode
void SwitchManager()
Switch to Video Manager View.
void OnParentalChange(int amount)
void VideoMenu()
Pop up a MythUI "Playback Menu" for MythVideo.
void playFolder()
Play all the items in the selected folder.
void ShowMetadataSettings()
Pop up a MythUI Menu for MythVideo Metadata Settings.
void popupClosed(const QString &which, int result)
void SwitchVideoUserRatingGroup()
Switch to User Rating browse mode.
void ShowPlayerSettings()
Pop up a MythUI Menu for MythVideo Player Settings.
MythUIStateType * m_trailerState
static VideoMetadata * GetMetadata(MythUIButtonListItem *item)
Retrieve the Database Metadata for a given MythUIButtonListItem.
void OnVideoImageSetDone(VideoMetadata *metadata)
bool goBack()
Move one level up in the tree.
MythUIImage * m_screenshot
void setParentalLevel(ParentalLevel::Level level)
Set the parental level for the library.
void createBusyDialog(const QString &title)
Create a busy dialog, used during metadata search, etc.
void SwitchVideoYearGroup()
Switch to Year browse mode.
void SwitchVideoTVMovieGroup()
Switch to Television/Movie browse mode.
void handleDynamicDirSelect(MythGenericTree *node)
Request the latest metadata for a folder.
void fetchVideos()
Build the buttonlist/tree.
void StartVideoImageSet(VideoMetadata *metadata)
void SetCurrentNode(MythGenericTree *node)
Switch to a given MythGenericTree node.
MythMenu * CreateViewMenu()
Create a MythMenu for MythVideo Views.
void SwitchLayout(DialogType type, BrowseType browse)
Handle a layout or browse mode switch.
void createFetchDialog(VideoMetadata *metadata)
Create a fetch notification, used during metadata search.
QString GetFirstImage(MythGenericTree *node, const QString &type, const QString &gpnode=QString(), int levels=0)
Find the first image of "type" within a folder structure.
void shiftParental(int amount)
Shift the parental level for the library by an integer amount.
static QString GetCoverImage(MythGenericTree *node)
A "hunt" for cover art to apply for a folder item.
void createOkDialog(const QString &title)
Create a MythUI "OK" Dialog.
bool DoItemDetailShow()
Display the Item Detail Popup.
MythUIButtonList * m_videoButtonList
MythUIStateType * m_studioState
MythUIImage * m_coverImage
void SwitchVideoGenreGroup()
Switch to Genre browse mode.
void refreshData()
Reloads the tree without invalidating the data.
void ToggleFlatView()
Toggle Flat View.
virtual void loadData()
load the data used to build the ButtonTree/List for MythVideo.
static QString GetBanner(MythGenericTree *node)
Find the Banner for a given node.
void SwitchVideoCategoryGroup()
Switch to Category browse mode.
MythDialogBox * m_menuPopup
void handleDirSelect(MythGenericTree *node)
Descend into a selected folder.
void DisplayMenu()
Pop up a MythUI Menu for MythVideo Global Functions.
void searchComplete(const QString &string)
After using incremental search, move to the selected item.
void ShowCastDialog()
Display the Cast if the selected item.
void customEvent(QEvent *levent) override
void SwitchVideoStudioGroup()
Switch to Studio browse mode.
MythUIText * m_positionText
MythMenu * CreateMetadataBrowseMenu()
Create a MythMenu for MythVideo Metadata Browse modes.
void SwitchTree()
Switch to Tree (List) View.
static QString GetScreenshot(MythGenericTree *node)
Find the Screenshot for a given node.
MythMenu * CreateSettingsMenu()
Create a MythMenu for MythVideo Settings.
static VideoListDeathDelayPtr & GetSavedVideoList()
QPointer< class VideoListDeathDelay > VideoListDeathDelayPtr
static void UpdateWatchedState(MythUIButtonListItem *item)
Update the watched state for a given ButtonListItem from the database.
void reloadData()
Reloads the tree after having invalidated the data.
void SwitchVideoFolderGroup()
Switch to Folder (filesystem) browse mode.
virtual MythUIButtonListItem * GetItemCurrent()
MythMenu * CreateManageMenu()
Create a MythMenu for metadata management.
static QString GetFanart(MythGenericTree *node)
Find the Fanart for a given node.
void UpdateItem(MythUIButtonListItem *item)
Update the visible representation of a MythUIButtonListItem.
void UpdateVisible(MythUIButtonListItem *item)
Update playback state for for a given visible ButtonListItem.
void playTrailer()
Play the trailer associated with the selected item.
MythUIStateType * m_parentalLevelState
void SwitchVideoCastGroup()
Switch to Cast browse mode.
void playVideoWithTrailers()
Play the selected item w/ a User selectable # of trailers.
void ViewPlot()
Display a MythUI Popup with the selected item's plot.
void OnVideoSearchDone(MetadataLookup *lookup)
void UpdatePosition()
Called after the screen is created by MythScreenStack.
class VideoDialogPrivate * m_d
void OnVideoSearchListSelection(RefCountHandler< MetadataLookup > lookup)
void SwitchGallery()
Switch to Gallery View.
void UpdateText(MythUIButtonListItem *item)
Update the visible text values for a given ButtonListItem.
void ChangeFilter()
Change the filtering of the library.
void handleSelect(MythUIButtonListItem *item)
Handle SELECT action for a given MythUIButtonListItem.
void playbackStateChanged(const QString &filename)
static QString RemoteImageCheck(const QString &host, const QString &filename)
Search for a given (image) filename in the Video SG.
void SwitchBrowse()
Switch to Browser View.
void playVideoAlt()
Play the selected item in an alternate player.
void dismissFetchDialog(VideoMetadata *metadata, bool ok)
simple_ref_ptr< class VideoList > VideoListPtr
void playVideo()
Play the selected item.
void searchStart()
Create an incremental search dialog for the current tree level.
MythMenu * CreatePlayMenu()
Create a "Play Menu" for MythVideo.
void SwitchVideoInsertDateGroup()
Switch to Insert Date browse mode.
MetadataFactory * m_metadataFactory
bool keyPressEvent(QKeyEvent *levent) override
Handle keypresses and keybindings.
void ToggleBrowseMode()
Toggle the browseable status for the selected item.
MythMenu * CreateInfoMenu()
Create a MythMenu for Info pertaining to the selected item.
VideoDialog(MythScreenStack *lparent, const QString &lname, const VideoListPtr &video_list, DialogType type, BrowseType browse)
void OnRemoveVideo(bool dodelete)
MythScreenStack * m_mainStack
MythUIStateType * m_watchedState
MythUIStateType * m_bookmarkState
void Load() override
Called after the screen is created by MythScreenStack.
MythUIBusyDialog * m_busyPopup
virtual MythUIButtonListItem * GetItemByMetadata(VideoMetadata *metadata)
void scanFinished(bool dbChanged)
MythScreenStack * m_popupStack
MythUIButtonTree * m_videoButtonTree
void ShowExtensionSettings()
Pop up a MythUI Menu for MythVideo filte Type Settings.
void SwitchVideoDirectorGroup()
Switch to Director browse mode.
MythUIText * m_novideoText
VideoListDeathDelayPrivate(const VideoDialog::VideoListPtr &toSave)
VideoDialog::VideoListPtr GetSaved()
VideoDialog::VideoListPtr m_savedList
~VideoListDeathDelay() override
VideoDialog::VideoListPtr GetSaved()
static constexpr std::chrono::milliseconds kDelayTimeMS
VideoListDeathDelay(const VideoDialog::VideoListPtr &toSave)
class VideoListDeathDelayPrivate * m_d
bool Delete(int video_id)
bool refreshNode(MythGenericTree *node)
const VideoMetadataListManager & getListCache() const
void setCurrentVideoFilter(const VideoFilterSettings &filter)
void refreshList(bool filebrowser, const ParentalLevel &parental_level, bool flat_list, int group_type)
MythGenericTree * GetTreeRoot()
MythGenericTree * buildVideoList(bool filebrowser, bool flatlist, int group_type, const ParentalLevel &parental_level, bool include_updirs)
static VideoPlayerCommand AltPlayerFor(const VideoMetadata *item)
static VideoPlayerCommand PlayerFor(const VideoMetadata *item)
void doScan(const QStringList &dirs)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
void LoadImage(const QString &filename, MythUIImage *image)
ParentalLevelChangeChecker m_levelCheck
ParentalLevelNotifyContainer(QObject *lparent=nullptr)
const ParentalLevel & GetLevel() const
void SetLevel(const ParentalLevel &level)
void OnResultReady(bool passwordValid, ParentalLevel::Level newLevel)
void handleImage(const QString &name, const QString &filename) override
ScreenCopyDest(MythScreenType *screen)
void handleState(const QString &name, const QString &value) override
void handleText(const QString &name, const QString &value) override
bool ScanVideoDirectory(const QString &start_path, DirectoryHandler *handler, const FileAssociations::ext_ignore_list &ext_disposition, bool list_unknown_extensions)
const QString VIDEO_PLOT_DEFAULT
const QString VIDEO_BANNER_DEFAULT
const QString VIDEO_SCREENSHOT_DEFAULT
const QString VIDEO_FANART_DEFAULT
const QString VIDEO_RATING_DEFAULT
const QString VIDEO_DIRECTOR_UNKNOWN
static const iso6937table * d
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythNotificationCenter * GetNotificationCenter(void)
MythMainWindow * GetMythMainWindow(void)
Convenience inline random number generator functions.
@ kMSDontDisableDrawing
avoid disabling UI drawing
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
static MythThemedMenu * menu
QHash< QString, QString > InfoMap
uint32_t MythRandom()
generate 32 random bits
bool IsValidDialogType(int num)
QStringList GetTrailersInDirectory(const QString &startDir)
VideoMetadata * GetMetadataPtrFromNode(MythGenericTree *node)
void CopyMetadataToUI(const VideoMetadata *metadata, CopyMetadataDestination &dest)
void PlayVideo(const QString &filename, const VideoMetadataListManager &video_list, bool useAltPlayer=false)
void CopyPlaybackStateToUI(const PlaybackState &playbackState, const VideoMetadata *metadata, MythUIButtonListItem *item=nullptr, MythScreenType *screen=nullptr)
MythGenericTree * GetNodePtrFromButton(MythUIButtonListItem *item)
bool GetLocalVideoImage(const QString &video_uid, const QString &filename, const QStringList &in_dirs, QString &image, QString title, int season, const QString &host, const QString &sgroup, int episode=0, bool isScreenshot=false)
std::unique_ptr< FanartLoader > fanartLoader
def rating(profile, smoonURL, gate)
bool RemoteGetFileList(const QString &host, const QString &path, QStringList *list, QString sgroup, bool fileNamesOnly)
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
SimpleCollect(QStringList &fileList)
void handleFile(const QString &fileName, const QString &fqFileName, const QString &extension, const QString &host) override
DirectoryHandler * newDir(const QString &dirName, const QString &fqDirName) override
static const QString sLocation
bool IsDefaultScreenshot(const QString &screenshot)
QString ParentalLevelToState(const ParentalLevel &level)
bool IsDefaultFanart(const QString &fanart)
QString WatchedToState(bool watched)
QStringList GetVideoDirsByHost(const QString &host)
QString TrailerToState(const QString &trailerFile)
void CheckedSet(MythUIStateType *uiItem, const QString &value)
bool IsDefaultCoverFile(const QString &coverfile)
bool IsDefaultBanner(const QString &banner)
QStringList GetVideoDirs()