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)
1429 QString result =
"";
1431 LOG(VB_GENERAL, LOG_DEBUG, QString(
"RemoteImageCheck(%1)").arg(
filename));
1436 if (!dirs.isEmpty())
1438 for (
const auto & dir : std::as_const(dirs))
1441 QString path = sgurl.path();
1443 QString fname = QString(
"%1/%2").arg(path,
filename);
1445 QStringList list( QString(
"QUERY_SG_FILEQUERY") );
1452 if (!ok || list.at(0).startsWith(
"SLAVE UNREACHABLE"))
1454 LOG(VB_GENERAL, LOG_WARNING,
1455 QString(
"Backend : %1 currently Unreachable. Skipping "
1456 "this one.") .arg(host));
1460 if ((!list.isEmpty()) && (list.at(0) == fname))
1463 if (!result.isEmpty())
1466 LOG(VB_GENERAL, LOG_DEBUG,
1467 QString(
"RemoteImageCheck(%1) res :%2: :%3:")
1468 .arg(fname).arg(result).arg(dir));
1488 int nodeInt = node->
getInt();
1503 if (folder_path.startsWith(
"myth://"))
1504 folder_path = folder_path.right(folder_path.length()
1505 - folder_path.lastIndexOf(
"//") - 1);
1507 QString
filename = QString(
"%1/folder").arg(folder_path);
1510 LOG(VB_GENERAL, LOG_DEBUG,
1511 QString(
"GetCoverImage host : %1 prefix : %2 file : %3")
1515 QStringList test_files;
1516 test_files.append(
filename +
".png");
1517 test_files.append(
filename +
".jpg");
1518 test_files.append(
filename +
".jpeg");
1519 test_files.append(
filename +
".gif");
1522 for (
auto imagePath : std::as_const(test_files))
1525 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Cover check :%1 : ").arg(imagePath));
1528 bool foundCover =
false;
1529 if (!host.isEmpty())
1532 imagePath.replace(
"//",
"/");
1533 prefix.replace(
"//",
"/");
1534 imagePath = imagePath.right(imagePath.length() - (
prefix.length() + 1));
1537 if (!tmpCover.isEmpty())
1540 imagePath = tmpCover;
1550 icon_file = imagePath;
1556 if (icon_file.isEmpty())
1558 QStringList imageTypes {
"*.png",
"*.jpg",
"*.jpeg",
"*.gif" };
1561 if (!host.isEmpty())
1567 if (!dirs.isEmpty())
1569 for (
const auto & dir : std::as_const(dirs))
1572 QString path = sgurl.path();
1574 QString subdir = folder_path.right(folder_path.length() - (
prefix.length() + 1));
1576 path = path +
"/" + subdir;
1578 QStringList tmpList;
1583 for (
const auto & pattern : std::as_const(imageTypes))
1585 auto rePattern = QRegularExpression::wildcardToRegularExpression(pattern);
1586 QRegularExpression rx {
1587 rePattern.mid(2,rePattern.size()-4),
1588 QRegularExpression::CaseInsensitiveOption };
1589 QStringList matches = tmpList.filter(rx);
1590 if (!matches.isEmpty())
1593 fList.append(subdir +
"/" + matches.at(0).split(
"::").at(1));
1606 QDir vidDir(folder_path);
1607 vidDir.setNameFilters(imageTypes);
1608 fList = vidDir.entryList();
1612 if (icon_file.isEmpty())
1617 for (
int i = 0; i < list_count; i++)
1625 if (!metadata->
GetHost().isEmpty() &&
1630 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1633 icon_file = test_file;
1640 if (!test_file.isEmpty() &&
1643 icon_file = test_file;
1653 if (!fList.isEmpty())
1657 icon_file = QString(
"%1/%2").arg(folder_path, fList.at(0));
1666 if (!icon_file.isEmpty())
1668 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Found Image : %1 :")
1673 LOG(VB_GENERAL, LOG_DEBUG,
1674 QString(
"Could not find folder cover Image : %1 ")
1716 const QString& gpnode,
int levels)
1718 if (!node ||
type.isEmpty())
1726 QList<MythGenericTree *> subDirs;
1727 static constexpr
int maxRecurse { 1 };
1729 for (
int i = 0; i < list_count; i++)
1741 const QString& host = metadata->
GetHost();
1742 const QString& title = metadata->
GetTitle();
1744 if (
type ==
"Coverart" && !host.isEmpty() &&
1750 else if (
type ==
"Coverart")
1755 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1757 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1759 icon_file = test_file;
1763 if (
type ==
"Fanart" && !host.isEmpty() &&
1769 else if (
type ==
"Fanart")
1774 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1776 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1778 icon_file = test_file;
1782 if (
type ==
"Banners" && !host.isEmpty() &&
1788 else if (
type ==
"Banners")
1793 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1795 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1797 icon_file = test_file;
1801 if (
type ==
"Screenshots" && !host.isEmpty() &&
1807 else if (
type ==
"Screenshots")
1812 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1814 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1816 icon_file = test_file;
1822 if (icon_file.isEmpty() && !subDirs.isEmpty())
1825 int subDirCount = subDirs.count();
1826 for (
int i = 0; i < subDirCount; i ++)
1828 if (levels < maxRecurse)
1832 if (!test_file.isEmpty())
1834 icon_file = test_file;
1850 const int nodeInt = node->
getInt();
1890 const int nodeInt = node->
getInt();
1901 !metadata->
GetBanner().startsWith(
"/") &&
1925 const int nodeInt = node->
getInt();
1936 !metadata->
GetFanart().startsWith(
"/") &&
1963 QStringList actions;
1966 for (
int i = 0; i < actions.size() && !handled; i++)
1968 const QString&
action = actions[i];
1978 else if (
action ==
"INCPARENT")
1982 else if (
action ==
"DECPARENT")
1991 else if (
action ==
"FILTER")
1995 else if (
action ==
"MENU")
2000 else if (
action ==
"PLAYALT")
2006 else if (
action ==
"DOWNLOADDATA")
2011 else if (
action ==
"INCSEARCH")
2015 else if (
action ==
"ITEMDETAIL")
2019 else if (
action ==
"DELETE")
2028 else if (
action ==
"ESCAPE")
2048 for (
int i = 0; i < actions.size() && !handled; i++)
2050 const QString&
action = actions[i];
2051 if (
action ==
"PLAYBACK")
2074 const QString& message = title;
2077 "mythvideobusydialog");
2095 QString msg = tr(
"Fetching details for %1")
2100 desc = tr(
"Season %1, Episode %2")
2120 msg = tr(
"Retrieved details for %1").arg(metadata->
GetTitle());
2124 msg = tr(
"Failed to retrieve details for %1").arg(metadata->
GetTitle());
2129 desc = tr(
"Season %1, Episode %2")
2155 const QString& message = title;
2159 if (okPopup->Create())
2169 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Jumping to: %1").arg(
string));
2172 QList<MythGenericTree*> *children =
nullptr;
2173 QMap<int, QString> idTitle;
2180 for (
auto * child : std::as_const(*children))
2182 QString title = child->GetText();
2183 int id = child->getPosition();
2184 idTitle.insert(
id, title);
2211 QStringList childList;
2212 QList<MythGenericTree*> *children =
nullptr;
2218 for (
auto * child : std::as_const(*children))
2220 childList << child->GetText();
2226 tr(
"Video Search"), childList,
false,
"");
2228 if (searchDialog->Create())
2237 delete searchDialog;
2247 bool handled =
false;
2334 metadata->
toMap(metadataMap);
2344 ScreenCopyDest
dest(
this);
2399 if (metadata->
GetWatched() != metadataNew->GetWatched())
2401 metadata->
SetWatched(metadataNew->GetWatched());
2419 label = tr(
"Video Options\n%1\n%2").arg(metadata->
GetTitle(),
2424 label = tr(
"Video Options\n%1").arg(metadata->
GetTitle());
2429 label = tr(
"Video Options");
2485 label = tr(
"Playback Options\n%1").arg(metadata->
GetTitle());
2503 QString trailerFile = metadata->
GetTrailer();
2505 (!metadata->
GetHost().isEmpty() && !trailerFile.isEmpty()))
2519 QString label = tr(
"Video Display Menu");
2552 if (which ==
"display")
2563 QString label = tr(
"Change View");
2599 QString label = tr(
"Video Settings");
2658 QString label = tr(
"Browse By");
2701 QString label = tr(
"Video Info");
2713 if (!metadata->
GetCast().empty())
2728 QString label = tr(
"Manage Video Details");
2813 int nodeInt = node->
getInt();
2981 if (mythvideo->Create())
2987 screenStack->
PopScreen(
this,
false,
false);
2992 ShowOkPopup(tr(
"An error occurred when switching views."));
3006 if (plotdialog->Create())
3044 if (castdialog->Create())
3063 if (browser.isEmpty())
3065 ShowOkPopup(tr(
"No browser command set! MythVideo needs MythBrowser "
3066 "installed to display the homepage."));
3070 if (browser.toLower() ==
"internal")
3076 QString cmd = browser;
3077 cmd.replace(
"%ZOOM%", zoom);
3078 cmd.replace(
"%URL%", url);
3079 cmd.replace(
'\'',
"%27");
3080 cmd.replace(
"&",
"\\&");
3081 cmd.replace(
";",
"\\;");
3122 const int WATCHED_WATERMARK = 10000;
3125 QElapsedTimer playing_time;
3131 if (node && !(node->
getInt() >= 0))
3138 bool video_started =
false;
3140 while (i < list_count &&
3141 (!video_started || playing_time.hasExpired(WATCHED_WATERMARK)))
3149 playing_time.start();
3150 video_started =
true;
3167 [[maybe_unused]]
const QString &fqDirName)
override
3173 const QString &fqFileName,
3174 [[maybe_unused]]
const QString &extension,
3175 [[maybe_unused]]
const QString &host)
override
3177 m_fileList.push_back(fqFileName);
3204 if (!metadata)
return;
3207 GetSetting(
"mythvideo.TrailersDir"));
3212 const int trailersToPlay =
3216 while (!
trailers.isEmpty() && i < trailersToPlay)
3221 LOG(VB_GENERAL, LOG_DEBUG,
3222 QString(
"Random trailer to play will be: %1").arg(trailer));
3237 if (!metadata)
return;
3283 if (filterdialog->Create())
3302 int nodeInt = node->
getInt();
3323 if (list.count() > 1)
3325 auto *metadata = list[0]->GetData().value<
VideoMetadata *>();
3331 Qt::QueuedConnection);
3333 if (resultsdialog->Create())
3367 metadata->SetProcessed(
true);
3368 metadata->UpdateDatabase();
3370 LOG(VB_GENERAL, LOG_INFO,
3371 QString(
"No results found for %1 %2 %3").arg(lookup->
GetTitle())
3379 QString
id = dce->
GetId();
3381 if (
id ==
"scanprompt")
3383 int result = dce->GetResult();
3415 if (item !=
nullptr)
3436 QMap<int, int> idPosition;
3440 for (
auto * child : std::as_const(*children))
3442 int nodeInt = child->getInt();
3449 int position = child->getPosition();
3450 int id = listmeta->
GetID();
3451 idPosition.insert(
id, position);
3485 using MGTreeChildList = QList<MythGenericTree *>;
3488 LOG(VB_GENERAL, LOG_DEBUG,
3489 QString(
"Fetching details in %1").arg(node->
GetText()));
3491 for (
auto * child : std::as_const(*lchildren))
3533 QString(
"Selected Item: Type: %1%2 : Subtype: %3%4%5 : InetRef: %6")
3548 QString(
"Selected Item has no InetRef Number!"));
3561 curshowlevel += amount;
3581 "mythvideoeditmetadata", metadata,
3586 if (md_editor->Create())
3597 QString message = tr(
"Are you sure you want to permanently delete:\n%1")
3602 if (confirmdialog->Create())
3634 QString message = tr(
"Failed to delete file");
3639 if (confirmdialog->Create())
3662 QStringList cover_dirs;
3668 QString title = metadata->
GetTitle();
3670 QString host = metadata->
GetHost();
3677 cover_dirs, cover_file, title,
3678 season, host,
"Coverart", episode))
3685 QStringList fanart_dirs;
3688 QString fanart_file;
3693 fanart_dirs, fanart_file, title,
3694 season, host,
"Fanart", episode))
3701 QStringList banner_dirs;
3704 QString banner_file;
3709 banner_dirs, banner_file, title,
3710 season, host,
"Banners", episode))
3717 QStringList screenshot_dirs;
3720 QString screenshot_file;
3725 screenshot_dirs, screenshot_file, title,
3726 season, host,
"Screenshots", episode,
3746 metadata->SetTitle(lookup->
GetTitle());
3749 if (metadata->GetTagline().isEmpty())
3751 if (metadata->GetYear() == 1895 || metadata->GetYear() == 0)
3752 metadata->SetYear(lookup->
GetYear());
3753 if (metadata->GetReleaseDate() == QDate())
3756 metadata->GetDirector().isEmpty())
3759 if (director.count() > 0)
3760 metadata->SetDirector(director.takeFirst().name);
3762 if (metadata->GetStudio().isEmpty())
3765 if (studios.count() > 0)
3766 metadata->SetStudio(studios.takeFirst());
3769 metadata->GetPlot().isEmpty())
3771 if (metadata->GetUserRating() == 0)
3775 if (metadata->GetLength() == 0min)
3777 if (metadata->GetSeason() == 0)
3778 metadata->SetSeason(lookup->
GetSeason());
3779 if (metadata->GetEpisode() == 0)
3781 if (metadata->GetHomepage().isEmpty())
3792 for (
const auto & name : std::as_const(gueststars))
3793 actors.append(name);
3798 for (
const auto & person : std::as_const(actors))
3799 cl.append(person.name);
3801 for (
const auto & name : std::as_const(cl))
3803 QString cn = name.trimmed();
3806 cast.emplace_back(-1, cn);
3810 metadata->SetCast(cast);
3816 for (
const auto & name : std::as_const(genres))
3818 QString genre_name = name.trimmed();
3819 if (!genre_name.isEmpty())
3821 video_genres.emplace_back(-1, genre_name);
3825 metadata->SetGenres(video_genres);
3831 for (
const auto & name : std::as_const(countries))
3833 QString country_name = name.trimmed();
3834 if (!country_name.isEmpty())
3836 video_countries.emplace_back(-1, country_name);
3840 metadata->SetCountries(video_countries);
3841 metadata->SetProcessed(
true);
3843 metadata->UpdateDatabase();
3846 if (item !=
nullptr)
3862 QString message = tr(
"There are no videos in the database, would you like "
3863 "to scan your video directories now?");
3865 dialog->SetReturnEvent(
this,
"scanprompt");
3866 if (dialog->Create())
3872 #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