MythTV  master
videolist.cpp
Go to the documentation of this file.
1 #include <algorithm>
2 #include <iterator>
3 #include <map>
4 using namespace std;
5 
6 #include <QFileInfo>
7 #include <QList>
8 #include <QScopedPointer>
9 #include <utility>
10 
11 #include "mythcontext.h"
12 #include "mythdate.h"
13 #include "mythmiscutil.h"
14 
15 #include "mythgenerictree.h"
17 #include "dbaccess.h"
18 #include "quicksp.h"
19 #include "dirscan.h"
20 #include "videoutils.h"
21 #include "parentalcontrols.h"
22 
23 #include "videofilter.h"
24 #include "videolist.h"
25 #include "videodlg.h"
26 
27 #include "upnpscanner.h"
28 
30 {
31  public:
32  explicit TreeNodeDataPrivate(VideoMetadata *metadata) :
33  m_metadata(metadata)
34  {
35  if (m_metadata)
36  m_host = m_metadata->GetHost();
37  else
38  m_host = "";
39  }
40 
41  TreeNodeDataPrivate(QString path, QString host, QString prefix) :
42  m_host(std::move(host)), m_path(std::move(path)), m_prefix(std::move(prefix))
43  {
44  }
45 
47  {
48  return m_metadata;
49  }
50 
51  const VideoMetadata *GetMetadata(void) const
52  {
53  return m_metadata;
54  }
55 
56  QString GetPath(void) const
57  {
58  return m_path;
59  }
60 
61  QString GetHost(void) const
62  {
63  return m_host;
64  }
65 
66  QString GetPrefix(void) const
67  {
68  return m_prefix;
69  }
70 
71  private:
72  VideoMetadata *m_metadata {nullptr};
73  QString m_host;
74  QString m_path;
75  QString m_prefix;
76 };
77 
79 {
80  m_d = new TreeNodeDataPrivate(metadata);
81 }
82 
83 TreeNodeData::TreeNodeData(QString path, QString host, QString prefix)
84 {
85  m_d = new TreeNodeDataPrivate(std::move(path), std::move(host), std::move(prefix));
86 }
87 
89 {
90  *this = other;
91 }
92 
94 {
95  if (this != &rhs)
96  {
97  delete m_d;
98  m_d = new TreeNodeDataPrivate(*rhs.m_d);
99  }
100 
101  return *this;
102 }
103 
105 {
106  delete m_d;
107 }
108 
110 {
111  if (m_d)
112  return m_d->GetMetadata();
113 
114  return nullptr;
115 }
116 
117 const VideoMetadata *TreeNodeData::GetMetadata(void) const
118 {
119  if (m_d)
120  return m_d->GetMetadata();
121 
122  return nullptr;
123 }
124 
125 QString TreeNodeData::GetPath(void) const
126 {
127  if (m_d)
128  return m_d->GetPath();
129  return QString();
130 }
131 
132 QString TreeNodeData::GetHost(void) const
133 {
134  if (m_d)
135  return m_d->GetHost();
136  return QString();
137 }
138 
139 QString TreeNodeData::GetPrefix(void) const
140 {
141  if (m_d)
142  return m_d->GetPrefix();
143  return QString();
144 }
145 
148 {
149  explicit metadata_sort(const VideoFilterSettings &vfs) : m_vfs(vfs) {}
150 
151  bool operator()(const VideoMetadata *lhs, const VideoMetadata *rhs)
152  {
153  return m_vfs.meta_less_than(*lhs, *rhs);
154  }
155 
156  bool operator()(const smart_meta_node &lhs, const smart_meta_node &rhs)
157  {
158  return m_vfs.meta_less_than(*(lhs->getData()), *(rhs->getData()));
159  }
160 
161  private:
163 };
164 
166 {
167  explicit metadata_path_sort(void) = default;
168 
169  bool operator()(const VideoMetadata &lhs, const VideoMetadata &rhs)
170  {
171  return sort(&lhs, &rhs);
172  }
173 
174  bool operator()(const VideoMetadata *lhs, const VideoMetadata *rhs)
175  {
176  return sort(lhs, rhs);
177  }
178 
179  bool operator()(const smart_dir_node &lhs, const smart_dir_node &rhs)
180  {
181  return sort(lhs->getSortPath(), rhs->getSortPath());
182  }
183 
184  private:
185  static bool sort(const VideoMetadata *lhs, const VideoMetadata *rhs)
186  {
187  return sort(lhs->GetSortFilename(), rhs->GetSortFilename());
188  }
189 
190  static bool sort(const QString &lhs, const QString &rhs)
191  {
192  return naturalCompare(lhs, rhs) < 0;
193  }
194 };
195 
196 static QString path_to_node_name(const QString &path)
197 {
198  QString ret;
199  int slashLoc = path.lastIndexOf('/', -2) + 1;
200  if (path.endsWith("/"))
201  ret = path.mid(slashLoc, path.length() - slashLoc - 1);
202  else
203  ret = path.mid(slashLoc);
204 
205  return ret;
206 }
207 
210  meta_dir_node *hint = nullptr)
211 {
212  meta_dir_node *start = dir;
213  QString insert_chunk = metadata->GetFilename();
214  QString host = metadata->GetHost();
215  QString prefix = metadata->GetPrefix();
216 
217  if (hint)
218  {
219  if (metadata->GetFilename().startsWith(hint->getFQPath() + "/"))
220  {
221  start = hint;
222  insert_chunk =
223  metadata->GetFilename().mid(hint->getFQPath().length());
224  }
225  }
226 
227  if (insert_chunk.startsWith(dir->getFQPath() + "/"))
228  {
229  insert_chunk = metadata->GetFilename().mid(dir->getFQPath().length());
230  }
231 
232 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
233  QStringList path = insert_chunk.split("/", QString::SkipEmptyParts);
234 #else
235  QStringList path = insert_chunk.split("/", Qt::SkipEmptyParts);
236 #endif
237  if (path.size() > 1)
238  {
239  path.pop_back();
240  }
241  else
242  {
243  path.clear();
244  }
245 
246  for (QStringList::const_iterator p = path.begin(); p != path.end(); ++p)
247  {
248  smart_dir_node sdn = start->addSubDir(*p, "" , host, prefix);
249  start = sdn.get();
250  }
251 
252  start->addEntry(smart_meta_node(new meta_data_node(metadata)));
253 
254  return start;
255 }
256 
258 {
260  {
261  return smn->getData();
262  }
263 
265  {
266  return &data;
267  }
268 
271  {
272  return data.get();
273  }
274 };
275 
277  MythGenericTree *where_to_add,
278  const QString& name, QString fqPath, bool add_up_dirs,
279  QString host = "", QString prefix = "")
280 {
281  // Add the subdir node...
282  MythGenericTree *sub_node =
283  where_to_add->addNode(name, kSubFolder, false);
284  sub_node->SetData(QVariant::fromValue(TreeNodeData(std::move(fqPath), std::move(host), std::move(prefix))));
285  sub_node->SetText(name, "title");
286  sub_node->DisplayState("subfolder", "nodetype");
287 
288  // ...and the updir node.
289  if (add_up_dirs)
290  {
291  MythGenericTree *up_node =
292  sub_node->addNode(where_to_add->GetText(), kUpFolder,
293  true, false);
294  up_node->DisplayState("subfolder", "nodetype");
295  }
296 
297  return sub_node;
298 }
299 
300 static int AddFileNode(MythGenericTree *where_to_add, const QString& name,
301  VideoMetadata *metadata)
302 {
303  MythGenericTree *sub_node = where_to_add->addNode(name, 0, true);
304  sub_node->SetData(QVariant::fromValue(TreeNodeData(metadata)));
305 
306  // Text
307  InfoMap textMap;
308  metadata->toMap(textMap);
309  sub_node->SetTextFromMap(textMap);
310 
311  // Images
312  InfoMap imageMap;
313  metadata->GetImageMap(imageMap);
314  sub_node->SetImageFromMap(imageMap);
315  sub_node->SetImage("buttonimage", imageMap["smartimage"]);
316 
317  // Assign images to parent node if this is the first child
318  if (where_to_add->visibleChildCount() == 1 &&
319  where_to_add->getInt() == kSubFolder)
320  {
321  where_to_add->SetImageFromMap(imageMap);
322  where_to_add->SetImage("buttonimage", imageMap["smartimage"]);
323  }
324 
325  // Statetypes
326  InfoMap stateMap;
327  metadata->GetStateMap(stateMap);
328  sub_node->DisplayStateFromMap(stateMap);
329 
330  return 1;
331 }
332 
334 {
335  public:
336  using metadata_view_list = vector<VideoMetadata *>;
337 
338  private:
339  enum metadata_list_type { ltNone, ltFileSystem, ltDBMetadata,
340  ltDBGenreGroup, ltDBCategoryGroup,
341  ltDBYearGroup, ltDBDirectorGroup,
342  ltDBStudioGroup, ltDBCastGroup,
343  ltDBUserRatingGroup, ltDBInsertDateGroup,
344  ltTVMetadata};
347 
348  public:
349  VideoListImp();
350 
351  void build_generic_tree(MythGenericTree *dst, meta_dir_node *src,
352  bool include_updirs);
353  MythGenericTree *buildVideoList(
354  bool filebrowser, bool flatlist,
355  int group_type, const ParentalLevel &parental_level,
356  bool include_updirs);
357 
358  void refreshList(bool filebrowser, const ParentalLevel &parental_level,
359  bool flat_list, int group_type);
360  bool refreshNode(MythGenericTree *node);
361 
362  unsigned int count(void) const
363  {
364  return m_metadataViewFlat.size();
365  }
366 
368  {
369  return m_videoFilter;
370  }
371 
373  {
374  m_videoFilter = filter;
375  }
376 
377  int TryFilter(const VideoFilterSettings &filter) const
378  {
379  int ret = 0;
380  for (const auto & md : m_metadata.getList())
381  if (filter.matches_filter(*md)) ++ret;
382  return ret;
383  }
384 
386  {
387  return m_metadata;
388  }
389 
390  unsigned int getFilterChangedState(void)
391  {
392  return m_videoFilter.getChangedState();
393  }
394 
395  bool Delete(unsigned int video_id, VideoList &/*dummy*/)
396  {
397  bool ret = false;
398  MetadataPtr mp = m_metadata.byID(video_id);
399  if (mp)
400  {
401  ret = mp->DeleteFile();
402  if (ret)
403  {
404  ret = m_metadata.purgeByID(video_id);
405  // Force refresh
406  m_metadataListType = VideoListImp::ltNone;
407  }
408  }
409 
410  return ret;
411  }
412 
414  {
415  return m_videoTreeRoot.data();
416  }
417 
419  // Set the type to none to avoid refreshList thinking it doesn't
420  // need to.
421  m_metadataListType = VideoListImp::ltNone;
422 
423  metadata_list ml;
425  m_metadata.setList(ml);
426  }
427 
428  private:
429  void sort_view_data(bool flat_list);
430  void fillMetadata(metadata_list_type whence);
431 
432  void buildFsysList(void);
433  void buildGroupList(metadata_list_type whence);
434  void buildDbList(void);
435  void buildTVList(void);
436  void buildFileList(smart_dir_node &directory, metadata_list &metalist,
437  const QString &prefix) const;
438 
439  void update_meta_view(bool flat_list);
440 
441  private:
442  bool m_listUnknown {false};
443  bool m_loadMetaData {false};
444 
445  QScopedPointer <MythGenericTree> m_videoTreeRoot;
446 
448  meta_dir_node m_metadataTree; // master list for tree views
449 
452 
453  metadata_list_type m_metadataListType {ltNone};
454 
456 };
457 
459 {
460  m_imp = new VideoListImp;
461 }
462 
464 {
465  delete m_imp;
466 }
467 
469  bool filebrowser, bool flatlist,
470  int group_type, const ParentalLevel &parental_level,
471  bool include_updirs)
472 {
473  return m_imp->buildVideoList(filebrowser, flatlist,
474  group_type, parental_level, include_updirs);
475 }
476 
477 void VideoList::refreshList(bool filebrowser,
478  const ParentalLevel &parental_level,
479  bool flat_list, int group_type)
480 {
481  m_imp->refreshList(filebrowser, parental_level, flat_list, group_type);
482 }
483 
485 {
486  return m_imp->refreshNode(node);
487 }
488 
489 unsigned int VideoList::count(void) const
490 {
491  return m_imp->count();
492 }
493 
495 {
496  return m_imp->getCurrentVideoFilter();
497 }
498 
500 {
501  m_imp->setCurrentVideoFilter(filter);
502 }
503 
505 {
506  return m_imp->TryFilter(filter);
507 }
508 
510 {
511  return m_imp->getListCache();
512 }
513 
515 {
516  return m_imp->getFilterChangedState();
517 }
518 
519 bool VideoList::Delete(int video_id)
520 {
521  return m_imp->Delete(video_id, *this);
522 }
523 
525 {
526  return m_imp->GetTreeRoot();
527 }
528 
530 {
531  return m_imp->InvalidateCache();
532 }
533 
535 // VideoListImp
537 VideoListImp::VideoListImp() : m_metadataViewTree("", "top")
538 {
539  m_listUnknown = gCoreContext->GetBoolSetting("VideoListUnknownFileTypes", false);
540 
541  m_loadMetaData = gCoreContext->GetBoolSetting("VideoTreeLoadMetaData", false);
542 }
543 
545  bool include_updirs)
546 {
547  if (src->DataIsValid())
548  {
550  dst->SetData(src->GetData());
551  return;
552  }
553 
554  for (auto dir = src->dirs_begin();
555  dir != src->dirs_end(); ++dir)
556  {
557  if ((*dir)->has_entries())
558  {
559  bool incUpDir = include_updirs;
560  // Only include upnodes when there is a parent to move up to
561  if (!dst->getParent())
562  incUpDir = false;
563 
565  dst, (*dir)->getName(),
566  (*dir)->getFQPath(), incUpDir, (*dir)->GetHost(),
567  (*dir)->GetPrefix());
568 
569  build_generic_tree(t, dir->get(), include_updirs);
570  }
571  }
572 
573  for (auto entry = src->entries_begin();
574  entry != src->entries_end(); ++entry)
575  {
576  if (((*entry)->getData()->GetSeason() > 0) ||
577  ((*entry)->getData()->GetEpisode() > 0))
578  {
579  QString seas = QString::number((*entry)->getData()->GetSeason());
580  QString ep = QString::number((*entry)->getData()->GetEpisode());
581  QString title = (*entry)->getData()->GetTitle();
582  QString subtitle = (*entry)->getData()->GetSubtitle();
583 
584  if (ep.size() < 2)
585  ep.prepend("0");
586 
587  QString displayTitle = QString("%1 %2x%3 - %4")
588  .arg(title).arg(seas).arg(ep).arg(subtitle);
589 
590  if (src->getName() == title)
591  {
592  displayTitle = QString("%2x%3 - %4")
593  .arg(seas).arg(ep).arg(subtitle);
594  }
595  AddFileNode(dst, displayTitle, (*entry)->getData());
596  }
597  else if ((*entry)->getData()->GetSubtitle().isEmpty())
598  {
599  AddFileNode(
600  dst, (*entry)->getData()->GetTitle(), (*entry)->getData());
601  }
602  else
603  {
604  QString TitleSub = QString("%1 - %2")
605  .arg((*entry)->getData()->GetTitle())
606  .arg((*entry)->getData()->GetSubtitle());
607  AddFileNode(dst, TitleSub, (*entry)->getData());
608  }
609  }
610 }
611 
612 // Build a generic tree containing the video files. You can control the
613 // contents and the shape of the tree in de following ways:
614 // filebrowser:
615 // If true, the actual state of the filesystem is examined. If a video
616 // is already known to the system, this info is retrieved. If not, some
617 // basic info is provided.
618 // If false, only video information already present in the database is
619 // presented.
620 // flatlist:
621 // If true, the tree is reduced to a single level containing all the
622 // videos found.
623 // If false, the hierarchy present on the filesystem or in the database
624 // is preserved. In this mode, both sub-dirs and updirs are present.
626  bool filebrowser, bool flatlist, int group_type,
627  const ParentalLevel &parental_level, bool include_updirs)
628 {
629  refreshList(filebrowser, parental_level, flatlist, group_type);
630 
631  m_videoTreeRoot.reset(new MythGenericTree(QObject::tr("Video Home"),
632  kRootNode, false));
633 
635  include_updirs);
636 
637  if (m_metadataViewFlat.empty())
638  {
639  m_videoTreeRoot.reset(new MythGenericTree(QObject::tr("Video Home"),
640  kRootNode, false));
641  m_videoTreeRoot.data()->addNode(QObject::tr("No files found"),
642  kNoFilesFound, false);
643  }
644 
645  return m_videoTreeRoot.data();
646 }
647 
649 {
650  if (!node)
651  return false;
652 
653  // node->GetData() provides information on how/where to refresh the
654  // data for this node
655 
656  QVariant data = node->GetData();
657  if (!data.isValid())
658  return false;
659 
660  // currently only UPNPScanner can refresh data
661  if (UPNPScanner::Instance() && UPNPScanner::Instance()->GetMetadata(data))
662  {
663  // force a refresh
665  return true;
666  }
667 
668  return false;
669 }
670 
671 void VideoListImp::refreshList(bool filebrowser,
672  const ParentalLevel &parental_level,
673  bool flat_list, int group_type)
674 {
675 
676  m_videoFilter.setParentalLevel(parental_level.GetLevel());
677 
678  if (filebrowser)
679  {
681  }
682  else
683  {
684  switch (group_type)
685  {
688  LOG(VB_GENERAL, LOG_DEBUG, "Using Folder mode");
689  break;
692  LOG(VB_GENERAL, LOG_DEBUG, "Using Genre mode");
693  break;
696  LOG(VB_GENERAL, LOG_DEBUG, "Using Category mode");
697  break;
700  LOG(VB_GENERAL, LOG_DEBUG, "Using Year mode");
701  break;
704  LOG(VB_GENERAL, LOG_DEBUG, "Using Director mode");
705  break;
708  LOG(VB_GENERAL, LOG_DEBUG, "Using Studio mode");
709  break;
712  LOG(VB_GENERAL, LOG_DEBUG, "Using Cast Mode");
713  break;
716  LOG(VB_GENERAL, LOG_DEBUG, "Using User Rating Mode");
717  break;
720  LOG(VB_GENERAL, LOG_DEBUG, "Using Insert Date Mode");
721  break;
724  LOG(VB_GENERAL, LOG_DEBUG, "Using TV/Movie Mode");
725  break;
726  default:
728  break;
729  }
730  }
731  update_meta_view(flat_list);
732 }
733 
734 void VideoListImp::sort_view_data(bool flat_list)
735 {
736  if (flat_list)
737  {
738  sort(m_metadataViewFlat.begin(), m_metadataViewFlat.end(),
740  }
741  else
742  {
745  }
746 }
747 
749 {
750  if (m_metadataListType != whence)
751  {
752  m_metadataListType = whence;
753  // flush existing data
754  metadata_list ml;
755  m_metadata.setList(ml);
757 
758  switch (whence)
759  {
760  case ltFileSystem:
761  buildFsysList();
762  break;
763  case ltDBMetadata:
764  buildDbList();
765  break;
766  case ltTVMetadata:
767  buildTVList();
768  break;
769  case ltDBGenreGroup:
770  case ltDBCategoryGroup:
771  case ltDBYearGroup:
772  case ltDBDirectorGroup:
773  case ltDBStudioGroup:
774  case ltDBCastGroup:
775  case ltDBUserRatingGroup:
776  case ltDBInsertDateGroup:
777  buildGroupList(whence);
778  break;
779  case ltNone:
780  break;
781  }
782  }
783 }
784 
786 {
787  metadata_list ml;
789  m_metadata.setList(ml);
790 
791  metadata_view_list mlist;
792  mlist.reserve(m_metadata.getList().size());
793 
794  back_insert_iterator<metadata_view_list> mli(mlist);
795  transform(m_metadata.getList().begin(), m_metadata.getList().end(),
796  mli, to_metadata_ptr());
797 
799  sort(mlist.begin(), mlist.end(), mps);
800 
801  using group_to_node_map = map<QString, meta_dir_node *>;
802  group_to_node_map gtnm;
803 
804  meta_dir_node *video_root = &m_metadataTree;
805 
806  smart_dir_node sdn1 = video_root->addSubDir("All");
807  meta_dir_node* all_group_node = sdn1.get();
808 
809  for (auto *data : mlist)
810  {
811  all_group_node->addEntry(smart_meta_node(new meta_data_node(data)));
812 
813  vector<QString> groups;
814 
815  switch (whence)
816  {
817  case ltDBGenreGroup:
818  {
819  vector<pair <int, QString> > genres =
820  data->GetGenres();
821 
822  for (const auto& item : genres)
823  groups.push_back(item.second);
824  break;
825  }
826  case ltDBCategoryGroup:
827  {
828  groups.push_back(data->GetCategory());
829  break;
830  }
831  case ltDBYearGroup:
832  {
833  groups.push_back(QString::number(data->GetYear()));
834  break;
835  }
836  case ltDBDirectorGroup:
837  {
838  groups.push_back(data->GetDirector());
839  break;
840  }
841  case ltDBStudioGroup:
842  {
843  groups.push_back(data->GetStudio());
844  break;
845  }
846  case ltDBCastGroup:
847  {
848  vector<pair<int, QString> > cast = data->GetCast();
849 
850  for (const auto& item : cast)
851  groups.push_back(item.second);
852  break;
853  }
854  case ltDBUserRatingGroup:
855  {
856  int i = data->GetUserRating();
857  groups.push_back(QString::number(i));
858  break;
859  }
860  case ltDBInsertDateGroup:
861  {
862  QDate date = data->GetInsertdate();
863  QString tmp = MythDate::toString(
865  groups.push_back(tmp);
866  break;
867  }
868  default:
869  {
870  LOG(VB_GENERAL, LOG_ERR, "Invalid type of grouping");
871  break;
872  }
873  }
874 
875  if (groups.empty())
876  {
877  meta_dir_node *group_node = gtnm["Unknown"];
878 
879  if (group_node == nullptr)
880  {
881  smart_dir_node sdn2 = video_root->addSubDir("Unknown");
882  group_node = sdn2.get();
883  gtnm["Unknown"] = group_node;
884  }
885 
886  group_node->addEntry(smart_meta_node(new meta_data_node(data)));
887  }
888 
889  for (const auto& item : groups)
890  {
891  meta_dir_node *group_node = gtnm[item];
892 
893  if (group_node == nullptr)
894  {
895  smart_dir_node sdn2 = video_root->addSubDir(item);
896  group_node = sdn2.get();
897  gtnm[item] = group_node;
898  }
899 
900  group_node->addEntry(smart_meta_node(new meta_data_node(data)));
901  }
902  }
903 }
904 
906 {
907  metadata_list ml;
909  m_metadata.setList(ml);
910 
911  metadata_view_list mlist;
912  mlist.reserve(m_metadata.getList().size());
913 
914  back_insert_iterator<metadata_view_list> mli(mlist);
915  transform(m_metadata.getList().begin(), m_metadata.getList().end(),
916  mli, to_metadata_ptr());
917 
919  sort(mlist.begin(), mlist.end(), mps);
920 
921  meta_dir_node *video_root = &m_metadataTree;
922 
923  smart_dir_node sdn1 = video_root->addSubDir(QObject::tr("Television"));
924  meta_dir_node* television_node = sdn1.get();
925 
926  smart_dir_node vdn = video_root->addSubDir(QObject::tr("Movies"));
927  meta_dir_node* movie_node = vdn.get();
928 
929  for (auto & p : mlist)
930  {
931  VideoMetadata *data = p;
932 
933  if ((p->GetSeason() > 0) || (p->GetEpisode() > 0))
934  {
935  smart_dir_node sdn2 = television_node->addSubDir(p->GetTitle());
936  meta_dir_node* title_node = sdn2.get();
937 
938  smart_dir_node ssdn = title_node->addSubDir(
939  QObject::tr("Season %1").arg(p->GetSeason()));
940  meta_dir_node* season_node = ssdn.get();
941 
942  season_node->addEntry(smart_meta_node(new meta_data_node(data)));
943  }
944  else
945  movie_node->addEntry(smart_meta_node(new meta_data_node(data)));
946  }
947 }
948 
950 {
951  metadata_list ml;
953  m_metadata.setList(ml);
954 
955  metadata_view_list mlist;
956  mlist.reserve(m_metadata.getList().size());
957 
958  back_insert_iterator<metadata_view_list> mli(mlist);
959  transform(m_metadata.getList().begin(), m_metadata.getList().end(),
960  mli, to_metadata_ptr());
961 
962 // print_meta_list(mlist);
963 
965  sort(mlist.begin(), mlist.end(), mps);
966 
967  // TODO: break out the prefix in the DB so this isn't needed
968  using prefix_to_node_map = map<QString, meta_dir_node *>;
969  prefix_to_node_map ptnm;
970 
971  QStringList dirs = GetVideoDirs();
972 
973  if (dirs.isEmpty())
974  return;
975 
976  QString test_prefix(dirs[0]);
977 
978  meta_dir_node *video_root = &m_metadataTree;
979  if (dirs.size() == 1)
980  {
981  video_root->setPathRoot();
982  video_root->setPath(test_prefix);
983  video_root->setName("videos");
984  ptnm.insert(prefix_to_node_map::value_type(test_prefix, video_root));
985  }
986 
987  for (auto & mv : mlist)
988  AddMetadataToDir(mv, video_root);
989 
990 // print_dir_tree(m_metadataTree); // AEW DEBUG
991 }
992 
994 {
995  //
996  // Fill metadata from directory structure
997  //
998 
999  using node_to_path_list = vector<pair<QString, QString> >;
1000 
1001  node_to_path_list node_paths;
1002 
1003  QStringList dirs = GetVideoDirs();
1004  if (dirs.size() > 1)
1005  {
1006  for (QStringList::const_iterator iter = dirs.begin();
1007  iter != dirs.end(); ++iter)
1008  {
1009  node_paths.push_back(
1010  node_to_path_list::value_type(path_to_node_name(*iter),
1011  *iter));
1012  }
1013  }
1014  else
1015  {
1016  node_paths.push_back(
1017  node_to_path_list::value_type(QObject::tr("videos"), dirs[0]));
1018  }
1019 
1020  //
1021  // Add all root-nodes to the tree.
1022  //
1023  metadata_list ml;
1024  for (auto & path : node_paths)
1025  {
1026  smart_dir_node root = m_metadataTree.addSubDir(path.second, path.first);
1027  root->setPathRoot();
1028 
1029  buildFileList(root, ml, path.second);
1030  }
1031 
1032  // retrieve any MediaServer data that may be available
1033  if (UPNPScanner::Instance())
1035 
1036  // See if we can find this filename in DB
1037  if (m_loadMetaData)
1038  {
1039  // Load the DB data so metadata lookups work
1040  // TODO: ugly, pass the list
1042  metadata_list db_metadata;
1044  mdlm.setList(db_metadata);
1045  for (auto & list : ml)
1046  list->FillDataFromFilename(mdlm);
1047  }
1048  m_metadata.setList(ml);
1049 }
1050 
1051 
1053  const VideoFilterSettings &filter)
1054 {
1055  for (auto e = src.entries_begin(); e != src.entries_end(); ++e)
1056  {
1057  if (filter.matches_filter(*((*e)->getData())))
1058  {
1059  dst.addEntry(
1060  smart_meta_node(new meta_data_node((*e)->getData())));
1061  }
1062  }
1063 }
1064 
1066  const VideoFilterSettings &filter)
1067 {
1068  copy_entries(dst, src, filter);
1069  for (auto dir = src.dirs_begin(); dir != src.dirs_end(); ++dir)
1070  {
1071  smart_dir_node sdn = dst.addSubDir((*dir)->getPath(),
1072  (*dir)->getName(),
1073  (*dir)->GetHost(),
1074  (*dir)->GetPrefix(),
1075  (*dir)->GetData());
1076  copy_filtered_tree(*sdn, *(dir->get()), filter);
1077  }
1078 }
1079 
1080 void tree_view_to_flat(meta_dir_node &tree,
1083 {
1085 
1087  {
1088  tree_view_to_flat(*(sdn.get()), m_list);
1089  }
1090 
1092 };
1093 
1094 // Fills a flat view with pointers to all entries in a tree.
1097 {
1098  back_insert_iterator<VideoListImp::metadata_view_list> bip(flat);
1099  transform(tree.entries_begin(), tree.entries_end(), bip,
1100  to_metadata_ptr());
1101 
1102  for_each(tree.dirs_begin(), tree.dirs_end(), call_tree_flat(flat));
1103 }
1104 
1106 {
1107  m_metadataViewFlat.clear();
1108  m_metadataViewFlat.reserve(m_metadata.getList().size());
1109 
1111 
1112  if (flat_list)
1113  {
1114  for (const auto & md : m_metadata.getList())
1115  {
1116  if (m_videoFilter.matches_filter(*md))
1117  {
1118  m_metadataViewFlat.push_back(md.get());
1119  }
1120  }
1121 
1122  sort_view_data(flat_list);
1123 
1124  for (auto & md : m_metadataViewFlat)
1126  }
1127  else
1128  {
1132  m_videoFilter);
1133 
1134  sort_view_data(flat_list);
1135 
1137  }
1138 }
1139 
1141 {
1142  public:
1143  using free_list = list<simple_ref_ptr<DirectoryHandler> >;
1144 
1145  public:
1146  dirhandler(smart_dir_node &directory, const QString &prefix,
1148  free_list &dh_free_list, bool infer_title) :
1149  m_directory(directory), m_prefix(prefix), m_metalist(metalist),
1150  m_dhFreeList(dh_free_list), m_inferTitle(infer_title)
1151  {
1152  }
1153 
1154  DirectoryHandler *newDir(const QString &dir_name,
1155  const QString &fq_dir_name) override // DirectoryHandler
1156  {
1157  (void) fq_dir_name;
1158  smart_dir_node dir = m_directory->addSubDir(dir_name);
1160  m_dhFreeList,
1161  m_inferTitle);
1162  m_dhFreeList.push_back(dh);
1163  return dh;
1164  }
1165 
1166  void handleFile(const QString &file_name,
1167  const QString &fq_file_name,
1168  const QString &extension)
1169  {
1170  handleFile(file_name, fq_file_name, extension, "");
1171  }
1172 
1173  void handleFile(const QString &file_name,
1174  const QString &fq_file_name,
1175  const QString &extension,
1176  const QString &host) override // DirectoryHandler
1177  {
1178  (void) file_name;
1179  (void) extension;
1180  const QString& file_string(fq_file_name);
1181 
1183  new VideoMetadata(file_string));
1184  QFileInfo qfi(file_string);
1185  QString title = qfi.completeBaseName();
1186  if (m_inferTitle)
1187  {
1188  QString tmptitle(VideoMetadata::FilenameToMeta(file_string, 1));
1189  if (tmptitle.length())
1190  title = tmptitle;
1191  }
1192  myData->SetTitle(title);
1193  myData->SetPrefix(m_prefix);
1194 
1195  myData->SetHost(host);
1196  m_metalist.push_back(myData);
1197 
1198  m_directory->addEntry(new meta_data_node(myData.get()));
1199  }
1200 
1201  private:
1203  const QString &m_prefix;
1206  const bool m_inferTitle;
1207 };
1208 
1210  smart_dir_node &directory, metadata_list &metalist, const QString &prefix) const
1211 {
1214 
1216  dirhandler dh(directory, prefix, metalist, fl, false);
1217  (void) ScanVideoDirectory(
1218  directory->getFQPath(), &dh, ext_list, m_listUnknown);
1219 }
VideoMetadata::toMap
void toMap(InfoMap &metadataMap)
Definition: videometadata.cpp:1212
e
QDomElement e
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1417
VideoMetadata
Definition: videometadata.h:25
VideoListImp::getCurrentVideoFilter
const VideoFilterSettings & getCurrentVideoFilter() const
Definition: videolist.cpp:367
MythDate::toString
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:80
TreeNodeDataPrivate::m_prefix
QString m_prefix
Definition: videolist.cpp:75
call_tree_flat::call_tree_flat
call_tree_flat(VideoListImp::metadata_view_list &list)
Definition: videolist.cpp:1084
VideoList::getFilterChangedState
unsigned int getFilterChangedState()
Definition: videolist.cpp:514
VideoMetadata::FilenameToMeta
static QString FilenameToMeta(const QString &file_name, int position)
Definition: videometadata.cpp:1072
metadata_path_sort::sort
static bool sort(const VideoMetadata *lhs, const VideoMetadata *rhs)
Definition: videolist.cpp:185
TreeNodeDataPrivate::GetMetadata
const VideoMetadata * GetMetadata(void) const
Definition: videolist.cpp:51
root
QDomElement root
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:653
TreeNodeDataPrivate
Definition: videolist.cpp:30
kRootNode
@ kRootNode
Definition: videolist.h:8
metadata_sort::operator()
bool operator()(const VideoMetadata *lhs, const VideoMetadata *rhs)
Definition: videolist.cpp:151
MythGenericTree::SetData
void SetData(QVariant data)
Definition: mythgenerictree.h:87
VideoDialog::BRS_USERRATING
@ BRS_USERRATING
Definition: videodlg.h:41
FileAssociations::getExtensionIgnoreList
void getExtensionIgnoreList(ext_ignore_list &ext_ignore) const
Definition: dbaccess.cpp:810
MythGenericTree::GetText
QString GetText(const QString &name="") const
Definition: mythgenerictree.cpp:548
dirscan.h
dirhandler::m_inferTitle
const bool m_inferTitle
Definition: videolist.cpp:1206
MythGenericTree::setInt
void setInt(int an_int)
Definition: mythgenerictree.h:65
meta_node::setPathRoot
void setPathRoot(bool is_root=true)
Definition: videometadatalistmanager.cpp:223
MythGenericTree::SetTextFromMap
void SetTextFromMap(const InfoMap &infoMap, const QString &state="")
Definition: mythgenerictree.cpp:534
VideoMetadata::GetHost
const QString & GetHost() const
Definition: videometadata.cpp:1629
TreeNodeData::TreeNodeData
TreeNodeData()=default
VideoMetadataListManager
Definition: videometadatalistmanager.h:11
UPNPScanner::GetInitialMetadata
void GetInitialMetadata(VideoMetadataListManager::metadata_list *list, meta_dir_node *node)
Definition: upnpscanner.cpp:205
VideoListImp::m_metadataTree
meta_dir_node m_metadataTree
Definition: videolist.cpp:448
VideoDialog::BRS_INSERTDATE
@ BRS_INSERTDATE
Definition: videodlg.h:41
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:633
meta_dir_node::sort
void sort(DirSort dir_sort, EntrySort entry_sort)
Definition: videometadatalistmanager.h:128
simple_ref_ptr
Definition: quicksp.h:25
metadata_path_sort
Definition: videolist.cpp:166
dirhandler::handleFile
void handleFile(const QString &file_name, const QString &fq_file_name, const QString &extension, const QString &host) override
Definition: videolist.cpp:1173
VideoList::refreshList
void refreshList(bool filebrowser, const ParentalLevel &parental_level, bool flat_list, int group_type)
Definition: videolist.cpp:477
call_tree_flat::operator()
void operator()(smart_dir_node &sdn)
Definition: videolist.cpp:1086
parentalcontrols.h
metadata_sort::operator()
bool operator()(const smart_meta_node &lhs, const smart_meta_node &rhs)
Definition: videolist.cpp:156
MythGenericTree::visibleChildCount
uint visibleChildCount() const
Definition: mythgenerictree.h:91
VideoList::TryFilter
int TryFilter(const VideoFilterSettings &filter) const
Definition: videolist.cpp:504
smart_meta_node
simple_ref_ptr< meta_data_node > smart_meta_node
Definition: videometadatalistmanager.h:77
MythGenericTree::getInt
int getInt() const
Definition: mythgenerictree.h:66
VideoListImp::ltDBDirectorGroup
@ ltDBDirectorGroup
Definition: videolist.cpp:341
VideoListImp::ltDBMetadata
@ ltDBMetadata
Definition: videolist.cpp:339
meta_dir_node::entries_end
entry_iterator entries_end()
Definition: videometadatalistmanager.cpp:419
arg
arg(title).arg(filename).arg(doDelete))
MythGenericTree::GetData
QVariant GetData(void) const
Definition: mythgenerictree.h:88
VideoListImp::fillMetadata
void fillMetadata(metadata_list_type whence)
Definition: videolist.cpp:748
TreeNodeDataPrivate::GetMetadata
VideoMetadata * GetMetadata(void)
Definition: videolist.cpp:46
dirhandler::m_prefix
const QString & m_prefix
Definition: videolist.cpp:1203
VideoListImp::ltFileSystem
@ ltFileSystem
Definition: videolist.cpp:339
meta_dir_node
Definition: videometadatalistmanager.h:83
meta_dir_node::setName
void setName(const QString &name)
Definition: videometadatalistmanager.cpp:270
VideoListImp::ltDBUserRatingGroup
@ ltDBUserRatingGroup
Definition: videolist.cpp:343
MythGenericTree::SetImageFromMap
void SetImageFromMap(const InfoMap &infoMap)
Definition: mythgenerictree.cpp:563
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
TreeNodeDataPrivate::GetPath
QString GetPath(void) const
Definition: videolist.cpp:56
MythGenericTree::DisplayStateFromMap
void DisplayStateFromMap(const InfoMap &infoMap)
Definition: mythgenerictree.cpp:581
dirhandler::free_list
list< simple_ref_ptr< DirectoryHandler > > free_list
Definition: videolist.cpp:1143
VideoMetadataListManager::getList
const metadata_list & getList() const
Definition: videometadatalistmanager.cpp:165
meta_dir_node::addEntry
void addEntry(const smart_meta_node &entry)
Definition: videometadatalistmanager.cpp:372
VideoMetadataListManager::setList
void setList(metadata_list &list)
Definition: videometadatalistmanager.cpp:159
VideoListImp::VideoListImp
VideoListImp()
Definition: videolist.cpp:537
VideoListImp::ltDBYearGroup
@ ltDBYearGroup
Definition: videolist.cpp:341
call_tree_flat::m_list
VideoListImp::metadata_view_list & m_list
Definition: videolist.cpp:1091
TreeNodeData
Definition: videolist.h:66
meta_dir_node::DataIsValid
bool DataIsValid(void) const
Definition: videometadatalistmanager.cpp:327
to_metadata_ptr
Definition: videolist.cpp:258
meta_dir_node::dirs_begin
dir_iterator dirs_begin()
Definition: videometadatalistmanager.cpp:394
metadata_path_sort::operator()
bool operator()(const smart_dir_node &lhs, const smart_dir_node &rhs)
Definition: videolist.cpp:179
VideoDialog::BRS_STUDIO
@ BRS_STUDIO
Definition: videodlg.h:42
hardwareprofile.distros.mythtv_data.data_mythtv.prefix
string prefix
Definition: data_mythtv.py:40
VideoList::InvalidateCache
void InvalidateCache()
Definition: videolist.cpp:529
VideoDialog::BRS_CATEGORY
@ BRS_CATEGORY
Definition: videodlg.h:39
VideoListImp::buildTVList
void buildTVList(void)
Definition: videolist.cpp:905
VideoMetadataListManager::loadAllFromDatabase
static void loadAllFromDatabase(metadata_list &items, const QString &sql="")
Load videometadata database into memory.
Definition: videometadatalistmanager.cpp:128
VideoList::buildVideoList
MythGenericTree * buildVideoList(bool filebrowser, bool flatlist, int group_type, const ParentalLevel &parental_level, bool include_updirs)
Definition: videolist.cpp:468
tmp
static guint32 * tmp
Definition: goom_core.cpp:30
dbaccess.h
VideoDialog::BRS_CAST
@ BRS_CAST
Definition: videodlg.h:40
VideoListImp::m_videoTreeRoot
QScopedPointer< MythGenericTree > m_videoTreeRoot
Definition: videolist.cpp:445
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
MythGenericTree::addNode
MythGenericTree * addNode(const QString &a_string, int an_int=0, bool selectable_flag=false, bool visible=true)
Definition: mythgenerictree.cpp:87
videofilter.h
TreeNodeDataPrivate::GetPrefix
QString GetPrefix(void) const
Definition: videolist.cpp:66
VideoList::VideoList
VideoList()
Definition: videolist.cpp:458
VideoListImp::metadata_list_type
metadata_list_type
Definition: videolist.cpp:339
dirhandler::handleFile
void handleFile(const QString &file_name, const QString &fq_file_name, const QString &extension)
Definition: videolist.cpp:1166
TreeNodeData::GetPath
QString GetPath() const
Definition: videolist.cpp:125
to_metadata_ptr::operator()
VideoMetadata * operator()(const VideoMetadataListManager::VideoMetadataPtr &data)
Definition: videolist.cpp:269
VideoListImp::m_loadMetaData
bool m_loadMetaData
Definition: videolist.cpp:443
VideoDialog::BRS_TVMOVIE
@ BRS_TVMOVIE
Definition: videodlg.h:42
VideoListImp::buildFsysList
void buildFsysList(void)
Definition: videolist.cpp:993
VideoList::Delete
bool Delete(int video_id)
Definition: videolist.cpp:519
mythdate.h
VideoMetadata::GetFilename
const QString & GetFilename() const
Definition: videometadata.cpp:1609
kSubFolder
@ kSubFolder
Definition: videolist.h:6
meta_dir_node::addSubDir
smart_dir_node addSubDir(const QString &subdir, const QString &name="", const QString &host="", const QString &prefix="", const QVariant &data=QVariant())
Definition: videometadatalistmanager.cpp:332
to_metadata_ptr::operator()
VideoMetadata * operator()(VideoMetadata &data)
Definition: videolist.cpp:264
videolist.h
VideoListImp::m_metadataViewTree
meta_dir_node m_metadataViewTree
Definition: videolist.cpp:451
GetVideoDirs
QStringList GetVideoDirs()
Definition: videoutils.cpp:125
TreeNodeData::GetMetadata
VideoMetadata * GetMetadata()
Definition: videolist.cpp:109
hardwareprofile.config.p
p
Definition: config.py:33
meta_node::getFQPath
const QString & getFQPath()
Definition: videometadatalistmanager.cpp:199
hardwareprofile.i18n.t
t
Definition: i18n.py:36
FileAssociations::ext_ignore_list
std::vector< std::pair< QString, bool > > ext_ignore_list
Definition: dbaccess.h:155
VideoListImp::metadata_list
VideoMetadataListManager::metadata_list metadata_list
Definition: videolist.cpp:345
VideoListImp::ltDBCategoryGroup
@ ltDBCategoryGroup
Definition: videolist.cpp:340
TreeNodeDataPrivate::TreeNodeDataPrivate
TreeNodeDataPrivate(QString path, QString host, QString prefix)
Definition: videolist.cpp:41
MythGenericTree::SetImage
void SetImage(const QString &filename, const QString &name="")
Definition: mythgenerictree.cpp:557
metadata_path_sort::operator()
bool operator()(const VideoMetadata *lhs, const VideoMetadata *rhs)
Definition: videolist.cpp:174
metadata_sort::metadata_sort
metadata_sort(const VideoFilterSettings &vfs)
Definition: videolist.cpp:149
copy_entries
static void copy_entries(meta_dir_node &dst, meta_dir_node &src, const VideoFilterSettings &filter)
Definition: videolist.cpp:1052
dirhandler::m_dhFreeList
free_list & m_dhFreeList
Definition: videolist.cpp:1205
VideoListImp::m_listUnknown
bool m_listUnknown
Definition: videolist.cpp:442
VideoDialog::BRS_YEAR
@ BRS_YEAR
Definition: videodlg.h:40
copy_filtered_tree
static void copy_filtered_tree(meta_dir_node &dst, meta_dir_node &src, const VideoFilterSettings &filter)
Definition: videolist.cpp:1065
VideoList::getCurrentVideoFilter
const VideoFilterSettings & getCurrentVideoFilter() const
Definition: videolist.cpp:494
metadata_sort::m_vfs
const VideoFilterSettings & m_vfs
Definition: videolist.cpp:162
VideoMetadata::GetImageMap
void GetImageMap(InfoMap &imageMap)
Definition: videometadata.cpp:1280
VideoMetadata::GetSortFilename
const QString & GetSortFilename() const
Definition: videometadata.cpp:1614
mythgenerictree.h
VideoListImp::getFilterChangedState
unsigned int getFilterChangedState(void)
Definition: videolist.cpp:390
VideoListImp::count
unsigned int count(void) const
Definition: videolist.cpp:362
VideoDialog::BRS_DIRECTOR
@ BRS_DIRECTOR
Definition: videodlg.h:40
meta_dir_node::setPath
void setPath(const QString &path, const QString &sortPath=nullptr)
Definition: videometadatalistmanager.cpp:310
VideoListImp::sort_view_data
void sort_view_data(bool flat_list)
Definition: videolist.cpp:734
VideoDialog::BRS_FOLDER
@ BRS_FOLDER
Definition: videodlg.h:39
kUpFolder
@ kUpFolder
Definition: videolist.h:7
meta_dir_node::clear
void clear()
Definition: videometadatalistmanager.cpp:378
metadata_path_sort::sort
static bool sort(const QString &lhs, const QString &rhs)
Definition: videolist.cpp:190
naturalCompare
int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity)
Definition: mythmiscutil.cpp:1032
AddDirNode
static MythGenericTree * AddDirNode(MythGenericTree *where_to_add, const QString &name, QString fqPath, bool add_up_dirs, QString host="", QString prefix="")
Definition: videolist.cpp:276
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
VideoMetadata::GetPrefix
const QString & GetPrefix() const
Definition: videometadata.cpp:1329
VideoFilterSettings::setParentalLevel
void setParentalLevel(ParentalLevel::Level parental_level)
Definition: videofilter.h:193
VideoList::setCurrentVideoFilter
void setCurrentVideoFilter(const VideoFilterSettings &filter)
Definition: videolist.cpp:499
VideoList
Definition: videolist.h:24
TreeNodeData::operator=
TreeNodeData & operator=(const TreeNodeData &rhs)
Definition: videolist.cpp:93
VideoListImp::ltDBInsertDateGroup
@ ltDBInsertDateGroup
Definition: videolist.cpp:343
VideoListImp::buildDbList
void buildDbList(void)
Definition: videolist.cpp:949
videometadatalistmanager.h
VideoListImp::ltDBStudioGroup
@ ltDBStudioGroup
Definition: videolist.cpp:342
VideoListImp::refreshNode
bool refreshNode(MythGenericTree *node)
Definition: videolist.cpp:648
AddMetadataToDir
static meta_dir_node * AddMetadataToDir(VideoMetadata *metadata, meta_dir_node *dir, meta_dir_node *hint=nullptr)
Definition: videolist.cpp:208
VideoListImp::refreshList
void refreshList(bool filebrowser, const ParentalLevel &parental_level, bool flat_list, int group_type)
Definition: videolist.cpp:671
MythDate::kSimplify
@ kSimplify
Do Today/Yesterday/Tomorrow transform.
Definition: mythdate.h:23
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:924
FileAssociations::getFileAssociation
static FileAssociations & getFileAssociation()
Definition: dbaccess.cpp:830
VideoFilterSettings
Definition: videofilter.h:73
VideoListImp::m_videoFilter
VideoFilterSettings m_videoFilter
Definition: videolist.cpp:455
meta_dir_node::entries_begin
entry_iterator entries_begin()
Definition: videometadatalistmanager.cpp:414
VideoListImp::buildFileList
void buildFileList(smart_dir_node &directory, metadata_list &metalist, const QString &prefix) const
Definition: videolist.cpp:1209
meta_dir_node::getName
const QString & getName() const override
Definition: videometadatalistmanager.cpp:275
path_to_node_name
static QString path_to_node_name(const QString &path)
Definition: videolist.cpp:196
TreeNodeData::m_d
class TreeNodeDataPrivate * m_d
Definition: videolist.h:84
mythmiscutil.h
VideoListImp::Delete
bool Delete(unsigned int video_id, VideoList &)
Definition: videolist.cpp:395
TreeNodeDataPrivate::m_path
QString m_path
Definition: videolist.cpp:74
meta_data_node
Definition: videometadatalistmanager.h:61
ScanVideoDirectory
bool ScanVideoDirectory(const QString &start_path, DirectoryHandler *handler, const FileAssociations::ext_ignore_list &ext_disposition, bool list_unknown_extensions)
Definition: dirscan.cpp:226
dir
QDir dir
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1171
metadata_path_sort::operator()
bool operator()(const VideoMetadata &lhs, const VideoMetadata &rhs)
Definition: videolist.cpp:169
VideoListImp
Definition: videolist.cpp:334
MythGenericTree::getParent
MythGenericTree * getParent(void) const
Definition: mythgenerictree.cpp:372
ParentalLevel
Definition: parentalcontrols.h:10
VideoDialog::BRS_GENRE
@ BRS_GENRE
Definition: videodlg.h:39
dirhandler::m_directory
smart_dir_node m_directory
Definition: videolist.cpp:1202
VideoList::count
unsigned int count() const
Definition: videolist.cpp:489
VideoListImp::m_metadataViewFlat
metadata_view_list m_metadataViewFlat
Definition: videolist.cpp:450
UPNPScanner::Instance
static UPNPScanner * Instance(UPNPSubscription *sub=nullptr)
Definition: upnpscanner.cpp:154
VideoListImp::m_metadataListType
metadata_list_type m_metadataListType
Definition: videolist.cpp:453
VideoListImp::buildVideoList
MythGenericTree * buildVideoList(bool filebrowser, bool flatlist, int group_type, const ParentalLevel &parental_level, bool include_updirs)
Definition: videolist.cpp:625
tree_view_to_flat
void tree_view_to_flat(meta_dir_node &tree, VideoListImp::metadata_view_list &flat)
Definition: videolist.cpp:1095
VideoMetadataListManager::VideoMetadataPtr
simple_ref_ptr< VideoMetadata > VideoMetadataPtr
Definition: videometadatalistmanager.h:13
VideoListImp::ltNone
@ ltNone
Definition: videolist.cpp:339
MythGenericTree
Definition: mythgenerictree.h:21
meta_dir_node::getSortPath
const QString & getSortPath() const
Definition: videometadatalistmanager.cpp:305
MythGenericTree::DisplayState
void DisplayState(const QString &state, const QString &name="")
Definition: mythgenerictree.cpp:587
mythcontext.h
metadata_path_sort::metadata_path_sort
metadata_path_sort(void)=default
VideoList::~VideoList
~VideoList()
Definition: videolist.cpp:463
dirhandler::m_metalist
VideoMetadataListManager::metadata_list & m_metalist
Definition: videolist.cpp:1204
VideoListImp::TryFilter
int TryFilter(const VideoFilterSettings &filter) const
Definition: videolist.cpp:377
meta_dir_node::GetData
const QVariant & GetData() const
Definition: videometadatalistmanager.cpp:322
AddFileNode
static int AddFileNode(MythGenericTree *where_to_add, const QString &name, VideoMetadata *metadata)
Definition: videolist.cpp:300
to_metadata_ptr::operator()
VideoMetadata * operator()(smart_meta_node &smn)
Definition: videolist.cpp:259
call_tree_flat
Definition: videolist.cpp:1083
TreeNodeDataPrivate::m_host
QString m_host
Definition: videolist.cpp:73
MythDate::kDateFull
@ kDateFull
Default local time.
Definition: mythdate.h:16
VideoMetadataListManager::metadata_list
std::list< VideoMetadataPtr > metadata_list
Definition: videometadatalistmanager.h:14
quicksp.h
VideoListImp::ltDBGenreGroup
@ ltDBGenreGroup
Definition: videolist.cpp:340
VideoList::refreshNode
bool refreshNode(MythGenericTree *node)
Definition: videolist.cpp:484
VideoListImp::buildGroupList
void buildGroupList(metadata_list_type whence)
Definition: videolist.cpp:785
MythGenericTree::SetText
void SetText(const QString &text, const QString &name="", const QString &state="")
Definition: mythgenerictree.cpp:516
meta_dir_node::dirs_end
dir_iterator dirs_end()
Definition: videometadatalistmanager.cpp:399
VideoList::GetTreeRoot
MythGenericTree * GetTreeRoot()
Definition: videolist.cpp:524
VideoListImp::m_metadata
VideoMetadataListManager m_metadata
Definition: videolist.cpp:447
upnpscanner.h
meta_dir_node::getPath
const QString & getPath() const override
Definition: videometadatalistmanager.cpp:300
dirhandler::dirhandler
dirhandler(smart_dir_node &directory, const QString &prefix, VideoMetadataListManager::metadata_list &metalist, free_list &dh_free_list, bool infer_title)
Definition: videolist.cpp:1146
VideoListImp::ltDBCastGroup
@ ltDBCastGroup
Definition: videolist.cpp:342
VideoListImp::setCurrentVideoFilter
void setCurrentVideoFilter(const VideoFilterSettings &filter)
Definition: videolist.cpp:372
DirectoryHandler
Definition: dirscan.h:7
kDynamicSubFolder
@ kDynamicSubFolder
Definition: videolist.h:10
VideoFilterSettings::matches_filter
bool matches_filter(const VideoMetadata &mdata) const
Definition: videofilter.cpp:187
ParentalLevel::GetLevel
Level GetLevel() const
Definition: parentalcontrols.cpp:128
TreeNodeData::GetHost
QString GetHost() const
Definition: videolist.cpp:132
VideoListImp::GetTreeRoot
MythGenericTree * GetTreeRoot(void)
Definition: videolist.cpp:413
VideoListImp::build_generic_tree
void build_generic_tree(MythGenericTree *dst, meta_dir_node *src, bool include_updirs)
Definition: videolist.cpp:544
VideoListImp::metadata_view_list
vector< VideoMetadata * > metadata_view_list
Definition: videolist.cpp:336
TreeNodeData::~TreeNodeData
~TreeNodeData()
Definition: videolist.cpp:104
VideoListImp::update_meta_view
void update_meta_view(bool flat_list)
Definition: videolist.cpp:1105
VideoList::getListCache
const VideoMetadataListManager & getListCache() const
Definition: videolist.cpp:509
videoutils.h
kNoFilesFound
@ kNoFilesFound
Definition: videolist.h:9
dirhandler
Definition: videolist.cpp:1141
TreeNodeDataPrivate::TreeNodeDataPrivate
TreeNodeDataPrivate(VideoMetadata *metadata)
Definition: videolist.cpp:32
TreeNodeDataPrivate::GetHost
QString GetHost(void) const
Definition: videolist.cpp:61
VideoListImp::ltTVMetadata
@ ltTVMetadata
Definition: videolist.cpp:344
videodlg.h
metadata_sort
metadata sort function
Definition: videolist.cpp:148
VideoListImp::getListCache
const VideoMetadataListManager & getListCache(void) const
Definition: videolist.cpp:385
VideoListImp::InvalidateCache
void InvalidateCache()
Definition: videolist.cpp:418
simple_ref_ptr::get
T * get() const
Definition: quicksp.h:73
VideoMetadata::GetStateMap
void GetStateMap(InfoMap &stateMap) const
Definition: videometadata.cpp:1271
dirhandler::newDir
DirectoryHandler * newDir(const QString &dir_name, const QString &fq_dir_name) override
Definition: videolist.cpp:1154
TreeNodeData::GetPrefix
QString GetPrefix() const
Definition: videolist.cpp:139
genres
QDomElement genres
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:807