4 #include <QApplication>
52 bool IsValidDialogType(
int num)
55 if (num == i)
return true;
59 class ParentalLevelNotifyContainer :
public QObject
64 void SigLevelChanged();
67 ParentalLevelNotifyContainer(QObject *lparent = 0) :
70 connect(&m_levelCheck,
79 m_levelCheck.Check(m_level.GetLevel(), level.
GetLevel());
96 if (lastLevel != m_level)
98 emit SigLevelChanged();
123 bool GetLocalVideoImage(
const QString &video_uid,
const QString &filename,
124 const QStringList &in_dirs, QString &image,
125 QString title,
int season,
126 const QString host, QString sgroup,
127 int episode = 0,
bool isScreenshot =
false)
129 QStringList search_dirs(in_dirs);
130 QFileInfo qfi(filename);
131 search_dirs += qfi.absolutePath();
132 if (title.contains(
"/"))
133 title.replace(
"/",
"-");
135 const QString base_name = qfi.completeBaseName();
136 QList<QByteArray> image_types = QImageReader::supportedImageFormats();
138 typedef std::set<QString> image_type_list;
139 image_type_list image_exts;
143 if (sgroup ==
"Coverart")
145 if (sgroup ==
"Fanart")
147 if (sgroup ==
"Screenshots")
148 suffix =
"screenshot";
149 if (sgroup ==
"Banners")
152 for (QList<QByteArray>::const_iterator it = image_types.begin();
153 it != image_types.end(); ++it)
155 image_exts.insert(QString(*it).toLower());
160 QStringList hostFiles;
163 const QString hntm(
"%2.%3");
165 for (image_type_list::const_iterator ext = image_exts.begin();
166 ext != image_exts.end(); ++ext)
169 if (episode > 0 || season > 0)
172 sfn += hntm.arg(QString(
"%1 Season %2x%3_%4")
173 .arg(title).arg(QString::number(season))
174 .arg(QString::number(episode))
178 sfn += hntm.arg(QString(
"%1 Season %2_%3")
179 .arg(title).arg(QString::number(season))
186 sfn += hntm.arg(base_name +
"_%1").arg(suffix).arg(*ext);
187 sfn += hntm.arg(video_uid +
"_%1").arg(suffix).arg(*ext);
190 for (QStringList::const_iterator i = sfn.begin();
193 if (hostFiles.contains(*i))
202 const QString fntm(
"%1/%2.%3");
204 for (QStringList::const_iterator dir = search_dirs.begin();
205 dir != search_dirs.end(); ++dir)
207 if (!(*dir).length())
continue;
209 for (image_type_list::const_iterator ext = image_exts.begin();
210 ext != image_exts.end(); ++ext)
213 if (season > 0 || episode > 0)
216 sfn += fntm.arg(*dir).arg(QString(
"%1 Season %2x%3_%4")
217 .arg(title).arg(QString::number(season))
218 .arg(QString::number(episode))
221 else if (!isScreenshot)
222 sfn += fntm.arg(*dir).arg(QString(
"%1 Season %2_%3")
223 .arg(title).arg(QString::number(season))
230 sfn += fntm.arg(*dir).arg(QString(base_name +
"_%1")
231 .arg(suffix)).arg(*ext);
232 sfn += fntm.arg(*dir).arg(QString(video_uid +
"_%1")
233 .arg(suffix)).arg(*ext);
236 for (QStringList::const_iterator i = sfn.begin();
251 void PlayVideo(
const QString &filename,
254 const int WATCHED_WATERMARK = 10000;
266 playing_time.start();
273 if (item->GetChildID() > 0 && video_list.
byID(item->GetChildID()))
274 item = video_list.
byID(item->GetChildID());
278 while (item && playing_time.elapsed() > WATCHED_WATERMARK);
281 class FanartLoader:
public QObject
286 FanartLoader() : itemsPast(0), m_fanart(NULL)
288 connect(&m_fanartTimer, SIGNAL(
timeout()), SLOT(fanartLoad()));
293 m_fanartTimer.stop();
294 m_fanartTimer.disconnect(
this);
297 void LoadImage(
const QString &filename,
MythUIImage *image)
299 bool wasActive = m_fanartTimer.isActive();
300 if (filename.isEmpty())
303 m_fanartTimer.stop();
310 QMutexLocker locker(&m_fanartLock);
312 if (filename != m_fanart->GetFilename())
315 m_fanartTimer.stop();
320 m_fanart->SetFilename(filename);
321 m_fanartTimer.setSingleShot(
true);
322 m_fanartTimer.start(300);
335 void fanartLoad(
void)
337 QMutexLocker locker(&m_fanartLock);
345 QTimer m_fanartTimer;
348 FanartLoader fanartLoader;
350 struct CopyMetadataDestination
352 virtual void handleText(
const QString &
name,
const QString &value) = 0;
353 virtual void handleState(
const QString &
name,
const QString &value) = 0;
354 virtual void handleImage(
const QString &
name,
355 const QString &filename) = 0;
358 class ScreenCopyDest :
public CopyMetadataDestination
363 void handleText(
const QString &
name,
const QString &value)
368 void handleState(
const QString &
name,
const QString &value)
370 handleText(name, value);
373 void handleImage(
const QString &
name,
const QString &filename)
379 if (name !=
"fanart")
381 if (!filename.isEmpty())
391 fanartLoader.LoadImage(filename, image);
400 class MythUIButtonListItemCopyDest :
public CopyMetadataDestination
406 void handleText(
const QString &name,
const QString &value)
408 m_item->SetText(value, name);
411 void handleState(
const QString &name,
const QString &value)
413 m_item->DisplayState(value, name);
416 void handleImage(
const QString &name,
const QString &filename)
427 CopyMetadataDestination &
dest)
429 typedef std::map<QString, QString> valuelist;
449 tmp[
"coverart"] = coverfile;
451 tmp[
"coverfile"] = coverfile;
453 QString screenshotfile;
466 tmp[
"screenshot"] = screenshotfile;
468 tmp[
"screenshotfile"] = screenshotfile;
483 tmp[
"banner"] = bannerfile;
485 tmp[
"bannerfile"] = bannerfile;
500 tmp[
"fanart"] = fanartfile;
502 tmp[
"fanartfile"] = fanartfile;
505 tmp[
"studiostate"] = metadata->
GetStudio();
506 tmp[
"userratingstate"] =
515 helper(valuelist &values, CopyMetadataDestination &
d) :
516 m_vallist(values), m_dest(d) {}
518 void handleImage(
const QString &name)
520 m_dest.handleImage(name, m_vallist[name]);
523 void handleState(
const QString &name)
525 m_dest.handleState(name, m_vallist[name]);
528 valuelist &m_vallist;
529 CopyMetadataDestination &m_dest;
534 h.handleImage(
"coverart");
535 h.handleImage(
"screenshot");
536 h.handleImage(
"banner");
537 h.handleImage(
"fanart");
539 h.handleState(
"trailerstate");
540 h.handleState(
"userratingstate");
541 h.handleState(
"watchedstate");
542 h.handleState(
"videolevel");
588 ScreenCopyDest
dest(
this);
610 bool handled =
false;
611 for (QStringList::const_iterator key = actions.begin();
612 key != actions.end(); ++key)
615 if (*key ==
"SELECT" || *key ==
"PLAYBACK")
658 typedef std::list<std::pair<QString, ParentalLevel::Level> >
662 public std::binary_function<parental_level_map::value_type,
663 parental_level_map::value_type, bool>
666 const parental_level_map::value_type &rhs)
const
668 return lhs.first.length() < rhs.first.length();
687 QString ratingstring =
689 .arg(sl.GetLevel()));
690 QStringList ratings =
691 ratingstring.split(
':', QString::SkipEmptyParts);
693 for (QStringList::const_iterator
p = ratings.begin();
694 p != ratings.end(); ++
p)
697 parental_level_map::value_type(*
p, sl.GetLevel()));
739 if (rating.indexOf(
p->first) != -1)
814 QTimer::singleShot(3000,
this, SLOT(
OnTimeUp()));
834 return VideoDialogPrivate::m_savedPtr;
840 m_videoButtonList(0), m_videoButtonTree(0), m_titleText(0),
841 m_novideoText(0), m_positionText(0), m_crumbText(0), m_coverImage(0),
842 m_screenshot(0), m_banner(0), m_fanart(0), m_trailerState(0),
843 m_parentalLevelState(0), m_watchedState(0), m_studioState(0)
856 GetNumSetting(
"VideoDefaultParentalLevel",
911 QString windowName =
"videogallery";
912 int flatlistDefault = 0;
917 windowName =
"browser";
921 windowName =
"gallery";
929 windowName =
"manager";
1002 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen '" + windowName +
"'");
1088 QString message = tr(
"The video scan found no files, have you "
1089 "configured a video storage group?");
1148 QStringList lastTreeNodePath =
gCoreContext->
GetSetting(
"mythvideo.VideoTreeLastActive",
"").split(
"\n");
1152 if (!lastTreeNodePath.isEmpty())
1157 for (
int i = 0; i < lastTreeNodePath.size(); i++)
1165 if (node->
GetText().compare(lastTreeNodePath.at(i)) == 0)
1171 i < lastTreeNodePath.size()-1)
1177 if (lastTreeNodePath.at(i) == lastTreeNodePath.last())
1178 selectedNode = node;
1188 typedef QList<MythGenericTree *> MGTreeChildList;
1191 for (MGTreeChildList::const_iterator
p = lchildren->begin();
1192 p != lchildren->end(); ++
p)
1200 item->
SetData(qVariantFromValue(*
p));
1204 if (*
p == selectedNode)
1229 metadata->
toMap(metadataMap);
1233 MythUIButtonListItemCopyDest
dest(item);
1234 CopyMetadataToUI(metadata, dest);
1238 if (parent && metadata && ((QString::compare(parent->
GetText(),
1239 metadata->
GetTitle(), Qt::CaseInsensitive) == 0) ||
1240 parent->
GetText().startsWith(tr(
"Season"), Qt::CaseInsensitive)))
1242 else if (metadata && !metadata->
GetSubtitle().isEmpty())
1252 if (!screenshot.isEmpty() && parent && metadata &&
1253 ((QString::compare(parent->
GetText(),
1254 metadata->
GetTitle(), Qt::CaseInsensitive) == 0) ||
1255 parent->
GetText().startsWith(tr(
"Season"), Qt::CaseInsensitive)))
1261 if (coverimage.isEmpty())
1266 int nodeInt = node->
getInt();
1268 if (coverimage.isEmpty() && nodeInt ==
kSubFolder)
1271 item->
SetImage(coverimage,
"coverart");
1273 if (screenshot.isEmpty() && nodeInt ==
kSubFolder)
1276 item->
SetImage(screenshot,
"screenshot");
1278 if (banner.isEmpty() && nodeInt ==
kSubFolder)
1283 if (fanart.isEmpty() && nodeInt ==
kSubFolder)
1351 QString result =
"";
1353 LOG(VB_GENERAL, LOG_DEBUG, QString(
"RemoteImageCheck(%1)").arg(filename));
1358 if (!dirs.isEmpty())
1360 for (QStringList::const_iterator iter = dirs.begin();
1361 iter != dirs.end(); ++iter)
1364 QString path = sgurl.path();
1366 QString fname = QString(
"%1/%2").arg(path).arg(filename);
1368 QStringList list( QString(
"QUERY_SG_FILEQUERY") );
1375 if (!ok || list.at(0).startsWith(
"SLAVE UNREACHABLE"))
1377 LOG(VB_GENERAL, LOG_WARNING,
1378 QString(
"Backend : %1 currently Unreachable. Skipping "
1379 "this one.") .arg(host));
1383 if ((!list.isEmpty()) && (list.at(0) == fname))
1386 if (!result.isEmpty())
1389 LOG(VB_GENERAL, LOG_DEBUG,
1390 QString(
"RemoteImageCheck(%1) res :%2: :%3:")
1391 .arg(fname).arg(result).arg(*iter));
1409 QString host = metadata->
GetHost();
1411 QDir dir = fullpath.dir();
1412 QString
prefix = QDir::cleanPath(dir.path());
1414 QString filename = QString(
"%1/folder").arg(prefix);
1416 QStringList test_files;
1417 test_files.append(filename +
".png");
1418 test_files.append(filename +
".jpg");
1419 test_files.append(filename +
".gif");
1422 for (QStringList::const_iterator tfp = test_files.begin();
1423 tfp != test_files.end(); ++tfp)
1425 QString imagePath = *tfp;
1427 if (!host.isEmpty())
1430 imagePath.replace(
"//",
"/");
1431 prefix.replace(
"//",
"/");
1432 imagePath = imagePath.right(imagePath.length() - (prefix.length() + 1));
1435 if (!tmpCover.isEmpty())
1438 imagePath = tmpCover;
1446 icon_file = imagePath;
1453 if (icon_file.isEmpty())
1455 QStringList imageTypes;
1456 imageTypes.append(metadata->
GetTitle() +
".png");
1457 imageTypes.append(metadata->
GetTitle() +
".jpg");
1458 imageTypes.append(metadata->
GetTitle() +
".gif");
1459 imageTypes.append(
"*.png");
1460 imageTypes.append(
"*.jpg");
1461 imageTypes.append(
"*.gif");
1465 if (!host.isEmpty())
1471 if (!dirs.isEmpty())
1473 for (QStringList::const_iterator iter = dirs.begin();
1474 iter != dirs.end(); ++iter)
1477 QString path = sgurl.path();
1481 path = path +
"/" + subdir;
1482 QStringList tmpList;
1487 for (QStringList::const_iterator pattern = imageTypes.begin();
1488 pattern != imageTypes.end(); ++pattern)
1490 QRegExp rx(*pattern);
1491 rx.setPatternSyntax(QRegExp::Wildcard);
1492 QStringList matches = tmpList.filter(rx);
1493 if (!matches.isEmpty())
1496 fList.append(subdir +
"/" + matches.at(0).split(
"::").at(1));
1508 QDir vidDir(prefix);
1509 vidDir.setNameFilters(imageTypes);
1510 fList = vidDir.entryList();
1513 if (!fList.isEmpty())
1516 icon_file = QString(
"%1/%2")
1524 if (!icon_file.isEmpty())
1525 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Found Image : %1 :")
1528 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Could not find cover Image : %1 ")
1543 int nodeInt = node->
getInt();
1554 if (folder_path.startsWith(
"myth://"))
1555 folder_path = folder_path.right(folder_path.length()
1556 - folder_path.lastIndexOf(
"//") - 1);
1558 QString filename = QString(
"%1/folder").arg(folder_path);
1561 LOG(VB_GENERAL, LOG_DEBUG,
1562 QString(
"GetCoverImage host : %1 prefix : %2 file : %3")
1563 .arg(host).arg(prefix).arg(filename));
1566 QStringList test_files;
1567 test_files.append(filename +
".png");
1568 test_files.append(filename +
".jpg");
1569 test_files.append(filename +
".gif");
1572 for (QStringList::const_iterator tfp = test_files.begin();
1573 tfp != test_files.end(); ++tfp)
1575 QString imagePath = *tfp;
1577 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Cover check :%1 : ").arg(*tfp));
1581 if (!host.isEmpty())
1584 imagePath.replace(
"//",
"/");
1585 prefix.replace(
"//",
"/");
1586 imagePath = imagePath.right(imagePath.length() - (prefix.length() + 1));
1589 if (!tmpCover.isEmpty())
1592 imagePath = tmpCover;
1600 icon_file = imagePath;
1606 if (icon_file.isEmpty())
1608 QStringList imageTypes;
1609 imageTypes.append(
"*.png");
1610 imageTypes.append(
"*.jpg");
1611 imageTypes.append(
"*.gif");
1615 if (!host.isEmpty())
1621 if (!dirs.isEmpty())
1623 for (QStringList::const_iterator iter = dirs.begin();
1624 iter != dirs.end(); ++iter)
1627 QString path = sgurl.path();
1629 QString subdir = folder_path.right(folder_path.length() - (prefix.length() + 2));
1631 path = path +
"/" + subdir;
1633 QStringList tmpList;
1638 for (QStringList::const_iterator pattern = imageTypes.begin();
1639 pattern != imageTypes.end(); ++pattern)
1641 QRegExp rx(*pattern);
1642 rx.setPatternSyntax(QRegExp::Wildcard);
1643 QStringList matches = tmpList.filter(rx);
1644 if (!matches.isEmpty())
1647 fList.append(subdir +
"/" + matches.at(0).split(
"::").at(1));
1660 QDir vidDir(folder_path);
1661 vidDir.setNameFilters(imageTypes);
1662 fList = vidDir.entryList();
1666 if (icon_file.isEmpty())
1671 for (
int i = 0; i < list_count; i++)
1679 if (!metadata->
GetHost().isEmpty() &&
1684 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1687 icon_file = test_file;
1694 if (!test_file.isEmpty() &&
1697 icon_file = test_file;
1707 if (!fList.isEmpty())
1710 icon_file = QString(
"%1/%2")
1718 if (!icon_file.isEmpty())
1719 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Found Image : %1 :")
1722 LOG(VB_GENERAL, LOG_DEBUG,
1723 QString(
"Could not find folder cover Image : %1 ")
1728 const VideoMetadata *metadata = GetMetadataPtrFromNode(node);
1764 QString gpnode,
int levels)
1766 if (!node || type.isEmpty())
1774 QList<MythGenericTree *> subDirs;
1777 for (
int i = 0; i < list_count; i++)
1789 QString host = metadata->
GetHost();
1790 QString title = metadata->
GetTitle();
1792 if (type ==
"Coverart" && !host.isEmpty() &&
1798 else if (type ==
"Coverart")
1801 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1803 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1805 icon_file = test_file;
1809 if (type ==
"Fanart" && !host.isEmpty() &&
1815 else if (type ==
"Fanart")
1818 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1820 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1822 icon_file = test_file;
1826 if (type ==
"Banners" && !host.isEmpty() &&
1832 else if (type ==
"Banners")
1835 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1837 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1839 icon_file = test_file;
1843 if (type ==
"Screenshots" && !host.isEmpty() &&
1849 else if (type ==
"Screenshots")
1852 if (!test_file.endsWith(
"/") && !test_file.isEmpty() &&
1854 (QString::compare(gpnode, title, Qt::CaseInsensitive) == 0)))
1856 icon_file = test_file;
1862 if (icon_file.isEmpty() && !subDirs.isEmpty())
1865 int subDirCount = subDirs.count();
1866 for (
int i = 0; i < subDirCount; i ++)
1868 if (levels < maxRecurse)
1872 if (!test_file.isEmpty())
1874 icon_file = test_file;
1890 const int nodeInt = node->
getInt();
1900 const VideoMetadata *metadata = GetMetadataPtrFromNode(node);
1930 const int nodeInt = node->
getInt();
1936 const VideoMetadata *metadata = GetMetadataPtrFromNode(node);
1941 !metadata->
GetBanner().startsWith(
"/") &&
1965 const int nodeInt = node->
getInt();
1971 const VideoMetadata *metadata = GetMetadataPtrFromNode(node);
1976 !metadata->
GetFanart().startsWith(
"/") &&
2003 bool handled =
false;
2004 QStringList actions;
2007 for (
int i = 0; i < actions.size() && !handled; i++)
2009 QString
action = actions[i];
2012 if (action ==
"INFO")
2019 else if (action ==
"INCPARENT")
2021 else if (action ==
"DECPARENT")
2023 else if (action ==
"1" || action ==
"2" ||
2024 action ==
"3" || action ==
"4")
2026 else if (action ==
"FILTER")
2028 else if (action ==
"MENU")
2033 else if (action ==
"PLAYALT")
2039 else if (action ==
"DOWNLOADDATA")
2044 else if (action ==
"INCSEARCH")
2046 else if (action ==
"ITEMDETAIL")
2048 else if (action ==
"DELETE")
2055 else if (action ==
"ESCAPE")
2073 for (
int i = 0; i < actions.size() && !handled; i++)
2075 QString
action = actions[i];
2076 if (action ==
"PLAYBACK")
2099 QString message = title;
2102 "mythvideobusydialog");
2114 QString message = title;
2129 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Jumping to: %1").arg(
string));
2132 QStringList childList;
2133 QList<MythGenericTree*>::iterator it;
2134 QList<MythGenericTree*> *children;
2135 QMap<int, QString> idTitle;
2142 for (it = children->begin(); it != children->end(); ++it)
2145 QString title = child->
GetText();
2147 idTitle.insert(
id, title);
2172 QStringList childList;
2173 QList<MythGenericTree*>::iterator it;
2174 QList<MythGenericTree*> *children;
2180 for (it = children->begin(); it != children->end(); ++it)
2183 childList << child->
GetText();
2189 tr(
"Video Search"), childList,
false,
"");
2191 if (searchDialog->
Create())
2193 connect(searchDialog, SIGNAL(haveResult(QString)),
2199 delete searchDialog;
2208 bool handled =
false;
2279 metadata->
toMap(metadataMap);
2289 ScreenCopyDest
dest(
this);
2290 CopyMetadataToUI(metadata, dest);
2334 label = tr(
"Video Options\n%1\n%2").arg(metadata->
GetTitle())
2337 label = tr(
"Video Options\n%1").arg(metadata->
GetTitle());
2340 label = tr(
"Video Options");
2387 label = tr(
"Playback Options\n%1").arg(metadata->
GetTitle());
2405 QString trailerFile = metadata->
GetTrailer();
2407 (!metadata->
GetHost().isEmpty() && !trailerFile.isEmpty()))
2421 QString label = tr(
"Video Display Menu");
2446 QString label = tr(
"Change View");
2482 QString label = tr(
"Video Settings");
2541 QString label = tr(
"Browse By");
2584 QString label = tr(
"Video Info");
2596 if (!metadata->
GetCast().empty())
2611 QString label = tr(
"Manage Video Details");
2696 int nodeInt = node->
getInt();
2870 screenStack->
PopScreen(
this,
false,
false);
2875 ShowOkPopup(tr(
"An error occurred when switching views."));
2889 if (plotdialog->
Create())
2927 if (castdialog->
Create())
2946 if (browser.isEmpty())
2948 ShowOkPopup(tr(
"No browser command set! MythVideo needs MythBrowser "
2949 "installed to display the homepage."));
2953 if (browser.toLower() ==
"internal")
2960 QString cmd = browser;
2961 cmd.replace(
"%ZOOM%", zoom);
2962 cmd.replace(
"%URL%", url);
2963 cmd.replace(
'\'',
"%27");
2964 cmd.replace(
"&",
"\\&");
2965 cmd.replace(
";",
"\\;");
3003 const int WATCHED_WATERMARK = 10000;
3012 if (node && !(node->
getInt() >= 0))
3019 bool video_started =
false;
3021 while (i < list_count &&
3022 (!video_started || playing_time.elapsed() > WATCHED_WATERMARK))
3030 playing_time.start();
3031 video_started =
true;
3045 SimpleCollect(QStringList &fileList) : m_fileList(fileList) {}
3048 const QString &fqDirName)
3055 void handleFile(
const QString &fileName,
const QString &fqFileName,
3056 const QString &extension,
const QString &host)
3061 m_fileList.push_back(fqFileName);
3065 QStringList &m_fileList;
3068 QStringList GetTrailersInDirectory(
const QString &startDir)
3074 SimpleCollect sc(ret);
3088 if (!metadata)
return;
3090 QStringList trailers = GetTrailersInDirectory(
gCoreContext->
3091 GetSetting(
"mythvideo.TrailersDir"));
3093 if (trailers.isEmpty())
3096 const int trailersToPlay =
3100 while (!trailers.isEmpty() && i < trailersToPlay)
3103 QString trailer = trailers.takeAt(
random() % trailers.size());
3105 LOG(VB_GENERAL, LOG_DEBUG,
3106 QString(
"Random trailer to play will be: %1").arg(trailer));
3121 if (!metadata)
return;
3149 .GetLevel() + amount).GetLevel());
3163 if (filterdialog->
Create())
3166 connect(filterdialog, SIGNAL(filterChanged()), SLOT(
reloadData()));
3182 int nodeInt = node->
getInt();
3185 metadata = GetMetadataPtrFromNode(node);
3209 if (list.count() > 1)
3216 Qt::QueuedConnection);
3218 if (resultsdialog->
Create())
3255 qVariantValue<VideoMetadata *>(lookup->
GetData());
3261 LOG(VB_GENERAL, LOG_INFO,
3262 QString(
"No results found for %1 %2 %3").arg(lookup->
GetTitle())
3268 QString
id = dce->
GetId();
3270 if (
id ==
"scanprompt")
3315 QList<MythGenericTree*>::iterator it;
3316 QList<MythGenericTree*> *children;
3317 QMap<int, int> idPosition;
3321 for (it = children->begin(); it != children->end(); ++it)
3324 int nodeInt = child->
getInt();
3328 GetMetadataPtrFromNode(child);
3332 int id = listmeta->
GetID();
3333 idPosition.insert(
id, position);
3359 QString msg = tr(
"Fetching details for %1")
3362 msg += QString(
": %1").arg(metadata->
GetSubtitle());
3364 msg += tr(
" %1x%2").arg(metadata->
GetSeason())
3374 typedef QList<MythGenericTree *> MGTreeChildList;
3377 LOG(VB_GENERAL, LOG_DEBUG,
3378 QString(
"Fetching details in %1").arg(node->
GetText()));
3380 for (MGTreeChildList::const_iterator
p = lchildren->begin();
3381 p != lchildren->end(); ++
p)
3431 curshowlevel += amount;
3451 "mythvideoeditmetadata", metadata,
3454 connect(md_editor, SIGNAL(Finished()), SLOT(
refreshData()));
3467 QString message = tr(
"Are you sure you want to permanently delete:\n%1")
3473 if (confirmdialog->
Create())
3476 connect(confirmdialog, SIGNAL(haveResult(
bool)),
3505 QString message = tr(
"Failed to delete file");
3510 if (confirmdialog->
Create())
3533 QStringList cover_dirs;
3539 QString title = metadata->
GetTitle();
3541 QString host = metadata->
GetHost();
3547 if (GetLocalVideoImage(inetref, filename,
3548 cover_dirs, cover_file, title,
3549 season, host,
"Coverart", episode))
3556 QStringList fanart_dirs;
3559 QString fanart_file;
3563 if (GetLocalVideoImage(inetref, filename,
3564 fanart_dirs, fanart_file, title,
3565 season, host,
"Fanart", episode))
3572 QStringList banner_dirs;
3575 QString banner_file;
3579 if (GetLocalVideoImage(inetref, filename,
3580 banner_dirs, banner_file, title,
3581 season, host,
"Banners", episode))
3588 QStringList screenshot_dirs;
3591 QString screenshot_file;
3595 if (GetLocalVideoImage(inetref, filename,
3596 screenshot_dirs, screenshot_file, title,
3597 season, host,
"Screenshots", episode,
3635 if (director.count() > 0)
3641 if (studios.count() > 0)
3642 metadata->
SetStudio(studios.takeFirst());
3645 metadata->
GetPlot().isEmpty())
3668 for (QList<PersonInfo>::const_iterator
p = gueststars.begin();
3669 p != gueststars.end(); ++
p)
3677 for (QList<PersonInfo>::const_iterator
p = actors.begin();
3678 p != actors.end(); ++
p)
3680 cl.append((*p).name);
3683 for (QStringList::const_iterator
p = cl.begin();
3686 QString cn = (*p).trimmed();
3690 value_type(-1, cn));
3700 for (QStringList::const_iterator
p = genres.begin();
3701 p != genres.end(); ++
p)
3703 QString genre_name = (*p).trimmed();
3704 if (genre_name.length())
3706 video_genres.push_back(
3707 VideoMetadata::genre_list::value_type(-1, genre_name));
3717 for (QStringList::const_iterator
p = countries.begin();
3718 p != countries.end(); ++
p)
3720 QString country_name = (*p).trimmed();
3721 if (country_name.length())
3723 video_countries.push_back(
3724 VideoMetadata::country_list::value_type(-1,
3754 QString message = tr(
"There are no videos in the database, would you like "
3755 "to scan your video directories now?");
3766 #include "videodlg.moc"