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  m_changedState(0)
61 {
62  *this = rhs;
63 }
64 
67 {
68  if (this == &rhs)
69  return *this;
70 
71  m_prefix = rhs.m_prefix;
72 
73  if (m_category != rhs.m_category)
74  {
76  m_category = rhs.m_category;
77  }
78 
79  if (m_genre != rhs.m_genre)
80  {
82  m_genre = rhs.m_genre;
83  }
84 
85  if (m_country != rhs.m_country)
86  {
88  m_country = rhs.m_country;
89  }
90 
91  if (m_cast != rhs.m_cast)
92  {
94  m_cast = rhs.m_cast;
95  }
96 
97  if (m_year != rhs.m_year)
98  {
100  m_year = rhs.m_year;
101  }
102 
103  if (m_runtime != rhs.m_runtime)
104  {
106  m_runtime = rhs.m_runtime;
107  }
108 
109  if (m_userRating != rhs.m_userRating)
110  {
113  }
114 
115  if (m_browse != rhs.m_browse)
116  {
118  m_browse = rhs.m_browse;
119  }
120 
121  if (m_watched != rhs.m_watched)
122  {
124  m_watched = rhs.m_watched;
125  }
126 
127  if (m_inetRef != rhs.m_inetRef)
128  {
130  m_inetRef = rhs.m_inetRef;
131  }
132 
133  if (m_coverFile != rhs.m_coverFile)
134  {
136  m_coverFile = rhs.m_coverFile;
137  }
138 
139  if (m_orderBy != rhs.m_orderBy)
140  {
142  m_orderBy = rhs.m_orderBy;
143  }
144 
145  if (m_parentalLevel != rhs.m_parentalLevel)
146  {
149  }
150 
151  if (m_textFilter != rhs.m_textFilter)
152  {
155  }
156  if (m_season != rhs.m_season || m_episode != rhs.m_episode)
157  {
158  m_season = rhs.m_season;
159  m_episode = rhs.m_episode;
161  }
162  if (m_insertDate != rhs.m_insertDate)
163  {
166  }
167 
168  return *this;
169 }
170 
172 {
173  gCoreContext->SaveSetting(QString("%1Category").arg(m_prefix), m_category);
174  gCoreContext->SaveSetting(QString("%1Genre").arg(m_prefix), m_genre);
175  gCoreContext->SaveSetting(QString("%1Cast").arg(m_prefix), m_cast);
176  gCoreContext->SaveSetting(QString("%1Country").arg(m_prefix), m_country);
177  gCoreContext->SaveSetting(QString("%1Year").arg(m_prefix), m_year);
178  gCoreContext->SaveSetting(QString("%1Runtime").arg(m_prefix), m_runtime);
179  gCoreContext->SaveSetting(QString("%1Userrating").arg(m_prefix), m_userRating);
180  gCoreContext->SaveSetting(QString("%1Browse").arg(m_prefix), m_browse);
181  gCoreContext->SaveSetting(QString("%1Watched").arg(m_prefix), m_watched);
182  gCoreContext->SaveSetting(QString("%1InetRef").arg(m_prefix), m_inetRef);
183  gCoreContext->SaveSetting(QString("%1CoverFile").arg(m_prefix), m_coverFile);
184  gCoreContext->SaveSetting(QString("%1Orderby").arg(m_prefix), m_orderBy);
185  gCoreContext->SaveSetting(QString("%1Filter").arg(m_prefix), m_textFilter);
186 }
187 
189 {
190  bool matches = true;
191 
192  //textfilter
193  if (!m_textFilter.isEmpty())
194  {
195  matches = false;
196  matches = (matches ||
197  mdata.GetTitle().contains(m_textFilter, Qt::CaseInsensitive));
198  matches = (matches ||
199  mdata.GetSubtitle().contains(m_textFilter, Qt::CaseInsensitive));
200  matches = (matches ||
201  mdata.GetPlot().contains(m_textFilter, Qt::CaseInsensitive));
202  }
203  //search for season with optionally episode nr.
204  if (matches && (m_season != -1))
205  {
206  matches = (m_season == mdata.GetSeason());
207  matches = (matches && (m_episode == -1 || m_episode == mdata.GetEpisode()));
208  }
209  if (matches && m_insertDate.isValid())
210  {
211  matches = (mdata.GetInsertdate().isValid() &&
212  mdata.GetInsertdate() >= m_insertDate);
213  }
214  if (matches && (m_genre != kGenreFilterAll))
215  {
216  matches = false;
217 
218  const VideoMetadata::genre_list &gl = mdata.GetGenres();
219  for (const auto & g : gl)
220  {
221  if ((matches = (g.first == m_genre)))
222  {
223  break;
224  }
225  }
226  }
227 
228  if (matches && m_country != kCountryFilterAll)
229  {
230  matches = false;
231 
232  const VideoMetadata::country_list &cl = mdata.GetCountries();
233  for (const auto & c : cl)
234  {
235  if ((matches = (c.first == m_country)))
236  {
237  break;
238  }
239  }
240  }
241 
242  if (matches && m_cast != kCastFilterAll)
243  {
244  const VideoMetadata::cast_list &cl = mdata.GetCast();
245 
246  if ((m_cast == kCastFilterUnknown) && (cl.empty()))
247  {
248  matches = true;
249  }
250  else
251  {
252  matches = false;
253 
254  for (const auto & c : cl)
255  {
256  if ((matches = (c.first == m_cast)))
257  {
258  break;
259  }
260  }
261  }
262  }
263 
264  if (matches && m_category != kCategoryFilterAll)
265  {
266  matches = (m_category == mdata.GetCategoryID());
267  }
268 
269  if (matches && m_year != kYearFilterAll)
270  {
271  if (m_year == kYearFilterUnknown)
272  {
273  matches = ((mdata.GetYear() == 0) ||
274  (mdata.GetYear() == VIDEO_YEAR_DEFAULT));
275  }
276  else
277  {
278  matches = (m_year == mdata.GetYear());
279  }
280  }
281 
282  if (matches && m_runtime != kRuntimeFilterAll)
283  {
285  {
286  matches = (mdata.GetLength() == 0);
287  }
288  else
289  {
290  matches = (m_runtime == (mdata.GetLength() / 30));
291  }
292  }
293 
294  if (matches && m_userRating != kUserRatingFilterAll)
295  {
296  matches = (mdata.GetUserRating() >= m_userRating);
297  }
298 
299  if (matches && m_browse != kBrowseFilterAll)
300  {
301  matches = (mdata.GetBrowse() == m_browse);
302  }
303 
304  if (matches && m_watched != kWatchedFilterAll)
305  {
306  matches = (mdata.GetWatched() == m_watched);
307  }
308 
309  if (matches && m_inetRef != kInetRefFilterAll)
310  {
311  matches = (mdata.GetInetRef() == VIDEO_INETREF_DEFAULT);
312  }
313 
314  if (matches && m_coverFile != kCoverFileFilterAll)
315  {
316  matches = (IsDefaultCoverFile(mdata.GetCoverFile()));
317  }
318 
319  if (matches && m_parentalLevel)
320  {
321  matches = ((mdata.GetShowLevel() != ParentalLevel::plNone) &&
322  (mdata.GetShowLevel() <= m_parentalLevel));
323  }
324 
325  return matches;
326 }
327 
330  const VideoMetadata &rhs) const
331 {
332  bool ret = false;
333  switch (m_orderBy)
334  {
335  case kOrderByTitle:
336  {
337  ret = lhs.sortBefore(rhs);
338  break;
339  }
340  case kOrderBySeasonEp:
341  {
342  if ((lhs.GetSeason() == rhs.GetSeason())
343  && (lhs.GetEpisode() == rhs.GetEpisode())
344  && (lhs.GetSeason() == 0)
345  && (rhs.GetSeason() == 0)
346  && (lhs.GetEpisode() == 0)
347  && (rhs.GetEpisode() == 0))
348  {
349  ret = lhs.sortBefore(rhs);
350  }
351  else if ((lhs.GetSeason() == rhs.GetSeason())
352  && (lhs.GetTitle() == rhs.GetTitle()))
353  ret = (lhs.GetEpisode() < rhs.GetEpisode());
354  else
355  ret = (lhs.GetSeason() < rhs.GetSeason());
356  break;
357  }
359  {
360  ret = (lhs.GetYear() > rhs.GetYear());
361  break;
362  }
364  {
365  ret = (lhs.GetUserRating() > rhs.GetUserRating());
366  break;
367  }
368  case kOrderByLength:
369  {
370  ret = (lhs.GetLength() < rhs.GetLength());
371  break;
372  }
373  case kOrderByFilename:
374  {
375  const QString& lhsfn = lhs.GetSortFilename();
376  const QString& rhsfn = rhs.GetSortFilename();
377  ret = naturalCompare(lhsfn, rhsfn) < 0;
378  break;
379  }
380  case kOrderByID:
381  {
382  ret = (lhs.GetID() < rhs.GetID());
383  break;
384  }
386  {
387  ret = (lhs.GetInsertdate() > rhs.GetInsertdate());
388  break;
389  }
390  default:
391  {
392  LOG(VB_GENERAL, LOG_ERR, QString("Error: unknown sort type %1")
393  .arg(m_orderBy));
394  }
395  }
396 
397  return ret;
398 }
399 
400 void VideoFilterSettings::setTextFilter(const QString& val)
401 {
403  if (m_reSeason.indexIn(val) != -1)
404  {
405  bool res = false;
406  QStringList list = m_reSeason.capturedTexts();
407  m_season = list[1].toInt(&res);
408  if (!res)
409  m_season = -1;
410  if (list.size() > 2) {
411  m_episode = list[2].toInt(&res);
412  if (!res)
413  m_episode = -1;
414  }
415  else {
416  m_episode = -1;
417  }
418  //clear \dX\d from string for string-search in plot/title/subtitle
419  m_textFilter = val;
420  m_textFilter.replace(m_reSeason, "");
421  m_textFilter = m_textFilter.simplified ();
422  }
423  else
424  {
425  m_textFilter = val;
426  m_season = -1;
427  m_episode = -1;
428  }
429  if (m_reDate.indexIn(m_textFilter) != -1)
430  {
431  QStringList list = m_reDate.capturedTexts();
432  int modnr = list[1].toInt();
433  QDate testdate = MythDate::current().date();
434  switch(list[2].at(0).toLatin1())
435  {
436  case 'm': testdate = testdate.addMonths(-modnr);break;
437  case 'd': testdate = testdate.addDays(-modnr);break;
438  case 'w': testdate = testdate.addDays(-modnr * 7);break;
439  }
440  m_insertDate = testdate;
441  m_textFilter.replace(m_reDate, "");
442  m_textFilter = m_textFilter.simplified ();
443  }
444  else
445  {
446  //reset testdate
447  m_insertDate = QDate();
448  }
449 }
450 
452 // VideoFilterDialog
455  VideoList *video_list) : MythScreenType(lparent, lname),
456  m_videoList(*video_list)
457 {
458  m_fsp = new BasicFilterSettingsProxy<VideoList>(*video_list);
460 }
461 
463 {
464  delete m_fsp;
465 }
466 
468 {
469  if (!LoadWindowFromXML("video-ui.xml", "filter", this))
470  return false;
471 
472  bool err = false;
473  UIUtilE::Assign(this, m_textFilter, "textfilter_input", &err);
474  UIUtilE::Assign(this, m_yearList, "year_select", &err);
475  UIUtilE::Assign(this, m_userRatingList, "userrating_select", &err);
476  UIUtilE::Assign(this, m_categoryList, "category_select", &err);
477  UIUtilE::Assign(this, m_countryList, "country_select", &err);
478  UIUtilE::Assign(this, m_genreList, "genre_select", &err);
479  UIUtilE::Assign(this, m_castList, "cast_select", &err);
480  UIUtilE::Assign(this, m_runtimeList, "runtime_select", &err);
481  UIUtilE::Assign(this, m_browseList, "browse_select", &err);
482  UIUtilE::Assign(this, m_watchedList, "watched_select", &err);
483  UIUtilE::Assign(this, m_inetRefList, "inetref_select", &err);
484  UIUtilE::Assign(this, m_coverFileList, "coverfile_select", &err);
485  UIUtilE::Assign(this, m_orderByList, "orderby_select", &err);
486 
487  UIUtilE::Assign(this, m_doneButton, "done_button", &err);
488  UIUtilE::Assign(this, m_saveButton, "save_button", &err);
489 
490  UIUtilE::Assign(this, m_numVideosText, "numvideos_text", &err);
491 
492  if (err)
493  {
494  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'filter'");
495  return false;
496  }
497 
498  BuildFocusList();
499 
500  fillWidgets();
501  update_numvideo();
502 
503  connect(m_yearList, SIGNAL(itemSelected(MythUIButtonListItem*)),
504  SLOT(SetYear(MythUIButtonListItem*)));
505  connect(m_userRatingList, SIGNAL(itemSelected(MythUIButtonListItem*)),
507  connect(m_categoryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
509  connect(m_countryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
511  connect(m_genreList,SIGNAL(itemSelected(MythUIButtonListItem*)),
513  connect(m_castList,SIGNAL(itemSelected(MythUIButtonListItem*)),
514  SLOT(SetCast(MythUIButtonListItem*)));
515  connect(m_runtimeList, SIGNAL(itemSelected(MythUIButtonListItem*)),
517  connect(m_browseList, SIGNAL(itemSelected(MythUIButtonListItem*)),
519  connect(m_watchedList, SIGNAL(itemSelected(MythUIButtonListItem*)),
521  connect(m_inetRefList, SIGNAL(itemSelected(MythUIButtonListItem*)),
523  connect(m_coverFileList, SIGNAL(itemSelected(MythUIButtonListItem*)),
525  connect(m_orderByList, SIGNAL(itemSelected(MythUIButtonListItem*)),
527  connect(m_textFilter, SIGNAL(valueChanged()),
528  SLOT(setTextFilter()));
529 
530  connect(m_saveButton, SIGNAL(Clicked()), SLOT(saveAsDefault()));
531  connect(m_doneButton, SIGNAL(Clicked()), SLOT(saveAndExit()));
532 
533  return true;
534 }
535 
537 {
538  int video_count = m_videoList.TryFilter(m_settings);
539 
540  if (video_count > 0)
541  {
542  m_numVideosText->SetText(tr("Result of this filter : %n video(s)", "",
543  video_count));
544  }
545  else
546  {
547  m_numVideosText->SetText(tr("Result of this filter : No Videos"));
548  }
549 }
550 
552 {
553  bool have_unknown_year = false;
554  bool have_unknown_runtime = false;
555 
556  using int_list = std::set<int>;
557  int_list years;
558  int_list runtimes;
559  int_list user_ratings;
560 
563  for (const auto & md : mdl)
564  {
565  int year = md->GetYear();
566  if ((year == 0) || (year == VIDEO_YEAR_DEFAULT))
567  have_unknown_year = true;
568  else
569  years.insert(year);
570 
571  int runtime = md->GetLength();
572  if (runtime == 0)
573  have_unknown_runtime = true;
574  else
575  runtimes.insert(runtime / 30);
576 
577  user_ratings.insert(static_cast<int>(md->GetUserRating()));
578  }
579 
580  // Category
581  new MythUIButtonListItem(m_categoryList, tr("All", "Category"),
583 
584  const VideoCategory::entry_list &vcl =
586  for (const auto & vc : vcl)
587  new MythUIButtonListItem(m_categoryList, vc.second, vc.first);
588 
592 
593  // Genre
594  new MythUIButtonListItem(m_genreList, tr("All", "Genre"), kGenreFilterAll);
595 
597  for (const auto & g : gl)
598  new MythUIButtonListItem(m_genreList, g.second, g.first);
599 
602 
603  // Cast
604  new MythUIButtonListItem(m_castList, tr("All", "Cast"), kCastFilterAll);
605 
607  for (const auto & c : cl)
608  new MythUIButtonListItem(m_castList, c.second, c.first);
609 
612 
613  // Country
614  new MythUIButtonListItem(m_countryList, tr("All", "Country"), kCountryFilterAll);
615 
617  for (const auto & cn : cnl)
618  new MythUIButtonListItem(m_countryList, cn.second, cn.first);
619 
623 
624  // Year
625  new MythUIButtonListItem(m_yearList, tr("All", "Year"), kYearFilterAll);
626 
627  for (auto p = years.crbegin(); p != years.crend(); ++p)
628  {
629  new MythUIButtonListItem(m_yearList, QString::number(*p), *p);
630  }
631 
632  if (have_unknown_year)
635 
637 
638  // Runtime
639  new MythUIButtonListItem(m_runtimeList, tr("All", "Runtime"), kRuntimeFilterAll);
640 
641  if (have_unknown_runtime)
644 
645  for (int runtime : runtimes)
646  {
647  QString s = QString("%1 %2 ~ %3 %4").arg(runtime * 30).arg(tr("minutes"))
648  .arg((runtime + 1) * 30).arg(tr("minutes"));
649  new MythUIButtonListItem(m_runtimeList, s, runtime);
650  }
651 
653 
654  // User Rating
655  new MythUIButtonListItem(m_userRatingList, tr("All", "User rating"),
657 
658  for (auto p = user_ratings.crbegin(); p != user_ratings.crend(); ++p)
659  {
661  QString(">= %1").arg(QString::number(*p)),
662  *p);
663  }
664 
666 
667  // Browsable
668  new MythUIButtonListItem(m_browseList, tr("All", "Browsable"),
671  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
673  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
675 
676  // Watched
677  new MythUIButtonListItem(m_watchedList, tr("All", "Watched"),
680  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
682  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
684 
685  // Inet Reference
686  new MythUIButtonListItem(m_inetRefList, tr("All", "Inet reference"),
688  new MythUIButtonListItem(m_inetRefList, tr("Unknown", "Inet reference"),
691 
692  // Coverfile
693  new MythUIButtonListItem(m_coverFileList, tr("All", "Cover file"),
695  new MythUIButtonListItem(m_coverFileList, tr("None", "Cover file"),
698 
699  // Order by
701  QCoreApplication::translate("(Common)", "Title"),
704  QCoreApplication::translate("(Common)", "Season/Episode"),
707  QCoreApplication::translate("(Common)", "Year"),
710  QCoreApplication::translate("(Common)", "User Rating"),
713  QCoreApplication::translate("(Common)", "Runtime"),
716  QCoreApplication::translate("(Common)", "Filename"),
718  new MythUIButtonListItem(m_orderByList, tr("Video ID"),
720  new MythUIButtonListItem(m_orderByList, tr("Date Added"),
723 
724  // Text Filter
726 }
727 
729 {
731  saveAndExit();
732 }
733 
735 {
737 
738  if (m_settings.getChangedState() > 0)
739  emit filterChanged();
740  Close();
741 }
742 
744 {
745  int new_year = item->GetData().toInt();
746  m_settings.SetYear(new_year);
747  update_numvideo();
748 }
749 
751 {
752  m_settings.SetUserRating(item->GetData().toInt());
753  update_numvideo();
754 }
755 
757 {
758  m_settings.SetCategory(item->GetData().toInt());
759  update_numvideo();
760 }
761 
763 {
764  m_settings.setCountry(item->GetData().toInt());
765  update_numvideo();
766 }
767 
769 {
770  m_settings.setGenre(item->GetData().toInt());
771  update_numvideo();
772 }
773 
775 {
776  m_settings.SetCast(item->GetData().toInt());
777  update_numvideo();
778 }
779 
781 {
782  m_settings.setRuntime(item->GetData().toInt());
783  update_numvideo();
784 }
785 
787 {
788  m_settings.SetBrowse(item->GetData().toInt());
789  update_numvideo();
790 }
791 
793 {
794  m_settings.SetWatched(item->GetData().toInt());
795  update_numvideo();
796 }
797 
799 {
800  m_settings.SetInetRef(item->GetData().toInt());
801  update_numvideo();
802 }
803 
805 {
806  m_settings.SetCoverFile(item->GetData().toInt());
807  update_numvideo();
808 }
809 
811 {
812  m_settings
814  update_numvideo();
815 }
816 
818 {
820  update_numvideo();
821 }
void SetCategory(MythUIButtonListItem *item)
void SetCoverFile(MythUIButtonListItem *item)
void setOrderby(MythUIButtonListItem *item)
void SetInetRef(int inetref)
Definition: videofilter.h:200
int getRuntime() const
Definition: videofilter.h:154
int GetLength() const
const QString & GetSortFilename() const
bool GetWatched() const
const QRegExp m_reSeason
Definition: videofilter.h:239
void SetUserRating(int luserrating)
Definition: videofilter.h:162
MythUIButton * m_saveButton
Definition: videofilter.h:321
void SetCast(MythUIButtonListItem *item)
const metadata_list & getList() const
QDate GetInsertdate() const
int GetSeason() const
virtual void setSettings(const VideoFilterSettings &settings)=0
void SetCategory(int lcategory)
Definition: videofilter.h:120
MythUIButton * m_doneButton
Definition: videofilter.h:322
int GetCoverFile() const
Definition: videofilter.h:206
const VideoMetadataListManager & getListCache() const
Definition: videolist.cpp:505
void setGenre(MythUIButtonListItem *item)
VideoFilterSettings(bool loaddefaultsettings=true, const QString &_prefix="")
Definition: videofilter.cpp:19
ParentalLevel::Level m_parentalLevel
Definition: videofilter.h:233
std::vector< country_entry > country_list
Definition: videometadata.h:33
void SaveSetting(const QString &key, int newValue)
const QString VIDEO_COUNTRY_UNKNOWN
Definition: globals.cpp:13
void setGenre(int lgenre)
Definition: videofilter.h:127
void SetBrowse(int lbrowse)
Definition: videofilter.h:169
const QString VIDEO_CAST_UNKNOWN
Definition: globals.cpp:19
int getYear() const
Definition: videofilter.h:147
MythUIButtonList * m_genreList
Definition: videofilter.h:316
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:135
std::vector< cast_entry > cast_list
Definition: videometadata.h:34
const QString VIDEO_CATEGORY_UNKNOWN
Definition: globals.cpp:7
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
virtual const VideoFilterSettings & getSettings()=0
static VideoCategory & GetCategory()
Definition: dbaccess.cpp:488
void setCountry(int lcountry)
Definition: videofilter.h:141
bool IsDefaultCoverFile(const QString &coverfile)
Definition: videoutils.cpp:125
MythUIButtonList * m_inetRefList
Definition: videofilter.h:319
const QString VIDEO_YEAR_UNKNOWN
Definition: globals.cpp:15
const VideoList & m_videoList
Definition: videofilter.h:326
int GetCast() const
Definition: videofilter.h:133
void BuildFocusList(void)
unsigned int GetID() const
VideoFilterDialog(MythScreenStack *lparent, const QString &lname, VideoList *video_list)
MythUIButtonList * m_browseList
Definition: videofilter.h:309
int getCountry() const
Definition: videofilter.h:140
int getInteRef() const
Definition: videofilter.h:199
virtual void Close()
ParentalLevel::Level GetShowLevel() const
int GetYear() const
void setTextFilter(const QString &val)
bool Create() override
int GetBrowse() const
Definition: videofilter.h:168
static VideoCountry & getCountry()
Definition: dbaccess.cpp:502
MythUIButtonList * m_runtimeList
Definition: videofilter.h:318
float GetUserRating() const
void SetCoverFile(int coverfile)
Definition: videofilter.h:207
unsigned int m_changedState
Definition: videofilter.h:242
const QString & GetPlot() const
void setRunTime(MythUIButtonListItem *item)
void SetWatched(int lwatched)
Definition: videofilter.h:176
int GetEpisode() const
void SetBrowse(MythUIButtonListItem *item)
void SetUserRating(MythUIButtonListItem *item)
const QString VIDEO_GENRE_UNKNOWN
Definition: globals.cpp:11
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
bool sortBefore(const VideoMetadata &rhs) const
MythUITextEdit * m_textFilter
Definition: videofilter.h:324
MythUIButtonList * m_yearList
Definition: videofilter.h:312
void SetYear(int lyear)
Definition: videofilter.h:148
MythUIButtonList * m_countryList
Definition: videofilter.h:315
void SetYear(MythUIButtonListItem *item)
void setRuntime(int lruntime)
Definition: videofilter.h:155
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
std::vector< genre_entry > genre_list
Definition: videometadata.h:32
int GetCategoryID() const
static VideoCast & GetCast()
Definition: dbaccess.cpp:530
bool matches_filter(const VideoMetadata &mdata) const
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
void SetText(const QString &text, bool moveCursor=true)
bool meta_less_than(const VideoMetadata &lhs, const VideoMetadata &rhs) const
Compares two VideoMetadata instances.
const cast_list & GetCast() const
int getGenre() const
Definition: videofilter.h:126
int TryFilter(const VideoFilterSettings &filter) const
Definition: videolist.cpp:500
MythUIButtonList * m_coverFileList
Definition: videofilter.h:320
int GetCategory() const
Definition: videofilter.h:119
int GetNumSetting(const QString &key, int defaultval=0)
const country_list & GetCountries() const
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
VideoFilterSettings m_settings
Definition: videofilter.h:307
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
MythUIButtonList * m_userRatingList
Definition: videofilter.h:313
const entry_list & getList()
Definition: dbaccess.cpp:240
MythUIText * m_numVideosText
Definition: videofilter.h:323
MythUIButtonList * m_categoryList
Definition: videofilter.h:314
static VideoGenre & getGenre()
Definition: dbaccess.cpp:516
bool GetBrowse() const
const QRegExp m_reDate
Definition: videofilter.h:240
std::vector< entry > entry_list
Definition: dbaccess.h:16
FilterSettingsProxy * m_fsp
Definition: videofilter.h:327
void setCountry(MythUIButtonListItem *item)
const QString & GetSubtitle() const
const QString & GetCoverFile() const
int GetUserRating() const
Definition: videofilter.h:161
MythUIButtonList * m_castList
Definition: videofilter.h:317
const genre_list & GetGenres() const
unsigned int getChangedState()
Definition: videofilter.h:213
Screen in which all other widgets are contained and rendered.
const QString & GetInetRef() const
const QString & GetTitle() const
int GetWatched() const
Definition: videofilter.h:175
int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity)
ordering getOrderby() const
Definition: videofilter.h:182
void SetCast(int lcast)
Definition: videofilter.h:134
const QString VIDEO_RUNTIME_UNKNOWN
Definition: globals.cpp:17
QString getTextFilter() const
Definition: videofilter.h:189
MythUIButtonList * m_watchedList
Definition: videofilter.h:310
VideoFilterSettings & operator=(const VideoFilterSettings &rhs)
Definition: videofilter.cpp:66
void SetWatched(MythUIButtonListItem *item)
void SetInetRef(MythUIButtonListItem *item)
QString GetText(void) const
void SetValueByData(const QVariant &data)
std::list< VideoMetadataPtr > metadata_list
MythUIButtonList * m_orderByList
Definition: videofilter.h:311
void setOrderby(ordering lorderby)
Definition: videofilter.h:183
~VideoFilterDialog() override