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 }
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:487
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:501
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:529
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
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:239
MythUIText * m_numVideosText
Definition: videofilter.h:323
MythUIButtonList * m_categoryList
Definition: videofilter.h:314
static VideoGenre & getGenre()
Definition: dbaccess.cpp:515
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:65
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
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23