59#define LOC_MML QString("Manual Metadata Lookup: ")
68 if (num == i)
return true;
83 connect(&m_levelCheck,
85 this, &ParentalLevelNotifyContainer::OnResultReady);
92 m_levelCheck.Check(m_level.GetLevel(), level.
GetLevel());
109 if (lastLevel != m_level)
111 emit SigLevelChanged();
137 const QStringList &in_dirs, QString &image,
138 QString title,
int season,
139 const QString &host,
const QString& sgroup,
140 int episode = 0,
bool isScreenshot =
false)
142 QStringList search_dirs(in_dirs);
144 search_dirs += qfi.absolutePath();
145 if (title.contains(
"/"))
146 title.replace(
"/",
"-");
148 const QString base_name = qfi.completeBaseName();
149 QList<QByteArray> image_types = QImageReader::supportedImageFormats();
151 using image_type_list = std::set<QString>;
152 image_type_list image_exts;
156 if (sgroup ==
"Coverart")
158 if (sgroup ==
"Fanart")
160 if (sgroup ==
"Screenshots")
161 suffix =
"screenshot";
162 if (sgroup ==
"Banners")
165 for (
const auto & itype : std::as_const(image_types))
166 image_exts.insert(QString(itype).toLower());
170 QStringList hostFiles;
173 const QString hntm(
"%2.%3");
175 for (
const auto & ext : image_exts)
178 if (episode > 0 || season > 0)
182 sfn += hntm.arg(QString(
"%1 Season %2x%3_%4")
183 .arg(title, QString::number(season),
184 QString::number(episode), suffix),
189 sfn += hntm.arg(QString(
"%1 Season %2_%3")
190 .arg(title, QString::number(season),
198 sfn += hntm.arg(base_name + QString(
"_%1").arg(suffix),
200 sfn += hntm.arg(video_uid + QString(
"_%1").arg(suffix),
204 for (
const auto & str : std::as_const(sfn))
206 if (hostFiles.contains(str))
215 const QString fntm(
"%1/%2.%3");
217 for (
const auto & dir : std::as_const(search_dirs))
219 if (dir.isEmpty())
continue;
221 for (
const auto & ext : image_exts)
224 if (season > 0 || episode > 0)
229 QString(
"%1 Season %2x%3_%4")
230 .arg(title, QString::number(season),
231 QString::number(episode),
238 QString(
"%1 Season %2_%3")
239 .arg(title, QString::number(season),
247 base_name + QString(
"_%1").arg(suffix),
250 video_uid + QString(
"_%1").arg(suffix),
254 for (
const auto &
file : std::as_const(sfn))
271 const int WATCHED_WATERMARK = 10000;
279 QElapsedTimer playing_time;
283 playing_time.start();
290 if (!playing_time.hasExpired(WATCHED_WATERMARK))
293 item = (item->GetChildID() > 0)
294 ? video_list.
byID(item->GetChildID())
307 m_fanartTimer.stop();
308 m_fanartTimer.disconnect(
this);
315 connect(&m_fanartTimer, &
QTimer::timeout,
this, &FanartLoader::fanartLoad);
319 bool wasActive = m_fanartTimer.isActive();
323 m_fanartTimer.stop();
330 QMutexLocker locker(&m_fanartLock);
332 if (
filename != m_fanart->GetFilename())
335 m_fanartTimer.stop();
341 m_fanartTimer.setSingleShot(
true);
342 m_fanartTimer.start(300ms);
359 QMutexLocker locker(&m_fanartLock);
368 bool m_bConnected {
false};
375 virtual void handleText(
const QString &name,
const QString &value) = 0;
376 virtual void handleState(
const QString &name,
const QString &value) = 0;
386 void handleText(
const QString &name,
const QString &value)
override
391 void handleState(
const QString &name,
const QString &value)
override
393 handleText(name, value);
402 if (name !=
"fanart")
433 void handleText(
const QString &name,
const QString &value)
override
435 m_item->SetText(value, name);
438 void handleState(
const QString &name,
const QString &value)
override
440 m_item->DisplayState(value, name);
444 [[maybe_unused]]
const QString &
filename)
override
455 using valuelist = std::map<QString, QString>;
475 tmp[
"coverart"] = coverfile;
477 tmp[
"coverfile"] = coverfile;
479 QString screenshotfile;
492 tmp[
"screenshot"] = screenshotfile;
494 tmp[
"screenshotfile"] = screenshotfile;
509 tmp[
"banner"] = bannerfile;
511 tmp[
"bannerfile"] = bannerfile;
526 tmp[
"fanart"] = fanartfile;
528 tmp[
"fanartfile"] = fanartfile;
531 tmp[
"studiostate"] = metadata->
GetStudio();
532 tmp[
"userratingstate"] =
542 m_vallist(values), m_dest(
d) {}
544 void handleImage(
const QString &name)
546 m_dest.handleImage(name, m_vallist[name]);
549 void handleState(
const QString &name)
551 m_dest.handleState(name, m_vallist[name]);
554 valuelist &m_vallist;
560 h.handleImage(
"coverart");
561 h.handleImage(
"screenshot");
562 h.handleImage(
"banner");
563 h.handleImage(
"fanart");
565 h.handleState(
"trailerstate");
566 h.handleState(
"userratingstate");
567 h.handleState(
"watchedstate");
568 h.handleState(
"videolevel");
576 if (!metadata || (!item && !screen))
586 item->DisplayState(bookmarkState,
"bookmarkstate");
587 item->SetProgress1(0, showProgress ? 100 : 0, watchedPercent);
591 CheckedSet(screen,
"bookmarkstate", bookmarkState);
592 auto *watchedProgress =
dynamic_cast<MythUIProgressBar *
>(screen->GetChild(
"watchedprogressbar"));
595 watchedProgress->
Set(0, showProgress ? 100 : 0, watchedPercent);
644 ScreenCopyDest
dest(
this);
667 bool handled =
false;
668 for (
const auto &
action : std::as_const(actions))
716 const parental_level_map::value_type &rhs)
718 return lhs.first.length() >= rhs.first.length();
733 QString ratingstring =
735 .arg(sl.GetLevel()));
736 QStringList ratings =
737 ratingstring.split(
':', Qt::SkipEmptyParts);
738 auto to_pl = [sl](
const auto &
rating)
739 {
return parental_level_map::value_type(
rating, sl.GetLevel()); };
740 std::transform(ratings.cbegin(), ratings.cend(),
782 if (
rating.indexOf(
p->first) != -1)
857 QObject(QCoreApplication::instance()),
895 GetNumSetting(
"VideoDefaultParentalLevel",
910 if (metadata && metadata->GetFilename() ==
filename)
978 QString windowName =
"videogallery";
979 bool flatlistDefault =
false;
984 windowName =
"browser";
985 flatlistDefault =
true;
988 windowName =
"gallery";
996 windowName =
"manager";
997 flatlistDefault =
true;
1070 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen '" + windowName +
"'");
1161 QString message = tr(
"The video scan found no files, have you "
1162 "configured a video storage group?");
1221 QStringList lastTreeNodePath =
gCoreContext->
GetSetting(
"mythvideo.VideoTreeLastActive",
"").split(
"\n");
1225 if (!lastTreeNodePath.isEmpty())
1228 for (
int i = 0; i < lastTreeNodePath.size(); i++)
1232 if (node !=
nullptr)
1237 if (node->
GetText().compare(lastTreeNodePath.at(i)) == 0)
1243 i < lastTreeNodePath.size()-1)
1249 if (lastTreeNodePath.at(i) == lastTreeNodePath.last())
1250 selectedNode = node;
1260 using MGTreeChildList = QList<MythGenericTree *>;
1263 for (
auto * child : std::as_const(*lchildren))
1265 if (child !=
nullptr)
1271 item->SetData(QVariant::fromValue(child));
1275 if (child == selectedNode)
1300 metadata->
toMap(metadataMap);
1304 MythUIButtonListItemCopyDest
dest(item);
1310 if (parent && metadata && ((QString::compare(parent->
GetText(),
1311 metadata->
GetTitle(), Qt::CaseInsensitive) == 0) ||
1312 parent->
GetText().startsWith(tr(
"Season"), Qt::CaseInsensitive)))
1314 else if (metadata && !metadata->
GetSubtitle().isEmpty())
1324 if (!screenshot.isEmpty() && parent && metadata &&
1325 ((QString::compare(parent->
GetText(),
1326 metadata->
GetTitle(), Qt::CaseInsensitive) == 0) ||
1327 parent->
GetText().startsWith(tr(
"Season"), Qt::CaseInsensitive)))
1333 if (coverimage.isEmpty())
1338 int nodeInt = node->
getInt();
1340 if (coverimage.isEmpty() && nodeInt ==
kSubFolder)
1343 item->
SetImage(coverimage,
"coverart");
1345 if (screenshot.isEmpty() && nodeInt ==
kSubFolder)
1348 item->
SetImage(screenshot,
"screenshot");
1350 if (banner.isEmpty() && nodeInt ==
kSubFolder)
1355 if (fanart.isEmpty() && nodeInt ==
kSubFolder)
1430 QString result =
"";
1432 LOG(VB_GENERAL, LOG_DEBUG, QString(
"RemoteImageCheck(%1)").arg(
filename));
1437 if (!dirs.isEmpty())
1439 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))
1575 QString path = sgurl.path();
1577 QString subdir = folder_path.right(folder_path.length() - (
prefix.length() + 1));
1579 path = path +
"/" + subdir;
1581 QStringList tmpList;
1586 for (
const auto & pattern : std::as_const(imageTypes))
1588 auto rePattern = QRegularExpression::wildcardToRegularExpression(pattern);
1589 QRegularExpression rx {
1590 rePattern.mid(2,rePattern.size()-4),
1591 QRegularExpression::CaseInsensitiveOption };
1592 QStringList matches = tmpList.filter(rx);
1593 if (!matches.isEmpty())
1596 fList.append(subdir +
"/" + matches.at(0).split(
"::").at(1));
1609 QDir vidDir(folder_path);
1610 vidDir.setNameFilters(imageTypes);
1611 fList = vidDir.entryList();
1615 if (icon_file.isEmpty())
1620 for (
int i = 0; i < list_count; i++)
1628 if (!metadata->
GetHost().isEmpty() &&
1633 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1636 icon_file = test_file;
1643 if (!test_file.isEmpty() &&
1646 icon_file = test_file;
1656 if (!fList.isEmpty())
1660 icon_file = QString(
"%1/%2").arg(folder_path, fList.at(0));
1669 if (!icon_file.isEmpty())
1671 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Found Image : %1 :")
1676 LOG(VB_GENERAL, LOG_DEBUG,
1677 QString(
"Could not find folder cover Image : %1 ")
1719 const QString& gpnode,
int levels)
1721 if (!node ||
type.isEmpty())
1729 QList<MythGenericTree *> subDirs;
1730 static constexpr int maxRecurse { 1 };
1732 for (
int i = 0; i < list_count; i++)
1744 const QString& host = metadata->
GetHost();
1745 const QString& title = metadata->
GetTitle();
1747 if (
type ==
"Coverart" && !host.isEmpty() &&
1753 else if (
type ==
"Coverart")
1758 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1760 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1762 icon_file = test_file;
1766 if (
type ==
"Fanart" && !host.isEmpty() &&
1772 else if (
type ==
"Fanart")
1777 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1779 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1781 icon_file = test_file;
1785 if (
type ==
"Banners" && !host.isEmpty() &&
1791 else if (
type ==
"Banners")
1796 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1798 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1800 icon_file = test_file;
1804 if (
type ==
"Screenshots" && !host.isEmpty() &&
1810 else if (
type ==
"Screenshots")
1815 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1817 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1819 icon_file = test_file;
1825 if (icon_file.isEmpty() && !subDirs.isEmpty())
1828 int subDirCount = subDirs.count();
1829 for (
int i = 0; i < subDirCount; i ++)
1831 if (levels < maxRecurse)
1835 if (!test_file.isEmpty())
1837 icon_file = test_file;
1853 const int nodeInt = node->
getInt();
1893 const int nodeInt = node->
getInt();
1904 !metadata->
GetBanner().startsWith(
"/") &&
1928 const int nodeInt = node->
getInt();
1939 !metadata->
GetFanart().startsWith(
"/") &&
1966 QStringList actions;
1969 for (
int i = 0; i < actions.size() && !handled; i++)
1971 const QString&
action = actions[i];
1981 else if (
action ==
"INCPARENT")
1985 else if (
action ==
"DECPARENT")
1994 else if (
action ==
"FILTER")
1998 else if (
action ==
"MENU")
2003 else if (
action ==
"PLAYALT")
2009 else if (
action ==
"DOWNLOADDATA")
2014 else if (
action ==
"INCSEARCH")
2018 else if (
action ==
"ITEMDETAIL")
2022 else if (
action ==
"DELETE")
2031 else if (
action ==
"ESCAPE")
2051 for (
int i = 0; i < actions.size() && !handled; i++)
2053 const QString&
action = actions[i];
2054 if (
action ==
"PLAYBACK")
2077 const QString& message = title;
2080 "mythvideobusydialog");
2098 QString msg = tr(
"Fetching details for %1")
2103 desc = tr(
"Season %1, Episode %2")
2123 msg = tr(
"Retrieved details for %1").arg(metadata->
GetTitle());
2127 msg = tr(
"Failed to retrieve details for %1").arg(metadata->
GetTitle());
2132 desc = tr(
"Season %1, Episode %2")
2158 const QString& message = title;
2162 if (okPopup->Create())
2172 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Jumping to: %1").arg(
string));
2175 QList<MythGenericTree*> *children =
nullptr;
2176 QMap<int, QString> idTitle;
2183 for (
auto * child : std::as_const(*children))
2185 QString title = child->GetText();
2186 int id = child->getPosition();
2187 idTitle.insert(
id, title);
2214 QStringList childList;
2215 QList<MythGenericTree*> *children =
nullptr;
2221 for (
auto * child : std::as_const(*children))
2223 childList << child->GetText();
2229 tr(
"Video Search"), childList,
false,
"");
2231 if (searchDialog->Create())
2240 delete searchDialog;
2250 bool handled =
false;
2337 metadata->
toMap(metadataMap);
2347 ScreenCopyDest
dest(
this);
2402 if (metadata->
GetWatched() != metadataNew->GetWatched())
2404 metadata->
SetWatched(metadataNew->GetWatched());
2422 label = tr(
"Video Options\n%1\n%2").arg(metadata->
GetTitle(),
2427 label = tr(
"Video Options\n%1").arg(metadata->
GetTitle());
2432 label = tr(
"Video Options");
2488 label = tr(
"Playback Options\n%1").arg(metadata->
GetTitle());
2506 QString trailerFile = metadata->
GetTrailer();
2508 (!metadata->
GetHost().isEmpty() && !trailerFile.isEmpty()))
2522 QString label = tr(
"Video Display Menu");
2555 if (which ==
"display")
2566 QString label = tr(
"Change View");
2602 QString label = tr(
"Video Settings");
2661 QString label = tr(
"Browse By");
2704 QString label = tr(
"Video Info");
2716 if (!metadata->
GetCast().empty())
2731 QString label = tr(
"Manage Video Details");
2822 int nodeInt = node->
getInt();
2990 if (mythvideo->Create())
2996 screenStack->
PopScreen(
this,
false,
false);
3001 ShowOkPopup(tr(
"An error occurred when switching views."));
3015 if (plotdialog->Create())
3053 if (castdialog->Create())
3072 if (browser.isEmpty())
3074 ShowOkPopup(tr(
"No browser command set! MythVideo needs MythBrowser "
3075 "installed to display the homepage."));
3079 if (browser.toLower() ==
"internal")
3085 QString cmd = browser;
3086 cmd.replace(
"%ZOOM%", zoom);
3087 cmd.replace(
"%URL%", url);
3088 cmd.replace(
'\'',
"%27");
3089 cmd.replace(
"&",
"\\&");
3090 cmd.replace(
";",
"\\;");
3125 const int WATCHED_WATERMARK = 10000;
3130 if (!node || (node->
getInt() >= 0))
3133 if (list_count <= 0)
3136 for (
int i = 0; i < list_count; i++)
3144 QElapsedTimer playing_time;
3145 playing_time.start();
3147 if (!playing_time.hasExpired(WATCHED_WATERMARK))
3159 [[maybe_unused]]
const QString &fqDirName)
override
3165 const QString &fqFileName,
3166 [[maybe_unused]]
const QString &extension,
3167 [[maybe_unused]]
const QString &host)
override
3169 m_fileList.push_back(fqFileName);
3196 if (!metadata)
return;
3199 GetSetting(
"mythvideo.TrailersDir"));
3204 const int trailersToPlay =
3208 while (!
trailers.isEmpty() && i < trailersToPlay)
3213 LOG(VB_GENERAL, LOG_DEBUG,
3214 QString(
"Random trailer to play will be: %1").arg(trailer));
3229 if (!metadata)
return;
3275 if (filterdialog->Create())
3294 int nodeInt = node->
getInt();
3315 if (list.count() > 1)
3317 auto *metadata = list[0]->GetData().value<
VideoMetadata *>();
3323 Qt::QueuedConnection);
3325 if (resultsdialog->Create())
3359 metadata->SetProcessed(
true);
3360 metadata->UpdateDatabase();
3362 LOG(VB_GENERAL, LOG_INFO,
3363 QString(
"No results found for %1 %2 %3").arg(lookup->
GetTitle())
3371 QString
id = dce->
GetId();
3373 if (
id ==
"scanprompt")
3375 int result = dce->GetResult();
3407 if (item !=
nullptr)
3428 QMap<int, int> idPosition;
3432 for (
auto * child : std::as_const(*children))
3434 int nodeInt = child->getInt();
3441 int position = child->getPosition();
3442 int id = listmeta->
GetID();
3443 idPosition.insert(
id, position);
3477 using MGTreeChildList = QList<MythGenericTree *>;
3480 LOG(VB_GENERAL, LOG_DEBUG,
3481 QString(
"Fetching details in %1").arg(node->
GetText()));
3483 for (
auto * child : std::as_const(*lchildren))
3522 if(!lookup->GetInetref().isEmpty() && lookup->GetInetref() !=
"00000000")
3525 QString(
"Selected Item: Type: %1%2 : Subtype: %3%4%5 : InetRef: %6")
3531 lookup->GetInetref()));
3540 QString(
"Selected Item has no InetRef Number!"));
3553 curshowlevel += amount;
3573 "mythvideoeditmetadata", metadata,
3578 if (md_editor->Create())
3589 QString message = tr(
"Are you sure you want to permanently delete:\n%1")
3594 if (confirmdialog->Create())
3626 QString message = tr(
"Failed to delete file");
3631 if (confirmdialog->Create())
3654 QStringList cover_dirs;
3660 QString title = metadata->
GetTitle();
3662 QString host = metadata->
GetHost();
3669 cover_dirs, cover_file, title,
3670 season, host,
"Coverart", episode))
3677 QStringList fanart_dirs;
3680 QString fanart_file;
3685 fanart_dirs, fanart_file, title,
3686 season, host,
"Fanart", episode))
3693 QStringList banner_dirs;
3696 QString banner_file;
3701 banner_dirs, banner_file, title,
3702 season, host,
"Banners", episode))
3709 QStringList screenshot_dirs;
3712 QString screenshot_file;
3717 screenshot_dirs, screenshot_file, title,
3718 season, host,
"Screenshots", episode,
3738 metadata->SetTitle(lookup->
GetTitle());
3741 if (metadata->GetTagline().isEmpty())
3743 if (metadata->GetYear() == 1895 || metadata->GetYear() == 0)
3744 metadata->SetYear(lookup->
GetYear());
3745 if (metadata->GetReleaseDate() == QDate())
3748 metadata->GetDirector().isEmpty())
3751 if (director.count() > 0)
3752 metadata->SetDirector(director.takeFirst().name);
3754 if (metadata->GetStudio().isEmpty())
3757 if (studios.count() > 0)
3758 metadata->SetStudio(studios.takeFirst());
3761 metadata->GetPlot().isEmpty())
3763 if (metadata->GetUserRating() == 0)
3767 if (metadata->GetLength() == 0min)
3769 if (metadata->GetSeason() == 0)
3770 metadata->SetSeason(lookup->
GetSeason());
3771 if (metadata->GetEpisode() == 0)
3773 if (metadata->GetHomepage().isEmpty())
3784 for (
const auto & name : std::as_const(gueststars))
3785 actors.append(name);
3790 for (
const auto & person : std::as_const(actors))
3791 cl.append(person.name);
3793 for (
const auto & name : std::as_const(cl))
3795 QString cn = name.trimmed();
3798 cast.emplace_back(-1, cn);
3802 metadata->SetCast(cast);
3808 for (
const auto & name : std::as_const(genres))
3810 QString genre_name = name.trimmed();
3811 if (!genre_name.isEmpty())
3813 video_genres.emplace_back(-1, genre_name);
3817 metadata->SetGenres(video_genres);
3823 for (
const auto & name : std::as_const(countries))
3825 QString country_name = name.trimmed();
3826 if (!country_name.isEmpty())
3828 video_countries.emplace_back(-1, country_name);
3832 metadata->SetCountries(video_countries);
3833 metadata->SetProcessed(
true);
3835 metadata->UpdateDatabase();
3838 if (item !=
nullptr)
3854 QString message = tr(
"There are no videos in the database, would you like "
3855 "to scan your video directories now?");
3857 dialog->SetReturnEvent(
this,
"scanprompt");
3858 if (dialog->Create())
3864#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 bool remoteGetFileList(const QString &host, const QString &path, QStringList *list, QString sgroup, bool fileNamesOnly=false)
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)
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()