MythTV  master
videofilter.cpp
Go to the documentation of this file.
1 #include <set>
2 
3 #include "mythcontext.h"
4 
5 #include "mythuibuttonlist.h"
6 #include "mythuibutton.h"
7 #include "mythuitext.h"
8 #include "mythuitextedit.h"
9 #include "mythmiscutil.h"
10 #include "globals.h"
11 #include "dbaccess.h"
13 #include "videoutils.h"
14 #include "mythdate.h"
15 
16 #include "videolist.h"
17 #include "videofilter.h"
18 
20  const QString& _prefix)
21 {
22  if (_prefix.isEmpty())
23  m_prefix = "VideoDefault";
24  else
25  m_prefix = _prefix + "Default";
26 
27  // do nothing yet
28  if (loaddefaultsettings)
29  {
30  m_category = gCoreContext->GetNumSetting(QString("%1Category").arg(m_prefix),
32  m_genre = gCoreContext->GetNumSetting(QString("%1Genre").arg(m_prefix),
34  m_country = gCoreContext->GetNumSetting(QString("%1Country").arg(m_prefix),
36  m_cast = gCoreContext->GetNumSetting(QString("%1Cast").arg(m_prefix),
38  m_year = gCoreContext->GetNumSetting(QString("%1Year").arg(m_prefix),
40  m_runtime = gCoreContext->GetNumSetting(QString("%1Runtime").arg(m_prefix),
42  m_userRating =
43  gCoreContext->GetNumSetting(QString("%1Userrating").arg(m_prefix),
45  m_browse = gCoreContext->GetNumSetting(QString("%1Browse").arg(m_prefix),
47  m_watched = gCoreContext->GetNumSetting(QString("%1Watched").arg(m_prefix),
49  m_inetRef = gCoreContext->GetNumSetting(QString("%1InetRef").arg(m_prefix),
51  m_coverFile = gCoreContext->GetNumSetting(QString("%1CoverFile")
53  m_orderBy = (ordering)gCoreContext->GetNumSetting(QString("%1Orderby")
54  .arg(m_prefix),
56  }
57 }
58 
60 {
61  *this = rhs;
62 }
63 
66 {
67  if (this == &rhs)
68  return *this;
69 
70  m_prefix = rhs.m_prefix;
71 
72  if (m_category != rhs.m_category)
73  {
75  m_category = rhs.m_category;
76  }
77 
78  if (m_genre != rhs.m_genre)
79  {
81  m_genre = rhs.m_genre;
82  }
83 
84  if (m_country != rhs.m_country)
85  {
87  m_country = rhs.m_country;
88  }
89 
90  if (m_cast != rhs.m_cast)
91  {
93  m_cast = rhs.m_cast;
94  }
95 
96  if (m_year != rhs.m_year)
97  {
99  m_year = rhs.m_year;
100  }
101 
102  if (m_runtime != rhs.m_runtime)
103  {
105  m_runtime = rhs.m_runtime;
106  }
107 
108  if (m_userRating != rhs.m_userRating)
109  {
112  }
113 
114  if (m_browse != rhs.m_browse)
115  {
117  m_browse = rhs.m_browse;
118  }
119 
120  if (m_watched != rhs.m_watched)
121  {
123  m_watched = rhs.m_watched;
124  }
125 
126  if (m_inetRef != rhs.m_inetRef)
127  {
129  m_inetRef = rhs.m_inetRef;
130  }
131 
132  if (m_coverFile != rhs.m_coverFile)
133  {
135  m_coverFile = rhs.m_coverFile;
136  }
137 
138  if (m_orderBy != rhs.m_orderBy)
139  {
141  m_orderBy = rhs.m_orderBy;
142  }
143 
144  if (m_parentalLevel != rhs.m_parentalLevel)
145  {
148  }
149 
150  if (m_textFilter != rhs.m_textFilter)
151  {
154  }
155  if (m_season != rhs.m_season || m_episode != rhs.m_episode)
156  {
157  m_season = rhs.m_season;
158  m_episode = rhs.m_episode;
160  }
161  if (m_insertDate != rhs.m_insertDate)
162  {
165  }
166 
167  return *this;
168 }
169 
171 {
172  gCoreContext->SaveSetting(QString("%1Category").arg(m_prefix), m_category);
173  gCoreContext->SaveSetting(QString("%1Genre").arg(m_prefix), m_genre);
174  gCoreContext->SaveSetting(QString("%1Cast").arg(m_prefix), m_cast);
175  gCoreContext->SaveSetting(QString("%1Country").arg(m_prefix), m_country);
176  gCoreContext->SaveSetting(QString("%1Year").arg(m_prefix), m_year);
177  gCoreContext->SaveSetting(QString("%1Runtime").arg(m_prefix), m_runtime);
178  gCoreContext->SaveSetting(QString("%1Userrating").arg(m_prefix), m_userRating);
179  gCoreContext->SaveSetting(QString("%1Browse").arg(m_prefix), m_browse);
180  gCoreContext->SaveSetting(QString("%1Watched").arg(m_prefix), m_watched);
181  gCoreContext->SaveSetting(QString("%1InetRef").arg(m_prefix), m_inetRef);
182  gCoreContext->SaveSetting(QString("%1CoverFile").arg(m_prefix), m_coverFile);
183  gCoreContext->SaveSetting(QString("%1Orderby").arg(m_prefix), m_orderBy);
184  gCoreContext->SaveSetting(QString("%1Filter").arg(m_prefix), m_textFilter);
185 }
186 
188 {
189  bool matches = true;
190 
191  //textfilter
192  if (!m_textFilter.isEmpty())
193  {
194  matches = false;
195  matches = (matches ||
196  mdata.GetTitle().contains(m_textFilter, Qt::CaseInsensitive));
197  matches = (matches ||
198  mdata.GetSubtitle().contains(m_textFilter, Qt::CaseInsensitive));
199  matches = (matches ||
200  mdata.GetPlot().contains(m_textFilter, Qt::CaseInsensitive));
201  }
202  //search for season with optionally episode nr.
203  if (matches && (m_season != -1))
204  {
205  matches = (m_season == mdata.GetSeason());
206  matches = (matches && (m_episode == -1 || m_episode == mdata.GetEpisode()));
207  }
208  if (matches && m_insertDate.isValid())
209  {
210  matches = (mdata.GetInsertdate().isValid() &&
211  mdata.GetInsertdate() >= m_insertDate);
212  }
213  if (matches && (m_genre != kGenreFilterAll))
214  {
215  matches = false;
216 
217  const VideoMetadata::genre_list &gl = mdata.GetGenres();
218  for (const auto & g : gl)
219  {
220  if ((matches = (g.first == m_genre)))
221  {
222  break;
223  }
224  }
225  }
226 
227  if (matches && m_country != kCountryFilterAll)
228  {
229  matches = false;
230 
231  const VideoMetadata::country_list &cl = mdata.GetCountries();
232  for (const auto & c : cl)
233  {
234  if ((matches = (c.first == m_country)))
235  {
236  break;
237  }
238  }
239  }
240 
241  if (matches && m_cast != kCastFilterAll)
242  {
243  const VideoMetadata::cast_list &cl = mdata.GetCast();
244 
245  if ((m_cast == kCastFilterUnknown) && (cl.empty()))
246  {
247  matches = true;
248  }
249  else
250  {
251  matches = false;
252 
253  for (const auto & c : cl)
254  {
255  if ((matches = (c.first == m_cast)))
256  {
257  break;
258  }
259  }
260  }
261  }
262 
263  if (matches && m_category != kCategoryFilterAll)
264  {
265  matches = (m_category == mdata.GetCategoryID());
266  }
267 
268  if (matches && m_year != kYearFilterAll)
269  {
270  if (m_year == kYearFilterUnknown)
271  {
272  matches = ((mdata.GetYear() == 0) ||
273  (mdata.GetYear() == VIDEO_YEAR_DEFAULT));
274  }
275  else
276  {
277  matches = (m_year == mdata.GetYear());
278  }
279  }
280 
281  if (matches && m_runtime != kRuntimeFilterAll)
282  {
284  {
285  matches = (mdata.GetLength() == 0);
286  }
287  else
288  {
289  matches = (m_runtime == (mdata.GetLength() / 30));
290  }
291  }
292 
293  if (matches && m_userRating != kUserRatingFilterAll)
294  {
295  matches = (mdata.GetUserRating() >= m_userRating);
296  }
297 
298  if (matches && m_browse != kBrowseFilterAll)
299  {
300  matches = (static_cast<int>(mdata.GetBrowse()) == m_browse);
301  }
302 
303  if (matches && m_watched != kWatchedFilterAll)
304  {
305  matches = (static_cast<int>(mdata.GetWatched()) == m_watched);
306  }
307 
308  if (matches && m_inetRef != kInetRefFilterAll)
309  {
310  matches = (mdata.GetInetRef() == VIDEO_INETREF_DEFAULT);
311  }
312 
313  if (matches && m_coverFile != kCoverFileFilterAll)
314  {
315  matches = (IsDefaultCoverFile(mdata.GetCoverFile()));
316  }
317 
318  if (matches && m_parentalLevel)
319  {
320  matches = ((mdata.GetShowLevel() != ParentalLevel::plNone) &&
321  (mdata.GetShowLevel() <= m_parentalLevel));
322  }
323 
324  return matches;
325 }
326 
329  const VideoMetadata &rhs) const
330 {
331  bool ret = false;
332  switch (m_orderBy)
333  {
334  case kOrderByTitle:
335  {
336  ret = lhs.sortBefore(rhs);
337  break;
338  }
339  case kOrderBySeasonEp:
340  {
341  if ((lhs.GetSeason() == rhs.GetSeason())
342  && (lhs.GetEpisode() == rhs.GetEpisode())
343  && (lhs.GetSeason() == 0)
344  && (rhs.GetSeason() == 0)
345  && (lhs.GetEpisode() == 0)
346  && (rhs.GetEpisode() == 0))
347  {
348  ret = lhs.sortBefore(rhs);
349  }
350  else if ((lhs.GetSeason() == rhs.GetSeason())
351  && (lhs.GetTitle() == rhs.GetTitle()))
352  ret = (lhs.GetEpisode() < rhs.GetEpisode());
353  else
354  ret = (lhs.GetSeason() < rhs.GetSeason());
355  break;
356  }
358  {
359  ret = (lhs.GetYear() > rhs.GetYear());
360  break;
361  }
363  {
364  ret = (lhs.GetUserRating() > rhs.GetUserRating());
365  break;
366  }
367  case kOrderByLength:
368  {
369  ret = (lhs.GetLength() < rhs.GetLength());
370  break;
371  }
372  case kOrderByFilename:
373  {
374  const QString& lhsfn = lhs.GetSortFilename();
375  const QString& rhsfn = rhs.GetSortFilename();
376  ret = naturalCompare(lhsfn, rhsfn) < 0;
377  break;
378  }
379  case kOrderByID:
380  {
381  ret = (lhs.GetID() < rhs.GetID());
382  break;
383  }
385  {
386  ret = (lhs.GetInsertdate() > rhs.GetInsertdate());
387  break;
388  }
389  default:
390  {
391  LOG(VB_GENERAL, LOG_ERR, QString("Error: unknown sort type %1")
392  .arg(m_orderBy));
393  }
394  }
395 
396  return ret;
397 }
398 
399 void VideoFilterSettings::setTextFilter(const QString& val)
400 {
402  if (m_reSeason.indexIn(val) != -1)
403  {
404  bool res = false;
405  QStringList list = m_reSeason.capturedTexts();
406  m_season = list[1].toInt(&res);
407  if (!res)
408  m_season = -1;
409  if (list.size() > 2) {
410  m_episode = list[2].toInt(&res);
411  if (!res)
412  m_episode = -1;
413  }
414  else {
415  m_episode = -1;
416  }
417  //clear \dX\d from string for string-search in plot/title/subtitle
418  m_textFilter = val;
419  m_textFilter.replace(m_reSeason, "");
420  m_textFilter = m_textFilter.simplified ();
421  }
422  else
423  {
424  m_textFilter = val;
425  m_season = -1;
426  m_episode = -1;
427  }
428  if (m_reDate.indexIn(m_textFilter) != -1)
429  {
430  QStringList list = m_reDate.capturedTexts();
431  int modnr = list[1].toInt();
432  QDate testdate = MythDate::current().date();
433  switch(list[2].at(0).toLatin1())
434  {
435  case 'm': testdate = testdate.addMonths(-modnr);break;
436  case 'd': testdate = testdate.addDays(-modnr);break;
437  case 'w': testdate = testdate.addDays(-modnr * 7);break;
438  }
439  m_insertDate = testdate;
440  m_textFilter.replace(m_reDate, "");
441  m_textFilter = m_textFilter.simplified ();
442  }
443  else
444  {
445  //reset testdate
446  m_insertDate = QDate();
447  }
448 }
449 
451 // VideoFilterDialog
454  VideoList *video_list) : MythScreenType(lparent, lname),
455  m_videoList(*video_list)
456 {
457  m_fsp = new BasicFilterSettingsProxy<VideoList>(*video_list);
459 }
460 
462 {
463  delete m_fsp;
464 }
465 
467 {
468  if (!LoadWindowFromXML("video-ui.xml", "filter", this))
469  return false;
470 
471  bool err = false;
472  UIUtilE::Assign(this, m_textFilter, "textfilter_input", &err);
473  UIUtilE::Assign(this, m_yearList, "year_select", &err);
474  UIUtilE::Assign(this, m_userRatingList, "userrating_select", &err);
475  UIUtilE::Assign(this, m_categoryList, "category_select", &err);
476  UIUtilE::Assign(this, m_countryList, "country_select", &err);
477  UIUtilE::Assign(this, m_genreList, "genre_select", &err);
478  UIUtilE::Assign(this, m_castList, "cast_select", &err);
479  UIUtilE::Assign(this, m_runtimeList, "runtime_select", &err);
480  UIUtilE::Assign(this, m_browseList, "browse_select", &err);
481  UIUtilE::Assign(this, m_watchedList, "watched_select", &err);
482  UIUtilE::Assign(this, m_inetRefList, "inetref_select", &err);
483  UIUtilE::Assign(this, m_coverFileList, "coverfile_select", &err);
484  UIUtilE::Assign(this, m_orderByList, "orderby_select", &err);
485 
486  UIUtilE::Assign(this, m_doneButton, "done_button", &err);
487  UIUtilE::Assign(this, m_saveButton, "save_button", &err);
488 
489  UIUtilE::Assign(this, m_numVideosText, "numvideos_text", &err);
490 
491  if (err)
492  {
493  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'filter'");
494  return false;
495  }
496 
497  BuildFocusList();
498 
499  fillWidgets();
500  update_numvideo();
501 
502  connect(m_yearList, SIGNAL(itemSelected(MythUIButtonListItem*)),
503  SLOT(SetYear(MythUIButtonListItem*)));
504  connect(m_userRatingList, SIGNAL(itemSelected(MythUIButtonListItem*)),
506  connect(m_categoryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
508  connect(m_countryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
510  connect(m_genreList,SIGNAL(itemSelected(MythUIButtonListItem*)),
512  connect(m_castList,SIGNAL(itemSelected(MythUIButtonListItem*)),
513  SLOT(SetCast(MythUIButtonListItem*)));
514  connect(m_runtimeList, SIGNAL(itemSelected(MythUIButtonListItem*)),
516  connect(m_browseList, SIGNAL(itemSelected(MythUIButtonListItem*)),
518  connect(m_watchedList, SIGNAL(itemSelected(MythUIButtonListItem*)),
520  connect(m_inetRefList, SIGNAL(itemSelected(MythUIButtonListItem*)),
522  connect(m_coverFileList, SIGNAL(itemSelected(MythUIButtonListItem*)),
524  connect(m_orderByList, SIGNAL(itemSelected(MythUIButtonListItem*)),
526  connect(m_textFilter, SIGNAL(valueChanged()),
527  SLOT(setTextFilter()));
528 
529  connect(m_saveButton, SIGNAL(Clicked()), SLOT(saveAsDefault()));
530  connect(m_doneButton, SIGNAL(Clicked()), SLOT(saveAndExit()));
531 
532  return true;
533 }
534 
536 {
537  int video_count = m_videoList.TryFilter(m_settings);
538 
539  if (video_count > 0)
540  {
541  m_numVideosText->SetText(tr("Result of this filter : %n video(s)", "",
542  video_count));
543  }
544  else
545  {
546  m_numVideosText->SetText(tr("Result of this filter : No Videos"));
547  }
548 }
549 
551 {
552  bool have_unknown_year = false;
553  bool have_unknown_runtime = false;
554 
555  using int_list = std::set<int>;
556  int_list years;
557  int_list runtimes;
558  int_list user_ratings;
559 
562  for (const auto & md : mdl)
563  {
564  int year = md->GetYear();
565  if ((year == 0) || (year == VIDEO_YEAR_DEFAULT))
566  have_unknown_year = true;
567  else
568  years.insert(year);
569 
570  int runtime = md->GetLength();
571  if (runtime == 0)
572  have_unknown_runtime = true;
573  else
574  runtimes.insert(runtime / 30);
575 
576  user_ratings.insert(static_cast<int>(md->GetUserRating()));
577  }
578 
579  // Category
580  new MythUIButtonListItem(m_categoryList, tr("All", "Category"),
582 
583  const VideoCategory::entry_list &vcl =
585  for (const auto & vc : vcl)
586  new MythUIButtonListItem(m_categoryList, vc.second, vc.first);
587 
591 
592  // Genre
593  new MythUIButtonListItem(m_genreList, tr("All", "Genre"), kGenreFilterAll);
594 
596  for (const auto & g : gl)
597  new MythUIButtonListItem(m_genreList, g.second, g.first);
598 
601 
602  // Cast
603  new MythUIButtonListItem(m_castList, tr("All", "Cast"), kCastFilterAll);
604 
606  for (const auto & c : cl)
607  new MythUIButtonListItem(m_castList, c.second, c.first);
608 
611 
612  // Country
613  new MythUIButtonListItem(m_countryList, tr("All", "Country"), kCountryFilterAll);
614 
616  for (const auto & cn : cnl)
617  new MythUIButtonListItem(m_countryList, cn.second, cn.first);
618 
622 
623  // Year
624  new MythUIButtonListItem(m_yearList, tr("All", "Year"), kYearFilterAll);
625 
626  for (auto p = years.crbegin(); p != years.crend(); ++p)
627  {
628  new MythUIButtonListItem(m_yearList, QString::number(*p), *p);
629  }
630 
631  if (have_unknown_year)
634 
636 
637  // Runtime
638  new MythUIButtonListItem(m_runtimeList, tr("All", "Runtime"), kRuntimeFilterAll);
639 
640  if (have_unknown_runtime)
643 
644  for (int runtime : runtimes)
645  {
646  QString s = QString("%1 %2 ~ %3 %4").arg(runtime * 30).arg(tr("minutes"))
647  .arg((runtime + 1) * 30).arg(tr("minutes"));
648  new MythUIButtonListItem(m_runtimeList, s, runtime);
649  }
650 
652 
653  // User Rating
654  new MythUIButtonListItem(m_userRatingList, tr("All", "User rating"),
656 
657  for (auto p = user_ratings.crbegin(); p != user_ratings.crend(); ++p)
658  {
660  QString(">= %1").arg(QString::number(*p)),
661  *p);
662  }
663 
665 
666  // Browsable
667  new MythUIButtonListItem(m_browseList, tr("All", "Browsable"),
670  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
672  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
674 
675  // Watched
676  new MythUIButtonListItem(m_watchedList, tr("All", "Watched"),
679  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
681  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
683 
684  // Inet Reference
685  new MythUIButtonListItem(m_inetRefList, tr("All", "Inet reference"),
687  new MythUIButtonListItem(m_inetRefList, tr("Unknown", "Inet reference"),
690 
691  // Coverfile
692  new MythUIButtonListItem(m_coverFileList, tr("All", "Cover file"),
694  new MythUIButtonListItem(m_coverFileList, tr("None", "Cover file"),
697 
698  // Order by
700  QCoreApplication::translate("(Common)", "Title"),
703  QCoreApplication::translate("(Common)", "Season/Episode"),
706  QCoreApplication::translate("(Common)", "Year"),
709  QCoreApplication::translate("(Common)", "User Rating"),
712  QCoreApplication::translate("(Common)", "Runtime"),
715  QCoreApplication::translate("(Common)", "Filename"),
717  new MythUIButtonListItem(m_orderByList, tr("Video ID"),
719  new MythUIButtonListItem(m_orderByList, tr("Date Added"),
722 
723  // Text Filter
725 }
726 
728 {
730  saveAndExit();
731 }
732 
734 {
736 
737  if (m_settings.getChangedState() > 0)
738  emit filterChanged();
739  Close();
740 }
741 
743 {
744  int new_year = item->GetData().toInt();
745  m_settings.SetYear(new_year);
746  update_numvideo();
747 }
748 
750 {
751  m_settings.SetUserRating(item->GetData().toInt());
752  update_numvideo();
753 }
754 
756 {
757  m_settings.SetCategory(item->GetData().toInt());
758  update_numvideo();
759 }
760 
762 {
763  m_settings.setCountry(item->GetData().toInt());
764  update_numvideo();
765 }
766 
768 {
769  m_settings.setGenre(item->GetData().toInt());
770  update_numvideo();
771 }
772 
774 {
775  m_settings.SetCast(item->GetData().toInt());
776  update_numvideo();
777 }
778 
780 {
781  m_settings.setRuntime(item->GetData().toInt());
782  update_numvideo();
783 }
784 
786 {
787  m_settings.SetBrowse(item->GetData().toInt());
788  update_numvideo();
789 }
790 
792 {
793  m_settings.SetWatched(item->GetData().toInt());
794  update_numvideo();
795 }
796 
798 {
799  m_settings.SetInetRef(item->GetData().toInt());
800  update_numvideo();
801 }
802 
804 {
805  m_settings.SetCoverFile(item->GetData().toInt());
806  update_numvideo();
807 }
808 
810 {
811  m_settings
813  update_numvideo();
814 }
815 
817 {
819  update_numvideo();
820 }
VideoFilterDialog::SetWatched
void SetWatched(MythUIButtonListItem *item)
Definition: videofilter.cpp:791
VideoFilterSettings::VideoFilterSettings
VideoFilterSettings(bool loaddefaultsettings=true, const QString &_prefix="")
Definition: videofilter.cpp:19
VIDEO_YEAR_UNKNOWN
const QString VIDEO_YEAR_UNKNOWN
Definition: globals.cpp:15
VideoMetadata
Definition: videometadata.h:25
VideoFilterSettings::m_parentalLevel
ParentalLevel::Level m_parentalLevel
Definition: videofilter.h:233
VideoFilterDialog::setTextFilter
void setTextFilter()
Definition: videofilter.cpp:816
VideoFilterSettings::m_prefix
QString m_prefix
Definition: videofilter.h:234
VideoFilterSettings::kFilterCountryChanged
@ kFilterCountryChanged
Definition: videofilter.h:81
VideoFilterSettings::kOrderByTitle
@ kOrderByTitle
Definition: videofilter.h:109
VideoFilterDialog::SetCategory
void SetCategory(MythUIButtonListItem *item)
Definition: videofilter.cpp:755
VideoFilterSettings::SetCast
void SetCast(int lcast)
Definition: videofilter.h:134
VideoFilterSettings::setGenre
void setGenre(int lgenre)
Definition: videofilter.h:127
MythUIButtonList::SetValueByData
void SetValueByData(const QVariant &data)
Definition: mythuibuttonlist.cpp:1542
VideoFilterDialog::m_genreList
MythUIButtonList * m_genreList
Definition: videofilter.h:316
mythuitext.h
VIDEO_RUNTIME_UNKNOWN
const QString VIDEO_RUNTIME_UNKNOWN
Definition: globals.cpp:17
VideoMetadata::GetShowLevel
ParentalLevel::Level GetShowLevel() const
Definition: videometadata.cpp:1599
VideoFilterSettings::getInteRef
int getInteRef() const
Definition: videofilter.h:199
VideoFilterDialog::setGenre
void setGenre(MythUIButtonListItem *item)
Definition: videofilter.cpp:767
VideoFilterSettings::kFilterUserRatingChanged
@ kFilterUserRatingChanged
Definition: videofilter.h:84
kInetRefFilterUnknown
@ kInetRefFilterUnknown
Definition: videofilter.h:64
VideoFilterDialog::m_watchedList
MythUIButtonList * m_watchedList
Definition: videofilter.h:310
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
VideoFilterSettings::m_year
int m_year
Definition: videofilter.h:225
VideoFilterSettings::kFilterCoverFileChanged
@ kFilterCoverFileChanged
Definition: videofilter.h:87
VideoFilterSettings::GetUserRating
int GetUserRating() const
Definition: videofilter.h:161
VideoFilterSettings::m_episode
int m_episode
Definition: videofilter.h:237
VideoFilterDialog::SetCast
void SetCast(MythUIButtonListItem *item)
Definition: videofilter.cpp:773
VideoFilterDialog::m_orderByList
MythUIButtonList * m_orderByList
Definition: videofilter.h:311
VideoFilterSettings::m_runtime
int m_runtime
Definition: videofilter.h:226
VideoFilterSettings::kOrderByUserRatingDescending
@ kOrderByUserRatingDescending
Definition: videofilter.h:111
VIDEO_YEAR_DEFAULT
@ VIDEO_YEAR_DEFAULT
Definition: videometadata.h:18
VideoFilterSettings::getRuntime
int getRuntime() const
Definition: videofilter.h:154
VideoList::TryFilter
int TryFilter(const VideoFilterSettings &filter) const
Definition: videolist.cpp:504
VideoFilterSettings::getGenre
int getGenre() const
Definition: videofilter.h:126
kCategoryFilterUnknown
@ kCategoryFilterUnknown
Definition: videofilter.h:37
kCategoryFilterAll
@ kCategoryFilterAll
Definition: videofilter.h:36
VideoMetadata::GetInsertdate
QDate GetInsertdate() const
Definition: videometadata.cpp:1519
VideoFilterDialog::m_doneButton
MythUIButton * m_doneButton
Definition: videofilter.h:322
VideoFilterSettings::m_reSeason
const QRegExp m_reSeason
Definition: videofilter.h:239
VideoFilterDialog::VideoFilterDialog
VideoFilterDialog(MythScreenStack *lparent, const QString &lname, VideoList *video_list)
Definition: videofilter.cpp:453
VideoFilterDialog::m_browseList
MythUIButtonList * m_browseList
Definition: videofilter.h:309
MythScreenStack
Definition: mythscreenstack.h:16
arg
arg(title).arg(filename).arg(doDelete))
VideoMetadata::country_list
std::vector< country_entry > country_list
Definition: videometadata.h:33
VideoFilterSettings::ordering
ordering
Definition: videofilter.h:106
VideoFilterSettings::kFilterGenreChanged
@ kFilterGenreChanged
Definition: videofilter.h:80
VideoFilterSettings::kFilterBrowseChanged
@ kFilterBrowseChanged
Definition: videofilter.h:85
VideoFilterDialog::m_saveButton
MythUIButton * m_saveButton
Definition: videofilter.h:321
VideoMetadata::GetSeason
int GetSeason() const
Definition: videometadata.cpp:1499
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
VideoMetadata::genre_list
std::vector< genre_entry > genre_list
Definition: videometadata.h:32
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
VideoMetadataListManager::getList
const metadata_list & getList() const
Definition: videometadatalistmanager.cpp:165
MythUITextEdit::GetText
QString GetText(void) const
Definition: mythuitextedit.h:47
kYearFilterUnknown
@ kYearFilterUnknown
Definition: videofilter.h:42
VideoMetadata::GetCategoryID
int GetCategoryID() const
Definition: videometadata.cpp:1734
VideoFilterSettings::setOrderby
void setOrderby(ordering lorderby)
Definition: videofilter.h:183
VideoFilterSettings::m_browse
int m_browse
Definition: videofilter.h:228
mythuibuttonlist.h
VIDEO_CATEGORY_UNKNOWN
const QString VIDEO_CATEGORY_UNKNOWN
Definition: globals.cpp:7
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
VideoMetadata::GetPlot
const QString & GetPlot() const
Definition: videometadata.cpp:1449
VideoFilterSettings::m_inetRef
int m_inetRef
Definition: videofilter.h:230
VideoFilterSettings::SetCoverFile
void SetCoverFile(int coverfile)
Definition: videofilter.h:207
VideoMetadata::GetSubtitle
const QString & GetSubtitle() const
Definition: videometadata.cpp:1354
VideoFilterSettings::getYear
int getYear() const
Definition: videofilter.h:147
VideoFilterSettings::saveAsDefault
void saveAsDefault()
Definition: videofilter.cpp:170
VideoFilterSettings::SetInetRef
void SetInetRef(int inetref)
Definition: videofilter.h:200
dbaccess.h
VideoFilterDialog::Create
bool Create() override
Definition: videofilter.cpp:466
VideoFilterDialog::m_textFilter
MythUITextEdit * m_textFilter
Definition: videofilter.h:324
videofilter.h
VideoFilterSettings::kFilterRuntimeChanged
@ kFilterRuntimeChanged
Definition: videofilter.h:83
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
VideoFilterDialog::SetYear
void SetYear(MythUIButtonListItem *item)
Definition: videofilter.cpp:742
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:216
VideoFilterDialog::m_countryList
MythUIButtonList * m_countryList
Definition: videofilter.h:315
VideoFilterSettings::m_userRating
int m_userRating
Definition: videofilter.h:227
VideoFilterSettings::kOrderByID
@ kOrderByID
Definition: videofilter.h:114
VideoFilterDialog::fillWidgets
void fillWidgets()
Definition: videofilter.cpp:550
mythdate.h
VideoFilterDialog::m_runtimeList
MythUIButtonList * m_runtimeList
Definition: videofilter.h:318
VideoMetadata::GetInetRef
const QString & GetInetRef() const
Definition: videometadata.cpp:1399
VideoMetadata::GetCountries
const country_list & GetCountries() const
Definition: videometadata.cpp:1724
VideoFilterSettings::SetYear
void SetYear(int lyear)
Definition: videofilter.h:148
VideoGenre::getGenre
static VideoGenre & getGenre()
Definition: dbaccess.cpp:515
VideoFilterDialog::setRunTime
void setRunTime(MythUIButtonListItem *item)
Definition: videofilter.cpp:779
VideoFilterDialog::saveAsDefault
void saveAsDefault()
Definition: videofilter.cpp:727
videolist.h
ParentalLevel::plNone
@ plNone
Definition: parentalcontrols.h:12
kYearFilterAll
@ kYearFilterAll
Definition: videofilter.h:41
VideoFilterSettings::kFilterParentalLevelChanged
@ kFilterParentalLevelChanged
Definition: videofilter.h:88
VideoFilterDialog::SetUserRating
void SetUserRating(MythUIButtonListItem *item)
Definition: videofilter.cpp:749
VideoFilterSettings::getOrderby
ordering getOrderby() const
Definition: videofilter.h:182
kRuntimeFilterAll
@ kRuntimeFilterAll
Definition: videofilter.h:46
VideoFilterSettings::m_genre
int m_genre
Definition: videofilter.h:222
kCastFilterAll
@ kCastFilterAll
Definition: videofilter.h:31
VideoFilterSettings::GetCoverFile
int GetCoverFile() const
Definition: videofilter.h:206
VideoFilterDialog::m_videoList
const VideoList & m_videoList
Definition: videofilter.h:326
VIDEO_COUNTRY_UNKNOWN
const QString VIDEO_COUNTRY_UNKNOWN
Definition: globals.cpp:13
hardwareprofile.config.p
p
Definition: config.py:33
VideoFilterDialog::m_inetRefList
MythUIButtonList * m_inetRefList
Definition: videofilter.h:319
VideoFilterSettings::kFilterWatchedChanged
@ kFilterWatchedChanged
Definition: videofilter.h:90
globals.h
VideoFilterSettings::m_season
int m_season
Definition: videofilter.h:236
VideoFilterSettings::getTextFilter
QString getTextFilter() const
Definition: videofilter.h:189
VideoFilterSettings::operator=
VideoFilterSettings & operator=(const VideoFilterSettings &rhs)
Definition: videofilter.cpp:65
kCountryFilterUnknown
@ kCountryFilterUnknown
Definition: videofilter.h:27
VIDEO_CAST_UNKNOWN
const QString VIDEO_CAST_UNKNOWN
Definition: globals.cpp:19
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:222
VideoFilterSettings::m_category
int m_category
Definition: videofilter.h:221
kCoverFileFilterNone
@ kCoverFileFilterNone
Definition: videofilter.h:69
kBrowseFilterAll
@ kBrowseFilterAll
Definition: videofilter.h:55
VideoFilterSettings::m_orderBy
ordering m_orderBy
Definition: videofilter.h:232
VideoFilterSettings::m_watched
int m_watched
Definition: videofilter.h:229
VideoFilterSettings::GetBrowse
int GetBrowse() const
Definition: videofilter.h:168
VideoMetadata::GetYear
int GetYear() const
Definition: videometadata.cpp:1379
VideoFilterSettings::m_reDate
const QRegExp m_reDate
Definition: videofilter.h:240
VideoFilterDialog::SetBrowse
void SetBrowse(MythUIButtonListItem *item)
Definition: videofilter.cpp:785
VideoCountry::getCountry
static VideoCountry & getCountry()
Definition: dbaccess.cpp:501
VideoMetadata::GetSortFilename
const QString & GetSortFilename() const
Definition: videometadata.cpp:1614
kGenreFilterAll
@ kGenreFilterAll
Definition: videofilter.h:21
VideoFilterSettings::m_cast
int m_cast
Definition: videofilter.h:224
VIDEO_GENRE_UNKNOWN
const QString VIDEO_GENRE_UNKNOWN
Definition: globals.cpp:11
VideoFilterDialog::m_settings
VideoFilterSettings m_settings
Definition: videofilter.h:307
VideoFilterSettings::m_changedState
unsigned int m_changedState
Definition: videofilter.h:242
VideoFilterSettings::GetCategory
int GetCategory() const
Definition: videofilter.h:119
VideoMetadata::GetGenres
const genre_list & GetGenres() const
Definition: videometadata.cpp:1704
VideoCategory::GetCategory
static VideoCategory & GetCategory()
Definition: dbaccess.cpp:487
naturalCompare
int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity)
Definition: mythmiscutil.cpp:1032
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3588
FilterSettingsProxy::setSettings
virtual void setSettings(const VideoFilterSettings &settings)=0
VideoFilterSettings::GetWatched
int GetWatched() const
Definition: videofilter.h:175
VideoMetadata::GetEpisode
int GetEpisode() const
Definition: videometadata.cpp:1509
kUserRatingFilterAll
@ kUserRatingFilterAll
Definition: videofilter.h:51
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
VideoFilterDialog::saveAndExit
void saveAndExit()
Definition: videofilter.cpp:733
VideoFilterSettings::m_coverFile
int m_coverFile
Definition: videofilter.h:231
VideoFilterSettings::kOrderByDateAddedDescending
@ kOrderByDateAddedDescending
Definition: videofilter.h:116
VideoFilterSettings::kOrderByYearDescending
@ kOrderByYearDescending
Definition: videofilter.h:110
VideoList
Definition: videolist.h:24
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:930
kInetRefFilterAll
@ kInetRefFilterAll
Definition: videofilter.h:63
VIDEO_INETREF_DEFAULT
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
VideoMetadata::sortBefore
bool sortBefore(const VideoMetadata &rhs) const
Definition: videometadata.cpp:1807
videometadatalistmanager.h
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
FilterSettingsProxy::getSettings
virtual const VideoFilterSettings & getSettings()=0
IsDefaultCoverFile
bool IsDefaultCoverFile(const QString &coverfile)
Definition: videoutils.cpp:130
kRuntimeFilterUnknown
@ kRuntimeFilterUnknown
Definition: videofilter.h:47
VideoFilterSettings
Definition: videofilter.h:73
VideoFilterDialog::m_yearList
MythUIButtonList * m_yearList
Definition: videofilter.h:312
VideoFilterSettings::m_country
int m_country
Definition: videofilter.h:223
VideoFilterSettings::getCountry
int getCountry() const
Definition: videofilter.h:140
BasicFilterSettingsProxy
Definition: videofilter.h:254
VideoFilterSettings::kSortOrderChanged
@ kSortOrderChanged
Definition: videofilter.h:78
kCoverFileFilterAll
@ kCoverFileFilterAll
Definition: videofilter.h:68
VideoFilterSettings::setTextFilter
void setTextFilter(const QString &val)
Definition: videofilter.cpp:399
VideoFilterSettings::m_textFilter
QString m_textFilter
Definition: videofilter.h:235
SingleValue::getList
const entry_list & getList()
Definition: dbaccess.cpp:239
VideoFilterSettings::kFilterInetRefChanged
@ kFilterInetRefChanged
Definition: videofilter.h:86
VideoFilterSettings::SetBrowse
void SetBrowse(int lbrowse)
Definition: videofilter.h:169
mythmiscutil.h
VideoFilterDialog::m_categoryList
MythUIButtonList * m_categoryList
Definition: videofilter.h:314
VideoFilterSettings::kFilterCastChanged
@ kFilterCastChanged
Definition: videofilter.h:89
mythuitextedit.h
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:692
VideoMetadata::cast_list
std::vector< cast_entry > cast_list
Definition: videometadata.h:34
VideoCast::GetCast
static VideoCast & GetCast()
Definition: dbaccess.cpp:529
VideoMetadata::GetUserRating
float GetUserRating() const
Definition: videometadata.cpp:1459
VideoFilterSettings::kOrderByFilename
@ kOrderByFilename
Definition: videofilter.h:113
VideoFilterSettings::SetWatched
void SetWatched(int lwatched)
Definition: videofilter.h:176
VideoMetadata::GetWatched
bool GetWatched() const
Definition: videometadata.cpp:1559
kWatchedFilterAll
@ kWatchedFilterAll
Definition: videofilter.h:59
VideoFilterSettings::getChangedState
unsigned int getChangedState()
Definition: videofilter.h:213
VideoFilterDialog::m_fsp
FilterSettingsProxy * m_fsp
Definition: videofilter.h:327
VideoFilterSettings::SetUserRating
void SetUserRating(int luserrating)
Definition: videofilter.h:162
VideoMetadata::GetCoverFile
const QString & GetCoverFile() const
Definition: videometadata.cpp:1654
VideoFilterDialog::update_numvideo
void update_numvideo()
Definition: videofilter.cpp:535
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:134
mythcontext.h
VideoFilterSettings::kOrderByLength
@ kOrderByLength
Definition: videofilter.h:112
VideoFilterSettings::kFilterTextFilterChanged
@ kFilterTextFilterChanged
Definition: videofilter.h:91
VideoFilterDialog::SetInetRef
void SetInetRef(MythUIButtonListItem *item)
Definition: videofilter.cpp:797
VideoMetadata::GetID
unsigned int GetID() const
Definition: videometadata.cpp:1529
VideoFilterSettings::GetCast
int GetCast() const
Definition: videofilter.h:133
VideoFilterDialog::m_coverFileList
MythUIButtonList * m_coverFileList
Definition: videofilter.h:320
VideoFilterSettings::SetCategory
void SetCategory(int lcategory)
Definition: videofilter.h:120
VideoMetadata::GetTitle
const QString & GetTitle() const
Definition: videometadata.cpp:1339
mythuibutton.h
VideoFilterSettings::kFilterYearChanged
@ kFilterYearChanged
Definition: videofilter.h:82
VideoMetadataListManager::metadata_list
std::list< VideoMetadataPtr > metadata_list
Definition: videometadatalistmanager.h:14
VideoFilterSettings::setRuntime
void setRuntime(int lruntime)
Definition: videofilter.h:155
VideoFilterDialog::filterChanged
void filterChanged()
kGenreFilterUnknown
@ kGenreFilterUnknown
Definition: videofilter.h:22
SingleValue::entry_list
std::vector< entry > entry_list
Definition: dbaccess.h:16
VideoFilterDialog::setOrderby
void setOrderby(MythUIButtonListItem *item)
Definition: videofilter.cpp:809
VideoFilterDialog::m_userRatingList
MythUIButtonList * m_userRatingList
Definition: videofilter.h:313
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:899
VideoFilterSettings::kFilterCategoryChanged
@ kFilterCategoryChanged
Definition: videofilter.h:79
VideoFilterDialog::m_numVideosText
MythUIText * m_numVideosText
Definition: videofilter.h:323
VideoMetadata::GetBrowse
bool GetBrowse() const
Definition: videometadata.cpp:1549
VideoFilterDialog::m_castList
MythUIButtonList * m_castList
Definition: videofilter.h:317
kCastFilterUnknown
@ kCastFilterUnknown
Definition: videofilter.h:32
VideoFilterSettings::matches_filter
bool matches_filter(const VideoMetadata &mdata) const
Definition: videofilter.cpp:187
VideoFilterSettings::m_insertDate
QDate m_insertDate
Definition: videofilter.h:238
VideoFilterDialog::~VideoFilterDialog
~VideoFilterDialog() override
Definition: videofilter.cpp:461
VideoMetadata::GetCast
const cast_list & GetCast() const
Definition: videometadata.cpp:1714
VideoFilterSettings::meta_less_than
bool meta_less_than(const VideoMetadata &lhs, const VideoMetadata &rhs) const
Compares two VideoMetadata instances.
Definition: videofilter.cpp:328
VideoList::getListCache
const VideoMetadataListManager & getListCache() const
Definition: videolist.cpp:509
videoutils.h
kCountryFilterAll
@ kCountryFilterAll
Definition: videofilter.h:26
VideoFilterSettings::setCountry
void setCountry(int lcountry)
Definition: videofilter.h:141
VideoFilterSettings::kOrderBySeasonEp
@ kOrderBySeasonEp
Definition: videofilter.h:115
VideoFilterDialog::SetCoverFile
void SetCoverFile(MythUIButtonListItem *item)
Definition: videofilter.cpp:803
VideoFilterDialog::setCountry
void setCountry(MythUIButtonListItem *item)
Definition: videofilter.cpp:761
VideoMetadata::GetLength
int GetLength() const
Definition: videometadata.cpp:1479