MythTV  master
videofilter.cpp
Go to the documentation of this file.
1 #include <set>
2 
3 #include "mythcontext.h"
4 
5 #include "mythuibuttonlist.h"
6 #include "mythuibutton.h"
7 #include "mythuitext.h"
8 #include "mythuitextedit.h"
9 #include "mythmiscutil.h"
10 #include "globals.h"
11 #include "dbaccess.h"
13 #include "videoutils.h"
14 #include "mythdate.h"
15 
16 #include "videolist.h"
17 #include "videofilter.h"
18 
20  const QString& _prefix)
21 {
22  if (_prefix.isEmpty())
23  m_prefix = "VideoDefault";
24  else
25  m_prefix = _prefix + "Default";
26 
27  // do nothing yet
28  if (loaddefaultsettings)
29  {
30  m_category = gCoreContext->GetNumSetting(QString("%1Category").arg(m_prefix),
32  m_genre = gCoreContext->GetNumSetting(QString("%1Genre").arg(m_prefix),
34  m_country = gCoreContext->GetNumSetting(QString("%1Country").arg(m_prefix),
36  m_cast = gCoreContext->GetNumSetting(QString("%1Cast").arg(m_prefix),
38  m_year = gCoreContext->GetNumSetting(QString("%1Year").arg(m_prefix),
40  m_runtime = gCoreContext->GetNumSetting(QString("%1Runtime").arg(m_prefix),
42  m_userRating =
43  gCoreContext->GetNumSetting(QString("%1Userrating").arg(m_prefix),
45  m_browse = gCoreContext->GetNumSetting(QString("%1Browse").arg(m_prefix),
47  m_watched = gCoreContext->GetNumSetting(QString("%1Watched").arg(m_prefix),
49  m_inetRef = gCoreContext->GetNumSetting(QString("%1InetRef").arg(m_prefix),
51  m_coverFile = gCoreContext->GetNumSetting(QString("%1CoverFile")
53  m_orderBy = (ordering)gCoreContext->GetNumSetting(QString("%1Orderby")
54  .arg(m_prefix),
56  }
57 }
58 
60 {
61  *this = rhs;
62 }
63 
66 {
67  if (this == &rhs)
68  return *this;
69 
70  m_prefix = rhs.m_prefix;
71 
72  if (m_category != rhs.m_category)
73  {
75  m_category = rhs.m_category;
76  }
77 
78  if (m_genre != rhs.m_genre)
79  {
81  m_genre = rhs.m_genre;
82  }
83 
84  if (m_country != rhs.m_country)
85  {
87  m_country = rhs.m_country;
88  }
89 
90  if (m_cast != rhs.m_cast)
91  {
93  m_cast = rhs.m_cast;
94  }
95 
96  if (m_year != rhs.m_year)
97  {
99  m_year = rhs.m_year;
100  }
101 
102  if (m_runtime != rhs.m_runtime)
103  {
105  m_runtime = rhs.m_runtime;
106  }
107 
108  if (m_userRating != rhs.m_userRating)
109  {
112  }
113 
114  if (m_browse != rhs.m_browse)
115  {
117  m_browse = rhs.m_browse;
118  }
119 
120  if (m_watched != rhs.m_watched)
121  {
123  m_watched = rhs.m_watched;
124  }
125 
126  if (m_inetRef != rhs.m_inetRef)
127  {
129  m_inetRef = rhs.m_inetRef;
130  }
131 
132  if (m_coverFile != rhs.m_coverFile)
133  {
135  m_coverFile = rhs.m_coverFile;
136  }
137 
138  if (m_orderBy != rhs.m_orderBy)
139  {
141  m_orderBy = rhs.m_orderBy;
142  }
143 
144  if (m_parentalLevel != rhs.m_parentalLevel)
145  {
148  }
149 
150  if (m_textFilter != rhs.m_textFilter)
151  {
154  }
155  if (m_season != rhs.m_season || m_episode != rhs.m_episode)
156  {
157  m_season = rhs.m_season;
158  m_episode = rhs.m_episode;
160  }
161  if (m_insertDate != rhs.m_insertDate)
162  {
165  }
166 
167  return *this;
168 }
169 
171 {
172  gCoreContext->SaveSetting(QString("%1Category").arg(m_prefix), m_category);
173  gCoreContext->SaveSetting(QString("%1Genre").arg(m_prefix), m_genre);
174  gCoreContext->SaveSetting(QString("%1Cast").arg(m_prefix), m_cast);
175  gCoreContext->SaveSetting(QString("%1Country").arg(m_prefix), m_country);
176  gCoreContext->SaveSetting(QString("%1Year").arg(m_prefix), m_year);
177  gCoreContext->SaveSetting(QString("%1Runtime").arg(m_prefix), m_runtime);
178  gCoreContext->SaveSetting(QString("%1Userrating").arg(m_prefix), m_userRating);
179  gCoreContext->SaveSetting(QString("%1Browse").arg(m_prefix), m_browse);
180  gCoreContext->SaveSetting(QString("%1Watched").arg(m_prefix), m_watched);
181  gCoreContext->SaveSetting(QString("%1InetRef").arg(m_prefix), m_inetRef);
182  gCoreContext->SaveSetting(QString("%1CoverFile").arg(m_prefix), m_coverFile);
183  gCoreContext->SaveSetting(QString("%1Orderby").arg(m_prefix), m_orderBy);
184  gCoreContext->SaveSetting(QString("%1Filter").arg(m_prefix), m_textFilter);
185 }
186 
188 {
189  bool matches = true;
190 
191  //textfilter
192  if (!m_textFilter.isEmpty())
193  {
194  matches = false;
195  matches = (matches ||
196  mdata.GetTitle().contains(m_textFilter, Qt::CaseInsensitive));
197  matches = (matches ||
198  mdata.GetSubtitle().contains(m_textFilter, Qt::CaseInsensitive));
199  matches = (matches ||
200  mdata.GetPlot().contains(m_textFilter, Qt::CaseInsensitive));
201  }
202  //search for season with optionally episode nr.
203  if (matches && (m_season != -1))
204  {
205  matches = (m_season == mdata.GetSeason());
206  matches = (matches && (m_episode == -1 || m_episode == mdata.GetEpisode()));
207  }
208  if (matches && m_insertDate.isValid())
209  {
210  matches = (mdata.GetInsertdate().isValid() &&
211  mdata.GetInsertdate() >= m_insertDate);
212  }
213  if (matches && (m_genre != kGenreFilterAll))
214  {
215  const VideoMetadata::genre_list &gl = mdata.GetGenres();
216  auto samegenre = [this](const auto & g) {return g.first == m_genre; };
217  matches = std::any_of(gl.cbegin(), gl.cend(), samegenre);
218  }
219 
220  if (matches && m_country != kCountryFilterAll)
221  {
222  const VideoMetadata::country_list &cl = mdata.GetCountries();
223  auto samecountry = [this](const auto & c) {return c.first == m_country; };
224  matches = std::any_of(cl.cbegin(), cl.cend(), samecountry);
225  }
226 
227  if (matches && m_cast != kCastFilterAll)
228  {
229  const VideoMetadata::cast_list &cl = mdata.GetCast();
230 
231  if ((m_cast == kCastFilterUnknown) && (cl.empty()))
232  {
233  matches = true;
234  }
235  else
236  {
237  auto samecast = [this](const auto & c){return c.first == m_cast; };
238  matches = std::any_of(cl.cbegin(), cl.cend(), samecast);
239  }
240  }
241 
242  if (matches && m_category != kCategoryFilterAll)
243  {
244  matches = (m_category == mdata.GetCategoryID());
245  }
246 
247  if (matches && m_year != kYearFilterAll)
248  {
249  if (m_year == kYearFilterUnknown)
250  {
251  matches = ((mdata.GetYear() == 0) ||
252  (mdata.GetYear() == VIDEO_YEAR_DEFAULT));
253  }
254  else
255  {
256  matches = (m_year == mdata.GetYear());
257  }
258  }
259 
260  if (matches && m_runtime != kRuntimeFilterAll)
261  {
263  {
264  matches = (mdata.GetLength() == 0);
265  }
266  else
267  {
268  matches = (m_runtime == (mdata.GetLength() / 30));
269  }
270  }
271 
272  if (matches && m_userRating != kUserRatingFilterAll)
273  {
274  matches = (mdata.GetUserRating() >= m_userRating);
275  }
276 
277  if (matches && m_browse != kBrowseFilterAll)
278  {
279  matches = (static_cast<int>(mdata.GetBrowse()) == m_browse);
280  }
281 
282  if (matches && m_watched != kWatchedFilterAll)
283  {
284  matches = (static_cast<int>(mdata.GetWatched()) == m_watched);
285  }
286 
287  if (matches && m_inetRef != kInetRefFilterAll)
288  {
289  matches = (mdata.GetInetRef() == VIDEO_INETREF_DEFAULT);
290  }
291 
292  if (matches && m_coverFile != kCoverFileFilterAll)
293  {
294  matches = (IsDefaultCoverFile(mdata.GetCoverFile()));
295  }
296 
297  if (matches && m_parentalLevel)
298  {
299  matches = ((mdata.GetShowLevel() != ParentalLevel::plNone) &&
300  (mdata.GetShowLevel() <= m_parentalLevel));
301  }
302 
303  return matches;
304 }
305 
308  const VideoMetadata &rhs) const
309 {
310  bool ret = false;
311  switch (m_orderBy)
312  {
313  case kOrderByTitle:
314  {
315  ret = lhs.sortBefore(rhs);
316  break;
317  }
318  case kOrderBySeasonEp:
319  {
320  if ((lhs.GetSeason() == rhs.GetSeason())
321  && (lhs.GetEpisode() == rhs.GetEpisode())
322  && (lhs.GetSeason() == 0)
323  && (rhs.GetSeason() == 0)
324  && (lhs.GetEpisode() == 0)
325  && (rhs.GetEpisode() == 0))
326  {
327  ret = lhs.sortBefore(rhs);
328  }
329  else if ((lhs.GetSeason() == rhs.GetSeason())
330  && (lhs.GetTitle() == rhs.GetTitle()))
331  ret = (lhs.GetEpisode() < rhs.GetEpisode());
332  else
333  ret = (lhs.GetSeason() < rhs.GetSeason());
334  break;
335  }
337  {
338  ret = (lhs.GetYear() > rhs.GetYear());
339  break;
340  }
342  {
343  ret = (lhs.GetUserRating() > rhs.GetUserRating());
344  break;
345  }
346  case kOrderByLength:
347  {
348  ret = (lhs.GetLength() < rhs.GetLength());
349  break;
350  }
351  case kOrderByFilename:
352  {
353  const QString& lhsfn = lhs.GetSortFilename();
354  const QString& rhsfn = rhs.GetSortFilename();
355  ret = naturalCompare(lhsfn, rhsfn) < 0;
356  break;
357  }
358  case kOrderByID:
359  {
360  ret = (lhs.GetID() < rhs.GetID());
361  break;
362  }
364  {
365  ret = (lhs.GetInsertdate() > rhs.GetInsertdate());
366  break;
367  }
368  default:
369  {
370  LOG(VB_GENERAL, LOG_ERR, QString("Error: unknown sort type %1")
371  .arg(m_orderBy));
372  }
373  }
374 
375  return ret;
376 }
377 
378 void VideoFilterSettings::setTextFilter(const QString& val)
379 {
381  if (m_reSeason.indexIn(val) != -1)
382  {
383  bool res = false;
384  QStringList list = m_reSeason.capturedTexts();
385  m_season = list[1].toInt(&res);
386  if (!res)
387  m_season = -1;
388  if (list.size() > 2) {
389  m_episode = list[2].toInt(&res);
390  if (!res)
391  m_episode = -1;
392  }
393  else {
394  m_episode = -1;
395  }
396  //clear \dX\d from string for string-search in plot/title/subtitle
397  m_textFilter = val;
398  m_textFilter.replace(m_reSeason, "");
399  m_textFilter = m_textFilter.simplified ();
400  }
401  else
402  {
403  m_textFilter = val;
404  m_season = -1;
405  m_episode = -1;
406  }
407  if (m_reDate.indexIn(m_textFilter) != -1)
408  {
409  QStringList list = m_reDate.capturedTexts();
410  int modnr = list[1].toInt();
411  QDate testdate = MythDate::current().date();
412  switch(list[2].at(0).toLatin1())
413  {
414  case 'm': testdate = testdate.addMonths(-modnr);break;
415  case 'd': testdate = testdate.addDays(-modnr);break;
416  case 'w': testdate = testdate.addDays(-modnr * 7);break;
417  }
418  m_insertDate = testdate;
419  m_textFilter.replace(m_reDate, "");
420  m_textFilter = m_textFilter.simplified ();
421  }
422  else
423  {
424  //reset testdate
425  m_insertDate = QDate();
426  }
427 }
428 
430 // VideoFilterDialog
433  VideoList *video_list) : MythScreenType(lparent, lname),
434  m_videoList(*video_list)
435 {
436  m_fsp = new BasicFilterSettingsProxy<VideoList>(*video_list);
438 }
439 
441 {
442  delete m_fsp;
443 }
444 
446 {
447  if (!LoadWindowFromXML("video-ui.xml", "filter", this))
448  return false;
449 
450  bool err = false;
451  UIUtilE::Assign(this, m_textFilter, "textfilter_input", &err);
452  UIUtilE::Assign(this, m_yearList, "year_select", &err);
453  UIUtilE::Assign(this, m_userRatingList, "userrating_select", &err);
454  UIUtilE::Assign(this, m_categoryList, "category_select", &err);
455  UIUtilE::Assign(this, m_countryList, "country_select", &err);
456  UIUtilE::Assign(this, m_genreList, "genre_select", &err);
457  UIUtilE::Assign(this, m_castList, "cast_select", &err);
458  UIUtilE::Assign(this, m_runtimeList, "runtime_select", &err);
459  UIUtilE::Assign(this, m_browseList, "browse_select", &err);
460  UIUtilE::Assign(this, m_watchedList, "watched_select", &err);
461  UIUtilE::Assign(this, m_inetRefList, "inetref_select", &err);
462  UIUtilE::Assign(this, m_coverFileList, "coverfile_select", &err);
463  UIUtilE::Assign(this, m_orderByList, "orderby_select", &err);
464 
465  UIUtilE::Assign(this, m_doneButton, "done_button", &err);
466  UIUtilE::Assign(this, m_saveButton, "save_button", &err);
467 
468  UIUtilE::Assign(this, m_numVideosText, "numvideos_text", &err);
469 
470  if (err)
471  {
472  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'filter'");
473  return false;
474  }
475 
476  BuildFocusList();
477 
478  fillWidgets();
479  update_numvideo();
480 
507 
510 
511  return true;
512 }
513 
515 {
516  int video_count = m_videoList.TryFilter(m_settings);
517 
518  if (video_count > 0)
519  {
520  m_numVideosText->SetText(tr("Result of this filter : %n video(s)", "",
521  video_count));
522  }
523  else
524  {
525  m_numVideosText->SetText(tr("Result of this filter : No Videos"));
526  }
527 }
528 
530 {
531  bool have_unknown_year = false;
532  bool have_unknown_runtime = false;
533 
534  using int_list = std::set<int>;
535  int_list years;
536  int_list runtimes;
537  int_list user_ratings;
538 
541  for (const auto & md : mdl)
542  {
543  int year = md->GetYear();
544  if ((year == 0) || (year == VIDEO_YEAR_DEFAULT))
545  have_unknown_year = true;
546  else
547  years.insert(year);
548 
549  int runtime = md->GetLength();
550  if (runtime == 0)
551  have_unknown_runtime = true;
552  else
553  runtimes.insert(runtime / 30);
554 
555  user_ratings.insert(static_cast<int>(md->GetUserRating()));
556  }
557 
558  // Category
559  new MythUIButtonListItem(m_categoryList, tr("All", "Category"),
561 
562  const VideoCategory::entry_list &vcl =
564  for (const auto & vc : vcl)
565  new MythUIButtonListItem(m_categoryList, vc.second, vc.first);
566 
570 
571  // Genre
572  new MythUIButtonListItem(m_genreList, tr("All", "Genre"), kGenreFilterAll);
573 
575  for (const auto & g : gl)
576  new MythUIButtonListItem(m_genreList, g.second, g.first);
577 
580 
581  // Cast
582  new MythUIButtonListItem(m_castList, tr("All", "Cast"), kCastFilterAll);
583 
585  for (const auto & c : cl)
586  new MythUIButtonListItem(m_castList, c.second, c.first);
587 
590 
591  // Country
592  new MythUIButtonListItem(m_countryList, tr("All", "Country"), kCountryFilterAll);
593 
595  for (const auto & cn : cnl)
596  new MythUIButtonListItem(m_countryList, cn.second, cn.first);
597 
601 
602  // Year
603  new MythUIButtonListItem(m_yearList, tr("All", "Year"), kYearFilterAll);
604 
605  for (auto p = years.crbegin(); p != years.crend(); ++p)
606  {
607  new MythUIButtonListItem(m_yearList, QString::number(*p), *p);
608  }
609 
610  if (have_unknown_year)
613 
615 
616  // Runtime
617  new MythUIButtonListItem(m_runtimeList, tr("All", "Runtime"), kRuntimeFilterAll);
618 
619  if (have_unknown_runtime)
622 
623  for (int runtime : runtimes)
624  {
625  QString s = QString("%1 %2 ~ %3 %4").arg(runtime * 30).arg(tr("minutes"))
626  .arg((runtime + 1) * 30).arg(tr("minutes"));
627  new MythUIButtonListItem(m_runtimeList, s, runtime);
628  }
629 
631 
632  // User Rating
633  new MythUIButtonListItem(m_userRatingList, tr("All", "User rating"),
635 
636  for (auto p = user_ratings.crbegin(); p != user_ratings.crend(); ++p)
637  {
639  QString(">= %1").arg(QString::number(*p)),
640  *p);
641  }
642 
644 
645  // Browsable
646  new MythUIButtonListItem(m_browseList, tr("All", "Browsable"),
649  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
651  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
653 
654  // Watched
655  new MythUIButtonListItem(m_watchedList, tr("All", "Watched"),
658  QCoreApplication::translate("(Common)", "Yes"), QVariant::fromValue(1));
660  QCoreApplication::translate("(Common)", "No"), QVariant::fromValue(0));
662 
663  // Inet Reference
664  new MythUIButtonListItem(m_inetRefList, tr("All", "Inet reference"),
666  new MythUIButtonListItem(m_inetRefList, tr("Unknown", "Inet reference"),
669 
670  // Coverfile
671  new MythUIButtonListItem(m_coverFileList, tr("All", "Cover file"),
673  new MythUIButtonListItem(m_coverFileList, tr("None", "Cover file"),
676 
677  // Order by
679  QCoreApplication::translate("(Common)", "Title"),
682  QCoreApplication::translate("(Common)", "Season/Episode"),
685  QCoreApplication::translate("(Common)", "Year"),
688  QCoreApplication::translate("(Common)", "User Rating"),
691  QCoreApplication::translate("(Common)", "Runtime"),
694  QCoreApplication::translate("(Common)", "Filename"),
696  new MythUIButtonListItem(m_orderByList, tr("Video ID"),
698  new MythUIButtonListItem(m_orderByList, tr("Date Added"),
701 
702  // Text Filter
704 }
705 
707 {
709  saveAndExit();
710 }
711 
713 {
715 
716  if (m_settings.getChangedState() > 0)
717  emit filterChanged();
718  Close();
719 }
720 
722 {
723  int new_year = item->GetData().toInt();
724  m_settings.SetYear(new_year);
725  update_numvideo();
726 }
727 
729 {
730  m_settings.SetUserRating(item->GetData().toInt());
731  update_numvideo();
732 }
733 
735 {
736  m_settings.SetCategory(item->GetData().toInt());
737  update_numvideo();
738 }
739 
741 {
742  m_settings.setCountry(item->GetData().toInt());
743  update_numvideo();
744 }
745 
747 {
748  m_settings.setGenre(item->GetData().toInt());
749  update_numvideo();
750 }
751 
753 {
754  m_settings.SetCast(item->GetData().toInt());
755  update_numvideo();
756 }
757 
759 {
760  m_settings.setRuntime(item->GetData().toInt());
761  update_numvideo();
762 }
763 
765 {
766  m_settings.SetBrowse(item->GetData().toInt());
767  update_numvideo();
768 }
769 
771 {
772  m_settings.SetWatched(item->GetData().toInt());
773  update_numvideo();
774 }
775 
777 {
778  m_settings.SetInetRef(item->GetData().toInt());
779  update_numvideo();
780 }
781 
783 {
784  m_settings.SetCoverFile(item->GetData().toInt());
785  update_numvideo();
786 }
787 
789 {
790  m_settings
792  update_numvideo();
793 }
794 
796 {
798  update_numvideo();
799 }
MythUIButton::Clicked
void Clicked()
VideoFilterDialog::SetWatched
void SetWatched(MythUIButtonListItem *item)
Definition: videofilter.cpp:770
VideoFilterSettings::VideoFilterSettings
VideoFilterSettings(bool loaddefaultsettings=true, const QString &_prefix="")
Definition: videofilter.cpp:19
VIDEO_YEAR_UNKNOWN
const QString VIDEO_YEAR_UNKNOWN
Definition: globals.cpp:15
VideoMetadata
Definition: videometadata.h:25
VideoFilterSettings::m_parentalLevel
ParentalLevel::Level m_parentalLevel
Definition: videofilter.h:233
VideoFilterDialog::setTextFilter
void setTextFilter()
Definition: videofilter.cpp:795
VideoFilterSettings::m_prefix
QString m_prefix
Definition: videofilter.h:234
VideoFilterSettings::kFilterCountryChanged
@ kFilterCountryChanged
Definition: videofilter.h:81
VideoFilterSettings::kOrderByTitle
@ kOrderByTitle
Definition: videofilter.h:109
VideoFilterDialog::SetCategory
void SetCategory(MythUIButtonListItem *item)
Definition: videofilter.cpp:734
VideoFilterSettings::SetCast
void SetCast(int lcast)
Definition: videofilter.h:134
VideoFilterSettings::setGenre
void setGenre(int lgenre)
Definition: videofilter.h:127
MythUIButtonList::SetValueByData
void SetValueByData(const QVariant &data)
Definition: mythuibuttonlist.cpp:1542
VideoFilterDialog::m_genreList
MythUIButtonList * m_genreList
Definition: videofilter.h:316
mythuitext.h
VIDEO_RUNTIME_UNKNOWN
const QString VIDEO_RUNTIME_UNKNOWN
Definition: globals.cpp:17
VideoMetadata::GetShowLevel
ParentalLevel::Level GetShowLevel() const
Definition: videometadata.cpp:1597
VideoFilterSettings::getInteRef
int getInteRef() const
Definition: videofilter.h:199
VideoFilterDialog::setGenre
void setGenre(MythUIButtonListItem *item)
Definition: videofilter.cpp:746
VideoFilterSettings::kFilterUserRatingChanged
@ kFilterUserRatingChanged
Definition: videofilter.h:84
kInetRefFilterUnknown
@ kInetRefFilterUnknown
Definition: videofilter.h:64
VideoFilterDialog::m_watchedList
MythUIButtonList * m_watchedList
Definition: videofilter.h:310
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
VideoFilterSettings::m_year
int m_year
Definition: videofilter.h:225
VideoFilterSettings::kFilterCoverFileChanged
@ kFilterCoverFileChanged
Definition: videofilter.h:87
VideoFilterSettings::GetUserRating
int GetUserRating() const
Definition: videofilter.h:161
VideoFilterSettings::m_episode
int m_episode
Definition: videofilter.h:237
VideoFilterDialog::SetCast
void SetCast(MythUIButtonListItem *item)
Definition: videofilter.cpp:752
VideoFilterDialog::m_orderByList
MythUIButtonList * m_orderByList
Definition: videofilter.h:311
VideoFilterSettings::m_runtime
int m_runtime
Definition: videofilter.h:226
VideoFilterSettings::kOrderByUserRatingDescending
@ kOrderByUserRatingDescending
Definition: videofilter.h:111
VideoFilterSettings::getRuntime
int getRuntime() const
Definition: videofilter.h:154
VideoList::TryFilter
int TryFilter(const VideoFilterSettings &filter) const
Definition: videolist.cpp:503
VideoFilterSettings::getGenre
int getGenre() const
Definition: videofilter.h:126
kCategoryFilterUnknown
@ kCategoryFilterUnknown
Definition: videofilter.h:37
kCategoryFilterAll
@ kCategoryFilterAll
Definition: videofilter.h:36
VideoMetadata::GetInsertdate
QDate GetInsertdate() const
Definition: videometadata.cpp:1517
VideoFilterDialog::m_doneButton
MythUIButton * m_doneButton
Definition: videofilter.h:322
MythUIButtonList::itemSelected
void itemSelected(MythUIButtonListItem *item)
VideoFilterSettings::m_reSeason
const QRegExp m_reSeason
Definition: videofilter.h:239
VideoFilterDialog::VideoFilterDialog
VideoFilterDialog(MythScreenStack *lparent, const QString &lname, VideoList *video_list)
Definition: videofilter.cpp:432
VideoFilterDialog::m_browseList
MythUIButtonList * m_browseList
Definition: videofilter.h:309
MythScreenStack
Definition: mythscreenstack.h:16
arg
arg(title).arg(filename).arg(doDelete))
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:80
VideoFilterSettings::kFilterBrowseChanged
@ kFilterBrowseChanged
Definition: videofilter.h:85
VideoFilterDialog::m_saveButton
MythUIButton * m_saveButton
Definition: videofilter.h:321
VideoMetadata::GetSeason
int GetSeason() const
Definition: videometadata.cpp:1497
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:45
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:42
VideoMetadata::GetCategoryID
int GetCategoryID() const
Definition: videometadata.cpp:1732
VideoFilterSettings::setOrderby
void setOrderby(ordering lorderby)
Definition: videofilter.h:183
VideoFilterSettings::m_browse
int m_browse
Definition: videofilter.h:228
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:1447
VideoFilterSettings::m_inetRef
int m_inetRef
Definition: videofilter.h:230
VideoFilterSettings::SetCoverFile
void SetCoverFile(int coverfile)
Definition: videofilter.h:207
VideoMetadata::GetSubtitle
const QString & GetSubtitle() const
Definition: videometadata.cpp:1352
VideoFilterSettings::getYear
int getYear() const
Definition: videofilter.h:147
VideoFilterSettings::saveAsDefault
void saveAsDefault()
Definition: videofilter.cpp:170
VideoFilterSettings::SetInetRef
void SetInetRef(int inetref)
Definition: videofilter.h:200
dbaccess.h
VideoFilterDialog::Create
bool Create() override
Definition: videofilter.cpp:445
VideoFilterDialog::m_textFilter
MythUITextEdit * m_textFilter
Definition: videofilter.h:324
videofilter.h
VideoFilterSettings::kFilterRuntimeChanged
@ kFilterRuntimeChanged
Definition: videofilter.h:83
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
VideoFilterDialog::SetYear
void SetYear(MythUIButtonListItem *item)
Definition: videofilter.cpp:721
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:216
VideoFilterDialog::m_countryList
MythUIButtonList * m_countryList
Definition: videofilter.h:315
VideoFilterSettings::m_userRating
int m_userRating
Definition: videofilter.h:227
VideoFilterSettings::kOrderByID
@ kOrderByID
Definition: videofilter.h:114
VideoFilterDialog::fillWidgets
void fillWidgets()
Definition: videofilter.cpp:529
mythdate.h
VideoFilterDialog::m_runtimeList
MythUIButtonList * m_runtimeList
Definition: videofilter.h:318
VideoMetadata::GetInetRef
const QString & GetInetRef() const
Definition: videometadata.cpp:1397
VideoMetadata::GetCountries
const country_list & GetCountries() const
Definition: videometadata.cpp:1722
VideoFilterSettings::SetYear
void SetYear(int lyear)
Definition: videofilter.h:148
VideoGenre::getGenre
static VideoGenre & getGenre()
Definition: dbaccess.cpp:515
VideoFilterDialog::setRunTime
void setRunTime(MythUIButtonListItem *item)
Definition: videofilter.cpp:758
VideoFilterDialog::saveAsDefault
void saveAsDefault()
Definition: videofilter.cpp:706
videolist.h
ParentalLevel::plNone
@ plNone
Definition: parentalcontrols.h:12
kYearFilterAll
@ kYearFilterAll
Definition: videofilter.h:41
VideoFilterSettings::kFilterParentalLevelChanged
@ kFilterParentalLevelChanged
Definition: videofilter.h:88
VideoFilterDialog::SetUserRating
void SetUserRating(MythUIButtonListItem *item)
Definition: videofilter.cpp:728
VideoFilterSettings::getOrderby
ordering getOrderby() const
Definition: videofilter.h:182
kRuntimeFilterAll
@ kRuntimeFilterAll
Definition: videofilter.h:46
VideoFilterSettings::m_genre
int m_genre
Definition: videofilter.h:222
kCastFilterAll
@ kCastFilterAll
Definition: videofilter.h:31
VideoFilterSettings::GetCoverFile
int GetCoverFile() const
Definition: videofilter.h:206
VideoFilterDialog::m_videoList
const VideoList & m_videoList
Definition: videofilter.h:326
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:319
VideoFilterSettings::kFilterWatchedChanged
@ kFilterWatchedChanged
Definition: videofilter.h:90
globals.h
VideoFilterSettings::m_season
int m_season
Definition: videofilter.h:236
VideoFilterSettings::getTextFilter
QString getTextFilter() const
Definition: videofilter.h:189
VideoFilterSettings::operator=
VideoFilterSettings & operator=(const VideoFilterSettings &rhs)
Definition: videofilter.cpp:65
kCountryFilterUnknown
@ kCountryFilterUnknown
Definition: videofilter.h:27
VIDEO_CAST_UNKNOWN
const QString VIDEO_CAST_UNKNOWN
Definition: globals.cpp:19
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:222
VideoFilterSettings::m_category
int m_category
Definition: videofilter.h:221
kCoverFileFilterNone
@ kCoverFileFilterNone
Definition: videofilter.h:69
kBrowseFilterAll
@ kBrowseFilterAll
Definition: videofilter.h:55
VideoFilterSettings::m_orderBy
ordering m_orderBy
Definition: videofilter.h:232
VideoFilterSettings::m_watched
int m_watched
Definition: videofilter.h:229
VideoFilterSettings::GetBrowse
int GetBrowse() const
Definition: videofilter.h:168
VideoMetadata::GetYear
int GetYear() const
Definition: videometadata.cpp:1377
VideoFilterSettings::m_reDate
const QRegExp m_reDate
Definition: videofilter.h:240
VideoFilterDialog::SetBrowse
void SetBrowse(MythUIButtonListItem *item)
Definition: videofilter.cpp:764
VideoCountry::getCountry
static VideoCountry & getCountry()
Definition: dbaccess.cpp:501
VideoMetadata::GetSortFilename
const QString & GetSortFilename() const
Definition: videometadata.cpp:1612
kGenreFilterAll
@ kGenreFilterAll
Definition: videofilter.h:21
VideoFilterSettings::m_cast
int m_cast
Definition: videofilter.h:224
VIDEO_GENRE_UNKNOWN
const QString VIDEO_GENRE_UNKNOWN
Definition: globals.cpp:11
VideoFilterDialog::m_settings
VideoFilterSettings m_settings
Definition: videofilter.h:307
VideoFilterSettings::m_changedState
unsigned int m_changedState
Definition: videofilter.h:242
VideoFilterSettings::GetCategory
int GetCategory() const
Definition: videofilter.h:119
VideoMetadata::GetGenres
const genre_list & GetGenres() const
Definition: videometadata.cpp:1702
VideoCategory::GetCategory
static VideoCategory & GetCategory()
Definition: dbaccess.cpp:487
naturalCompare
int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity)
Definition: mythmiscutil.cpp:1033
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3580
FilterSettingsProxy::setSettings
virtual void setSettings(const VideoFilterSettings &settings)=0
VideoFilterSettings::GetWatched
int GetWatched() const
Definition: videofilter.h:175
VideoMetadata::GetEpisode
int GetEpisode() const
Definition: videometadata.cpp:1507
kUserRatingFilterAll
@ kUserRatingFilterAll
Definition: videofilter.h:51
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
VideoFilterDialog::saveAndExit
void saveAndExit()
Definition: videofilter.cpp:712
VideoFilterSettings::m_coverFile
int m_coverFile
Definition: videofilter.h:231
VideoFilterSettings::kOrderByDateAddedDescending
@ kOrderByDateAddedDescending
Definition: videofilter.h:116
VideoFilterSettings::kOrderByYearDescending
@ kOrderByYearDescending
Definition: videofilter.h:110
VideoList
Definition: videolist.h:24
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:933
kInetRefFilterAll
@ kInetRefFilterAll
Definition: videofilter.h:63
VIDEO_INETREF_DEFAULT
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
VideoMetadata::sortBefore
bool sortBefore(const VideoMetadata &rhs) const
Definition: videometadata.cpp:1805
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:47
VideoFilterSettings
Definition: videofilter.h:73
VideoFilterDialog::m_yearList
MythUIButtonList * m_yearList
Definition: videofilter.h:312
VideoFilterSettings::m_country
int m_country
Definition: videofilter.h:223
VideoFilterSettings::getCountry
int getCountry() const
Definition: videofilter.h:140
BasicFilterSettingsProxy
Definition: videofilter.h:254
VideoFilterSettings::kSortOrderChanged
@ kSortOrderChanged
Definition: videofilter.h:78
kCoverFileFilterAll
@ kCoverFileFilterAll
Definition: videofilter.h:68
VideoFilterSettings::setTextFilter
void setTextFilter(const QString &val)
Definition: videofilter.cpp:378
VideoFilterSettings::m_textFilter
QString m_textFilter
Definition: videofilter.h:235
SingleValue::getList
const entry_list & getList()
Definition: dbaccess.cpp:239
VideoFilterSettings::kFilterInetRefChanged
@ kFilterInetRefChanged
Definition: videofilter.h:86
VideoFilterSettings::SetBrowse
void SetBrowse(int lbrowse)
Definition: videofilter.h:169
mythmiscutil.h
VideoFilterDialog::m_categoryList
MythUIButtonList * m_categoryList
Definition: videofilter.h:314
VideoFilterSettings::kFilterCastChanged
@ kFilterCastChanged
Definition: videofilter.h:89
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:1457
VideoFilterSettings::kOrderByFilename
@ kOrderByFilename
Definition: videofilter.h:113
VideoFilterSettings::SetWatched
void SetWatched(int lwatched)
Definition: videofilter.h:176
VideoMetadata::GetWatched
bool GetWatched() const
Definition: videometadata.cpp:1557
kWatchedFilterAll
@ kWatchedFilterAll
Definition: videofilter.h:59
VideoFilterSettings::getChangedState
unsigned int getChangedState()
Definition: videofilter.h:213
VideoFilterDialog::m_fsp
FilterSettingsProxy * m_fsp
Definition: videofilter.h:327
VideoFilterSettings::SetUserRating
void SetUserRating(int luserrating)
Definition: videofilter.h:162
VideoMetadata::GetCoverFile
const QString & GetCoverFile() const
Definition: videometadata.cpp:1652
VideoFilterDialog::update_numvideo
void update_numvideo()
Definition: videofilter.cpp:514
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:134
mythcontext.h
VideoFilterSettings::kOrderByLength
@ kOrderByLength
Definition: videofilter.h:112
VideoFilterSettings::kFilterTextFilterChanged
@ kFilterTextFilterChanged
Definition: videofilter.h:91
VideoFilterDialog::SetInetRef
void SetInetRef(MythUIButtonListItem *item)
Definition: videofilter.cpp:776
VideoMetadata::GetID
unsigned int GetID() const
Definition: videometadata.cpp:1527
VideoFilterSettings::GetCast
int GetCast() const
Definition: videofilter.h:133
VideoFilterDialog::m_coverFileList
MythUIButtonList * m_coverFileList
Definition: videofilter.h:320
VIDEO_YEAR_DEFAULT
@ VIDEO_YEAR_DEFAULT
Definition: videometadata.h:18
VideoFilterSettings::SetCategory
void SetCategory(int lcategory)
Definition: videofilter.h:120
VideoMetadata::GetTitle
const QString & GetTitle() const
Definition: videometadata.cpp:1337
mythuibutton.h
VideoFilterSettings::kFilterYearChanged
@ kFilterYearChanged
Definition: videofilter.h:82
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:155
VideoFilterDialog::filterChanged
void filterChanged()
kGenreFilterUnknown
@ kGenreFilterUnknown
Definition: videofilter.h:22
SingleValue::entry_list
std::vector< entry > entry_list
Definition: dbaccess.h:16
VideoFilterDialog::setOrderby
void setOrderby(MythUIButtonListItem *item)
Definition: videofilter.cpp:788
VideoFilterDialog::m_userRatingList
MythUIButtonList * m_userRatingList
Definition: videofilter.h:313
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:902
VideoFilterSettings::kFilterCategoryChanged
@ kFilterCategoryChanged
Definition: videofilter.h:79
VideoFilterDialog::m_numVideosText
MythUIText * m_numVideosText
Definition: videofilter.h:323
VideoMetadata::GetBrowse
bool GetBrowse() const
Definition: videometadata.cpp:1547
VideoFilterDialog::m_castList
MythUIButtonList * m_castList
Definition: videofilter.h:317
kCastFilterUnknown
@ kCastFilterUnknown
Definition: videofilter.h:32
VideoFilterSettings::matches_filter
bool matches_filter(const VideoMetadata &mdata) const
Definition: videofilter.cpp:187
VideoFilterSettings::m_insertDate
QDate m_insertDate
Definition: videofilter.h:238
VideoFilterDialog::~VideoFilterDialog
~VideoFilterDialog() override
Definition: videofilter.cpp:440
VideoMetadata::GetCast
const cast_list & GetCast() const
Definition: videometadata.cpp:1712
VideoFilterSettings::meta_less_than
bool meta_less_than(const VideoMetadata &lhs, const VideoMetadata &rhs) const
Compares two VideoMetadata instances.
Definition: videofilter.cpp:307
VideoList::getListCache
const VideoMetadataListManager & getListCache() const
Definition: videolist.cpp:508
videoutils.h
kCountryFilterAll
@ kCountryFilterAll
Definition: videofilter.h:26
VideoFilterSettings::setCountry
void setCountry(int lcountry)
Definition: videofilter.h:141
VideoFilterSettings::kOrderBySeasonEp
@ kOrderBySeasonEp
Definition: videofilter.h:115
VideoFilterDialog::SetCoverFile
void SetCoverFile(MythUIButtonListItem *item)
Definition: videofilter.cpp:782
VideoFilterDialog::setCountry
void setCountry(MythUIButtonListItem *item)
Definition: videofilter.cpp:740
VideoMetadata::GetLength
int GetLength() const
Definition: videometadata.cpp:1477