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;
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))
1442 QString path = sgurl.path();
1444 QString fname = QString(
"%1/%2").arg(path,
filename);
1446 QStringList list( QString(
"QUERY_SG_FILEQUERY") );
1453 if (!ok || list.at(0).startsWith(
"SLAVE UNREACHABLE"))
1455 LOG(VB_GENERAL, LOG_WARNING,
1456 QString(
"Backend : %1 currently Unreachable. Skipping "
1457 "this one.") .arg(host));
1461 if ((!list.isEmpty()) && (list.at(0) == fname))
1464 if (!result.isEmpty())
1467 LOG(VB_GENERAL, LOG_DEBUG,
1468 QString(
"RemoteImageCheck(%1) res :%2: :%3:")
1469 .arg(fname).arg(result).arg(dir));
1489 int nodeInt = node->
getInt();
1504 if (folder_path.startsWith(
"myth://"))
1505 folder_path = folder_path.right(folder_path.length()
1506 - folder_path.lastIndexOf(
"//") - 1);
1508 QString
filename = QString(
"%1/folder").arg(folder_path);
1511 LOG(VB_GENERAL, LOG_DEBUG,
1512 QString(
"GetCoverImage host : %1 prefix : %2 file : %3")
1516 QStringList test_files;
1517 test_files.append(
filename +
".png");
1518 test_files.append(
filename +
".jpg");
1519 test_files.append(
filename +
".jpeg");
1520 test_files.append(
filename +
".gif");
1523 for (
auto imagePath : std::as_const(test_files))
1526 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Cover check :%1 : ").arg(imagePath));
1529 bool foundCover =
false;
1530 if (!host.isEmpty())
1533 imagePath.replace(
"//",
"/");
1534 prefix.replace(
"//",
"/");
1535 imagePath = imagePath.right(imagePath.length() - (
prefix.length() + 1));
1538 if (!tmpCover.isEmpty())
1541 imagePath = tmpCover;
1551 icon_file = imagePath;
1557 if (icon_file.isEmpty())
1559 QStringList imageTypes {
"*.png",
"*.jpg",
"*.jpeg",
"*.gif" };
1562 if (!host.isEmpty())
1568 if (!dirs.isEmpty())
1570 for (
const auto & dir : std::as_const(dirs))
1573 QString path = sgurl.path();
1575 QString subdir = folder_path.right(folder_path.length() - (
prefix.length() + 1));
1577 path = path +
"/" + subdir;
1579 QStringList tmpList;
1584 for (
const auto & pattern : std::as_const(imageTypes))
1586 auto rePattern = QRegularExpression::wildcardToRegularExpression(pattern);
1587 QRegularExpression rx {
1588 rePattern.mid(2,rePattern.size()-4),
1589 QRegularExpression::CaseInsensitiveOption };
1590 QStringList matches = tmpList.filter(rx);
1591 if (!matches.isEmpty())
1594 fList.append(subdir +
"/" + matches.at(0).split(
"::").at(1));
1607 QDir vidDir(folder_path);
1608 vidDir.setNameFilters(imageTypes);
1609 fList = vidDir.entryList();
1613 if (icon_file.isEmpty())
1618 for (
int i = 0; i < list_count; i++)
1626 if (!metadata->
GetHost().isEmpty() &&
1631 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1634 icon_file = test_file;
1641 if (!test_file.isEmpty() &&
1644 icon_file = test_file;
1654 if (!fList.isEmpty())
1658 icon_file = QString(
"%1/%2").arg(folder_path, fList.at(0));
1667 if (!icon_file.isEmpty())
1669 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Found Image : %1 :")
1674 LOG(VB_GENERAL, LOG_DEBUG,
1675 QString(
"Could not find folder cover Image : %1 ")
1717 const QString& gpnode,
int levels)
1719 if (!node ||
type.isEmpty())
1727 QList<MythGenericTree *> subDirs;
1728 static constexpr int maxRecurse { 1 };
1730 for (
int i = 0; i < list_count; i++)
1742 const QString& host = metadata->
GetHost();
1743 const QString& title = metadata->
GetTitle();
1745 if (
type ==
"Coverart" && !host.isEmpty() &&
1751 else if (
type ==
"Coverart")
1756 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1758 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1760 icon_file = test_file;
1764 if (
type ==
"Fanart" && !host.isEmpty() &&
1770 else if (
type ==
"Fanart")
1775 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1777 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1779 icon_file = test_file;
1783 if (
type ==
"Banners" && !host.isEmpty() &&
1789 else if (
type ==
"Banners")
1794 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1796 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1798 icon_file = test_file;
1802 if (
type ==
"Screenshots" && !host.isEmpty() &&
1808 else if (
type ==
"Screenshots")
1813 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1815 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1817 icon_file = test_file;
1823 if (icon_file.isEmpty() && !subDirs.isEmpty())
1826 int subDirCount = subDirs.count();
1827 for (
int i = 0; i < subDirCount; i ++)
1829 if (levels < maxRecurse)
1833 if (!test_file.isEmpty())
1835 icon_file = test_file;
1851 const int nodeInt = node->
getInt();
1891 const int nodeInt = node->
getInt();
1902 !metadata->
GetBanner().startsWith(
"/") &&
1926 const int nodeInt = node->
getInt();
1937 !metadata->
GetFanart().startsWith(
"/") &&
1964 QStringList actions;
1967 for (
int i = 0; i < actions.size() && !handled; i++)
1969 const QString&
action = actions[i];
1979 else if (
action ==
"INCPARENT")
1983 else if (
action ==
"DECPARENT")
1992 else if (
action ==
"FILTER")
1996 else if (
action ==
"MENU")
2001 else if (
action ==
"PLAYALT")
2007 else if (
action ==
"DOWNLOADDATA")
2012 else if (
action ==
"INCSEARCH")
2016 else if (
action ==
"ITEMDETAIL")
2020 else if (
action ==
"DELETE")
2029 else if (
action ==
"ESCAPE")
2049 for (
int i = 0; i < actions.size() && !handled; i++)
2051 const QString&
action = actions[i];
2052 if (
action ==
"PLAYBACK")
2075 const QString& message = title;
2078 "mythvideobusydialog");
2096 QString msg = tr(
"Fetching details for %1")
2101 desc = tr(
"Season %1, Episode %2")
2121 msg = tr(
"Retrieved details for %1").arg(metadata->
GetTitle());
2125 msg = tr(
"Failed to retrieve details for %1").arg(metadata->
GetTitle());
2130 desc = tr(
"Season %1, Episode %2")
2156 const QString& message = title;
2160 if (okPopup->Create())
2170 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Jumping to: %1").arg(
string));
2173 QList<MythGenericTree*> *children =
nullptr;
2174 QMap<int, QString> idTitle;
2181 for (
auto * child : std::as_const(*children))
2183 QString title = child->GetText();
2184 int id = child->getPosition();
2185 idTitle.insert(
id, title);
2212 QStringList childList;
2213 QList<MythGenericTree*> *children =
nullptr;
2219 for (
auto * child : std::as_const(*children))
2221 childList << child->GetText();
2227 tr(
"Video Search"), childList,
false,
"");
2229 if (searchDialog->Create())
2238 delete searchDialog;
2248 bool handled =
false;
2335 metadata->
toMap(metadataMap);
2345 ScreenCopyDest
dest(
this);
2400 if (metadata->
GetWatched() != metadataNew->GetWatched())
2402 metadata->
SetWatched(metadataNew->GetWatched());
2420 label = tr(
"Video Options\n%1\n%2").arg(metadata->
GetTitle(),
2425 label = tr(
"Video Options\n%1").arg(metadata->
GetTitle());
2430 label = tr(
"Video Options");
2486 label = tr(
"Playback Options\n%1").arg(metadata->
GetTitle());
2504 QString trailerFile = metadata->
GetTrailer();
2506 (!metadata->
GetHost().isEmpty() && !trailerFile.isEmpty()))
2520 QString label = tr(
"Video Display Menu");
2553 if (which ==
"display")
2564 QString label = tr(
"Change View");
2600 QString label = tr(
"Video Settings");
2659 QString label = tr(
"Browse By");
2702 QString label = tr(
"Video Info");
2714 if (!metadata->
GetCast().empty())
2729 QString label = tr(
"Manage Video Details");
2814 int nodeInt = node->
getInt();
2982 if (mythvideo->Create())
2988 screenStack->
PopScreen(
this,
false,
false);
2993 ShowOkPopup(tr(
"An error occurred when switching views."));
3007 if (plotdialog->Create())
3045 if (castdialog->Create())
3064 if (browser.isEmpty())
3066 ShowOkPopup(tr(
"No browser command set! MythVideo needs MythBrowser "
3067 "installed to display the homepage."));
3071 if (browser.toLower() ==
"internal")
3077 QString cmd = browser;
3078 cmd.replace(
"%ZOOM%", zoom);
3079 cmd.replace(
"%URL%", url);
3080 cmd.replace(
'\'',
"%27");
3081 cmd.replace(
"&",
"\\&");
3082 cmd.replace(
";",
"\\;");
3117 const int WATCHED_WATERMARK = 10000;
3120 QElapsedTimer playing_time;
3126 if (node && !(node->
getInt() >= 0))
3133 bool video_started =
false;
3135 while (i < list_count &&
3136 (!video_started || playing_time.hasExpired(WATCHED_WATERMARK)))
3145 playing_time.start();
3146 video_started =
true;
3161 [[maybe_unused]]
const QString &fqDirName)
override
3167 const QString &fqFileName,
3168 [[maybe_unused]]
const QString &extension,
3169 [[maybe_unused]]
const QString &host)
override
3171 m_fileList.push_back(fqFileName);
3198 if (!metadata)
return;
3201 GetSetting(
"mythvideo.TrailersDir"));
3206 const int trailersToPlay =
3210 while (!
trailers.isEmpty() && i < trailersToPlay)
3215 LOG(VB_GENERAL, LOG_DEBUG,
3216 QString(
"Random trailer to play will be: %1").arg(trailer));
3231 if (!metadata)
return;
3277 if (filterdialog->Create())
3296 int nodeInt = node->
getInt();
3317 if (list.count() > 1)
3319 auto *metadata = list[0]->GetData().value<
VideoMetadata *>();
3325 Qt::QueuedConnection);
3327 if (resultsdialog->Create())
3361 metadata->SetProcessed(
true);
3362 metadata->UpdateDatabase();
3364 LOG(VB_GENERAL, LOG_INFO,
3365 QString(
"No results found for %1 %2 %3").arg(lookup->
GetTitle())
3373 QString
id = dce->
GetId();
3375 if (
id ==
"scanprompt")
3377 int result = dce->GetResult();
3409 if (item !=
nullptr)
3430 QMap<int, int> idPosition;
3434 for (
auto * child : std::as_const(*children))
3436 int nodeInt = child->getInt();
3443 int position = child->getPosition();
3444 int id = listmeta->
GetID();
3445 idPosition.insert(
id, position);
3479 using MGTreeChildList = QList<MythGenericTree *>;
3482 LOG(VB_GENERAL, LOG_DEBUG,
3483 QString(
"Fetching details in %1").arg(node->
GetText()));
3485 for (
auto * child : std::as_const(*lchildren))
3524 if(!lookup->GetInetref().isEmpty() && lookup->GetInetref() !=
"00000000")
3527 QString(
"Selected Item: Type: %1%2 : Subtype: %3%4%5 : InetRef: %6")
3533 lookup->GetInetref()));
3542 QString(
"Selected Item has no InetRef Number!"));
3555 curshowlevel += amount;
3575 "mythvideoeditmetadata", metadata,
3580 if (md_editor->Create())
3591 QString message = tr(
"Are you sure you want to permanently delete:\n%1")
3596 if (confirmdialog->Create())
3628 QString message = tr(
"Failed to delete file");
3633 if (confirmdialog->Create())
3656 QStringList cover_dirs;
3662 QString title = metadata->
GetTitle();
3664 QString host = metadata->
GetHost();
3671 cover_dirs, cover_file, title,
3672 season, host,
"Coverart", episode))
3679 QStringList fanart_dirs;
3682 QString fanart_file;
3687 fanart_dirs, fanart_file, title,
3688 season, host,
"Fanart", episode))
3695 QStringList banner_dirs;
3698 QString banner_file;
3703 banner_dirs, banner_file, title,
3704 season, host,
"Banners", episode))
3711 QStringList screenshot_dirs;
3714 QString screenshot_file;
3719 screenshot_dirs, screenshot_file, title,
3720 season, host,
"Screenshots", episode,
3740 metadata->SetTitle(lookup->
GetTitle());
3743 if (metadata->GetTagline().isEmpty())
3745 if (metadata->GetYear() == 1895 || metadata->GetYear() == 0)
3746 metadata->SetYear(lookup->
GetYear());
3747 if (metadata->GetReleaseDate() == QDate())
3750 metadata->GetDirector().isEmpty())
3753 if (director.count() > 0)
3754 metadata->SetDirector(director.takeFirst().name);
3756 if (metadata->GetStudio().isEmpty())
3759 if (studios.count() > 0)
3760 metadata->SetStudio(studios.takeFirst());
3763 metadata->GetPlot().isEmpty())
3765 if (metadata->GetUserRating() == 0)
3769 if (metadata->GetLength() == 0min)
3771 if (metadata->GetSeason() == 0)
3772 metadata->SetSeason(lookup->
GetSeason());
3773 if (metadata->GetEpisode() == 0)
3775 if (metadata->GetHomepage().isEmpty())
3786 for (
const auto & name : std::as_const(gueststars))
3787 actors.append(name);
3792 for (
const auto & person : std::as_const(actors))
3793 cl.append(person.name);
3795 for (
const auto & name : std::as_const(cl))
3797 QString cn = name.trimmed();
3800 cast.emplace_back(-1, cn);
3804 metadata->SetCast(cast);
3810 for (
const auto & name : std::as_const(genres))
3812 QString genre_name = name.trimmed();
3813 if (!genre_name.isEmpty())
3815 video_genres.emplace_back(-1, genre_name);
3819 metadata->SetGenres(video_genres);
3825 for (
const auto & name : std::as_const(countries))
3827 QString country_name = name.trimmed();
3828 if (!country_name.isEmpty())
3830 video_countries.emplace_back(-1, country_name);
3834 metadata->SetCountries(video_countries);
3835 metadata->SetProcessed(
true);
3837 metadata->UpdateDatabase();
3840 if (item !=
nullptr)
3856 QString message = tr(
"There are no videos in the database, would you like "
3857 "to scan your video directories now?");
3859 dialog->SetReturnEvent(
this,
"scanprompt");
3860 if (dialog->Create())
3866#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()