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 
19 const QRegularExpression VideoFilterSettings::kReSeason {
20  "(\\d+)x(\\d*)", QRegularExpression::CaseInsensitiveOption };
21 const QRegularExpression VideoFilterSettings::kReDate {
22  "-(\\d+)([dwmy])", QRegularExpression::CaseInsensitiveOption };
23 
24 #if QT_VERSION < QT_VERSION_CHECK(5,15,2)
25 #define capturedView capturedRef
26 #endif
27 
29  const QString& _prefix)
30 {
31  if (_prefix.isEmpty())
32  m_prefix = "VideoDefault";
33  else
34  m_prefix = _prefix + "Default";
35 
36  // do nothing yet
37  if (loaddefaultsettings)
38  {
39  m_category = gCoreContext->GetNumSetting(QString("%1Category").arg(m_prefix),
41  m_genre = gCoreContext->GetNumSetting(QString("%1Genre").arg(m_prefix),
43  m_country = gCoreContext->GetNumSetting(QString("%1Country").arg(m_prefix),
45  m_cast = gCoreContext->GetNumSetting(QString("%1Cast").arg(m_prefix),
47  m_year = gCoreContext->GetNumSetting(QString("%1Year").arg(m_prefix),
49  m_runtime = gCoreContext->GetNumSetting(QString("%1Runtime").arg(m_prefix),
51  m_userRating =
52  gCoreContext->GetNumSetting(QString("%1Userrating").arg(m_prefix),
54  m_browse = gCoreContext->GetNumSetting(QString("%1Browse").arg(m_prefix),
56  m_watched = gCoreContext->GetNumSetting(QString("%1Watched").arg(m_prefix),
58  m_inetRef = gCoreContext->GetNumSetting(QString("%1InetRef").arg(m_prefix),
60  m_coverFile = gCoreContext->GetNumSetting(QString("%1CoverFile")
62  m_orderBy = (ordering)gCoreContext->GetNumSetting(QString("%1Orderby")
63  .arg(m_prefix),
65  }
66 }
67 
69 {
70  *this = rhs;
71 }
72 
75 {
76  if (this == &rhs)
77  return *this;
78 
79  m_prefix = rhs.m_prefix;
80 
81  if (m_category != rhs.m_category)
82  {
84  m_category = rhs.m_category;
85  }
86 
87  if (m_genre != rhs.m_genre)
88  {
90  m_genre = rhs.m_genre;
91  }
92 
93  if (m_country != rhs.m_country)
94  {
96  m_country = rhs.m_country;
97  }
98 
99  if (m_cast != rhs.m_cast)
100  {
102  m_cast = rhs.m_cast;
103  }
104 
105  if (m_year != rhs.m_year)
106  {
108  m_year = rhs.m_year;
109  }
110 
111  if (m_runtime != rhs.m_runtime)
112  {
114  m_runtime = rhs.m_runtime;
115  }
116 
117  if (m_userRating != rhs.m_userRating)
118  {
121  }
122 
123  if (m_browse != rhs.m_browse)
124  {
126  m_browse = rhs.m_browse;
127  }
128 
129  if (m_watched != rhs.m_watched)
130  {
132  m_watched = rhs.m_watched;
133  }
134 
135  if (m_inetRef != rhs.m_inetRef)
136  {
138  m_inetRef = rhs.m_inetRef;
139  }
140 
141  if (m_coverFile != rhs.m_coverFile)
142  {
144  m_coverFile = rhs.m_coverFile;
145  }
146 
147  if (m_orderBy != rhs.m_orderBy)
148  {
150  m_orderBy = rhs.m_orderBy;
151  }
152 
153  if (m_parentalLevel != rhs.m_parentalLevel)
154  {
157  }
158 
159  if (m_textFilter != rhs.m_textFilter)
160  {
163  }
164  if (m_season != rhs.m_season || m_episode != rhs.m_episode)
165  {
166  m_season = rhs.m_season;
167  m_episode = rhs.m_episode;
169  }
170  if (m_insertDate != rhs.m_insertDate)
171  {
174  }
175 
176  return *this;
177 }
178 
180 {
181  gCoreContext->SaveSetting(QString("%1Category").arg(m_prefix), m_category);
182  gCoreContext->SaveSetting(QString("%1Genre").arg(m_prefix), m_genre);
183  gCoreContext->SaveSetting(QString("%1Cast").arg(m_prefix), m_cast);
184  gCoreContext->SaveSetting(QString("%1Country").arg(m_prefix), m_country);
185  gCoreContext->SaveSetting(QString("%1Year").arg(m_prefix), m_year);
186  gCoreContext->SaveSetting(QString("%1Runtime").arg(m_prefix), m_runtime);
187  gCoreContext->SaveSetting(QString("%1Userrating").arg(m_prefix), m_userRating);
188  gCoreContext->SaveSetting(QString("%1Browse").arg(m_prefix), m_browse);
189  gCoreContext->SaveSetting(QString("%1Watched").arg(m_prefix), m_watched);
190  gCoreContext->SaveSetting(QString("%1InetRef").arg(m_prefix), m_inetRef);
191  gCoreContext->SaveSetting(QString("%1CoverFile").arg(m_prefix), m_coverFile);
192  gCoreContext->SaveSetting(QString("%1Orderby").arg(m_prefix), m_orderBy);
193  gCoreContext->SaveSetting(QString("%1Filter").arg(m_prefix), m_textFilter);
194 }
195 
197 {
198  bool matches = true;
199 
200  //textfilter
201  if (!m_textFilter.isEmpty())
202  {
203  matches = false;
204  matches = (matches ||
205  mdata.GetTitle().contains(m_textFilter, Qt::CaseInsensitive));
206  matches = (matches ||
207  mdata.GetSubtitle().contains(m_textFilter, Qt::CaseInsensitive));
208  matches = (matches ||
209  mdata.GetPlot().contains(m_textFilter, Qt::CaseInsensitive));
210  }
211  //search for season with optionally episode nr.
212  if (matches && (m_season != -1))
213  {
214  matches = (m_season == mdata.GetSeason());
215  matches = (matches && (m_episode == -1 || m_episode == mdata.GetEpisode()));
216  }
217  if (matches && m_insertDate.isValid())
218  {
219  matches = (mdata.GetInsertdate().isValid() &&
220  mdata.GetInsertdate() >= m_insertDate);
221  }
222  if (matches && (m_genre != kGenreFilterAll))
223  {
224  const VideoMetadata::genre_list &gl = mdata.GetGenres();
225  auto samegenre = [this](const auto & g) {return g.first == m_genre; };
226  matches = std::any_of(gl.cbegin(), gl.cend(), samegenre);
227  }
228 
229  if (matches && m_country != kCountryFilterAll)
230  {
231  const VideoMetadata::country_list &cl = mdata.GetCountries();
232  auto samecountry = [this](const auto & c) {return c.first == m_country; };
233  matches = std::any_of(cl.cbegin(), cl.cend(), samecountry);
234  }
235 
236  if (matches && m_cast != kCastFilterAll)
237  {
238  const VideoMetadata::cast_list &cl = mdata.GetCast();
239 
240  if ((m_cast == kCastFilterUnknown) && (cl.empty()))
241  {
242  matches = true;
243  }
244  else
245  {
246  auto samecast = [this](const auto & c){return c.first == m_cast; };
247  matches = std::any_of(cl.cbegin(), cl.cend(), samecast);
248  }
249  }
250 
251  if (matches && m_category != kCategoryFilterAll)
252  {
253  matches = (m_category == mdata.GetCategoryID());
254  }
255 
256  if (matches && m_year != kYearFilterAll)
257  {
258  if (m_year == kYearFilterUnknown)
259  {
260  matches = ((mdata.GetYear() == 0) ||
261  (mdata.GetYear() == VIDEO_YEAR_DEFAULT));
262  }
263  else
264  {
265  matches = (m_year == mdata.GetYear());
266  }
267  }
268 
269  if (matches && m_runtime != kRuntimeFilterAll)
270  {
272  {
273  matches = (mdata.GetLength() == 0min);
274  }
275  else
276  {
277  matches = (m_runtime == (mdata.GetLength() / 30min));
278  }
279  }
280 
281  if (matches && m_userRating != kUserRatingFilterAll)
282  {
283  matches = (mdata.GetUserRating() >= m_userRating);
284  }
285 
286  if (matches && m_browse != kBrowseFilterAll)
287  {
288  matches = (static_cast<int>(mdata.GetBrowse()) == m_browse);
289  }
290 
291  if (matches && m_watched != kWatchedFilterAll)
292  {
293  matches = (static_cast<int>(mdata.GetWatched()) == m_watched);
294  }
295 
296  if (matches && m_inetRef != kInetRefFilterAll)
297  {
298  matches = (mdata.GetInetRef() == VIDEO_INETREF_DEFAULT);
299  }
300 
301  if (matches && m_coverFile != kCoverFileFilterAll)
302  {
303  matches = (IsDefaultCoverFile(mdata.GetCoverFile()));
304  }
305 
306  if (matches && m_parentalLevel)
307  {
308  matches = ((mdata.GetShowLevel() != ParentalLevel::plNone) &&
309  (mdata.GetShowLevel() <= m_parentalLevel));
310  }
311 
312  return matches;
313 }
314 
317  const VideoMetadata &rhs) const
318 {
319  bool ret = false;
320  switch (m_orderBy)
321  {
322  case kOrderByTitle:
323  {
324  ret = lhs.sortBefore(rhs);
325  break;
326  }
327  case kOrderBySeasonEp:
328  {
329  if ((lhs.GetSeason() == rhs.GetSeason())
330  && (lhs.GetEpisode() == rhs.GetEpisode())
331  && (lhs.GetSeason() == 0)
332  && (rhs.GetSeason() == 0)
333  && (lhs.GetEpisode() == 0)
334  && (rhs.GetEpisode() == 0))
335  {
336  ret = lhs.sortBefore(rhs);
337  }
338  else if ((lhs.GetSeason() == rhs.GetSeason())
339  && (lhs.GetTitle() == rhs.GetTitle()))
340  ret = (lhs.GetEpisode() < rhs.GetEpisode());
341  else
342  ret = (lhs.GetSeason() < rhs.GetSeason());
343  break;
344  }
346  {
347  ret = (lhs.GetYear() > rhs.GetYear());
348  break;
349  }
351  {
352  ret = (lhs.GetUserRating() > rhs.GetUserRating());
353  break;
354  }
355  case kOrderByLength:
356  {
357  ret = (lhs.GetLength() < rhs.GetLength());
358  break;
359  }
360  case kOrderByFilename:
361  {
362  const QString& lhsfn = lhs.GetSortFilename();
363  const QString& rhsfn = rhs.GetSortFilename();
364  ret = naturalCompare(lhsfn, rhsfn) < 0;
365  break;
366  }
367  case kOrderByID:
368  {
369  ret = (lhs.GetID() < rhs.GetID());
370  break;
371  }
373  {
374  ret = (lhs.GetInsertdate() > rhs.GetInsertdate());
375  break;
376  }
377  default:
378  {
379  LOG(VB_GENERAL, LOG_ERR, QString("Error: unknown sort type %1")
380  .arg(m_orderBy));
381  }
382  }
383 
384  return ret;
385 }
386 
387 void VideoFilterSettings::setTextFilter(const QString& val)
388 {
390  auto match = kReSeason.match(val);
391  if (match.hasMatch())
392  {
393  m_season = match.capturedView(1).isEmpty()
394  ? -1 : match.capturedView(1).toInt();
395  m_episode = match.capturedView(2).isEmpty()
396  ? -1 : match.capturedView(2).toInt();
397  //clear \dX\d from string for string-search in plot/title/subtitle
398  m_textFilter = val;
399  m_textFilter.remove(match.capturedStart(), match.capturedLength());
400  m_textFilter = m_textFilter.simplified ();
401  }
402  else
403  {
404  m_textFilter = val;
405  m_season = -1;
406  m_episode = -1;
407  }
408  match = kReDate.match(m_textFilter);
409  if (match.hasMatch())
410  {
411  int modnr = match.capturedView(1).toInt();
412  QDate testdate = MythDate::current().date();
413  switch(match.capturedView(2).at(0).toLatin1())
414  {
415  case 'd': testdate = testdate.addDays(-modnr);break;
416  case 'w': testdate = testdate.addDays(-modnr * 7);break;
417  case 'm': testdate = testdate.addMonths(-modnr);break;
418  case 'y': testdate = testdate.addYears(-modnr);break;
419  }
420  m_insertDate = testdate;
421  m_textFilter.remove(match.capturedStart(), match.capturedLength());
422  m_textFilter = m_textFilter.simplified ();
423  }
424  else
425  {
426  //reset testdate
427  m_insertDate = QDate();
428  }
429 }
430 
432 // VideoFilterDialog
435  VideoList *video_list) : MythScreenType(lparent, lname),
436  m_videoList(*video_list)
437 {
438  m_fsp = new BasicFilterSettingsProxy<VideoList>(*video_list);
440 }
441 
443 {
444  delete m_fsp;
445 }
446 
448 {
449  if (!LoadWindowFromXML("video-ui.xml", "filter", this))
450  return false;
451 
452  bool err = false;
453  UIUtilE::Assign(this, m_textFilter, "textfilter_input", &err);
454  UIUtilE::Assign(this, m_yearList, "year_select", &err);
455  UIUtilE::Assign(this, m_userRatingList, "userrating_select", &err);
456  UIUtilE::Assign(this, m_categoryList, "category_select", &err);
457  UIUtilE::Assign(this, m_countryList, "country_select", &err);
458  UIUtilE::Assign(this, m_genreList, "genre_select", &err);
459  UIUtilE::Assign(this, m_castList, "cast_select", &err);
460  UIUtilE::Assign(this, m_runtimeList, "runtime_select", &err);
461  UIUtilE::Assign(this, m_browseList, "browse_select", &err);
462  UIUtilE::Assign(this, m_watchedList, "watched_select", &err);
463  UIUtilE::Assign(this, m_inetRefList, "inetref_select", &err);
464  UIUtilE::Assign(this, m_coverFileList, "coverfile_select", &err);
465  UIUtilE::Assign(this, m_orderByList, "orderby_select", &err);
466 
467  UIUtilE::Assign(this, m_doneButton, "done_button", &err);
468  UIUtilE::Assign(this, m_saveButton, "save_button", &err);
469 
470  UIUtilE::Assign(this, m_numVideosText, "numvideos_text", &err);
471 
472  if (err)
473  {
474  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'filter'");
475  return false;
476  }
477 
478  BuildFocusList();
479 
480  fillWidgets();
481  update_numvideo();
482 
509 
512 
513  return true;
514 }
515 
517 {
518  int video_count = m_videoList.TryFilter(m_settings);
519 
520  if (video_count > 0)
521  {
522  m_numVideosText->SetText(tr("Result of this filter : %n video(s)", "",
523  video_count));
524  }
525  else
526  {
527  m_numVideosText->SetText(tr("Result of this filter : No Videos"));
528  }
529 }
530 
532 {
533  bool have_unknown_year = false;
534  bool have_unknown_runtime = false;
535 
536  using int_list = std::set<int>;
537  int_list years;
538  int_list runtimes;
539  int_list user_ratings;
540 
543  for (const auto & md : mdl)
544  {
545  int year = md->GetYear();
546  if ((year == 0) || (year == VIDEO_YEAR_DEFAULT))
547  have_unknown_year = true;
548  else
549  years.insert(year);
550 
551  std::chrono::minutes runtime = md->GetLength();
552  if (runtime == 0min)
553  have_unknown_runtime = true;
554  else
555  runtimes.insert(runtime.count() / 30);
556 
557  user_ratings.insert(static_cast<int>(md->GetUserRating()));
558  }
559 
560  // Category
561  new MythUIButtonListItem(m_categoryList, tr("All", "Category"),
563 
564  const VideoCategory::entry_list &vcl =
566  for (const auto & vc : vcl)
567  new MythUIButtonListItem(m_categoryList, vc.second, vc.first);
568 
572 
573  // Genre
574  new MythUIButtonListItem(m_genreList, tr("All", "Genre"), kGenreFilterAll);
575 
577  for (const auto & g : gl)
578  new MythUIButtonListItem(m_genreList, g.second, g.first);
579 
582 
583  // Cast
584  new MythUIButtonListItem(m_castList, tr("All", "Cast"), kCastFilterAll);
585 
587  for (const auto & c : cl)
588  new MythUIButtonListItem(m_castList, c.second, c.first);
589 
592 
593  // Country
594  new MythUIButtonListItem(m_countryList, tr("All", "Country"), kCountryFilterAll);
595 
597  for (const auto & cn : cnl)
598  new MythUIButtonListItem(m_countryList, cn.second, cn.first);
599 
603 
604  // Year
605  new MythUIButtonListItem(m_yearList, tr("All", "Year"), kYearFilterAll);
606 
607  for (auto p = years.crbegin(); p != years.crend(); ++p)
608  {
609  new MythUIButtonListItem(m_yearList, QString::number(*p), *p);
610  }
611 
612  if (have_unknown_year)
615 
617 
618  // Runtime
619  new MythUIButtonListItem(m_runtimeList, tr("All", "Runtime"), kRuntimeFilterAll);
620 
621  if (have_unknown_runtime)
624 
625  for (int runtime : runtimes)
626  {
627  QString s = QString("%1 %2 ~ %3 %4").arg(runtime * 30).arg(tr("minutes"))
628  .arg((runtime + 1) * 30).arg(tr("minutes"));
629  new MythUIButtonListItem(m_runtimeList, s, runtime);
630  }
631 
633 
634  // User Rating
635  new MythUIButtonListItem(m_userRatingList, tr("All", "User rating"),
637 
638  for (auto p = user_ratings.crbegin(); p != user_ratings.crend(); ++p)
639  {
641  QString(">= %1").arg(QString::number(*p)),
642  *p);
643  }
644 
646 
647  // Browsable
648  new MythUIButtonListItem(m_browseList, tr("All", "Browsable"),
651  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
653  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
655 
656  // Watched
657  new MythUIButtonListItem(m_watchedList, tr("All", "Watched"),
660  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
662  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
664 
665  // Inet Reference
666  new MythUIButtonListItem(m_inetRefList, tr("All", "Inet reference"),
668  new MythUIButtonListItem(m_inetRefList, tr("Unknown", "Inet reference"),
671 
672  // Coverfile
673  new MythUIButtonListItem(m_coverFileList, tr("All", "Cover file"),
675  new MythUIButtonListItem(m_coverFileList, tr("None", "Cover file"),
678 
679  // Order by
681  QCoreApplication::translate("(Common)", "Title"),
684  QCoreApplication::translate("(Common)", "Season/Episode"),
687  QCoreApplication::translate("(Common)", "Year"),
690  QCoreApplication::translate("(Common)", "User Rating"),
693  QCoreApplication::translate("(Common)", "Runtime"),
696  QCoreApplication::translate("(Common)", "Filename"),
698  new MythUIButtonListItem(m_orderByList, tr("Video ID"),
700  new MythUIButtonListItem(m_orderByList, tr("Date Added"),
703 
704  // Text Filter
706 }
707 
709 {
711  saveAndExit();
712 }
713 
715 {
717 
718  if (m_settings.getChangedState() > 0)
719  emit filterChanged();
720  Close();
721 }
722 
724 {
725  int new_year = item->GetData().toInt();
726  m_settings.SetYear(new_year);
727  update_numvideo();
728 }
729 
731 {
732  m_settings.SetUserRating(item->GetData().toInt());
733  update_numvideo();
734 }
735 
737 {
738  m_settings.SetCategory(item->GetData().toInt());
739  update_numvideo();
740 }
741 
743 {
744  m_settings.setCountry(item->GetData().toInt());
745  update_numvideo();
746 }
747 
749 {
750  m_settings.setGenre(item->GetData().toInt());
751  update_numvideo();
752 }
753 
755 {
756  m_settings.SetCast(item->GetData().toInt());
757  update_numvideo();
758 }
759 
761 {
762  m_settings.setRuntime(item->GetData().toInt());
763  update_numvideo();
764 }
765 
767 {
768  m_settings.SetBrowse(item->GetData().toInt());
769  update_numvideo();
770 }
771 
773 {
774  m_settings.SetWatched(item->GetData().toInt());
775  update_numvideo();
776 }
777 
779 {
780  m_settings.SetInetRef(item->GetData().toInt());
781  update_numvideo();
782 }
783 
785 {
786  m_settings.SetCoverFile(item->GetData().toInt());
787  update_numvideo();
788 }
789 
791 {
792  m_settings
794  update_numvideo();
795 }
796 
798 {
800  update_numvideo();
801 }
MythUIButton::Clicked
void Clicked()
VideoFilterDialog::SetWatched
void SetWatched(MythUIButtonListItem *item)
Definition: videofilter.cpp:772
VideoFilterSettings::VideoFilterSettings
VideoFilterSettings(bool loaddefaultsettings=true, const QString &_prefix="")
Definition: videofilter.cpp:28
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:797
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:736
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:1542
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:1802
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:748
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:385
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:754
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:498
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:1722
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:434
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:1702
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:44
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:43
VideoMetadata::GetCategoryID
int GetCategoryID() const
Definition: videometadata.cpp:1937
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:10
VideoMetadata::GetPlot
const QString & GetPlot() const
Definition: videometadata.cpp:1652
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:1557
VideoFilterSettings::getYear
int getYear() const
Definition: videofilter.h:148
VideoFilterSettings::saveAsDefault
void saveAsDefault()
Definition: videofilter.cpp:179
VideoFilterSettings::SetInetRef
void SetInetRef(int inetref)
Definition: videofilter.h:201
dbaccess.h
VideoFilterDialog::Create
bool Create() override
Definition: videofilter.cpp:447
VideoFilterDialog::m_textFilter
MythUITextEdit * m_textFilter
Definition: videofilter.h:325
videofilter.h
VideoFilterSettings::kFilterRuntimeChanged
@ kFilterRuntimeChanged
Definition: videofilter.h:84
MythUIButtonListItem
Definition: mythuibuttonlist.h:34
VideoFilterDialog::SetYear
void SetYear(MythUIButtonListItem *item)
Definition: videofilter.cpp:723
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:215
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:531
mythdate.h
VideoFilterDialog::m_runtimeList
MythUIButtonList * m_runtimeList
Definition: videofilter.h:319
VideoMetadata::GetInetRef
const QString & GetInetRef() const
Definition: videometadata.cpp:1602
VideoMetadata::GetCountries
const country_list & GetCountries() const
Definition: videometadata.cpp:1927
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:515
VideoFilterDialog::setRunTime
void setRunTime(MythUIButtonListItem *item)
Definition: videofilter.cpp:760
VideoFilterDialog::saveAsDefault
void saveAsDefault()
Definition: videofilter.cpp:708
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:730
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:74
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:205
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
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:1582
VideoFilterDialog::SetBrowse
void SetBrowse(MythUIButtonListItem *item)
Definition: videofilter.cpp:766
VideoCountry::getCountry
static VideoCountry & getCountry()
Definition: dbaccess.cpp:501
VideoMetadata::GetSortFilename
const QString & GetSortFilename() const
Definition: videometadata.cpp:1817
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:1907
VideoCategory::GetCategory
static VideoCategory & GetCategory()
Definition: dbaccess.cpp:487
naturalCompare
int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity)
Definition: mythmiscutil.cpp:1038
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3648
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:1712
kUserRatingFilterAll
@ kUserRatingFilterAll
Definition: videofilter.h:52
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
VideoFilterDialog::saveAndExit
void saveAndExit()
Definition: videofilter.cpp:714
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:936
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:2010
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: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:387
VideoFilterSettings::m_textFilter
QString m_textFilter
Definition: videofilter.h:236
SingleValue::getList
const entry_list & getList()
Definition: dbaccess.cpp:239
VideoFilterSettings::kFilterInetRefChanged
@ kFilterInetRefChanged
Definition: videofilter.h:87
VideoFilterSettings::SetBrowse
void SetBrowse(int lbrowse)
Definition: videofilter.h:170
mythmiscutil.h
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: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:1662
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:1762
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:1857
VideoFilterDialog::update_numvideo
void update_numvideo()
Definition: videofilter.cpp:516
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:133
mythcontext.h
VideoFilterSettings::kOrderByLength
@ kOrderByLength
Definition: videofilter.h:113
VideoMetadata::GetLength
std::chrono::minutes GetLength() const
Definition: videometadata.cpp:1682
VideoFilterSettings::kFilterTextFilterChanged
@ kFilterTextFilterChanged
Definition: videofilter.h:92
VideoFilterDialog::SetInetRef
void SetInetRef(MythUIButtonListItem *item)
Definition: videofilter.cpp:778
VideoMetadata::GetID
unsigned int GetID() const
Definition: videometadata.cpp:1732
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:1542
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:790
VideoFilterDialog::m_userRatingList
MythUIButtonList * m_userRatingList
Definition: videofilter.h:314
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:905
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:1752
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:196
VideoFilterSettings::m_insertDate
QDate m_insertDate
Definition: videofilter.h:239
VideoFilterDialog::~VideoFilterDialog
~VideoFilterDialog() override
Definition: videofilter.cpp:442
VideoMetadata::GetCast
const cast_list & GetCast() const
Definition: videometadata.cpp:1917
VideoFilterSettings::meta_less_than
bool meta_less_than(const VideoMetadata &lhs, const VideoMetadata &rhs) const
Compares two VideoMetadata instances.
Definition: videofilter.cpp:316
VideoList::getListCache
const VideoMetadataListManager & getListCache() const
Definition: videolist.cpp:503
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:784
VideoFilterDialog::setCountry
void setCountry(MythUIButtonListItem *item)
Definition: videofilter.cpp:742