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 
27  const QString& _prefix)
28 {
29  if (_prefix.isEmpty())
30  m_prefix = "VideoDefault";
31  else
32  m_prefix = _prefix + "Default";
33 
34  // do nothing yet
35  if (loaddefaultsettings)
36  {
37  m_category = gCoreContext->GetNumSetting(QString("%1Category").arg(m_prefix),
39  m_genre = gCoreContext->GetNumSetting(QString("%1Genre").arg(m_prefix),
41  m_country = gCoreContext->GetNumSetting(QString("%1Country").arg(m_prefix),
43  m_cast = gCoreContext->GetNumSetting(QString("%1Cast").arg(m_prefix),
45  m_year = gCoreContext->GetNumSetting(QString("%1Year").arg(m_prefix),
47  m_runtime = gCoreContext->GetNumSetting(QString("%1Runtime").arg(m_prefix),
49  m_userRating =
50  gCoreContext->GetNumSetting(QString("%1Userrating").arg(m_prefix),
52  m_browse = gCoreContext->GetNumSetting(QString("%1Browse").arg(m_prefix),
54  m_watched = gCoreContext->GetNumSetting(QString("%1Watched").arg(m_prefix),
56  m_inetRef = gCoreContext->GetNumSetting(QString("%1InetRef").arg(m_prefix),
58  m_coverFile = gCoreContext->GetNumSetting(QString("%1CoverFile")
60  m_orderBy = (ordering)gCoreContext->GetNumSetting(QString("%1Orderby")
61  .arg(m_prefix),
63  }
64 }
65 
67 {
68  *this = rhs;
69 }
70 
73 {
74  if (this == &rhs)
75  return *this;
76 
77  m_prefix = rhs.m_prefix;
78 
79  if (m_category != rhs.m_category)
80  {
82  m_category = rhs.m_category;
83  }
84 
85  if (m_genre != rhs.m_genre)
86  {
88  m_genre = rhs.m_genre;
89  }
90 
91  if (m_country != rhs.m_country)
92  {
94  m_country = rhs.m_country;
95  }
96 
97  if (m_cast != rhs.m_cast)
98  {
100  m_cast = rhs.m_cast;
101  }
102 
103  if (m_year != rhs.m_year)
104  {
106  m_year = rhs.m_year;
107  }
108 
109  if (m_runtime != rhs.m_runtime)
110  {
112  m_runtime = rhs.m_runtime;
113  }
114 
115  if (m_userRating != rhs.m_userRating)
116  {
119  }
120 
121  if (m_browse != rhs.m_browse)
122  {
124  m_browse = rhs.m_browse;
125  }
126 
127  if (m_watched != rhs.m_watched)
128  {
130  m_watched = rhs.m_watched;
131  }
132 
133  if (m_inetRef != rhs.m_inetRef)
134  {
136  m_inetRef = rhs.m_inetRef;
137  }
138 
139  if (m_coverFile != rhs.m_coverFile)
140  {
142  m_coverFile = rhs.m_coverFile;
143  }
144 
145  if (m_orderBy != rhs.m_orderBy)
146  {
148  m_orderBy = rhs.m_orderBy;
149  }
150 
151  if (m_parentalLevel != rhs.m_parentalLevel)
152  {
155  }
156 
157  if (m_textFilter != rhs.m_textFilter)
158  {
161  }
162  if (m_season != rhs.m_season || m_episode != rhs.m_episode)
163  {
164  m_season = rhs.m_season;
165  m_episode = rhs.m_episode;
167  }
168  if (m_insertDate != rhs.m_insertDate)
169  {
172  }
173 
174  return *this;
175 }
176 
178 {
179  gCoreContext->SaveSetting(QString("%1Category").arg(m_prefix), m_category);
180  gCoreContext->SaveSetting(QString("%1Genre").arg(m_prefix), m_genre);
181  gCoreContext->SaveSetting(QString("%1Cast").arg(m_prefix), m_cast);
182  gCoreContext->SaveSetting(QString("%1Country").arg(m_prefix), m_country);
183  gCoreContext->SaveSetting(QString("%1Year").arg(m_prefix), m_year);
184  gCoreContext->SaveSetting(QString("%1Runtime").arg(m_prefix), m_runtime);
185  gCoreContext->SaveSetting(QString("%1Userrating").arg(m_prefix), m_userRating);
186  gCoreContext->SaveSetting(QString("%1Browse").arg(m_prefix), m_browse);
187  gCoreContext->SaveSetting(QString("%1Watched").arg(m_prefix), m_watched);
188  gCoreContext->SaveSetting(QString("%1InetRef").arg(m_prefix), m_inetRef);
189  gCoreContext->SaveSetting(QString("%1CoverFile").arg(m_prefix), m_coverFile);
190  gCoreContext->SaveSetting(QString("%1Orderby").arg(m_prefix), m_orderBy);
191  gCoreContext->SaveSetting(QString("%1Filter").arg(m_prefix), m_textFilter);
192 }
193 
195 {
196  bool matches = true;
197 
198  //textfilter
199  if (!m_textFilter.isEmpty())
200  {
201  matches = false;
202  matches = (matches ||
203  mdata.GetTitle().contains(m_textFilter, Qt::CaseInsensitive));
204  matches = (matches ||
205  mdata.GetSubtitle().contains(m_textFilter, Qt::CaseInsensitive));
206  matches = (matches ||
207  mdata.GetPlot().contains(m_textFilter, Qt::CaseInsensitive));
208  }
209  //search for season with optionally episode nr.
210  if (matches && (m_season != -1))
211  {
212  matches = (m_season == mdata.GetSeason());
213  matches = (matches && (m_episode == -1 || m_episode == mdata.GetEpisode()));
214  }
215  if (matches && m_insertDate.isValid())
216  {
217  matches = (mdata.GetInsertdate().isValid() &&
218  mdata.GetInsertdate() >= m_insertDate);
219  }
220  if (matches && (m_genre != kGenreFilterAll))
221  {
222  const VideoMetadata::genre_list &gl = mdata.GetGenres();
223  auto samegenre = [this](const auto & g) {return g.first == m_genre; };
224  matches = std::any_of(gl.cbegin(), gl.cend(), samegenre);
225  }
226 
227  if (matches && m_country != kCountryFilterAll)
228  {
229  const VideoMetadata::country_list &cl = mdata.GetCountries();
230  auto samecountry = [this](const auto & c) {return c.first == m_country; };
231  matches = std::any_of(cl.cbegin(), cl.cend(), samecountry);
232  }
233 
234  if (matches && m_cast != kCastFilterAll)
235  {
236  const VideoMetadata::cast_list &cl = mdata.GetCast();
237 
238  if ((m_cast == kCastFilterUnknown) && (cl.empty()))
239  {
240  matches = true;
241  }
242  else
243  {
244  auto samecast = [this](const auto & c){return c.first == m_cast; };
245  matches = std::any_of(cl.cbegin(), cl.cend(), samecast);
246  }
247  }
248 
249  if (matches && m_category != kCategoryFilterAll)
250  {
251  matches = (m_category == mdata.GetCategoryID());
252  }
253 
254  if (matches && m_year != kYearFilterAll)
255  {
256  if (m_year == kYearFilterUnknown)
257  {
258  matches = ((mdata.GetYear() == 0) ||
259  (mdata.GetYear() == VIDEO_YEAR_DEFAULT));
260  }
261  else
262  {
263  matches = (m_year == mdata.GetYear());
264  }
265  }
266 
267  if (matches && m_runtime != kRuntimeFilterAll)
268  {
270  {
271  matches = (mdata.GetLength() == 0min);
272  }
273  else
274  {
275  matches = (m_runtime == (mdata.GetLength() / 30min));
276  }
277  }
278 
279  if (matches && m_userRating != kUserRatingFilterAll)
280  {
281  matches = (mdata.GetUserRating() >= m_userRating);
282  }
283 
284  if (matches && m_browse != kBrowseFilterAll)
285  {
286  matches = (static_cast<int>(mdata.GetBrowse()) == m_browse);
287  }
288 
289  if (matches && m_watched != kWatchedFilterAll)
290  {
291  matches = (static_cast<int>(mdata.GetWatched()) == m_watched);
292  }
293 
294  if (matches && m_inetRef != kInetRefFilterAll)
295  {
296  matches = (mdata.GetInetRef() == VIDEO_INETREF_DEFAULT);
297  }
298 
299  if (matches && m_coverFile != kCoverFileFilterAll)
300  {
301  matches = (IsDefaultCoverFile(mdata.GetCoverFile()));
302  }
303 
304  if (matches && m_parentalLevel)
305  {
306  matches = ((mdata.GetShowLevel() != ParentalLevel::plNone) &&
307  (mdata.GetShowLevel() <= m_parentalLevel));
308  }
309 
310  return matches;
311 }
312 
315  const VideoMetadata &rhs) const
316 {
317  switch (m_orderBy)
318  {
319  case kOrderByTitle: return lhs.sortBefore(rhs);
320  case kOrderByYearDescending: return lhs.GetYear() > rhs.GetYear();
321  case kOrderByUserRatingDescending: return lhs.GetUserRating() > rhs.GetUserRating();
322  case kOrderByDateAddedDescending: return lhs.GetInsertdate() > rhs.GetInsertdate();
323  case kOrderByLength: return lhs.GetLength() < rhs.GetLength();
324  case kOrderByID: return lhs.GetID() < rhs.GetID();
325  case kOrderByFilename:
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  return lhs.sortBefore(rhs);
337  }
338  if ((lhs.GetSeason() == rhs.GetSeason())
339  && (lhs.GetTitle() == rhs.GetTitle()))
340  {
341  return (lhs.GetEpisode() < rhs.GetEpisode());
342  }
343  return (lhs.GetSeason() < rhs.GetSeason());
344  }
345  default:
346  {
347  LOG(VB_GENERAL, LOG_ERR, QString("Error: unknown sort type %1")
348  .arg(m_orderBy));
349  return false;
350  }
351  }
352 }
353 
354 void VideoFilterSettings::setTextFilter(const QString& val)
355 {
357  auto match = kReSeason.match(val);
358  if (match.hasMatch())
359  {
360  m_season = match.capturedView(1).isEmpty()
361  ? -1 : match.capturedView(1).toInt();
362  m_episode = match.capturedView(2).isEmpty()
363  ? -1 : match.capturedView(2).toInt();
364  //clear \dX\d from string for string-search in plot/title/subtitle
365  m_textFilter = val;
366  m_textFilter.remove(match.capturedStart(), match.capturedLength());
367  m_textFilter = m_textFilter.simplified ();
368  }
369  else
370  {
371  m_textFilter = val;
372  m_season = -1;
373  m_episode = -1;
374  }
375  match = kReDate.match(m_textFilter);
376  if (match.hasMatch())
377  {
378  int64_t modnr = match.capturedView(1).toInt();
379  QDate testdate = MythDate::current().date();
380  switch(match.capturedView(2).at(0).toLatin1())
381  {
382  case 'd': testdate = testdate.addDays(-modnr);break;
383  case 'w': testdate = testdate.addDays(-modnr * 7);break;
384  case 'm': testdate = testdate.addMonths(-modnr);break;
385  case 'y': testdate = testdate.addYears(-modnr);break;
386  }
387  m_insertDate = testdate;
388  m_textFilter.remove(match.capturedStart(), match.capturedLength());
389  m_textFilter = m_textFilter.simplified ();
390  }
391  else
392  {
393  //reset testdate
394  m_insertDate = QDate();
395  }
396 }
397 
399 // VideoFilterDialog
402  VideoList *video_list) : MythScreenType(lparent, lname),
403  m_videoList(*video_list),
404  m_fsp(new BasicFilterSettingsProxy<VideoList>(*video_list))
405 {
407 }
408 
410 {
411  delete m_fsp;
412 }
413 
415 {
416  if (!LoadWindowFromXML("video-ui.xml", "filter", this))
417  return false;
418 
419  bool err = false;
420  UIUtilE::Assign(this, m_textFilter, "textfilter_input", &err);
421  UIUtilE::Assign(this, m_yearList, "year_select", &err);
422  UIUtilE::Assign(this, m_userRatingList, "userrating_select", &err);
423  UIUtilE::Assign(this, m_categoryList, "category_select", &err);
424  UIUtilE::Assign(this, m_countryList, "country_select", &err);
425  UIUtilE::Assign(this, m_genreList, "genre_select", &err);
426  UIUtilE::Assign(this, m_castList, "cast_select", &err);
427  UIUtilE::Assign(this, m_runtimeList, "runtime_select", &err);
428  UIUtilE::Assign(this, m_browseList, "browse_select", &err);
429  UIUtilE::Assign(this, m_watchedList, "watched_select", &err);
430  UIUtilE::Assign(this, m_inetRefList, "inetref_select", &err);
431  UIUtilE::Assign(this, m_coverFileList, "coverfile_select", &err);
432  UIUtilE::Assign(this, m_orderByList, "orderby_select", &err);
433 
434  UIUtilE::Assign(this, m_doneButton, "done_button", &err);
435  UIUtilE::Assign(this, m_saveButton, "save_button", &err);
436 
437  UIUtilE::Assign(this, m_numVideosText, "numvideos_text", &err);
438 
439  if (err)
440  {
441  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'filter'");
442  return false;
443  }
444 
445  BuildFocusList();
446 
447  fillWidgets();
448  update_numvideo();
449 
476 
479 
480  return true;
481 }
482 
484 {
485  int video_count = m_videoList.TryFilter(m_settings);
486 
487  if (video_count > 0)
488  {
489  m_numVideosText->SetText(tr("Result of this filter : %n video(s)", "",
490  video_count));
491  }
492  else
493  {
494  m_numVideosText->SetText(tr("Result of this filter : No Videos"));
495  }
496 }
497 
499 {
500  bool have_unknown_year = false;
501  bool have_unknown_runtime = false;
502 
503  using int_list = std::set<int>;
504  int_list years;
505  int_list runtimes;
506  int_list user_ratings;
507 
510  for (const auto & md : mdl)
511  {
512  int year = md->GetYear();
513  if ((year == 0) || (year == VIDEO_YEAR_DEFAULT))
514  have_unknown_year = true;
515  else
516  years.insert(year);
517 
518  std::chrono::minutes runtime = md->GetLength();
519  if (runtime == 0min)
520  have_unknown_runtime = true;
521  else
522  runtimes.insert(runtime.count() / 30);
523 
524  user_ratings.insert(static_cast<int>(md->GetUserRating()));
525  }
526 
527  // Category
528  new MythUIButtonListItem(m_categoryList, tr("All", "Category"),
530 
531  const VideoCategory::entry_list &vcl =
533  for (const auto & vc : vcl)
534  new MythUIButtonListItem(m_categoryList, vc.second, vc.first);
535 
539 
540  // Genre
541  new MythUIButtonListItem(m_genreList, tr("All", "Genre"), kGenreFilterAll);
542 
544  for (const auto & g : gl)
545  new MythUIButtonListItem(m_genreList, g.second, g.first);
546 
549 
550  // Cast
551  new MythUIButtonListItem(m_castList, tr("All", "Cast"), kCastFilterAll);
552 
554  for (const auto & c : cl)
555  new MythUIButtonListItem(m_castList, c.second, c.first);
556 
559 
560  // Country
561  new MythUIButtonListItem(m_countryList, tr("All", "Country"), kCountryFilterAll);
562 
564  for (const auto & cn : cnl)
565  new MythUIButtonListItem(m_countryList, cn.second, cn.first);
566 
570 
571  // Year
572  new MythUIButtonListItem(m_yearList, tr("All", "Year"), kYearFilterAll);
573 
574  for (auto p = years.crbegin(); p != years.crend(); ++p)
575  {
576  new MythUIButtonListItem(m_yearList, QString::number(*p), *p);
577  }
578 
579  if (have_unknown_year)
582 
584 
585  // Runtime
586  new MythUIButtonListItem(m_runtimeList, tr("All", "Runtime"), kRuntimeFilterAll);
587 
588  if (have_unknown_runtime)
591 
592  for (int runtime : runtimes)
593  {
594  QString s = QString("%1 %2 ~ %3 %4").arg(runtime * 30).arg(tr("minutes"))
595  .arg((runtime + 1) * 30).arg(tr("minutes"));
596  new MythUIButtonListItem(m_runtimeList, s, runtime);
597  }
598 
600 
601  // User Rating
602  new MythUIButtonListItem(m_userRatingList, tr("All", "User rating"),
604 
605  for (auto p = user_ratings.crbegin(); p != user_ratings.crend(); ++p)
606  {
608  QString(">= %1").arg(QString::number(*p)),
609  *p);
610  }
611 
613 
614  // Browsable
615  new MythUIButtonListItem(m_browseList, tr("All", "Browsable"),
618  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
620  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
622 
623  // Watched
624  new MythUIButtonListItem(m_watchedList, tr("All", "Watched"),
627  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
629  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
631 
632  // Inet Reference
633  new MythUIButtonListItem(m_inetRefList, tr("All", "Inet reference"),
635  new MythUIButtonListItem(m_inetRefList, tr("Unknown", "Inet reference"),
638 
639  // Coverfile
640  new MythUIButtonListItem(m_coverFileList, tr("All", "Cover file"),
642  new MythUIButtonListItem(m_coverFileList, tr("None", "Cover file"),
645 
646  // Order by
648  QCoreApplication::translate("(Common)", "Title"),
651  QCoreApplication::translate("(Common)", "Season/Episode"),
654  QCoreApplication::translate("(Common)", "Year"),
657  QCoreApplication::translate("(Common)", "User Rating"),
660  QCoreApplication::translate("(Common)", "Runtime"),
663  QCoreApplication::translate("(Common)", "Filename"),
665  new MythUIButtonListItem(m_orderByList, tr("Video ID"),
667  new MythUIButtonListItem(m_orderByList, tr("Date Added"),
670 
671  // Text Filter
673 }
674 
676 {
678  saveAndExit();
679 }
680 
682 {
684 
685  if (m_settings.getChangedState() > 0)
686  emit filterChanged();
687  Close();
688 }
689 
691 {
692  int new_year = item->GetData().toInt();
693  m_settings.SetYear(new_year);
694  update_numvideo();
695 }
696 
698 {
699  m_settings.SetUserRating(item->GetData().toInt());
700  update_numvideo();
701 }
702 
704 {
705  m_settings.SetCategory(item->GetData().toInt());
706  update_numvideo();
707 }
708 
710 {
711  m_settings.setCountry(item->GetData().toInt());
712  update_numvideo();
713 }
714 
716 {
717  m_settings.setGenre(item->GetData().toInt());
718  update_numvideo();
719 }
720 
722 {
723  m_settings.SetCast(item->GetData().toInt());
724  update_numvideo();
725 }
726 
728 {
729  m_settings.setRuntime(item->GetData().toInt());
730  update_numvideo();
731 }
732 
734 {
735  m_settings.SetBrowse(item->GetData().toInt());
736  update_numvideo();
737 }
738 
740 {
741  m_settings.SetWatched(item->GetData().toInt());
742  update_numvideo();
743 }
744 
746 {
747  m_settings.SetInetRef(item->GetData().toInt());
748  update_numvideo();
749 }
750 
752 {
753  m_settings.SetCoverFile(item->GetData().toInt());
754  update_numvideo();
755 }
756 
758 {
759  m_settings
761  update_numvideo();
762 }
763 
765 {
767  update_numvideo();
768 }
MythUIButton::Clicked
void Clicked()
VideoFilterDialog::SetWatched
void SetWatched(MythUIButtonListItem *item)
Definition: videofilter.cpp:739
kCountryFilterUnknown
@ kCountryFilterUnknown
Definition: videofilter.h:28
VideoFilterSettings::VideoFilterSettings
VideoFilterSettings(bool loaddefaultsettings=true, const QString &_prefix="")
Definition: videofilter.cpp:26
VIDEO_YEAR_UNKNOWN
const QString VIDEO_YEAR_UNKNOWN
Definition: globals.cpp:15
kRuntimeFilterAll
@ kRuntimeFilterAll
Definition: videofilter.h:47
kWatchedFilterAll
@ kWatchedFilterAll
Definition: videofilter.h:60
VideoMetadata
Definition: videometadata.h:24
VideoFilterSettings::m_parentalLevel
ParentalLevel::Level m_parentalLevel
Definition: videofilter.h:234
VideoFilterDialog::setTextFilter
void setTextFilter()
Definition: videofilter.cpp:764
VideoFilterSettings::m_prefix
QString m_prefix
Definition: videofilter.h:235
VideoFilterDialog::SetCategory
void SetCategory(MythUIButtonListItem *item)
Definition: videofilter.cpp:703
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:1566
VideoFilterDialog::m_genreList
MythUIButtonList * m_genreList
Definition: videofilter.h:317
mythuitext.h
VIDEO_RUNTIME_UNKNOWN
const QString VIDEO_RUNTIME_UNKNOWN
Definition: globals.cpp:17
kUserRatingFilterAll
@ kUserRatingFilterAll
Definition: videofilter.h:52
VideoMetadata::GetShowLevel
ParentalLevel::Level GetShowLevel() const
Definition: videometadata.cpp:1804
VideoFilterSettings::getInteRef
int getInteRef() const
Definition: videofilter.h:200
VideoFilterSettings::kReDate
static const QRegularExpression kReDate
Definition: videofilter.h:241
kYearFilterUnknown
@ kYearFilterUnknown
Definition: videofilter.h:43
VideoFilterDialog::setGenre
void setGenre(MythUIButtonListItem *item)
Definition: videofilter.cpp:715
VideoFilterSettings::ordering
ordering
Definition: videofilter.h:106
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
VideoFilterDialog::m_watchedList
MythUIButtonList * m_watchedList
Definition: videofilter.h:311
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:383
kCountryFilterAll
@ kCountryFilterAll
Definition: videofilter.h:27
VideoFilterSettings::m_year
int m_year
Definition: videofilter.h:226
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:721
VideoFilterDialog::m_orderByList
MythUIButtonList * m_orderByList
Definition: videofilter.h:312
VideoFilterSettings::kFilterGenreChanged
@ kFilterGenreChanged
Definition: videofilter.h:81
VideoFilterSettings::m_runtime
int m_runtime
Definition: videofilter.h:227
VideoFilterSettings::getRuntime
int getRuntime() const
Definition: videofilter.h:155
VideoList::TryFilter
int TryFilter(const VideoFilterSettings &filter) const
Definition: videolist.cpp:497
VideoFilterSettings::getGenre
int getGenre() const
Definition: videofilter.h:127
VideoMetadata::GetInsertdate
QDate GetInsertdate() const
Definition: videometadata.cpp:1724
VideoFilterDialog::m_doneButton
MythUIButton * m_doneButton
Definition: videofilter.h:323
MythUIButtonList::itemSelected
void itemSelected(MythUIButtonListItem *item)
VideoFilterSettings::kOrderByLength
@ kOrderByLength
Definition: videofilter.h:113
VideoFilterSettings::kFilterRuntimeChanged
@ kFilterRuntimeChanged
Definition: videofilter.h:84
VideoFilterDialog::VideoFilterDialog
VideoFilterDialog(MythScreenStack *lparent, const QString &lname, VideoList *video_list)
Definition: videofilter.cpp:401
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
VideoFilterDialog::m_saveButton
MythUIButton * m_saveButton
Definition: videofilter.h:322
VideoMetadata::GetSeason
int GetSeason() const
Definition: videometadata.cpp:1704
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:168
MythUITextEdit::GetText
QString GetText(void) const
Definition: mythuitextedit.h:50
VideoFilterSettings::kOrderByUserRatingDescending
@ kOrderByUserRatingDescending
Definition: videofilter.h:112
VideoMetadata::GetCategoryID
int GetCategoryID() const
Definition: videometadata.cpp:1939
VideoFilterSettings::setOrderby
void setOrderby(ordering lorderby)
Definition: videofilter.h:184
VideoFilterSettings::m_browse
int m_browse
Definition: videofilter.h:229
mythuibuttonlist.h
VideoFilterSettings::kOrderByFilename
@ kOrderByFilename
Definition: videofilter.h:114
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:1654
std::chrono::years
duration< CHRONO_TYPE, ratio< 31556952 > > years
Definition: mythchrono.h:28
VideoFilterSettings::kOrderByYearDescending
@ kOrderByYearDescending
Definition: videofilter.h:111
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:1559
VideoFilterSettings::getYear
int getYear() const
Definition: videofilter.h:148
VideoFilterSettings::saveAsDefault
void saveAsDefault()
Definition: videofilter.cpp:177
VideoFilterSettings::SetInetRef
void SetInetRef(int inetref)
Definition: videofilter.h:201
dbaccess.h
VideoFilterDialog::Create
bool Create() override
Definition: videofilter.cpp:414
VideoFilterDialog::m_textFilter
MythUITextEdit * m_textFilter
Definition: videofilter.h:325
videofilter.h
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
VideoFilterDialog::SetYear
void SetYear(MythUIButtonListItem *item)
Definition: videofilter.cpp:690
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:198
VideoFilterDialog::m_countryList
MythUIButtonList * m_countryList
Definition: videofilter.h:316
VideoFilterSettings::m_userRating
int m_userRating
Definition: videofilter.h:228
VideoFilterSettings::kFilterCoverFileChanged
@ kFilterCoverFileChanged
Definition: videofilter.h:88
VideoFilterDialog::fillWidgets
void fillWidgets()
Definition: videofilter.cpp:498
mythdate.h
VideoFilterDialog::m_runtimeList
MythUIButtonList * m_runtimeList
Definition: videofilter.h:319
VideoMetadata::GetInetRef
const QString & GetInetRef() const
Definition: videometadata.cpp:1604
VideoMetadata::GetCountries
const country_list & GetCountries() const
Definition: videometadata.cpp:1929
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:517
VideoFilterDialog::setRunTime
void setRunTime(MythUIButtonListItem *item)
Definition: videofilter.cpp:727
VideoFilterDialog::saveAsDefault
void saveAsDefault()
Definition: videofilter.cpp:675
videolist.h
VideoFilterDialog::SetUserRating
void SetUserRating(MythUIButtonListItem *item)
Definition: videofilter.cpp:697
VideoFilterSettings::getOrderby
ordering getOrderby() const
Definition: videofilter.h:183
VideoFilterSettings::m_genre
int m_genre
Definition: videofilter.h:223
VideoFilterSettings::kOrderByTitle
@ kOrderByTitle
Definition: videofilter.h:110
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
globals.h
VideoFilterSettings::m_season
int m_season
Definition: videofilter.h:237
VideoFilterSettings::getTextFilter
QString getTextFilter() const
Definition: videofilter.h:190
VideoFilterSettings::kOrderByID
@ kOrderByID
Definition: videofilter.h:115
VideoFilterSettings::operator=
VideoFilterSettings & operator=(const VideoFilterSettings &rhs)
Definition: videofilter.cpp:72
VIDEO_CAST_UNKNOWN
const QString VIDEO_CAST_UNKNOWN
Definition: globals.cpp:19
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:203
VideoFilterSettings::m_category
int m_category
Definition: videofilter.h:222
VideoFilterSettings::kFilterBrowseChanged
@ kFilterBrowseChanged
Definition: videofilter.h:86
VideoFilterSettings::kFilterYearChanged
@ kFilterYearChanged
Definition: videofilter.h:83
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
VideoFilterSettings::kFilterCountryChanged
@ kFilterCountryChanged
Definition: videofilter.h:82
VideoMetadata::GetYear
int GetYear() const
Definition: videometadata.cpp:1584
VideoFilterDialog::SetBrowse
void SetBrowse(MythUIButtonListItem *item)
Definition: videofilter.cpp:733
VideoCountry::getCountry
static VideoCountry & getCountry()
Definition: dbaccess.cpp:503
VideoMetadata::GetSortFilename
const QString & GetSortFilename() const
Definition: videometadata.cpp:1819
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:1909
VideoFilterSettings::kFilterTextFilterChanged
@ kFilterTextFilterChanged
Definition: videofilter.h:92
VideoCategory::GetCategory
static VideoCategory & GetCategory()
Definition: dbaccess.cpp:489
kBrowseFilterAll
@ kBrowseFilterAll
Definition: videofilter.h:56
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3715
VideoFilterSettings::kFilterParentalLevelChanged
@ kFilterParentalLevelChanged
Definition: videofilter.h:89
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:1714
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
VideoFilterDialog::saveAndExit
void saveAndExit()
Definition: videofilter.cpp:681
VideoFilterSettings::m_coverFile
int m_coverFile
Definition: videofilter.h:232
VideoFilterSettings::kOrderBySeasonEp
@ kOrderBySeasonEp
Definition: videofilter.h:116
kGenreFilterAll
@ kGenreFilterAll
Definition: videofilter.h:22
kCastFilterAll
@ kCastFilterAll
Definition: videofilter.h:32
ParentalLevel::plNone
@ plNone
Definition: parentalcontrols.h:13
VideoList
Definition: videolist.h:23
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:916
VIDEO_INETREF_DEFAULT
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
VideoMetadata::sortBefore
bool sortBefore(const VideoMetadata &rhs) const
Definition: videometadata.cpp:2012
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:121
kCoverFileFilterAll
@ kCoverFileFilterAll
Definition: videofilter.h:69
VideoFilterSettings
Definition: videofilter.h:73
kInetRefFilterAll
@ kInetRefFilterAll
Definition: videofilter.h:64
VideoFilterSettings::kOrderByDateAddedDescending
@ kOrderByDateAddedDescending
Definition: videofilter.h:117
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
kCategoryFilterUnknown
@ kCategoryFilterUnknown
Definition: videofilter.h:38
VideoFilterSettings::setTextFilter
void setTextFilter(const QString &val)
Definition: videofilter.cpp:354
VideoFilterSettings::m_textFilter
QString m_textFilter
Definition: videofilter.h:236
SingleValue::getList
const entry_list & getList()
Definition: dbaccess.cpp:241
VideoFilterSettings::SetBrowse
void SetBrowse(int lbrowse)
Definition: videofilter.h:170
VideoFilterDialog::m_categoryList
MythUIButtonList * m_categoryList
Definition: videofilter.h:315
mythuitextedit.h
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:687
VideoMetadata::cast_list
std::vector< cast_entry > cast_list
Definition: videometadata.h:34
VideoCast::GetCast
static VideoCast & GetCast()
Definition: dbaccess.cpp:531
VideoMetadata::GetUserRating
float GetUserRating() const
Definition: videometadata.cpp:1664
VideoFilterSettings::kSortOrderChanged
@ kSortOrderChanged
Definition: videofilter.h:79
VideoFilterSettings::SetWatched
void SetWatched(int lwatched)
Definition: videofilter.h:177
VideoMetadata::GetWatched
bool GetWatched() const
Definition: videometadata.cpp:1764
VideoFilterSettings::getChangedState
unsigned int getChangedState()
Definition: videofilter.h:214
kYearFilterAll
@ kYearFilterAll
Definition: videofilter.h:42
VideoFilterDialog::m_fsp
FilterSettingsProxy * m_fsp
Definition: videofilter.h:328
kCoverFileFilterNone
@ kCoverFileFilterNone
Definition: videofilter.h:70
VideoFilterSettings::SetUserRating
void SetUserRating(int luserrating)
Definition: videofilter.h:163
VideoMetadata::GetCoverFile
const QString & GetCoverFile() const
Definition: videometadata.cpp:1859
VideoFilterDialog::update_numvideo
void update_numvideo()
Definition: videofilter.cpp:483
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:115
mythcontext.h
kRuntimeFilterUnknown
@ kRuntimeFilterUnknown
Definition: videofilter.h:48
kInetRefFilterUnknown
@ kInetRefFilterUnknown
Definition: videofilter.h:65
VideoMetadata::GetLength
std::chrono::minutes GetLength() const
Definition: videometadata.cpp:1684
VideoFilterDialog::SetInetRef
void SetInetRef(MythUIButtonListItem *item)
Definition: videofilter.cpp:745
VideoMetadata::GetID
unsigned int GetID() const
Definition: videometadata.cpp:1734
VideoFilterSettings::GetCast
int GetCast() const
Definition: videofilter.h:134
VideoFilterDialog::m_coverFileList
MythUIButtonList * m_coverFileList
Definition: videofilter.h:321
VideoFilterSettings::SetCategory
void SetCategory(int lcategory)
Definition: videofilter.h:121
VideoMetadata::GetTitle
const QString & GetTitle() const
Definition: videometadata.cpp:1544
mythuibutton.h
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
VideoFilterSettings::kFilterCastChanged
@ kFilterCastChanged
Definition: videofilter.h:90
VideoFilterDialog::filterChanged
void filterChanged()
SingleValue::entry_list
std::vector< entry > entry_list
Definition: dbaccess.h:16
VIDEO_YEAR_DEFAULT
static constexpr uint16_t VIDEO_YEAR_DEFAULT
Definition: videometadata.h:18
VideoFilterDialog::setOrderby
void setOrderby(MythUIButtonListItem *item)
Definition: videofilter.cpp:757
kGenreFilterUnknown
@ kGenreFilterUnknown
Definition: videofilter.h:23
VideoFilterDialog::m_userRatingList
MythUIButtonList * m_userRatingList
Definition: videofilter.h:314
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:885
VideoFilterDialog::m_numVideosText
MythUIText * m_numVideosText
Definition: videofilter.h:324
VideoMetadata::GetBrowse
bool GetBrowse() const
Definition: videometadata.cpp:1754
VideoFilterDialog::m_castList
MythUIButtonList * m_castList
Definition: videofilter.h:318
VideoFilterSettings::matches_filter
bool matches_filter(const VideoMetadata &mdata) const
Definition: videofilter.cpp:194
VideoFilterSettings::m_insertDate
QDate m_insertDate
Definition: videofilter.h:239
VideoFilterDialog::~VideoFilterDialog
~VideoFilterDialog() override
Definition: videofilter.cpp:409
VideoFilterSettings::kFilterUserRatingChanged
@ kFilterUserRatingChanged
Definition: videofilter.h:85
VideoMetadata::GetCast
const cast_list & GetCast() const
Definition: videometadata.cpp:1919
VideoFilterSettings::meta_less_than
bool meta_less_than(const VideoMetadata &lhs, const VideoMetadata &rhs) const
Compares two VideoMetadata instances.
Definition: videofilter.cpp:314
kCategoryFilterAll
@ kCategoryFilterAll
Definition: videofilter.h:37
VideoFilterSettings::kFilterWatchedChanged
@ kFilterWatchedChanged
Definition: videofilter.h:91
VideoFilterSettings::kFilterCategoryChanged
@ kFilterCategoryChanged
Definition: videofilter.h:80
VideoList::getListCache
const VideoMetadataListManager & getListCache() const
Definition: videolist.cpp:502
videoutils.h
VideoFilterSettings::setCountry
void setCountry(int lcountry)
Definition: videofilter.h:142
kCastFilterUnknown
@ kCastFilterUnknown
Definition: videofilter.h:33
VideoFilterDialog::SetCoverFile
void SetCoverFile(MythUIButtonListItem *item)
Definition: videofilter.cpp:751
VideoFilterSettings::kFilterInetRefChanged
@ kFilterInetRefChanged
Definition: videofilter.h:87
VideoFilterDialog::setCountry
void setCountry(MythUIButtonListItem *item)
Definition: videofilter.cpp:709