MythTV  master
videofilter.cpp
Go to the documentation of this file.
1 // C++
2 #include <set>
3 
4 // MythTV
5 #include "libmyth/mythcontext.h"
6 #include "libmythbase/mythdate.h"
12 #include "libmythui/mythuibutton.h"
14 #include "libmythui/mythuitext.h"
16 
17 // MythFrontend
18 #include "videofilter.h"
19 #include "videolist.h"
20 
21 const QRegularExpression VideoFilterSettings::kReSeason {
22  "(\\d+)x(\\d*)", QRegularExpression::CaseInsensitiveOption };
23 const QRegularExpression VideoFilterSettings::kReDate {
24  "-(\\d+)([dwmy])", QRegularExpression::CaseInsensitiveOption };
25 
26 #if QT_VERSION < QT_VERSION_CHECK(5,15,2)
27 #define capturedView capturedRef
28 #endif
29 
31  const QString& _prefix)
32 {
33  if (_prefix.isEmpty())
34  m_prefix = "VideoDefault";
35  else
36  m_prefix = _prefix + "Default";
37 
38  // do nothing yet
39  if (loaddefaultsettings)
40  {
41  m_category = gCoreContext->GetNumSetting(QString("%1Category").arg(m_prefix),
43  m_genre = gCoreContext->GetNumSetting(QString("%1Genre").arg(m_prefix),
45  m_country = gCoreContext->GetNumSetting(QString("%1Country").arg(m_prefix),
47  m_cast = gCoreContext->GetNumSetting(QString("%1Cast").arg(m_prefix),
49  m_year = gCoreContext->GetNumSetting(QString("%1Year").arg(m_prefix),
51  m_runtime = gCoreContext->GetNumSetting(QString("%1Runtime").arg(m_prefix),
53  m_userRating =
54  gCoreContext->GetNumSetting(QString("%1Userrating").arg(m_prefix),
56  m_browse = gCoreContext->GetNumSetting(QString("%1Browse").arg(m_prefix),
58  m_watched = gCoreContext->GetNumSetting(QString("%1Watched").arg(m_prefix),
60  m_inetRef = gCoreContext->GetNumSetting(QString("%1InetRef").arg(m_prefix),
62  m_coverFile = gCoreContext->GetNumSetting(QString("%1CoverFile")
64  m_orderBy = (ordering)gCoreContext->GetNumSetting(QString("%1Orderby")
65  .arg(m_prefix),
67  }
68 }
69 
71 {
72  *this = rhs;
73 }
74 
77 {
78  if (this == &rhs)
79  return *this;
80 
81  m_prefix = rhs.m_prefix;
82 
83  if (m_category != rhs.m_category)
84  {
86  m_category = rhs.m_category;
87  }
88 
89  if (m_genre != rhs.m_genre)
90  {
92  m_genre = rhs.m_genre;
93  }
94 
95  if (m_country != rhs.m_country)
96  {
98  m_country = rhs.m_country;
99  }
100 
101  if (m_cast != rhs.m_cast)
102  {
104  m_cast = rhs.m_cast;
105  }
106 
107  if (m_year != rhs.m_year)
108  {
110  m_year = rhs.m_year;
111  }
112 
113  if (m_runtime != rhs.m_runtime)
114  {
116  m_runtime = rhs.m_runtime;
117  }
118 
119  if (m_userRating != rhs.m_userRating)
120  {
123  }
124 
125  if (m_browse != rhs.m_browse)
126  {
128  m_browse = rhs.m_browse;
129  }
130 
131  if (m_watched != rhs.m_watched)
132  {
134  m_watched = rhs.m_watched;
135  }
136 
137  if (m_inetRef != rhs.m_inetRef)
138  {
140  m_inetRef = rhs.m_inetRef;
141  }
142 
143  if (m_coverFile != rhs.m_coverFile)
144  {
146  m_coverFile = rhs.m_coverFile;
147  }
148 
149  if (m_orderBy != rhs.m_orderBy)
150  {
152  m_orderBy = rhs.m_orderBy;
153  }
154 
155  if (m_parentalLevel != rhs.m_parentalLevel)
156  {
159  }
160 
161  if (m_textFilter != rhs.m_textFilter)
162  {
165  }
166  if (m_season != rhs.m_season || m_episode != rhs.m_episode)
167  {
168  m_season = rhs.m_season;
169  m_episode = rhs.m_episode;
171  }
172  if (m_insertDate != rhs.m_insertDate)
173  {
176  }
177 
178  return *this;
179 }
180 
182 {
183  gCoreContext->SaveSetting(QString("%1Category").arg(m_prefix), m_category);
184  gCoreContext->SaveSetting(QString("%1Genre").arg(m_prefix), m_genre);
185  gCoreContext->SaveSetting(QString("%1Cast").arg(m_prefix), m_cast);
186  gCoreContext->SaveSetting(QString("%1Country").arg(m_prefix), m_country);
187  gCoreContext->SaveSetting(QString("%1Year").arg(m_prefix), m_year);
188  gCoreContext->SaveSetting(QString("%1Runtime").arg(m_prefix), m_runtime);
189  gCoreContext->SaveSetting(QString("%1Userrating").arg(m_prefix), m_userRating);
190  gCoreContext->SaveSetting(QString("%1Browse").arg(m_prefix), m_browse);
191  gCoreContext->SaveSetting(QString("%1Watched").arg(m_prefix), m_watched);
192  gCoreContext->SaveSetting(QString("%1InetRef").arg(m_prefix), m_inetRef);
193  gCoreContext->SaveSetting(QString("%1CoverFile").arg(m_prefix), m_coverFile);
194  gCoreContext->SaveSetting(QString("%1Orderby").arg(m_prefix), m_orderBy);
195  gCoreContext->SaveSetting(QString("%1Filter").arg(m_prefix), m_textFilter);
196 }
197 
199 {
200  bool matches = true;
201 
202  //textfilter
203  if (!m_textFilter.isEmpty())
204  {
205  matches = false;
206  matches = (matches ||
207  mdata.GetTitle().contains(m_textFilter, Qt::CaseInsensitive));
208  matches = (matches ||
209  mdata.GetSubtitle().contains(m_textFilter, Qt::CaseInsensitive));
210  matches = (matches ||
211  mdata.GetPlot().contains(m_textFilter, Qt::CaseInsensitive));
212  }
213  //search for season with optionally episode nr.
214  if (matches && (m_season != -1))
215  {
216  matches = (m_season == mdata.GetSeason());
217  matches = (matches && (m_episode == -1 || m_episode == mdata.GetEpisode()));
218  }
219  if (matches && m_insertDate.isValid())
220  {
221  matches = (mdata.GetInsertdate().isValid() &&
222  mdata.GetInsertdate() >= m_insertDate);
223  }
224  if (matches && (m_genre != kGenreFilterAll))
225  {
226  const VideoMetadata::genre_list &gl = mdata.GetGenres();
227  auto samegenre = [this](const auto & g) {return g.first == m_genre; };
228  matches = std::any_of(gl.cbegin(), gl.cend(), samegenre);
229  }
230 
231  if (matches && m_country != kCountryFilterAll)
232  {
233  const VideoMetadata::country_list &cl = mdata.GetCountries();
234  auto samecountry = [this](const auto & c) {return c.first == m_country; };
235  matches = std::any_of(cl.cbegin(), cl.cend(), samecountry);
236  }
237 
238  if (matches && m_cast != kCastFilterAll)
239  {
240  const VideoMetadata::cast_list &cl = mdata.GetCast();
241 
242  if ((m_cast == kCastFilterUnknown) && (cl.empty()))
243  {
244  matches = true;
245  }
246  else
247  {
248  auto samecast = [this](const auto & c){return c.first == m_cast; };
249  matches = std::any_of(cl.cbegin(), cl.cend(), samecast);
250  }
251  }
252 
253  if (matches && m_category != kCategoryFilterAll)
254  {
255  matches = (m_category == mdata.GetCategoryID());
256  }
257 
258  if (matches && m_year != kYearFilterAll)
259  {
260  if (m_year == kYearFilterUnknown)
261  {
262  matches = ((mdata.GetYear() == 0) ||
263  (mdata.GetYear() == VIDEO_YEAR_DEFAULT));
264  }
265  else
266  {
267  matches = (m_year == mdata.GetYear());
268  }
269  }
270 
271  if (matches && m_runtime != kRuntimeFilterAll)
272  {
274  {
275  matches = (mdata.GetLength() == 0min);
276  }
277  else
278  {
279  matches = (m_runtime == (mdata.GetLength() / 30min));
280  }
281  }
282 
283  if (matches && m_userRating != kUserRatingFilterAll)
284  {
285  matches = (mdata.GetUserRating() >= m_userRating);
286  }
287 
288  if (matches && m_browse != kBrowseFilterAll)
289  {
290  matches = (static_cast<int>(mdata.GetBrowse()) == m_browse);
291  }
292 
293  if (matches && m_watched != kWatchedFilterAll)
294  {
295  matches = (static_cast<int>(mdata.GetWatched()) == m_watched);
296  }
297 
298  if (matches && m_inetRef != kInetRefFilterAll)
299  {
300  matches = (mdata.GetInetRef() == VIDEO_INETREF_DEFAULT);
301  }
302 
303  if (matches && m_coverFile != kCoverFileFilterAll)
304  {
305  matches = (IsDefaultCoverFile(mdata.GetCoverFile()));
306  }
307 
308  if (matches && m_parentalLevel)
309  {
310  matches = ((mdata.GetShowLevel() != ParentalLevel::plNone) &&
311  (mdata.GetShowLevel() <= m_parentalLevel));
312  }
313 
314  return matches;
315 }
316 
319  const VideoMetadata &rhs) const
320 {
321  switch (m_orderBy)
322  {
323  case kOrderByTitle: return lhs.sortBefore(rhs);
324  case kOrderByYearDescending: return lhs.GetYear() > rhs.GetYear();
325  case kOrderByUserRatingDescending: return lhs.GetUserRating() > rhs.GetUserRating();
326  case kOrderByDateAddedDescending: return lhs.GetInsertdate() > rhs.GetInsertdate();
327  case kOrderByLength: return lhs.GetLength() < rhs.GetLength();
328  case kOrderByID: return lhs.GetID() < rhs.GetID();
329  case kOrderByFilename:
331  case kOrderBySeasonEp:
332  {
333  if ((lhs.GetSeason() == rhs.GetSeason())
334  && (lhs.GetEpisode() == rhs.GetEpisode())
335  && (lhs.GetSeason() == 0)
336  && (rhs.GetSeason() == 0)
337  && (lhs.GetEpisode() == 0)
338  && (rhs.GetEpisode() == 0))
339  {
340  return lhs.sortBefore(rhs);
341  }
342  if ((lhs.GetSeason() == rhs.GetSeason())
343  && (lhs.GetTitle() == rhs.GetTitle()))
344  {
345  return (lhs.GetEpisode() < rhs.GetEpisode());
346  }
347  return (lhs.GetSeason() < rhs.GetSeason());
348  }
349  default:
350  {
351  LOG(VB_GENERAL, LOG_ERR, QString("Error: unknown sort type %1")
352  .arg(m_orderBy));
353  return false;
354  }
355  }
356 }
357 
358 void VideoFilterSettings::setTextFilter(const QString& val)
359 {
361  auto match = kReSeason.match(val);
362  if (match.hasMatch())
363  {
364  m_season = match.capturedView(1).isEmpty()
365  ? -1 : match.capturedView(1).toInt();
366  m_episode = match.capturedView(2).isEmpty()
367  ? -1 : match.capturedView(2).toInt();
368  //clear \dX\d from string for string-search in plot/title/subtitle
369  m_textFilter = val;
370  m_textFilter.remove(match.capturedStart(), match.capturedLength());
371  m_textFilter = m_textFilter.simplified ();
372  }
373  else
374  {
375  m_textFilter = val;
376  m_season = -1;
377  m_episode = -1;
378  }
379  match = kReDate.match(m_textFilter);
380  if (match.hasMatch())
381  {
382  int64_t modnr = match.capturedView(1).toInt();
383  QDate testdate = MythDate::current().date();
384  switch(match.capturedView(2).at(0).toLatin1())
385  {
386  case 'd': testdate = testdate.addDays(-modnr);break;
387  case 'w': testdate = testdate.addDays(-modnr * 7);break;
388  case 'm': testdate = testdate.addMonths(-modnr);break;
389  case 'y': testdate = testdate.addYears(-modnr);break;
390  }
391  m_insertDate = testdate;
392  m_textFilter.remove(match.capturedStart(), match.capturedLength());
393  m_textFilter = m_textFilter.simplified ();
394  }
395  else
396  {
397  //reset testdate
398  m_insertDate = QDate();
399  }
400 }
401 
403 // VideoFilterDialog
406  VideoList *video_list) : MythScreenType(lparent, lname),
407  m_videoList(*video_list)
408 {
409  m_fsp = new BasicFilterSettingsProxy<VideoList>(*video_list);
411 }
412 
414 {
415  delete m_fsp;
416 }
417 
419 {
420  if (!LoadWindowFromXML("video-ui.xml", "filter", this))
421  return false;
422 
423  bool err = false;
424  UIUtilE::Assign(this, m_textFilter, "textfilter_input", &err);
425  UIUtilE::Assign(this, m_yearList, "year_select", &err);
426  UIUtilE::Assign(this, m_userRatingList, "userrating_select", &err);
427  UIUtilE::Assign(this, m_categoryList, "category_select", &err);
428  UIUtilE::Assign(this, m_countryList, "country_select", &err);
429  UIUtilE::Assign(this, m_genreList, "genre_select", &err);
430  UIUtilE::Assign(this, m_castList, "cast_select", &err);
431  UIUtilE::Assign(this, m_runtimeList, "runtime_select", &err);
432  UIUtilE::Assign(this, m_browseList, "browse_select", &err);
433  UIUtilE::Assign(this, m_watchedList, "watched_select", &err);
434  UIUtilE::Assign(this, m_inetRefList, "inetref_select", &err);
435  UIUtilE::Assign(this, m_coverFileList, "coverfile_select", &err);
436  UIUtilE::Assign(this, m_orderByList, "orderby_select", &err);
437 
438  UIUtilE::Assign(this, m_doneButton, "done_button", &err);
439  UIUtilE::Assign(this, m_saveButton, "save_button", &err);
440 
441  UIUtilE::Assign(this, m_numVideosText, "numvideos_text", &err);
442 
443  if (err)
444  {
445  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'filter'");
446  return false;
447  }
448 
449  BuildFocusList();
450 
451  fillWidgets();
452  update_numvideo();
453 
480 
483 
484  return true;
485 }
486 
488 {
489  int video_count = m_videoList.TryFilter(m_settings);
490 
491  if (video_count > 0)
492  {
493  m_numVideosText->SetText(tr("Result of this filter : %n video(s)", "",
494  video_count));
495  }
496  else
497  {
498  m_numVideosText->SetText(tr("Result of this filter : No Videos"));
499  }
500 }
501 
503 {
504  bool have_unknown_year = false;
505  bool have_unknown_runtime = false;
506 
507  using int_list = std::set<int>;
508  int_list years;
509  int_list runtimes;
510  int_list user_ratings;
511 
514  for (const auto & md : mdl)
515  {
516  int year = md->GetYear();
517  if ((year == 0) || (year == VIDEO_YEAR_DEFAULT))
518  have_unknown_year = true;
519  else
520  years.insert(year);
521 
522  std::chrono::minutes runtime = md->GetLength();
523  if (runtime == 0min)
524  have_unknown_runtime = true;
525  else
526  runtimes.insert(runtime.count() / 30);
527 
528  user_ratings.insert(static_cast<int>(md->GetUserRating()));
529  }
530 
531  // Category
532  new MythUIButtonListItem(m_categoryList, tr("All", "Category"),
534 
535  const VideoCategory::entry_list &vcl =
537  for (const auto & vc : vcl)
538  new MythUIButtonListItem(m_categoryList, vc.second, vc.first);
539 
543 
544  // Genre
545  new MythUIButtonListItem(m_genreList, tr("All", "Genre"), kGenreFilterAll);
546 
548  for (const auto & g : gl)
549  new MythUIButtonListItem(m_genreList, g.second, g.first);
550 
553 
554  // Cast
555  new MythUIButtonListItem(m_castList, tr("All", "Cast"), kCastFilterAll);
556 
558  for (const auto & c : cl)
559  new MythUIButtonListItem(m_castList, c.second, c.first);
560 
563 
564  // Country
565  new MythUIButtonListItem(m_countryList, tr("All", "Country"), kCountryFilterAll);
566 
568  for (const auto & cn : cnl)
569  new MythUIButtonListItem(m_countryList, cn.second, cn.first);
570 
574 
575  // Year
576  new MythUIButtonListItem(m_yearList, tr("All", "Year"), kYearFilterAll);
577 
578  for (auto p = years.crbegin(); p != years.crend(); ++p)
579  {
580  new MythUIButtonListItem(m_yearList, QString::number(*p), *p);
581  }
582 
583  if (have_unknown_year)
586 
588 
589  // Runtime
590  new MythUIButtonListItem(m_runtimeList, tr("All", "Runtime"), kRuntimeFilterAll);
591 
592  if (have_unknown_runtime)
595 
596  for (int runtime : runtimes)
597  {
598  QString s = QString("%1 %2 ~ %3 %4").arg(runtime * 30).arg(tr("minutes"))
599  .arg((runtime + 1) * 30).arg(tr("minutes"));
600  new MythUIButtonListItem(m_runtimeList, s, runtime);
601  }
602 
604 
605  // User Rating
606  new MythUIButtonListItem(m_userRatingList, tr("All", "User rating"),
608 
609  for (auto p = user_ratings.crbegin(); p != user_ratings.crend(); ++p)
610  {
612  QString(">= %1").arg(QString::number(*p)),
613  *p);
614  }
615 
617 
618  // Browsable
619  new MythUIButtonListItem(m_browseList, tr("All", "Browsable"),
622  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
624  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
626 
627  // Watched
628  new MythUIButtonListItem(m_watchedList, tr("All", "Watched"),
631  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
633  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
635 
636  // Inet Reference
637  new MythUIButtonListItem(m_inetRefList, tr("All", "Inet reference"),
639  new MythUIButtonListItem(m_inetRefList, tr("Unknown", "Inet reference"),
642 
643  // Coverfile
644  new MythUIButtonListItem(m_coverFileList, tr("All", "Cover file"),
646  new MythUIButtonListItem(m_coverFileList, tr("None", "Cover file"),
649 
650  // Order by
652  QCoreApplication::translate("(Common)", "Title"),
655  QCoreApplication::translate("(Common)", "Season/Episode"),
658  QCoreApplication::translate("(Common)", "Year"),
661  QCoreApplication::translate("(Common)", "User Rating"),
664  QCoreApplication::translate("(Common)", "Runtime"),
667  QCoreApplication::translate("(Common)", "Filename"),
669  new MythUIButtonListItem(m_orderByList, tr("Video ID"),
671  new MythUIButtonListItem(m_orderByList, tr("Date Added"),
674 
675  // Text Filter
677 }
678 
680 {
682  saveAndExit();
683 }
684 
686 {
688 
689  if (m_settings.getChangedState() > 0)
690  emit filterChanged();
691  Close();
692 }
693 
695 {
696  int new_year = item->GetData().toInt();
697  m_settings.SetYear(new_year);
698  update_numvideo();
699 }
700 
702 {
703  m_settings.SetUserRating(item->GetData().toInt());
704  update_numvideo();
705 }
706 
708 {
709  m_settings.SetCategory(item->GetData().toInt());
710  update_numvideo();
711 }
712 
714 {
715  m_settings.setCountry(item->GetData().toInt());
716  update_numvideo();
717 }
718 
720 {
721  m_settings.setGenre(item->GetData().toInt());
722  update_numvideo();
723 }
724 
726 {
727  m_settings.SetCast(item->GetData().toInt());
728  update_numvideo();
729 }
730 
732 {
733  m_settings.setRuntime(item->GetData().toInt());
734  update_numvideo();
735 }
736 
738 {
739  m_settings.SetBrowse(item->GetData().toInt());
740  update_numvideo();
741 }
742 
744 {
745  m_settings.SetWatched(item->GetData().toInt());
746  update_numvideo();
747 }
748 
750 {
751  m_settings.SetInetRef(item->GetData().toInt());
752  update_numvideo();
753 }
754 
756 {
757  m_settings.SetCoverFile(item->GetData().toInt());
758  update_numvideo();
759 }
760 
762 {
763  m_settings
765  update_numvideo();
766 }
767 
769 {
771  update_numvideo();
772 }
MythUIButton::Clicked
void Clicked()
VideoFilterDialog::SetWatched
void SetWatched(MythUIButtonListItem *item)
Definition: videofilter.cpp:743
VideoFilterSettings::VideoFilterSettings
VideoFilterSettings(bool loaddefaultsettings=true, const QString &_prefix="")
Definition: videofilter.cpp:30
VIDEO_YEAR_UNKNOWN
const QString VIDEO_YEAR_UNKNOWN
Definition: globals.cpp:15
VideoMetadata
Definition: videometadata.h:24
VideoFilterSettings::m_parentalLevel
ParentalLevel::Level m_parentalLevel
Definition: videofilter.h:234
VideoFilterDialog::setTextFilter
void setTextFilter()
Definition: videofilter.cpp:768
VideoFilterSettings::m_prefix
QString m_prefix
Definition: videofilter.h:235
VideoFilterSettings::kFilterCountryChanged
@ kFilterCountryChanged
Definition: videofilter.h:82
VideoFilterSettings::kOrderByTitle
@ kOrderByTitle
Definition: videofilter.h:110
VideoFilterDialog::SetCategory
void SetCategory(MythUIButtonListItem *item)
Definition: videofilter.cpp:707
VideoFilterSettings::SetCast
void SetCast(int lcast)
Definition: videofilter.h:135
VideoFilterSettings::setGenre
void setGenre(int lgenre)
Definition: videofilter.h:128
MythUIButtonList::SetValueByData
void SetValueByData(const QVariant &data)
Definition: mythuibuttonlist.cpp:1539
VideoFilterDialog::m_genreList
MythUIButtonList * m_genreList
Definition: videofilter.h:317
mythuitext.h
VIDEO_RUNTIME_UNKNOWN
const QString VIDEO_RUNTIME_UNKNOWN
Definition: globals.cpp:17
VideoMetadata::GetShowLevel
ParentalLevel::Level GetShowLevel() const
Definition: videometadata.cpp:1807
VideoFilterSettings::getInteRef
int getInteRef() const
Definition: videofilter.h:200
VideoFilterSettings::kReDate
static const QRegularExpression kReDate
Definition: videofilter.h:241
VideoFilterDialog::setGenre
void setGenre(MythUIButtonListItem *item)
Definition: videofilter.cpp:719
StringUtil::naturalSortCompare
bool naturalSortCompare(const QString &a, const QString &b, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive)
naturalCompare as a std::sort compatible function (ignoring the third parameter, which is never used)...
Definition: stringutil.h:54
VideoFilterSettings::kFilterUserRatingChanged
@ kFilterUserRatingChanged
Definition: videofilter.h:85
kInetRefFilterUnknown
@ kInetRefFilterUnknown
Definition: videofilter.h:65
VideoFilterDialog::m_watchedList
MythUIButtonList * m_watchedList
Definition: videofilter.h:311
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:386
VideoFilterSettings::m_year
int m_year
Definition: videofilter.h:226
VideoFilterSettings::kFilterCoverFileChanged
@ kFilterCoverFileChanged
Definition: videofilter.h:88
VideoFilterSettings::GetUserRating
int GetUserRating() const
Definition: videofilter.h:162
VideoFilterSettings::m_episode
int m_episode
Definition: videofilter.h:238
VideoFilterDialog::SetCast
void SetCast(MythUIButtonListItem *item)
Definition: videofilter.cpp:725
VideoFilterDialog::m_orderByList
MythUIButtonList * m_orderByList
Definition: videofilter.h:312
VideoFilterSettings::m_runtime
int m_runtime
Definition: videofilter.h:227
VideoFilterSettings::kOrderByUserRatingDescending
@ kOrderByUserRatingDescending
Definition: videofilter.h:112
VideoFilterSettings::getRuntime
int getRuntime() const
Definition: videofilter.h:155
VideoList::TryFilter
int TryFilter(const VideoFilterSettings &filter) const
Definition: videolist.cpp:500
VideoFilterSettings::getGenre
int getGenre() const
Definition: videofilter.h:127
kCategoryFilterUnknown
@ kCategoryFilterUnknown
Definition: videofilter.h:38
kCategoryFilterAll
@ kCategoryFilterAll
Definition: videofilter.h:37
VideoMetadata::GetInsertdate
QDate GetInsertdate() const
Definition: videometadata.cpp:1727
VideoFilterDialog::m_doneButton
MythUIButton * m_doneButton
Definition: videofilter.h:323
MythUIButtonList::itemSelected
void itemSelected(MythUIButtonListItem *item)
VideoFilterDialog::VideoFilterDialog
VideoFilterDialog(MythScreenStack *lparent, const QString &lname, VideoList *video_list)
Definition: videofilter.cpp:405
VideoFilterDialog::m_browseList
MythUIButtonList * m_browseList
Definition: videofilter.h:310
MythScreenStack
Definition: mythscreenstack.h:16
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:81
VideoFilterSettings::kFilterBrowseChanged
@ kFilterBrowseChanged
Definition: videofilter.h:86
VideoFilterDialog::m_saveButton
MythUIButton * m_saveButton
Definition: videofilter.h:322
VideoMetadata::GetSeason
int GetSeason() const
Definition: videometadata.cpp:1707
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
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:50
kYearFilterUnknown
@ kYearFilterUnknown
Definition: videofilter.h:43
VideoMetadata::GetCategoryID
int GetCategoryID() const
Definition: videometadata.cpp:1942
VideoFilterSettings::setOrderby
void setOrderby(ordering lorderby)
Definition: videofilter.h:184
VideoFilterSettings::m_browse
int m_browse
Definition: videofilter.h:229
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:14
VideoMetadata::GetPlot
const QString & GetPlot() const
Definition: videometadata.cpp:1657
std::chrono::years
duration< CHRONO_TYPE, ratio< 31556952 > > years
Definition: mythchrono.h:28
VideoFilterSettings::m_inetRef
int m_inetRef
Definition: videofilter.h:231
VideoFilterSettings::SetCoverFile
void SetCoverFile(int coverfile)
Definition: videofilter.h:208
VideoMetadata::GetSubtitle
const QString & GetSubtitle() const
Definition: videometadata.cpp:1562
VideoFilterSettings::getYear
int getYear() const
Definition: videofilter.h:148
VideoFilterSettings::saveAsDefault
void saveAsDefault()
Definition: videofilter.cpp:181
VideoFilterSettings::SetInetRef
void SetInetRef(int inetref)
Definition: videofilter.h:201
dbaccess.h
VideoFilterDialog::Create
bool Create() override
Definition: videofilter.cpp:418
VideoFilterDialog::m_textFilter
MythUITextEdit * m_textFilter
Definition: videofilter.h:325
videofilter.h
VideoFilterSettings::kFilterRuntimeChanged
@ kFilterRuntimeChanged
Definition: videofilter.h:84
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
VideoFilterDialog::SetYear
void SetYear(MythUIButtonListItem *item)
Definition: videofilter.cpp:694
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:219
VideoFilterDialog::m_countryList
MythUIButtonList * m_countryList
Definition: videofilter.h:316
VideoFilterSettings::m_userRating
int m_userRating
Definition: videofilter.h:228
VideoFilterSettings::kOrderByID
@ kOrderByID
Definition: videofilter.h:115
VideoFilterDialog::fillWidgets
void fillWidgets()
Definition: videofilter.cpp:502
mythdate.h
VideoFilterDialog::m_runtimeList
MythUIButtonList * m_runtimeList
Definition: videofilter.h:319
VideoMetadata::GetInetRef
const QString & GetInetRef() const
Definition: videometadata.cpp:1607
VideoMetadata::GetCountries
const country_list & GetCountries() const
Definition: videometadata.cpp:1932
VideoFilterSettings::kReSeason
static const QRegularExpression kReSeason
Definition: videofilter.h:240
VideoFilterSettings::SetYear
void SetYear(int lyear)
Definition: videofilter.h:149
VideoGenre::getGenre
static VideoGenre & getGenre()
Definition: dbaccess.cpp:516
VideoFilterDialog::setRunTime
void setRunTime(MythUIButtonListItem *item)
Definition: videofilter.cpp:731
VideoFilterDialog::saveAsDefault
void saveAsDefault()
Definition: videofilter.cpp:679
videolist.h
ParentalLevel::plNone
@ plNone
Definition: parentalcontrols.h:12
kYearFilterAll
@ kYearFilterAll
Definition: videofilter.h:42
VideoFilterSettings::kFilterParentalLevelChanged
@ kFilterParentalLevelChanged
Definition: videofilter.h:89
VideoFilterDialog::SetUserRating
void SetUserRating(MythUIButtonListItem *item)
Definition: videofilter.cpp:701
VideoFilterSettings::getOrderby
ordering getOrderby() const
Definition: videofilter.h:183
kRuntimeFilterAll
@ kRuntimeFilterAll
Definition: videofilter.h:47
VideoFilterSettings::m_genre
int m_genre
Definition: videofilter.h:223
kCastFilterAll
@ kCastFilterAll
Definition: videofilter.h:32
VideoFilterSettings::GetCoverFile
int GetCoverFile() const
Definition: videofilter.h:207
VideoFilterDialog::m_videoList
const VideoList & m_videoList
Definition: videofilter.h:327
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:320
VideoFilterSettings::kFilterWatchedChanged
@ kFilterWatchedChanged
Definition: videofilter.h:91
globals.h
VideoFilterSettings::m_season
int m_season
Definition: videofilter.h:237
VideoFilterSettings::getTextFilter
QString getTextFilter() const
Definition: videofilter.h:190
VideoFilterSettings::operator=
VideoFilterSettings & operator=(const VideoFilterSettings &rhs)
Definition: videofilter.cpp:76
kCountryFilterUnknown
@ kCountryFilterUnknown
Definition: videofilter.h:28
VIDEO_CAST_UNKNOWN
const QString VIDEO_CAST_UNKNOWN
Definition: globals.cpp:19
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:206
VideoFilterSettings::m_category
int m_category
Definition: videofilter.h:222
kCoverFileFilterNone
@ kCoverFileFilterNone
Definition: videofilter.h:70
kBrowseFilterAll
@ kBrowseFilterAll
Definition: videofilter.h:56
VideoFilterSettings::m_orderBy
ordering m_orderBy
Definition: videofilter.h:233
stringutil.h
VideoFilterSettings::m_watched
int m_watched
Definition: videofilter.h:230
VideoFilterSettings::GetBrowse
int GetBrowse() const
Definition: videofilter.h:169
VideoMetadata::GetYear
int GetYear() const
Definition: videometadata.cpp:1587
VideoFilterDialog::SetBrowse
void SetBrowse(MythUIButtonListItem *item)
Definition: videofilter.cpp:737
VideoCountry::getCountry
static VideoCountry & getCountry()
Definition: dbaccess.cpp:502
VideoMetadata::GetSortFilename
const QString & GetSortFilename() const
Definition: videometadata.cpp:1822
kGenreFilterAll
@ kGenreFilterAll
Definition: videofilter.h:22
VideoFilterSettings::m_cast
int m_cast
Definition: videofilter.h:225
VIDEO_GENRE_UNKNOWN
const QString VIDEO_GENRE_UNKNOWN
Definition: globals.cpp:11
VideoFilterDialog::m_settings
VideoFilterSettings m_settings
Definition: videofilter.h:308
VideoFilterSettings::m_changedState
unsigned int m_changedState
Definition: videofilter.h:243
VideoFilterSettings::GetCategory
int GetCategory() const
Definition: videofilter.h:120
VideoMetadata::GetGenres
const genre_list & GetGenres() const
Definition: videometadata.cpp:1912
VideoCategory::GetCategory
static VideoCategory & GetCategory()
Definition: dbaccess.cpp:488
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3665
FilterSettingsProxy::setSettings
virtual void setSettings(const VideoFilterSettings &settings)=0
VideoFilterSettings::GetWatched
int GetWatched() const
Definition: videofilter.h:176
VideoMetadata::GetEpisode
int GetEpisode() const
Definition: videometadata.cpp:1717
kUserRatingFilterAll
@ kUserRatingFilterAll
Definition: videofilter.h:52
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
VideoFilterDialog::saveAndExit
void saveAndExit()
Definition: videofilter.cpp:685
VideoFilterSettings::m_coverFile
int m_coverFile
Definition: videofilter.h:232
VideoFilterSettings::kOrderByDateAddedDescending
@ kOrderByDateAddedDescending
Definition: videofilter.h:117
VideoFilterSettings::kOrderByYearDescending
@ kOrderByYearDescending
Definition: videofilter.h:111
VideoList
Definition: videolist.h:23
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:912
kInetRefFilterAll
@ kInetRefFilterAll
Definition: videofilter.h:64
VIDEO_INETREF_DEFAULT
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
VideoMetadata::sortBefore
bool sortBefore(const VideoMetadata &rhs) const
Definition: videometadata.cpp:2015
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:126
kRuntimeFilterUnknown
@ kRuntimeFilterUnknown
Definition: videofilter.h:48
VideoFilterSettings
Definition: videofilter.h:73
VideoFilterDialog::m_yearList
MythUIButtonList * m_yearList
Definition: videofilter.h:313
VideoFilterSettings::m_country
int m_country
Definition: videofilter.h:224
VideoFilterSettings::getCountry
int getCountry() const
Definition: videofilter.h:141
BasicFilterSettingsProxy
Definition: videofilter.h:254
VideoFilterSettings::kSortOrderChanged
@ kSortOrderChanged
Definition: videofilter.h:79
kCoverFileFilterAll
@ kCoverFileFilterAll
Definition: videofilter.h:69
VideoFilterSettings::setTextFilter
void setTextFilter(const QString &val)
Definition: videofilter.cpp:358
VideoFilterSettings::m_textFilter
QString m_textFilter
Definition: videofilter.h:236
SingleValue::getList
const entry_list & getList()
Definition: dbaccess.cpp:240
VideoFilterSettings::kFilterInetRefChanged
@ kFilterInetRefChanged
Definition: videofilter.h:87
VideoFilterSettings::SetBrowse
void SetBrowse(int lbrowse)
Definition: videofilter.h:170
VideoFilterDialog::m_categoryList
MythUIButtonList * m_categoryList
Definition: videofilter.h:315
VideoFilterSettings::kFilterCastChanged
@ kFilterCastChanged
Definition: videofilter.h:90
mythuitextedit.h
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:695
VideoMetadata::cast_list
std::vector< cast_entry > cast_list
Definition: videometadata.h:34
VideoCast::GetCast
static VideoCast & GetCast()
Definition: dbaccess.cpp:530
VideoMetadata::GetUserRating
float GetUserRating() const
Definition: videometadata.cpp:1667
VideoFilterSettings::kOrderByFilename
@ kOrderByFilename
Definition: videofilter.h:114
VideoFilterSettings::SetWatched
void SetWatched(int lwatched)
Definition: videofilter.h:177
VideoMetadata::GetWatched
bool GetWatched() const
Definition: videometadata.cpp:1767
kWatchedFilterAll
@ kWatchedFilterAll
Definition: videofilter.h:60
VideoFilterSettings::getChangedState
unsigned int getChangedState()
Definition: videofilter.h:214
VideoFilterDialog::m_fsp
FilterSettingsProxy * m_fsp
Definition: videofilter.h:328
VideoFilterSettings::SetUserRating
void SetUserRating(int luserrating)
Definition: videofilter.h:163
VideoMetadata::GetCoverFile
const QString & GetCoverFile() const
Definition: videometadata.cpp:1862
VideoFilterDialog::update_numvideo
void update_numvideo()
Definition: videofilter.cpp:487
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:132
mythcontext.h
VideoFilterSettings::kOrderByLength
@ kOrderByLength
Definition: videofilter.h:113
VideoMetadata::GetLength
std::chrono::minutes GetLength() const
Definition: videometadata.cpp:1687
VideoFilterSettings::kFilterTextFilterChanged
@ kFilterTextFilterChanged
Definition: videofilter.h:92
VideoFilterDialog::SetInetRef
void SetInetRef(MythUIButtonListItem *item)
Definition: videofilter.cpp:749
VideoMetadata::GetID
unsigned int GetID() const
Definition: videometadata.cpp:1737
VideoFilterSettings::GetCast
int GetCast() const
Definition: videofilter.h:134
VideoFilterDialog::m_coverFileList
MythUIButtonList * m_coverFileList
Definition: videofilter.h:321
VIDEO_YEAR_DEFAULT
@ VIDEO_YEAR_DEFAULT
Definition: videometadata.h:18
VideoFilterSettings::SetCategory
void SetCategory(int lcategory)
Definition: videofilter.h:121
VideoMetadata::GetTitle
const QString & GetTitle() const
Definition: videometadata.cpp:1547
mythuibutton.h
VideoFilterSettings::kFilterYearChanged
@ kFilterYearChanged
Definition: videofilter.h:83
VideoMetadataListManager::metadata_list
std::list< VideoMetadataPtr > metadata_list
Definition: videometadatalistmanager.h:14
MythUITextEdit::valueChanged
void valueChanged()
VideoFilterSettings::setRuntime
void setRuntime(int lruntime)
Definition: videofilter.h:156
VideoFilterDialog::filterChanged
void filterChanged()
kGenreFilterUnknown
@ kGenreFilterUnknown
Definition: videofilter.h:23
SingleValue::entry_list
std::vector< entry > entry_list
Definition: dbaccess.h:16
VideoFilterDialog::setOrderby
void setOrderby(MythUIButtonListItem *item)
Definition: videofilter.cpp:761
VideoFilterDialog::m_userRatingList
MythUIButtonList * m_userRatingList
Definition: videofilter.h:314
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:881
VideoFilterSettings::kFilterCategoryChanged
@ kFilterCategoryChanged
Definition: videofilter.h:80
VideoFilterDialog::m_numVideosText
MythUIText * m_numVideosText
Definition: videofilter.h:324
VideoMetadata::GetBrowse
bool GetBrowse() const
Definition: videometadata.cpp:1757
VideoFilterDialog::m_castList
MythUIButtonList * m_castList
Definition: videofilter.h:318
kCastFilterUnknown
@ kCastFilterUnknown
Definition: videofilter.h:33
VideoFilterSettings::matches_filter
bool matches_filter(const VideoMetadata &mdata) const
Definition: videofilter.cpp:198
VideoFilterSettings::m_insertDate
QDate m_insertDate
Definition: videofilter.h:239
VideoFilterDialog::~VideoFilterDialog
~VideoFilterDialog() override
Definition: videofilter.cpp:413
VideoMetadata::GetCast
const cast_list & GetCast() const
Definition: videometadata.cpp:1922
VideoFilterSettings::meta_less_than
bool meta_less_than(const VideoMetadata &lhs, const VideoMetadata &rhs) const
Compares two VideoMetadata instances.
Definition: videofilter.cpp:318
VideoList::getListCache
const VideoMetadataListManager & getListCache() const
Definition: videolist.cpp:505
videoutils.h
kCountryFilterAll
@ kCountryFilterAll
Definition: videofilter.h:27
VideoFilterSettings::setCountry
void setCountry(int lcountry)
Definition: videofilter.h:142
VideoFilterSettings::kOrderBySeasonEp
@ kOrderBySeasonEp
Definition: videofilter.h:116
VideoFilterDialog::SetCoverFile
void SetCoverFile(MythUIButtonListItem *item)
Definition: videofilter.cpp:755
VideoFilterDialog::setCountry
void setCountry(MythUIButtonListItem *item)
Definition: videofilter.cpp:713