Go to the documentation of this file.
9 #include <QApplication>
59 #define LOC_MML QString("Manual Metadata Lookup: ")
68 if (num == i)
return true;
77 void SigLevelChanged();
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 (item->GetChildID() > 0 && video_list.
byID(item->GetChildID()))
291 item = video_list.
byID(item->GetChildID());
295 while (item && playing_time.hasExpired(WATCHED_WATERMARK));
306 m_fanartTimer.stop();
307 m_fanartTimer.disconnect(
this);
314 connect(&m_fanartTimer, &
QTimer::timeout,
this, &FanartLoader::fanartLoad);
318 bool wasActive = m_fanartTimer.isActive();
322 m_fanartTimer.stop();
329 QMutexLocker locker(&m_fanartLock);
331 if (
filename != m_fanart->GetFilename())
334 m_fanartTimer.stop();
340 m_fanartTimer.setSingleShot(
true);
341 m_fanartTimer.start(300ms);
358 QMutexLocker locker(&m_fanartLock);
367 bool m_bConnected {
false};
374 virtual void handleText(
const QString &name,
const QString &value) = 0;
375 virtual void handleState(
const QString &name,
const QString &value) = 0;
376 virtual void handleImage(
const QString &name,
385 void handleText(
const QString &name,
const QString &value)
override
390 void handleState(
const QString &name,
const QString &value)
override
392 handleText(name, value);
401 if (name !=
"fanart")
432 void handleText(
const QString &name,
const QString &value)
override
434 m_item->SetText(value, name);
437 void handleState(
const QString &name,
const QString &value)
override
439 m_item->DisplayState(value, name);
443 [[maybe_unused]]
const QString &
filename)
override
454 using valuelist = std::map<QString, QString>;
474 tmp[
"coverart"] = coverfile;
476 tmp[
"coverfile"] = coverfile;
478 QString screenshotfile;
491 tmp[
"screenshot"] = screenshotfile;
493 tmp[
"screenshotfile"] = screenshotfile;
508 tmp[
"banner"] = bannerfile;
510 tmp[
"bannerfile"] = bannerfile;
525 tmp[
"fanart"] = fanartfile;
527 tmp[
"fanartfile"] = fanartfile;
531 tmp[
"userratingstate"] =
541 m_vallist(values), m_dest(
d) {}
543 void handleImage(
const QString &name)
545 m_dest.handleImage(name, m_vallist[name]);
548 void handleState(
const QString &name)
550 m_dest.handleState(name, m_vallist[name]);
553 valuelist &m_vallist;
559 h.handleImage(
"coverart");
560 h.handleImage(
"screenshot");
561 h.handleImage(
"banner");
562 h.handleImage(
"fanart");
564 h.handleState(
"trailerstate");
565 h.handleState(
"userratingstate");
566 h.handleState(
"watchedstate");
567 h.handleState(
"videolevel");
575 if (!metadata || (!item && !screen))
585 item->DisplayState(bookmarkState,
"bookmarkstate");
586 item->SetProgress1(0, showProgress ? 100 : 0, watchedPercent);
590 CheckedSet(screen,
"bookmarkstate", bookmarkState);
591 auto *watchedProgress =
dynamic_cast<MythUIProgressBar *
>(screen->GetChild(
"watchedprogressbar"));
594 watchedProgress->
Set(0, showProgress ? 100 : 0, watchedPercent);
643 ScreenCopyDest
dest(
this);
666 bool handled =
false;
667 for (
const auto &
action : std::as_const(actions))
715 const parental_level_map::value_type &rhs)
717 return lhs.first.length() >= rhs.first.length();
732 QString ratingstring =
734 .arg(sl.GetLevel()));
735 QStringList ratings =
736 ratingstring.split(
':', Qt::SkipEmptyParts);
737 auto to_pl = [sl](
const auto &
rating)
738 {
return parental_level_map::value_type(
rating, sl.GetLevel()); };
739 std::transform(ratings.cbegin(), ratings.cend(),
781 if (
rating.indexOf(
p->first) != -1)
856 QObject(QCoreApplication::instance()),
894 GetNumSetting(
"VideoDefaultParentalLevel",
909 if (metadata && metadata->GetFilename() ==
filename)
977 QString windowName =
"videogallery";
978 bool flatlistDefault =
false;
983 windowName =
"browser";
984 flatlistDefault =
true;
987 windowName =
"gallery";
995 windowName =
"manager";
996 flatlistDefault =
true;
1069 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen '" + windowName +
"'");
1160 QString message = tr(
"The video scan found no files, have you "
1161 "configured a video storage group?");
1220 QStringList lastTreeNodePath =
gCoreContext->
GetSetting(
"mythvideo.VideoTreeLastActive",
"").split(
"\n");
1224 if (!lastTreeNodePath.isEmpty())
1227 for (
int i = 0; i < lastTreeNodePath.size(); i++)
1231 if (node !=
nullptr)
1236 if (node->
GetText().compare(lastTreeNodePath.at(i)) == 0)
1242 i < lastTreeNodePath.size()-1)
1248 if (lastTreeNodePath.at(i) == lastTreeNodePath.last())
1249 selectedNode = node;
1259 using MGTreeChildList = QList<MythGenericTree *>;
1262 for (
auto * child : std::as_const(*lchildren))
1264 if (child !=
nullptr)
1270 item->SetData(QVariant::fromValue(child));
1274 if (child == selectedNode)
1299 metadata->
toMap(metadataMap);
1303 MythUIButtonListItemCopyDest
dest(item);
1309 if (parent && metadata && ((QString::compare(parent->
GetText(),
1310 metadata->
GetTitle(), Qt::CaseInsensitive) == 0) ||
1311 parent->
GetText().startsWith(tr(
"Season"), Qt::CaseInsensitive)))
1313 else if (metadata && !metadata->
GetSubtitle().isEmpty())
1323 if (!screenshot.isEmpty() && parent && metadata &&
1324 ((QString::compare(parent->
GetText(),
1325 metadata->
GetTitle(), Qt::CaseInsensitive) == 0) ||
1326 parent->
GetText().startsWith(tr(
"Season"), Qt::CaseInsensitive)))
1332 if (coverimage.isEmpty())
1337 int nodeInt = node->
getInt();
1339 if (coverimage.isEmpty() && nodeInt ==
kSubFolder)
1342 item->
SetImage(coverimage,
"coverart");
1344 if (screenshot.isEmpty() && nodeInt ==
kSubFolder)
1347 item->
SetImage(screenshot,
"screenshot");
1349 if (banner.isEmpty() && nodeInt ==
kSubFolder)
1354 if (fanart.isEmpty() && nodeInt ==
kSubFolder)
1425 QString result =
"";
1427 LOG(VB_GENERAL, LOG_DEBUG, QString(
"RemoteImageCheck(%1)").arg(
filename));
1432 if (!dirs.isEmpty())
1434 for (
const auto & dir : std::as_const(dirs))
1437 QString path = sgurl.path();
1439 QString fname = QString(
"%1/%2").arg(path,
filename);
1441 QStringList list( QString(
"QUERY_SG_FILEQUERY") );
1448 if (!ok || list.at(0).startsWith(
"SLAVE UNREACHABLE"))
1450 LOG(VB_GENERAL, LOG_WARNING,
1451 QString(
"Backend : %1 currently Unreachable. Skipping "
1452 "this one.") .arg(host));
1456 if ((!list.isEmpty()) && (list.at(0) == fname))
1459 if (!result.isEmpty())
1462 LOG(VB_GENERAL, LOG_DEBUG,
1463 QString(
"RemoteImageCheck(%1) res :%2: :%3:")
1464 .arg(fname).arg(result).arg(dir));
1484 int nodeInt = node->
getInt();
1499 if (folder_path.startsWith(
"myth://"))
1500 folder_path = folder_path.right(folder_path.length()
1501 - folder_path.lastIndexOf(
"//") - 1);
1503 QString
filename = QString(
"%1/folder").arg(folder_path);
1506 LOG(VB_GENERAL, LOG_DEBUG,
1507 QString(
"GetCoverImage host : %1 prefix : %2 file : %3")
1511 QStringList test_files;
1512 test_files.append(
filename +
".png");
1513 test_files.append(
filename +
".jpg");
1514 test_files.append(
filename +
".jpeg");
1515 test_files.append(
filename +
".gif");
1518 for (
auto imagePath : std::as_const(test_files))
1521 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Cover check :%1 : ").arg(imagePath));
1524 bool foundCover =
false;
1525 if (!host.isEmpty())
1528 imagePath.replace(
"//",
"/");
1529 prefix.replace(
"//",
"/");
1530 imagePath = imagePath.right(imagePath.length() - (
prefix.length() + 1));
1533 if (!tmpCover.isEmpty())
1536 imagePath = tmpCover;
1546 icon_file = imagePath;
1552 if (icon_file.isEmpty())
1554 QStringList imageTypes {
"*.png",
"*.jpg",
"*.jpeg",
"*.gif" };
1557 if (!host.isEmpty())
1563 if (!dirs.isEmpty())
1565 for (
const auto & dir : std::as_const(dirs))
1568 QString path = sgurl.path();
1570 QString subdir = folder_path.right(folder_path.length() - (
prefix.length() + 1));
1572 path = path +
"/" + subdir;
1574 QStringList tmpList;
1579 for (
const auto & pattern : std::as_const(imageTypes))
1581 auto rePattern = QRegularExpression::wildcardToRegularExpression(pattern);
1582 QRegularExpression rx {
1583 rePattern.mid(2,rePattern.size()-4),
1584 QRegularExpression::CaseInsensitiveOption };
1585 QStringList matches = tmpList.filter(rx);
1586 if (!matches.isEmpty())
1589 fList.append(subdir +
"/" + matches.at(0).split(
"::").at(1));
1602 QDir vidDir(folder_path);
1603 vidDir.setNameFilters(imageTypes);
1604 fList = vidDir.entryList();
1608 if (icon_file.isEmpty())
1613 for (
int i = 0; i < list_count; i++)
1621 if (!metadata->
GetHost().isEmpty() &&
1626 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1629 icon_file = test_file;
1636 if (!test_file.isEmpty() &&
1639 icon_file = test_file;
1649 if (!fList.isEmpty())
1653 icon_file = QString(
"%1/%2").arg(folder_path, fList.at(0));
1662 if (!icon_file.isEmpty())
1664 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Found Image : %1 :")
1669 LOG(VB_GENERAL, LOG_DEBUG,
1670 QString(
"Could not find folder cover Image : %1 ")
1712 const QString& gpnode,
int levels)
1714 if (!node ||
type.isEmpty())
1722 QList<MythGenericTree *> subDirs;
1723 static constexpr
int maxRecurse { 1 };
1725 for (
int i = 0; i < list_count; i++)
1737 const QString& host = metadata->
GetHost();
1738 const QString& title = metadata->
GetTitle();
1740 if (
type ==
"Coverart" && !host.isEmpty() &&
1746 else if (
type ==
"Coverart")
1751 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1753 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1755 icon_file = test_file;
1759 if (
type ==
"Fanart" && !host.isEmpty() &&
1765 else if (
type ==
"Fanart")
1770 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1772 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1774 icon_file = test_file;
1778 if (
type ==
"Banners" && !host.isEmpty() &&
1784 else if (
type ==
"Banners")
1789 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1791 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1793 icon_file = test_file;
1797 if (
type ==
"Screenshots" && !host.isEmpty() &&
1803 else if (
type ==
"Screenshots")
1808 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1810 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1812 icon_file = test_file;
1818 if (icon_file.isEmpty() && !subDirs.isEmpty())
1821 int subDirCount = subDirs.count();
1822 for (
int i = 0; i < subDirCount; i ++)
1824 if (levels < maxRecurse)
1828 if (!test_file.isEmpty())
1830 icon_file = test_file;
1846 const int nodeInt = node->
getInt();
1886 const int nodeInt = node->
getInt();
1897 !metadata->
GetBanner().startsWith(
"/") &&
1921 const int nodeInt = node->
getInt();
1932 !metadata->
GetFanart().startsWith(
"/") &&
1959 QStringList actions;
1962 for (
int i = 0; i < actions.size() && !handled; i++)
1964 const QString&
action = actions[i];
1974 else if (
action ==
"INCPARENT")
1978 else if (
action ==
"DECPARENT")
1987 else if (
action ==
"FILTER")
1991 else if (
action ==
"MENU")
1996 else if (
action ==
"PLAYALT")
2002 else if (
action ==
"DOWNLOADDATA")
2007 else if (
action ==
"INCSEARCH")
2011 else if (
action ==
"ITEMDETAIL")
2015 else if (
action ==
"DELETE")
2024 else if (
action ==
"ESCAPE")
2044 for (
int i = 0; i < actions.size() && !handled; i++)
2046 const QString&
action = actions[i];
2047 if (
action ==
"PLAYBACK")
2070 const QString& message = title;
2073 "mythvideobusydialog");
2091 QString msg = tr(
"Fetching details for %1")
2096 desc = tr(
"Season %1, Episode %2")
2116 msg = tr(
"Retrieved details for %1").arg(metadata->
GetTitle());
2120 msg = tr(
"Failed to retrieve details for %1").arg(metadata->
GetTitle());
2125 desc = tr(
"Season %1, Episode %2")
2151 const QString& message = title;
2155 if (okPopup->Create())
2165 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Jumping to: %1").arg(
string));
2168 QList<MythGenericTree*> *children =
nullptr;
2169 QMap<int, QString> idTitle;
2176 for (
auto * child : std::as_const(*children))
2178 QString title = child->GetText();
2179 int id = child->getPosition();
2180 idTitle.insert(
id, title);
2207 QStringList childList;
2208 QList<MythGenericTree*> *children =
nullptr;
2214 for (
auto * child : std::as_const(*children))
2216 childList << child->GetText();
2222 tr(
"Video Search"), childList,
false,
"");
2224 if (searchDialog->Create())
2233 delete searchDialog;
2243 bool handled =
false;
2330 metadata->
toMap(metadataMap);
2340 ScreenCopyDest
dest(
this);
2395 if (metadata->
GetWatched() != metadataNew->GetWatched())
2397 metadata->
SetWatched(metadataNew->GetWatched());
2415 label = tr(
"Video Options\n%1\n%2").arg(metadata->
GetTitle(),
2420 label = tr(
"Video Options\n%1").arg(metadata->
GetTitle());
2425 label = tr(
"Video Options");
2481 label = tr(
"Playback Options\n%1").arg(metadata->
GetTitle());
2499 QString trailerFile = metadata->
GetTrailer();
2501 (!metadata->
GetHost().isEmpty() && !trailerFile.isEmpty()))
2515 QString label = tr(
"Video Display Menu");
2548 if (which ==
"display")
2559 QString label = tr(
"Change View");
2595 QString label = tr(
"Video Settings");
2654 QString label = tr(
"Browse By");
2697 QString label = tr(
"Video Info");
2709 if (!metadata->
GetCast().empty())
2724 QString label = tr(
"Manage Video Details");
2809 int nodeInt = node->
getInt();
2977 if (mythvideo->Create())
2983 screenStack->
PopScreen(
this,
false,
false);
2988 ShowOkPopup(tr(
"An error occurred when switching views."));
3002 if (plotdialog->Create())
3040 if (castdialog->Create())
3059 if (browser.isEmpty())
3061 ShowOkPopup(tr(
"No browser command set! MythVideo needs MythBrowser "
3062 "installed to display the homepage."));
3066 if (browser.toLower() ==
"internal")
3072 QString cmd = browser;
3073 cmd.replace(
"%ZOOM%", zoom);
3074 cmd.replace(
"%URL%", url);
3075 cmd.replace(
'\'',
"%27");
3076 cmd.replace(
"&",
"\\&");
3077 cmd.replace(
";",
"\\;");
3113 const int WATCHED_WATERMARK = 10000;
3116 QElapsedTimer playing_time;
3122 if (node && !(node->
getInt() >= 0))
3129 bool video_started =
false;
3131 while (i < list_count &&
3132 (!video_started || playing_time.hasExpired(WATCHED_WATERMARK)))
3140 playing_time.start();
3141 video_started =
true;
3158 [[maybe_unused]]
const QString &fqDirName)
override
3164 const QString &fqFileName,
3165 [[maybe_unused]]
const QString &extension,
3166 [[maybe_unused]]
const QString &host)
override
3168 m_fileList.push_back(fqFileName);
3195 if (!metadata)
return;
3198 GetSetting(
"mythvideo.TrailersDir"));
3203 const int trailersToPlay =
3207 while (!
trailers.isEmpty() && i < trailersToPlay)
3212 LOG(VB_GENERAL, LOG_DEBUG,
3213 QString(
"Random trailer to play will be: %1").arg(trailer));
3228 if (!metadata)
return;
3274 if (filterdialog->Create())
3293 int nodeInt = node->
getInt();
3314 if (list.count() > 1)
3316 auto *metadata = list[0]->GetData().value<
VideoMetadata *>();
3322 Qt::QueuedConnection);
3324 if (resultsdialog->Create())
3358 metadata->SetProcessed(
true);
3359 metadata->UpdateDatabase();
3361 LOG(VB_GENERAL, LOG_INFO,
3362 QString(
"No results found for %1 %2 %3").arg(lookup->
GetTitle())
3370 QString
id = dce->
GetId();
3372 if (
id ==
"scanprompt")
3374 int result = dce->GetResult();
3406 if (item !=
nullptr)
3427 QMap<int, int> idPosition;
3431 for (
auto * child : std::as_const(*children))
3433 int nodeInt = child->getInt();
3440 int position = child->getPosition();
3441 int id = listmeta->
GetID();
3442 idPosition.insert(
id, position);
3476 using MGTreeChildList = QList<MythGenericTree *>;
3479 LOG(VB_GENERAL, LOG_DEBUG,
3480 QString(
"Fetching details in %1").arg(node->
GetText()));
3482 for (
auto * child : std::as_const(*lchildren))
3524 QString(
"Selected Item: Type: %1%2 : Subtype: %3%4%5 : InetRef: %6")
3539 QString(
"Selected Item has no InetRef Number!"));
3552 curshowlevel += amount;
3572 "mythvideoeditmetadata", metadata,
3577 if (md_editor->Create())
3588 QString message = tr(
"Are you sure you want to permanently delete:\n%1")
3593 if (confirmdialog->Create())
3625 QString message = tr(
"Failed to delete file");
3630 if (confirmdialog->Create())
3653 QStringList cover_dirs;
3659 QString title = metadata->
GetTitle();
3661 QString host = metadata->
GetHost();
3668 cover_dirs, cover_file, title,
3669 season, host,
"Coverart", episode))
3676 QStringList fanart_dirs;
3679 QString fanart_file;
3684 fanart_dirs, fanart_file, title,
3685 season, host,
"Fanart", episode))
3692 QStringList banner_dirs;
3695 QString banner_file;
3700 banner_dirs, banner_file, title,
3701 season, host,
"Banners", episode))
3708 QStringList screenshot_dirs;
3711 QString screenshot_file;
3716 screenshot_dirs, screenshot_file, title,
3717 season, host,
"Screenshots", episode,
3737 metadata->SetTitle(lookup->
GetTitle());
3740 if (metadata->GetTagline().isEmpty())
3742 if (metadata->GetYear() == 1895 || metadata->GetYear() == 0)
3743 metadata->SetYear(lookup->
GetYear());
3744 if (metadata->GetReleaseDate() == QDate())
3747 metadata->GetDirector().isEmpty())
3750 if (director.count() > 0)
3751 metadata->SetDirector(director.takeFirst().name);
3753 if (metadata->GetStudio().isEmpty())
3756 if (studios.count() > 0)
3757 metadata->SetStudio(studios.takeFirst());
3760 metadata->GetPlot().isEmpty())
3762 if (metadata->GetUserRating() == 0)
3766 if (metadata->GetLength() == 0min)
3768 if (metadata->GetSeason() == 0)
3769 metadata->SetSeason(lookup->
GetSeason());
3770 if (metadata->GetEpisode() == 0)
3772 if (metadata->GetHomepage().isEmpty())
3783 for (
const auto & name : std::as_const(gueststars))
3784 actors.append(name);
3789 for (
const auto & person : std::as_const(actors))
3790 cl.append(person.name);
3792 for (
const auto & name : std::as_const(cl))
3794 QString cn = name.trimmed();
3797 cast.emplace_back(-1, cn);
3801 metadata->SetCast(cast);
3807 for (
const auto & name : std::as_const(genres))
3809 QString genre_name = name.trimmed();
3810 if (!genre_name.isEmpty())
3812 video_genres.emplace_back(-1, genre_name);
3816 metadata->SetGenres(video_genres);
3822 for (
const auto & name : std::as_const(countries))
3824 QString country_name = name.trimmed();
3825 if (!country_name.isEmpty())
3827 video_countries.emplace_back(-1, country_name);
3831 metadata->SetCountries(video_countries);
3832 metadata->SetProcessed(
true);
3834 metadata->UpdateDatabase();
3837 if (item !=
nullptr)
3853 QString message = tr(
"There are no videos in the database, would you like "
3854 "to scan your video directories now?");
3856 dialog->SetReturnEvent(
this,
"scanprompt");
3857 if (dialog->Create())
3863 #include "videodlg.moc"
simple_ref_ptr< class VideoList > VideoListPtr
void SetLevel(const ParentalLevel &level)
static QString GetBanner(MythGenericTree *node)
Find the Banner for a given node.
MythScreenStack * GetMainStack()
QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
Provide a dialog to quickly find an entry in a list.
DirectoryHandler * newDir([[maybe_unused]] const QString &dirName, [[maybe_unused]] const QString &fqDirName) override
const ParentalLevel & GetLevel() const
class VideoDialogPrivate * m_d
MythMenu * CreateMetadataBrowseMenu()
Create a MythMenu for MythVideo Metadata Browse modes.
void OnVideoImageSetDone(VideoMetadata *metadata)
std::list< std::pair< QString, ParentalLevel::Level > > parental_level_map
void playVideoAlt()
Play the selected item in an alternate player.
QString WatchedToState(bool watched)
void AutomaticParentalAdjustment(VideoMetadata *metadata)
Image widget, displays a single image or multiple images in sequence.
MythMenu * CreateSettingsMenu()
Create a MythMenu for MythVideo Settings.
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)
void StartVideoImageSet(VideoMetadata *metadata)
void getExtensionIgnoreList(ext_ignore_list &ext_ignore) const
void playbackStateChanged(const QString &filename)
void playTrailer()
Play the trailer associated with the selected item.
QString GetText(const QString &name="") const
void ShowMetadataSettings()
Pop up a MythUI Menu for MythVideo Metadata Settings.
void Initialize()
Initializes playback state from database.
VideoDialog::DialogType m_type
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
SimpleCollect(QStringList &fileList)
MythDialogBox * m_menuPopup
void doScan(const QStringList &dirs)
ParentalLevelChangeChecker m_levelCheck
void SwitchManager()
Switch to Video Manager View.
int Register(void *from)
An application can register in which case it will be assigned a reusable screen, which can be modifie...
ParentalLevelNotifyContainer(QObject *lparent=nullptr)
uint visibleChildCount() const
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void CopyMetadataToUI(const VideoMetadata *metadata, CopyMetadataDestination &dest)
void refreshData()
Reloads the tree without invalidating the data.
bool Create(void) override
static void DelayVideoListDestruction(const VideoListPtr &videoList)
void SwitchVideoGenreGroup()
Switch to Genre browse mode.
~VideoListDeathDelay() override
QVariant GetData(void) const
void dismissFetchDialog(VideoMetadata *metadata, bool ok)
void SwitchVideoInsertDateGroup()
Switch to Insert Date browse mode.
void handleSelect(MythUIButtonListItem *item)
Handle SELECT action for a given MythUIButtonListItem.
MythGenericTree * getChildByName(const QString &a_name) const
void CheckedSet(MythUIStateType *uiItem, const QString &value)
std::unique_ptr< FanartLoader > fanartLoader
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void Closed(QString, int)
MythMenu * CreateManageMenu()
Create a MythMenu for metadata management.
bool HasBookmark(const QString &filename) const
Query bookmark of video with the specified filename.
Screen in which all other widgets are contained and rendered.
void Load() override
Called after the screen is created by MythScreenStack.
static VideoListDeathDelayPtr & GetSavedVideoList()
void Reset(void) override
Reset the image back to the default defined in the theme.
VideoListDeathDelay(const VideoDialog::VideoListPtr &toSave)
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
MythMenu * CreateViewMenu()
Create a MythMenu for MythVideo Views.
void SwitchVideoUserRatingGroup()
Switch to User Rating browse mode.
void LoadImage(const QString &filename, MythUIImage *image)
static void ClearGroupToUseCache(void)
MythUIStateType * m_studioState
VideoDialog::BrowseType m_browse
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 shiftParental(int amount)
Shift the parental level for the library by an integer amount.
MythUIText * m_positionText
MythUIBusyDialog * m_busyPopup
MythUIButtonTree * m_videoButtonTree
static VideoDialog::VideoListDeathDelayPtr m_savedPtr
MythUIType * GetFocusWidget(void) const
MythUIStateType * m_trailerState
QHash< QString, QString > InfoMap
MythGenericTree * getChildAt(uint reference) const
QString GetFirstImage(MythGenericTree *node, const QString &type, const QString &gpnode=QString(), int levels=0)
Find the first image of "type" within a folder structure.
virtual MythUIButtonListItem * GetItemByMetadata(VideoMetadata *metadata)
void searchComplete(const QString &string)
After using incremental search, move to the selected item.
MythGenericTree * getSelectedChild(bool onlyVisible=false) const
VideoDialog::VideoListPtr GetSaved()
void SwitchVideoTVMovieGroup()
Switch to Television/Movie browse mode.
static QString GetScreenshot(MythGenericTree *node)
Find the Screenshot for a given node.
void playVideoWithTrailers()
Play the selected item w/ a User selectable # of trailers.
static QString GetFanart(MythGenericTree *node)
Find the Fanart for a given node.
void scanFinished(bool dbChanged)
void SwitchBrowse()
Switch to Browser View.
void OnVideoSearchListSelection(RefCountHandler< MetadataLookup > lookup)
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MetadataFactory * m_metadataFactory
QStringList GetVideoDirs()
bool goBack()
Move one level up in the tree.
MythScreenStack * m_popupStack
static QString RemoteImageCheck(const QString &host, const QString &filename)
Search for a given (image) filename in the Video SG.
ParentalLevelNotifyContainer m_parentalLevel
QPointer< class VideoListDeathDelay > VideoListDeathDelayPtr
void Set(int start, int total, int used)
QStringList GetTrailersInDirectory(const QString &startDir)
bool SetFocusWidget(MythUIType *widget=nullptr)
QStringList getRouteByString(void)
std::vector< std::pair< QString, bool > > ext_ignore_list
Basic menu dialog, message and a list of options.
void SwitchVideoYearGroup()
Switch to Year browse mode.
static const Type kEventType
static MythThemedMenu * menu
void SwitchTree()
Switch to Tree (List) View.
MythUIStateType * m_bookmarkState
void ShowCastDialog()
Display the Cast if the selected item.
bool Create(void) override
void SetParent(void *Parent)
Contains the parent address. Required if id is set Id provided must match the parent address as provi...
class VideoListDeathDelayPrivate * m_d
virtual MythUIButtonListItem * GetItemCurrent()
void BuildFocusList(void)
def rating(profile, smoonURL, gate)
static void UpdateWatchedState(MythUIButtonListItem *item)
Update the watched state for a given ButtonListItem from the database.
MythScreenStack * m_mainStack
VideoDialog::VideoListPtr m_savedList
void searchStart()
Create an incremental search dialog for the current tree level.
int childCount(void) const
void PlayVideo(const QString &filename, const VideoMetadataListManager &video_list, bool useAltPlayer=false)
const QString VIDEO_PLOT_DEFAULT
virtual void SetTextFromMap(const InfoMap &infoMap)
void SwitchVideoDirectorGroup()
Switch to Director browse mode.
void handleText(const QString &name, const QString &value) override
void SetCurrentNode(MythGenericTree *node)
Switch to a given MythGenericTree node.
bool IsDefaultBanner(const QString &banner)
MythGenericTree * getVisibleChildAt(uint reference) const
void SwitchVideoFolderGroup()
Switch to Folder (filesystem) browse mode.
MythGenericTree * GetNodePtrFromButton(MythUIButtonListItem *item)
void SwitchLayout(DialogType type, BrowseType browse)
Handle a layout or browse mode switch.
void SwitchVideoCastGroup()
Switch to Cast browse mode.
void setParentalLevel(ParentalLevel::Level level)
Set the parental level for the library.
uint GetWatchedPercent(const QString &filename) const
Query watched percent of video with the specified filename.
void handleDynamicDirSelect(MythGenericTree *node)
Request the latest metadata for a folder.
MythMenu * CreateInfoMenu()
Create a MythMenu for Info pertaining to the selected item.
PlaybackState m_playbackState
MythUIStateType * m_parentalLevelState
void createOkDialog(const QString &title)
Create a MythUI "OK" Dialog.
void ShowExtensionSettings()
Pop up a MythUI Menu for MythVideo filte Type Settings.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void SigResultReady(bool passwordValid, ParentalLevel::Level newLevel)
bool IsValidDialogType(int num)
bool IsDefaultFanart(const QString &fanart)
int GetNumSetting(const QString &key, int defaultval=0)
MythScreenStack * GetScreenStack() const
MythMenu * CreatePlayMenu()
Create a "Play Menu" for MythVideo. Appears if multiple play options exist.
QList< MythGenericTree * > * getAllChildren() const
const QString VIDEO_FANART_DEFAULT
MythUIStateType * m_watchedState
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
virtual void loadData()
load the data used to build the ButtonTree/List for MythVideo.
VideoListDeathDelayPrivate(const VideoDialog::VideoListPtr &toSave)
void SwitchVideoCategoryGroup()
Switch to Category browse mode.
void TVPlaybackAborted(void)
QString ParentalLevelToState(const ParentalLevel &level)
bool IsDefaultCoverFile(const QString &coverfile)
Utility class to query playback state from database.
bool IsDefaultScreenshot(const QString &screenshot)
void customEvent(QEvent *levent) override
bool GetBoolSetting(const QString &key, bool defaultval=false)
void popupClosed(const QString &which, int result)
static FileAssociations & getFileAssociation()
void UpdatePosition()
Called after the screen is created by MythScreenStack.
void createBusyDialog(const QString &title)
Create a busy dialog, used during metadata search, etc.
static VideoPlayerCommand AltPlayerFor(const VideoMetadata *item)
VideoDialog(MythScreenStack *lparent, const QString &lname, const VideoListPtr &video_list, DialogType type, BrowseType browse)
void handleDirSelect(MythGenericTree *node)
Descend into a selected folder.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void deleteNode(MythGenericTree *child)
static bool rating_to_pl_greater(const parental_level_map::value_type &lhs, const parental_level_map::value_type &rhs)
MythGenericTree * m_currentNode
void reloadData()
Reloads the tree after having invalidated the data.
Dialog asking for user confirmation. Ok and optional Cancel button.
void OnResultReady(bool passwordValid, ParentalLevel::Level newLevel)
bool ScanVideoDirectory(const QString &start_path, DirectoryHandler *handler, const FileAssociations::ext_ignore_list &ext_disposition, bool list_unknown_extensions)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
void ShowPlayerSettings()
Pop up a MythUI Menu for MythVideo Player Settings.
MythGenericTree * getParent(void) const
void Update(const QString &filename)
Updates playback state of video with specified filename.
QStringList GetVideoDirsByHost(const QString &host)
const QString VIDEO_RATING_DEFAULT
void ChangeFilter()
Change the filtering of the library.
void handleState(const QString &name, const QString &value) override
VideoMetadata * GetMetadataPtrFromNode(MythGenericTree *node)
void OnVideoSearchDone(MetadataLookup *lookup)
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
static void ClearBackendServerPortCache()
void UpdateText(MythUIButtonListItem *item)
Update the visible text values for a given ButtonListItem.
static VideoMetadata * GetMetadata(MythUIButtonListItem *item)
Retrieve the Database Metadata for a given MythUIButtonListItem.
void OnParentalChange(int amount)
virtual void SetVisible(bool visible)
VideoDialog::VideoListPtr GetSaved()
MythNotificationCenter * GetNotificationCenter(void)
void UnRegister(void *from, int id, bool closeimemdiately=false)
Unregister the client.
void createFetchDialog(VideoMetadata *metadata)
Create a fetch notification, used during metadata search.
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
static const Type kEventType
MythUIImage * m_coverImage
parental_level_map m_ratingToPl
MythMainWindow * GetMythMainWindow(void)
void SetId(int Id)
Contains the application registration id.
void fetchVideos()
Build the buttonlist/tree.
MythGenericTree * m_rootNode
void SwitchGallery()
Switch to Gallery View.
MythScreenStack * GetStack(const QString &Stackname)
static constexpr std::chrono::milliseconds kDelayTimeMS
void playVideo()
Play the selected item.
void UpdateVisible(MythUIButtonListItem *item)
Update playback state for for a given visible ButtonListItem.
void handleFile([[maybe_unused]] const QString &fileName, const QString &fqFileName, [[maybe_unused]] const QString &extension, [[maybe_unused]] const QString &host) override
void playFolder()
Play all the items in the selected folder.
static VideoPlayerCommand PlayerFor(const VideoMetadata *item)
MythUIImage * m_screenshot
void handleImage(const QString &name, const QString &filename) override
QString TrailerToState(const QString &trailerFile)
const QString VIDEO_BANNER_DEFAULT
static const iso6937table * d
void SwitchVideoStudioGroup()
Switch to Studio browse mode.
void OnRemoveVideo(bool dodelete)
void TVPlaybackStopped(void)
@ kMSDontDisableDrawing
avoid disabling UI drawing
void SaveSetting(const QString &key, int newValue)
void ToggleFlatView()
Toggle Flat View.
void AllowInput(bool Allow)
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
void UpdateItem(MythUIButtonListItem *item)
Update the visible representation of a MythUIButtonListItem.
VideoDialogPrivate(const VideoListPtr &videoList, VideoDialog::DialogType type, VideoDialog::BrowseType browse)
MythUIText * m_novideoText
bool AlwaysShowWatchedProgress() const
Returns cached setting "AlwaysShowWatchedProgress".
QMap< QString, int > m_notifications
ScreenCopyDest(MythScreenType *screen)
void CopyPlaybackStateToUI(const PlaybackState &playbackState, const VideoMetadata *metadata, MythUIButtonListItem *item=nullptr, MythScreenType *screen=nullptr)
void DisplayMenu()
Pop up a MythUI Menu for MythVideo Global Functions. Bound to MENU.
virtual int IncrRef(void)
Increments reference count.
void VideoMenu()
Pop up a MythUI "Playback Menu" for MythVideo. Bound to INFO.
void ToggleBrowseMode()
Toggle the browseable status for the selected item.
MythUIButtonList * m_videoButtonList
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void becomeSelectedChild(void)
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
void ViewPlot()
Display a MythUI Popup with the selected item's plot.
static QString GetCoverImage(MythGenericTree *node)
A "hunt" for cover art to apply for a folder item.
uint32_t MythRandom()
generate 32 random bits
QString m_lastTreeNodePath
bool keyPressEvent(QKeyEvent *levent) override
Handle keypresses and keybindings.
bool DoItemDetailShow()
Display the Item Detail Popup.
const QString VIDEO_SCREENSHOT_DEFAULT
QString GetSetting(const QString &key, const QString &defaultval="")
static const QString sLocation
bool Queue(const MythNotification ¬ification)
Queue a notification Queue() is thread-safe and can be called from anywhere.
bool RemoteGetFileList(const QString &host, const QString &path, QStringList *list, QString sgroup, bool fileNamesOnly)
const QString VIDEO_DIRECTOR_UNKNOWN