MythTV  master
videometadata.cpp
Go to the documentation of this file.
1 #include <cmath> // for isnan()
2 
3 #include <QDir>
4 #include <QFile>
5 #include <QFileInfo>
6 #include <QRegularExpression>
7 
8 #include "libmyth/mythcontext.h"
9 #include "libmyth/programinfo.h" // for format_season_and_episode
10 #include "libmyth/remoteutil.h"
12 #include "libmythbase/mythdate.h"
13 #include "libmythbase/mythdb.h"
15 #include "libmythbase/mythmiscutil.h"// for FileHash
17 #include "libmythbase/remotefile.h"
19 #include "libmythbase/stringutil.h"
21 
22 #include "dbaccess.h"
23 #include "globals.h"
25 #include "videoutils.h"
26 
27 #if QT_VERSION < QT_VERSION_CHECK(5,15,2)
28 #define capturedView capturedRef
29 #endif
30 
32 {
33  public:
37 
38  public:
39  VideoMetadataImp(QString filename, QString sortFilename,
40  QString hash, QString trailer,
41  QString coverfile, QString screenshot, QString banner,
42  QString fanart, const QString &title, QString sortTitle,
43  const QString &subtitle, QString sortSubtitle,
44  QString tagline, int year, const QDate releasedate,
45  QString inetref, int collectionref, QString homepage,
46  QString director, QString studio,
47  QString plot, float userrating,
48  QString rating, int length, int playcount,
49  int season, int episode, const QDate insertdate,
50  int id, ParentalLevel::Level showlevel, int categoryID,
51  int childID, bool browse, bool watched,
52  QString playcommand, QString category,
53  genre_list genres,
54  country_list countries,
55  cast_list cast,
56  QString host = "",
57  bool processed = false,
58  VideoContentType contenttype = kContentUnknown) :
59  m_title(title), m_sortTitle(std::move(sortTitle)), m_subtitle(subtitle),
60  m_sortSubtitle(std::move(sortSubtitle)), m_tagline(std::move(tagline)),
61  m_inetref(std::move(inetref)), m_collectionref(collectionref),
62  m_homepage(std::move(homepage)), m_director(std::move(director)),
63  m_studio(std::move(studio)), m_plot(std::move(plot)),
64  m_rating(std::move(rating)), m_playcommand(std::move(playcommand)),
65  m_category(std::move(category)), m_genres(std::move(genres)),
66  m_countries(std::move(countries)), m_cast(std::move(cast)),
67  m_filename(std::move(filename)), m_sortFilename(std::move(sortFilename)),
68  m_hash(std::move(hash)), m_trailer(std::move(trailer)),
69  m_coverfile(std::move(coverfile)), m_screenshot(std::move(screenshot)),
70  m_banner(std::move(banner)), m_fanart(std::move(fanart)),
71  m_host(std::move(host)), m_categoryID(categoryID), m_childID(childID),
72  m_year(year), m_releasedate(releasedate), m_length(length), m_playcount(playcount),
73  m_season(season), m_episode(episode), m_insertdate(insertdate), m_showlevel(showlevel),
74  m_browse(browse), m_watched(watched), m_id(id),
75  m_userrating(userrating), m_processed(processed),
76  m_contenttype(contenttype)
77  {
78  // Try to glean data if none provided.
79  if (title.isEmpty() and subtitle.isEmpty()
80  and season == 0 and episode == 0)
81  {
86  }
87 
89 
91  }
92 
93  explicit VideoMetadataImp(MSqlQuery &query)
94  {
95  fromDBRow(query);
97  }
98 
100  {
101  *this = other;
102  }
103 
105  {
106  if (this != &rhs)
107  {
108  m_title = rhs.m_title;
109  m_sortTitle = rhs.m_sortTitle;
110  m_subtitle = rhs.m_subtitle;
112  m_tagline = rhs.m_tagline;
113  m_inetref = rhs.m_inetref;
115  m_homepage = rhs.m_homepage;
116  m_director = rhs.m_director;
117  m_studio = rhs.m_studio;
118  m_plot = rhs.m_plot;
119  m_rating = rhs.m_rating;
121  m_category = rhs.m_category;
122  m_genres = rhs.m_genres;
123  m_countries = rhs.m_countries;
124  m_cast = rhs.m_cast;
125  m_filename = rhs.m_filename;
127  m_hash = rhs.m_hash;
128  m_trailer = rhs.m_trailer;
129  m_coverfile = rhs.m_coverfile;
131  m_banner = rhs.m_banner;
132  m_fanart = rhs.m_fanart;
133 
135  m_childID = rhs.m_childID;
136  m_year = rhs.m_year;
138  m_length = rhs.m_length;
139  m_playcount = rhs.m_playcount;
140  m_season = rhs.m_season;
141  m_episode = rhs.m_episode;
143  m_showlevel = rhs.m_showlevel;
144  m_browse = rhs.m_browse;
145  m_watched = rhs.m_watched;
146  m_id = rhs.m_id;
148  m_host = rhs.m_host;
149  m_processed = rhs.m_processed;
151 
152  // No DB vars
153  m_prefix = rhs.m_prefix;
154 
156  }
157 
158  return *this;
159  }
160 
161  void ensureSortFields(void)
162  {
163  std::shared_ptr<MythSortHelper>sh = getMythSortHelper();
164  if (m_sortTitle.isEmpty() and not m_title.isEmpty())
165  m_sortTitle = sh->doTitle(m_title);
166  if (m_sortSubtitle.isEmpty() and not m_subtitle.isEmpty())
167  m_sortSubtitle = sh->doTitle(m_subtitle);
168  if (m_sortFilename.isEmpty() and not m_filename.isEmpty())
169  m_sortFilename = sh->doPathname(m_filename);
170  }
171 
172  public:
173  const QString &GetPrefix() const { return m_prefix; }
174  void SetPrefix(const QString &prefix) { m_prefix = prefix; }
175 
176  const QString &getTitle() const { return m_title; }
177  const QString &getSortTitle() const { return m_sortTitle; }
178  void SetTitle(const QString& title, const QString& sortTitle = "")
179  {
180  m_title = title;
181  m_sortTitle = sortTitle;
183  }
184 
185  const QString &getSubtitle() const { return m_subtitle; }
186  const QString &getSortSubtitle() const { return m_sortSubtitle; }
187  void SetSubtitle(const QString &subtitle, const QString &sortSubtitle = "") {
188  m_subtitle = subtitle;
189  m_sortSubtitle = sortSubtitle;
191  }
192 
193  const QString &GetTagline() const { return m_tagline; }
194  void SetTagline(const QString &tagline) { m_tagline = tagline; }
195 
196  const QString &GetInetRef() const { return m_inetref; }
197  void SetInetRef(const QString &inetRef) { m_inetref = inetRef; }
198 
199  int GetCollectionRef() const { return m_collectionref; }
200  void SetCollectionRef(int collectionref) { m_collectionref = collectionref; }
201 
202  const QString &GetHomepage() const { return m_homepage; }
203  void SetHomepage(const QString &homepage) { m_homepage = homepage; }
204 
205  const QString &getDirector() const { return m_director; }
206  void SetDirector(const QString &director) { m_director = director; }
207 
208  const QString &getStudio() const { return m_studio; }
209  void SetStudio(const QString &studio) { m_studio = studio; }
210 
211  const QString &getPlot() const { return m_plot; }
212  void SetPlot(const QString &plot) { m_plot = plot; }
213 
214  const QString &GetRating() const { return m_rating; }
215  void SetRating(const QString &rating) { m_rating = rating; }
216 
217  const QString &getPlayCommand() const { return m_playcommand; }
218  void SetPlayCommand(const QString &playCommand)
219  {
220  m_playcommand = playCommand;
221  }
222 
223  const QString &GetCategory() const { return m_category; }
224 // void SetCategory(const QString &category) { m_category = category; }
225 
226  const genre_list &getGenres() const { return m_genres; }
227  void SetGenres(const genre_list &genres) { m_genres = genres; }
228 
229  const country_list &GetCountries() const { return m_countries; }
230  void SetCountries(const country_list &countries)
231  {
232  m_countries = countries;
233  }
234 
235  const cast_list &GetCast() const { return m_cast; }
236  void SetCast(const cast_list &cast) { m_cast = cast; }
237 
238  const QString &GetHost() const { return m_host; }
239  void SetHost(const QString &host) { m_host = host; }
240 
241  const QString &getFilename() const { return m_filename; }
242  const QString &getSortFilename() const { return m_sortFilename; }
243  void SetFilename(const QString &filename, const QString &sortFilename = "")
244  {
246  m_sortFilename = sortFilename;
248  }
249 
250  bool sortBefore(const VideoMetadataImp *rhs) const;
251 
252  const QString &GetHash() const { return m_hash; }
253  void SetHash(const QString &hash) { m_hash = hash; }
254 
255  const QString &GetTrailer() const { return m_trailer; }
256  void SetTrailer(const QString &trailer) { m_trailer = trailer; }
257 
258  const QString &GetCoverFile() const { return m_coverfile; }
259  void SetCoverFile(const QString &coverFile) { m_coverfile = coverFile; }
260 
261  const QString &GetScreenshot() const { return m_screenshot; }
262  void SetScreenshot(const QString &screenshot) { m_screenshot = screenshot; }
263 
264  const QString &GetBanner() const { return m_banner; }
265  void SetBanner(const QString &banner) { m_banner = banner; }
266 
267  const QString &GetFanart() const { return m_fanart; }
268  void SetFanart(const QString &fanart) { m_fanart = fanart; }
269 
270  int GetCategoryID() const
271  {
272  return m_categoryID;
273  }
274  void SetCategoryID(int id);
275 
276  int GetChildID() const { return m_childID; }
277  void SetChildID(int childID) { m_childID = childID; }
278 
279  int getYear() const { return m_year; }
280  void SetYear(int year) { m_year = year; }
281 
282  QDate getReleaseDate() const { return m_releasedate; }
283  void SetReleaseDate(QDate releasedate) { m_releasedate = releasedate; }
284 
285  std::chrono::minutes GetLength() const { return m_length; }
286  void SetLength(std::chrono::minutes length) { m_length = length; }
287 
288  unsigned int GetPlayCount() const { return m_playcount; }
289  void SetPlayCount(int playcount) { m_playcount = playcount; }
290 
291  int GetSeason() const { return m_season; }
292  void SetSeason(int season) { m_season = season; }
293 
294  int GetEpisode() const { return m_episode; }
295  void SetEpisode(int episode) { m_episode = episode; }
296 
297  QDate GetInsertdate() const { return m_insertdate;}
298  void SetInsertdate(QDate date) { m_insertdate = date;}
299 
302  {
303  m_showlevel = ParentalLevel(showLevel).GetLevel();
304  }
305 
306  bool GetBrowse() const { return m_browse; }
307  void SetBrowse(bool browse) { m_browse = browse; }
308 
309  bool GetWatched() const { return m_watched; }
310  void SetWatched(bool watched) { m_watched = watched; }
311 
312  unsigned int GetID() const { return m_id; }
313  void SetID(int id) { m_id = id; }
314 
315  float GetUserRating() const { return m_userrating; }
316  void SetUserRating(float userRating) { m_userrating = userRating; }
317 
318  bool GetProcessed() const { return m_processed; }
319  void SetProcessed(bool processed) { m_processed = processed; }
320 
322  void SetContentType(VideoContentType contenttype) { m_contenttype = contenttype; }
323 
325 
326  void SaveToDatabase();
327  void UpdateDatabase();
328  bool DeleteFromDatabase();
329 
330  bool DeleteFile();
331 
332  void Reset();
333 
334  bool IsHostSet() const;
335 
336  void GetImageMap(InfoMap &imageMap) const;
337  QString GetImage(const QString &name) const;
338 
339  private:
340  void fillCountries();
341  void updateCountries();
342  void fillGenres();
343  void fillCast();
344  void updateGenres();
345  void updateCast();
346  bool removeDir(const QString &dirName);
347  void fromDBRow(MSqlQuery &query);
348  void saveToDatabase();
349 
350  private:
351  QString m_title;
352  QString m_sortTitle;
353  QString m_subtitle;
354  QString m_sortSubtitle;
355  QString m_tagline;
356  QString m_inetref;
358  QString m_homepage;
359  QString m_director;
360  QString m_studio;
361  QString m_plot;
362  QString m_rating;
363  QString m_playcommand;
364  QString m_category;
368  QString m_filename;
369  QString m_sortFilename;
370  QString m_hash;
371  QString m_trailer;
372  QString m_coverfile;
373  QString m_screenshot;
374  QString m_banner;
375  QString m_fanart;
376  QString m_host;
377 
378  int m_categoryID {0};
379  int m_childID {-1};
382  std::chrono::minutes m_length {0min};
383  int m_playcount {0};
384  int m_season {0};
385  int m_episode {0};
388  bool m_browse {true};
389  bool m_watched {false};
390  unsigned int m_id {0}; // videometadata.intid
391  float m_userrating {0.0};
392  bool m_processed {false};
394 
395  // not in DB
396  QString m_prefix;
397 };
398 
402 
406 {
408  if (cmp == 0)
410  if (cmp == 0)
411  cmp = ternary_compare(m_id, rhs->m_id);
412  return cmp < 0;
413 }
414 
415 bool VideoMetadataImp::removeDir(const QString &dirName)
416 {
417  QDir d(dirName);
418 
419  d.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
420  QFileInfoList contents = d.entryInfoList();
421  if (contents.empty())
422  {
423  return d.rmdir(dirName);
424  }
425 
426  for (const auto& entry : qAsConst(contents))
427  {
428  if (entry.isDir())
429  {
430  QString fileName = entry.fileName();
431  if (!removeDir(fileName))
432  return false;
433  }
434  else
435  {
436  if (!QFile(entry.fileName()).remove())
437  return false;
438  }
439  }
440  return d.rmdir(dirName);
441 }
442 
445 {
446  bool isremoved = false;
447 
448  if (!m_host.isEmpty())
449  {
450  QString url = generate_file_url("Videos", m_host, m_filename);
451  isremoved = RemoteFile::DeleteFile(url);
452  }
453  else
454  {
455  QFileInfo fi(m_filename);
456  if (fi.isDir())
457  {
458  isremoved = removeDir(m_filename);
459  }
460  else
461  {
462  isremoved = QFile::remove(m_filename);
463  }
464  }
465 
466  if (!isremoved)
467  {
468  LOG(VB_GENERAL, LOG_DEBUG, QString("Could not delete file: %1")
469  .arg(m_filename));
470  }
471 
472  return isremoved;
473 }
474 
476 {
477  VideoMetadataImp tmp(m_filename, QString(),
480  VIDEO_FANART_DEFAULT, QString(), QString(), QString(), QString(),
481  QString(), VIDEO_YEAR_DEFAULT,
482  QDate(), VIDEO_INETREF_DEFAULT, -1, QString(), VIDEO_DIRECTOR_DEFAULT,
483  QString(), VIDEO_PLOT_DEFAULT, 0.0,
484  VIDEO_RATING_DEFAULT, 0, 0,
485  0, 0, QDate(), m_id,
486  ParentalLevel::plLowest, 0, -1, true, false, "", "",
488  VideoMetadata::cast_list(), m_host, false);
489  tmp.m_prefix = m_prefix;
490 
491  *this = tmp;
492 }
493 
495 {
496  return !m_host.isEmpty();
497 }
498 
500 {
501  m_genres.clear();
503  VideoGenreMap::entry genres;
504  if (vgm.get(m_id, genres))
505  {
507  for (long value : genres.values)
508  {
509  // Just add empty string for no-name genres
510  QString name;
511  vg.get(value, name);
512  m_genres.push_back(genre_list::value_type(value, name));
513  }
514  }
515 }
516 
518 {
519  m_countries.clear();
521  VideoCountryMap::entry countries;
522  if (vcm.get(m_id, countries))
523  {
525  for (long value : countries.values)
526  {
527  // Just add empty string for no-name countries
528  QString name;
529  vc.get(value, name);
530  m_countries.push_back(country_list::value_type(value, name));
531  }
532  }
533 }
534 
536 {
537  m_cast.clear();
539  VideoCastMap::entry cast;
540  if (vcm.get(m_id, cast))
541  {
543  for (long value : cast.values)
544  {
545  // Just add empty string for no-name cast
546  QString name;
547  vc.get(value, name);
548  m_cast.push_back(cast_list::value_type(value, name));
549  }
550  }
551 }
552 
558 {
559  m_title = query.value(0).toString();
560  m_director = query.value(1).toString();
561  m_studio = query.value(2).toString();
562  m_plot = query.value(3).toString();
563  m_rating = query.value(4).toString();
564  m_year = query.value(5).toInt();
565  m_releasedate = query.value(6).toDate();
566  m_userrating = (float)query.value(7).toDouble();
567  if (std::isnan(m_userrating) || m_userrating < 0)
568  m_userrating = 0.0;
569  if (m_userrating > 10.0F)
570  m_userrating = 10.0F;
571  m_length = std::chrono::minutes(query.value(8).toInt());
572  m_playcount = query.value(9).toInt();
573  m_filename = query.value(10).toString();
574  m_hash = query.value(11).toString();
575  m_showlevel = ParentalLevel(query.value(12).toInt()).GetLevel();
576  m_coverfile = query.value(13).toString();
577  m_inetref = query.value(14).toString();
578  m_collectionref = query.value(15).toUInt();
579  m_homepage = query.value(16).toString();
580  m_childID = query.value(17).toUInt();
581  m_browse = query.value(18).toBool();
582  m_watched = query.value(19).toBool();
583  m_playcommand = query.value(20).toString();
584  m_categoryID = query.value(21).toInt();
585  m_id = query.value(22).toInt();
586  m_trailer = query.value(23).toString();
587  m_screenshot = query.value(24).toString();
588  m_banner = query.value(25).toString();
589  m_fanart = query.value(26).toString();
590  m_subtitle = query.value(27).toString();
591  m_tagline = query.value(28).toString();
592  m_season = query.value(29).toInt();
593  m_episode = query.value(30).toInt();
594  m_host = query.value(31).toString();
595  m_insertdate = query.value(32).toDate();
596  m_processed = query.value(33).toBool();
597 
598  m_contenttype = ContentTypeFromString(query.value(34).toString());
599 
601 
603 
604  // Genres
605  fillGenres();
606 
607  //Countries
608  fillCountries();
609 
610  // Cast
611  fillCast();
612 }
613 
615 {
616  if (m_title.isEmpty())
618  if (m_hash.isEmpty())
620  if (m_subtitle.isEmpty())
622  if (m_director.isEmpty())
624  if (m_plot.isEmpty())
626  if (m_rating.isEmpty())
629 
630  InfoMap metadataMap;
631  GetImageMap(metadataMap);
632  QString coverfile = metadataMap["coverfile"];
633  QString screenshot = metadataMap["screenshotfile"];
634  QString bannerfile = metadataMap["bannerfile"];
635  QString fanartfile = metadataMap["fanartfile"];
636 
637  if (coverfile.isEmpty() || !RemoteFile::Exists(coverfile))
639  if (screenshot.isEmpty() || !RemoteFile::Exists(screenshot))
641  if (bannerfile.isEmpty() || !RemoteFile::Exists(bannerfile))
643  if (fanartfile.isEmpty() || !RemoteFile::Exists(fanartfile))
645  if (m_trailer.isEmpty())
647  if (m_inetref.isEmpty())
649  if (std::isnan(m_userrating))
650  m_userrating = 0.0;
651  if (m_userrating < -10.0F || m_userrating > 10.0F)
652  m_userrating = 0.0;
653  if (m_releasedate.toString().isEmpty())
654  m_releasedate = QDate::fromString("0000-00-00", "YYYY-MM-DD");
656  {
657  if (m_season > 0 || m_episode > 0)
659  else
661  }
662 
663  bool inserting = m_id == 0;
664 
665  MSqlQuery query(MSqlQuery::InitCon());
666 
667  if (inserting)
668  {
669  m_browse = true;
670 
671  m_watched = false;
672 
673  query.prepare("INSERT INTO videometadata (title,subtitle,tagline,director,studio,plot,"
674  "rating,year,userrating,length,season,episode,filename,hash,"
675  "showlevel,coverfile,inetref,homepage,browse,watched,trailer,"
676  "screenshot,banner,fanart,host,processed,contenttype) VALUES (:TITLE, :SUBTITLE, "
677  ":TAGLINE, :DIRECTOR, :STUDIO, :PLOT, :RATING, :YEAR, :USERRATING, "
678  ":LENGTH, :SEASON, :EPISODE, :FILENAME, :HASH, :SHOWLEVEL, "
679  ":COVERFILE, :INETREF, :HOMEPAGE, :BROWSE, :WATCHED, "
680  ":TRAILER, :SCREENSHOT, :BANNER, :FANART, :HOST, :PROCESSED, :CONTENTTYPE)");
681  }
682  else
683  {
684  query.prepare("UPDATE videometadata SET title = :TITLE, subtitle = :SUBTITLE, "
685  "tagline = :TAGLINE, director = :DIRECTOR, studio = :STUDIO, "
686  "plot = :PLOT, rating= :RATING, year = :YEAR, "
687  "releasedate = :RELEASEDATE, userrating = :USERRATING, "
688  "length = :LENGTH, playcount = :PLAYCOUNT, season = :SEASON, "
689  "episode = :EPISODE, filename = :FILENAME, hash = :HASH, trailer = :TRAILER, "
690  "showlevel = :SHOWLEVEL, coverfile = :COVERFILE, "
691  "screenshot = :SCREENSHOT, banner = :BANNER, fanart = :FANART, "
692  "inetref = :INETREF, collectionref = :COLLECTION, homepage = :HOMEPAGE, "
693  "browse = :BROWSE, watched = :WATCHED, host = :HOST, playcommand = :PLAYCOMMAND, "
694  "childid = :CHILDID, category = :CATEGORY, processed = :PROCESSED, "
695  "contenttype = :CONTENTTYPE WHERE intid = :INTID");
696 
697  query.bindValue(":PLAYCOMMAND", m_playcommand);
698  query.bindValue(":CHILDID", m_childID);
699  query.bindValue(":CATEGORY", m_categoryID);
700  query.bindValue(":INTID", m_id);
701  }
702 
703  query.bindValueNoNull(":TITLE", m_title);
704  query.bindValueNoNull(":SUBTITLE", m_subtitle);
705  query.bindValue(":TAGLINE", m_tagline);
706  query.bindValueNoNull(":DIRECTOR", m_director);
707  query.bindValue(":STUDIO", m_studio);
708  query.bindValue(":PLOT", m_plot);
709  query.bindValueNoNull(":RATING", m_rating);
710  query.bindValue(":YEAR", m_year);
711  query.bindValue(":RELEASEDATE", m_releasedate);
712  query.bindValue(":USERRATING", m_userrating);
713  query.bindValue(":LENGTH", static_cast<qint64>(m_length.count()));
714  query.bindValue(":PLAYCOUNT", m_playcount);
715  query.bindValue(":SEASON", m_season);
716  query.bindValue(":EPISODE", m_episode);
717  query.bindValue(":FILENAME", m_filename);
718  query.bindValue(":HASH", m_hash);
719  query.bindValueNoNull(":TRAILER", m_trailer);
720  query.bindValue(":SHOWLEVEL", m_showlevel);
721  query.bindValueNoNull(":COVERFILE", m_coverfile);
722  query.bindValueNoNull(":SCREENSHOT", m_screenshot);
723  query.bindValueNoNull(":BANNER", m_banner);
724  query.bindValueNoNull(":FANART", m_fanart);
725  query.bindValueNoNull(":INETREF", m_inetref);
726  query.bindValue(":COLLECTION", m_collectionref);
727  query.bindValueNoNull(":HOMEPAGE", m_homepage);
728  query.bindValue(":BROWSE", m_browse);
729  query.bindValue(":WATCHED", m_watched);
730  query.bindValue(":HOST", m_host);
731  query.bindValue(":PROCESSED", m_processed);
732  query.bindValue(":CONTENTTYPE", ContentTypeToString(m_contenttype));
733 
734  if (!query.exec() || !query.isActive())
735  {
736  MythDB::DBError("video metadata update", query);
737  return;
738  }
739 
740  if (inserting)
741  {
742  // Must make sure we have 'id' filled before we call updateGenres or
743  // updateCountries
744 
745  if (!query.exec("SELECT LAST_INSERT_ID()") || !query.next())
746  {
747  MythDB::DBError("metadata id get", query);
748  return;
749  }
750 
751  m_id = query.value(0).toUInt();
752 
753  if (0 == m_id)
754  {
755  LOG(VB_GENERAL, LOG_ERR,
756  QString("%1: The id of the last inserted row to "
757  "videometadata seems to be 0. This is odd.")
758  .arg(__FILE__));
759  return;
760  }
761  }
762 
763  updateGenres();
764  updateCountries();
765  updateCast();
766 }
767 
769 {
770  saveToDatabase();
771 }
772 
774 {
775  saveToDatabase();
776 }
777 
779 {
783 
784  MSqlQuery query(MSqlQuery::InitCon());
785  query.prepare("DELETE FROM videometadata WHERE intid = :ID");
786  query.bindValue(":ID", m_id);
787  if (!query.exec())
788  {
789  MythDB::DBError("delete from videometadata", query);
790  }
791 
792  query.prepare("DELETE FROM filemarkup WHERE filename = :FILENAME");
793  query.bindValue(":FILENAME", m_filename);
794  if (!query.exec())
795  {
796  MythDB::DBError("delete from filemarkup", query);
797  }
798 
799  return true;
800 }
801 
803 {
804  if (id == 0)
805  {
806  m_category = "";
807  m_categoryID = id;
808  }
809  else
810  {
811  if (m_categoryID != id)
812  {
813  QString cat;
815  {
816  m_category = cat;
817  m_categoryID = id;
818  }
819  else
820  {
821  LOG(VB_GENERAL, LOG_ERR, "Unknown category id");
822  }
823  }
824  }
825 }
826 
828 {
830 
831  // ensure that all genres we have are in the DB
832  auto genre = m_genres.begin();
833  while (genre != m_genres.end())
834  {
835  if (!genre->second.trimmed().isEmpty())
836  {
837  genre->first = VideoGenre::getGenre().add(genre->second);
838  VideoGenreMap::getGenreMap().add(m_id, genre->first);
839  ++genre;
840  }
841  else
842  {
843  genre = m_genres.erase(genre);
844  }
845  }
846 }
847 
849 {
850  // remove countries for this video
852 
853  auto country = m_countries.begin();
854  while (country != m_countries.end())
855  {
856  if (!country->second.trimmed().isEmpty())
857  {
858  country->first = VideoCountry::getCountry().add(country->second);
859  VideoCountryMap::getCountryMap().add(m_id, country->first);
860  ++country;
861  }
862  else
863  {
864  country = m_countries.erase(country);
865  }
866  }
867 }
868 
870 {
872 
873  // ensure that all cast we have are in the DB
874  auto cast = m_cast.begin();
875  while (cast != m_cast.end())
876  {
877  if (!cast->second.trimmed().isEmpty())
878  {
879  cast->first = VideoCast::GetCast().add(cast->second);
880  VideoCastMap::getCastMap().add(m_id, cast->first);
881  ++cast;
882  }
883  else
884  {
885  cast = m_cast.erase(cast);
886  }
887  }
888 }
889 
891 {
892  QString coverfile;
893  if (IsHostSet()
894  && !GetCoverFile().startsWith(u'/')
895  && !GetCoverFile().isEmpty()
897  {
898  coverfile = generate_file_url(QStringLiteral(u"Coverart"), GetHost(),
899  GetCoverFile());
900  }
901  else
902  {
903  coverfile = GetCoverFile();
904  }
905 
906  imageMap[QStringLiteral(u"coverfile")] = coverfile;
907  imageMap[QStringLiteral(u"coverart")] = coverfile;
908 
909  QString screenshotfile;
910  if (IsHostSet() && !GetScreenshot().startsWith(u'/')
911  && !GetScreenshot().isEmpty())
912  {
913  screenshotfile = generate_file_url(QStringLiteral(u"Screenshots"),
914  GetHost(), GetScreenshot());
915  }
916  else
917  {
918  screenshotfile = GetScreenshot();
919  }
920 
921  imageMap[QStringLiteral(u"screenshotfile")] = screenshotfile;
922  imageMap[QStringLiteral(u"screenshot")] = screenshotfile;
923 
924  QString bannerfile;
925  if (IsHostSet() && !GetBanner().startsWith(u'/')
926  && !GetBanner().isEmpty())
927  {
928  bannerfile = generate_file_url(QStringLiteral(u"Banners"), GetHost(),
929  GetBanner());
930  }
931  else
932  {
933  bannerfile = GetBanner();
934  }
935 
936  imageMap[QStringLiteral(u"bannerfile")] = bannerfile;
937  imageMap[QStringLiteral(u"banner")] = bannerfile;
938 
939  QString fanartfile;
940  if (IsHostSet() && !GetFanart().startsWith('/')
941  && !GetFanart().isEmpty())
942  {
943  fanartfile = generate_file_url(QStringLiteral(u"Fanart"), GetHost(),
944  GetFanart());
945  }
946  else
947  {
948  fanartfile = GetFanart();
949  }
950 
951  imageMap[QStringLiteral(u"fanartfile")] = fanartfile;
952  imageMap[QStringLiteral(u"fanart")] = fanartfile;
953 
954  QString smartimage = coverfile;
955  if (!screenshotfile.isEmpty () && (GetSeason() > 0 || GetEpisode() > 0))
956  smartimage = screenshotfile;
957  imageMap[QStringLiteral(u"smartimage")] = smartimage;
958 }
959 
960 // This should be the equivalent of GetImageMap, only the image names
961 // are computed one at a time as needed.
962 QString VideoMetadataImp::GetImage(const QString& name) const
963 {
964  if ((name == QStringLiteral(u"coverfile")) ||
965  (name == QStringLiteral(u"coverart")))
966  {
967  QString coverfile = GetCoverFile();
968  if (IsHostSet()
969  && !coverfile.startsWith(u'/')
970  && !coverfile.isEmpty()
971  && !IsDefaultCoverFile(coverfile))
972  return generate_file_url(QStringLiteral(u"Coverart"), GetHost(),
973  coverfile);
974  return coverfile;
975  }
976 
977  if ((name == QStringLiteral(u"screenshotfile")) ||
978  (name == QStringLiteral(u"screenshot")))
979  {
980  QString screenshot = GetScreenshot();
981  if (IsHostSet() && !screenshot.startsWith(u'/')
982  && !screenshot.isEmpty())
983  return generate_file_url(QStringLiteral(u"Screenshots"),
984  GetHost(), screenshot);
985  return screenshot;
986  }
987 
988  if ((name == QStringLiteral(u"bannerfile")) ||
989  (name == QStringLiteral(u"banner")))
990  {
991  QString bannerfile = GetBanner();
992  if (IsHostSet() && !bannerfile.startsWith(u'/')
993  && !bannerfile.isEmpty())
994  return generate_file_url(QStringLiteral(u"Banners"), GetHost(),
995  bannerfile);
996  return bannerfile;
997  }
998 
999  if ((name == QStringLiteral(u"fanartfile")) ||
1000  (name == QStringLiteral(u"fanart")))
1001  {
1002  QString fanartfile = GetFanart();
1003  if (IsHostSet() && !fanartfile.startsWith('/')
1004  && !fanartfile.isEmpty())
1005  return generate_file_url(QStringLiteral(u"Fanart"), GetHost(),
1006  fanartfile);
1007  return fanartfile;
1008  }
1009 
1010  if ((name == QStringLiteral(u"smartimage")) ||
1011  (name == QStringLiteral(u"buttonimage")))
1012  {
1013  if (GetSeason() > 0 || GetEpisode() > 0)
1014  {
1015  QString screenshotfile = GetImage("screenshot");
1016  if (!screenshotfile.isEmpty())
1017  return screenshotfile;
1018  }
1019  return GetImage("coverart");
1020  }
1021 
1022  return {};
1023 }
1024 
1028 namespace
1029 {
1030  QString eatBraces(const QString &title, const QString &left_brace,
1031  const QString &right_brace)
1032  {
1033  QString ret(title);
1034  bool keep_checking = true;
1035 
1036  while (keep_checking)
1037  {
1038  int left_position = ret.indexOf(left_brace);
1039  int right_position = ret.indexOf(right_brace);
1040  if (left_position == -1 || right_position == -1)
1041  {
1042  //
1043  // No matching sets of these braces left.
1044  //
1045 
1046  keep_checking = false;
1047  }
1048  else
1049  {
1050  if (left_position < right_position)
1051  {
1052  //
1053  // We have a matching set like: ( foo )
1054  //
1055 
1056  ret = ret.left(left_position) +
1057  ret.right(ret.length() - right_position - 1);
1058  }
1059  else if (left_position > right_position)
1060  {
1061  //
1062  // We have a matching set like: ) foo (
1063  //
1064 
1065  ret = ret.left(right_position) +
1066  ret.right(ret.length() - left_position - 1);
1067  }
1068  }
1069  }
1070 
1071  return ret;
1072  }
1073 }
1074 
1075 int VideoMetadata::UpdateHashedDBRecord(const QString &hash,
1076  const QString &file_name,
1077  const QString &host)
1078 {
1079  MSqlQuery query(MSqlQuery::InitCon());
1080 
1081  query.prepare("SELECT intid,filename FROM videometadata WHERE "
1082  "hash = :HASH");
1083  query.bindValue(":HASH", hash);
1084 
1085  if (!query.exec() || !query.isActive())
1086  {
1087  MythDB::DBError("Video hashed metadata update", query);
1088  return -1;
1089  }
1090 
1091  if (!query.next())
1092  return -1;
1093 
1094  int intid = query.value(0).toInt();
1095  QString oldfilename = query.value(1).toString();
1096 
1097  query.prepare("UPDATE videometadata SET filename = :FILENAME, "
1098  "host = :HOST WHERE intid = :INTID");
1099  query.bindValue(":FILENAME", file_name);
1100  query.bindValue(":HOST", host);
1101  query.bindValue(":INTID", intid);
1102 
1103  if (!query.exec() || !query.isActive())
1104  {
1105  MythDB::DBError("Video hashed metadata update (videometadata)", query);
1106  return -1;
1107  }
1108 
1109  query.prepare("UPDATE filemarkup SET filename = :FILENAME "
1110  "WHERE filename = :OLDFILENAME");
1111  query.bindValue(":FILENAME", file_name);
1112  query.bindValue(":OLDFILENAME", oldfilename);
1113 
1114  if (!query.exec() || !query.isActive())
1115  {
1116  MythDB::DBError("Video hashed metadata update (filemarkup)", query);
1117  return -1;
1118  }
1119 
1120  return intid;
1121 }
1122 
1123 QString VideoMetadata::VideoFileHash(const QString &file_name,
1124  const QString &host)
1125 {
1126  if (host.isEmpty())
1127  return FileHash(file_name);
1128 
1130  {
1131  StorageGroup sgroup("Videos", host);
1132  QString fullname = sgroup.FindFile(file_name);
1133 
1134  return FileHash(fullname);
1135  }
1136 
1137  QString url = generate_file_url("Videos", host, file_name);
1138 
1139  return RemoteFile::GetFileHash(url);
1140 }
1141 
1142 QString VideoMetadata::FilenameToMeta(const QString &file_name, int position)
1143 {
1144  // position 1 returns title, 2 returns season,
1145  // 3 returns episode, 4 returns subtitle
1146 
1147  QString cleanFilename = file_name.left(file_name.lastIndexOf('.'));
1148  static const QRegularExpression kSpaceRE { "%20" };
1149  static const QRegularExpression kUnderscoreRE { "_" };
1150  static const QRegularExpression kDotRE { "\\." };
1151  cleanFilename.replace(kSpaceRE, " ");
1152  cleanFilename.replace(kUnderscoreRE, " ");
1153  cleanFilename.replace(kDotRE, " ");
1154 
1155  /*: Word(s) which should be recognized as "season" when parsing a video
1156  * file name. To list more than one word, separate them with a '|'.
1157  */
1158  QString season_translation = tr("Season", "Metadata file name parsing");
1159 
1160  /*: Word(s) which should be recognized as "episode" when parsing a video
1161  * file name. To list more than one word, separate them with a '|'.
1162  */
1163  QString episode_translation = tr("Episode", "Metadata file name parsing");
1164 
1165  // Primary Regexp
1166  QString separator = "(?:\\s?(?:-|/)?\\s?)?";
1167  QString regexp = QString(
1168  "^(.*[^s0-9])" // Title
1169  "%1" // optional separator
1170  "(?:s|(?:Season|%2))?" // season marker
1171  "%1" // optional separator
1172  "(\\d{1,4})" // Season
1173  "%1" // optional separator
1174  "(?:[ex/]|Episode|%3)" // episode marker
1175  "%1" // optional separator
1176  "(\\d{1,3})" // Episode
1177  "%1" // optional separator
1178  "(.*)$" // Subtitle
1179  ).arg(separator, season_translation, episode_translation);
1180  static const QRegularExpression filename_parse { regexp,
1181  QRegularExpression::CaseInsensitiveOption|QRegularExpression::UseUnicodePropertiesOption };
1182 
1183  // Cleanup Regexp
1184  QString regexp2 = QString("(%1(?:(?:Season|%2)%1\\d*%1)*%1)$")
1185  .arg(separator, season_translation);
1186  static const QRegularExpression title_parse {regexp2,
1187  QRegularExpression::CaseInsensitiveOption|QRegularExpression::UseUnicodePropertiesOption };
1188 
1189  auto match = filename_parse.match(cleanFilename);
1190  if (match.hasMatch())
1191  {
1192  // Return requested value
1193  if (position == 1 && !match.capturedView(1).isEmpty())
1194  {
1195  // Clean up the title
1196  QString title = match.captured(1);
1197  match = title_parse.match(title);
1198  if (match.hasMatch())
1199  title = title.left(match.capturedStart());
1200  title = title.right(title.length() - title.lastIndexOf('/') -1);
1201  return title.trimmed();
1202  }
1203  if (position == 2)
1204  return match.captured(2).trimmed();
1205  if (position == 3)
1206  return match.captured(3).trimmed();
1207  if (position == 4)
1208  return match.captured(4).trimmed();
1209  }
1210  else if (position == 1)
1211  {
1212  QString title = cleanFilename;
1213 
1214  // Clean up the title
1215  title = title.right(title.length() -
1216  title.lastIndexOf('/') -1);
1217 
1218  title = eatBraces(title, "[", "]");
1219  title = eatBraces(title, "(", ")");
1220  title = eatBraces(title, "{", "}");
1221  return title.trimmed();
1222  }
1223  else if (position == 2 || position == 3)
1224  return {"0"};
1225 
1226  return {};
1227 }
1228 
1229 VideoMetadata::VideoMetadata(const QString &filename, const QString &sortFilename,
1230  const QString &hash, const QString &trailer, const QString &coverfile,
1231  const QString &screenshot, const QString &banner, const QString &fanart,
1232  const QString &title, const QString &sortTitle,
1233  const QString &subtitle, const QString &sortSubtitle, const QString &tagline,
1234  int year, const QDate releasedate, const QString &inetref, int collectionref,
1235  const QString &homepage, const QString &director, const QString &studio,
1236  const QString &plot, float userrating, const QString &rating,
1237  int length, int playcount, int season, int episode, const QDate insertdate,
1238  int id, ParentalLevel::Level showlevel, int categoryID,
1239  int childID, bool browse, bool watched,
1240  const QString &playcommand, const QString &category,
1241  const genre_list &genres,
1242  const country_list &countries,
1243  const cast_list &cast,
1244  const QString &host, bool processed,
1245  VideoContentType contenttype)
1246 {
1247  m_imp = new VideoMetadataImp(filename, sortFilename, hash, trailer, coverfile,
1248  screenshot, banner, fanart, title, sortTitle, subtitle,
1249  sortSubtitle, tagline, year, releasedate, inetref,
1250  collectionref, homepage, director, studio, plot, userrating, rating,
1251  length, playcount, season, episode, insertdate, id, showlevel, categoryID,
1252  childID, browse, watched, playcommand, category, genres, countries,
1253  cast, host, processed, contenttype);
1254 }
1255 
1257 {
1258  delete m_imp;
1259 }
1260 
1262 {
1263  m_imp = new VideoMetadataImp(query);
1264 }
1265 
1266 VideoMetadata::VideoMetadata(const VideoMetadata &rhs) : m_imp(nullptr)
1267 {
1268  *this = rhs;
1269 }
1270 
1272 {
1273  if (this != &rhs)
1274  {
1275  m_imp = new VideoMetadataImp(*(rhs.m_imp));
1276  }
1277 
1278  return *this;
1279 }
1280 
1281 void VideoMetadata::toMap(InfoMap &metadataMap)
1282 {
1283  GetImageMap(metadataMap);
1284 
1285  metadataMap[QStringLiteral(u"filename")] = GetFilename();
1286  metadataMap[QStringLiteral(u"sortfilename")] = GetSortFilename();
1287  metadataMap[QStringLiteral(u"title")] = GetTitle();
1288  metadataMap[QStringLiteral(u"sorttitle")] = GetSortTitle();
1289  metadataMap[QStringLiteral(u"subtitle")] = GetSubtitle();
1290  metadataMap[QStringLiteral(u"sortsubtitle")] = GetSortSubtitle();
1291  metadataMap[QStringLiteral(u"tagline")] = GetTagline();
1292  metadataMap[QStringLiteral(u"director")] = GetDirector();
1293  metadataMap[QStringLiteral(u"studio")] = GetStudio();
1294  metadataMap[QStringLiteral(u"description0")] = metadataMap[QStringLiteral(u"description")] = GetPlot();
1295  metadataMap[QStringLiteral(u"genres")] = GetDisplayGenres(*this);
1296  metadataMap[QStringLiteral(u"countries")] = GetDisplayCountries(*this);
1297  metadataMap[QStringLiteral(u"cast")] = GetDisplayCast(*this).join(", ");
1298  metadataMap[QStringLiteral(u"rating")] = GetDisplayRating(GetRating());
1299  metadataMap[QStringLiteral(u"length")] = GetDisplayLength(GetLength());
1300  metadataMap[QStringLiteral(u"playcount")] = QString::number(GetPlayCount());
1301  metadataMap[QStringLiteral(u"year")] = GetDisplayYear(GetYear());
1302 
1303  metadataMap[QStringLiteral(u"releasedate")] = MythDate::toString(
1305 
1306  metadataMap[QStringLiteral(u"userrating")] = GetDisplayUserRating(GetUserRating());
1307 
1308  if (GetSeason() > 0 || GetEpisode() > 0)
1309  {
1310  metadataMap[QStringLiteral(u"season")] = StringUtil::intToPaddedString(GetSeason(), 1);
1311  metadataMap[QStringLiteral(u"episode")] = StringUtil::intToPaddedString(GetEpisode(), 1);
1312  QString usingSE = QStringLiteral(u"s%1e%2")
1315  metadataMap[QStringLiteral(u"s##e##")] = metadataMap[QStringLiteral(u"s00e00")] = usingSE;
1316  QString usingX = QStringLiteral(u"%1x%2")
1319  metadataMap[QStringLiteral(u"##x##")] = metadataMap[QStringLiteral(u"00x00")] = usingX;
1320  }
1321  else
1322  {
1323  metadataMap[QStringLiteral(u"s##e##")] = metadataMap[QStringLiteral(u"##x##")] = QString();
1324  metadataMap[QStringLiteral(u"s00e00")] = metadataMap[QStringLiteral(u"00x00")] = QString();
1325  metadataMap[QStringLiteral(u"season")] = metadataMap[QStringLiteral(u"episode")] = QString();
1326  }
1327 
1328  GetStateMap(metadataMap);
1329 
1330  metadataMap[QStringLiteral(u"insertdate")] = MythDate::toString(
1332  metadataMap[QStringLiteral(u"inetref")] = GetInetRef();
1333  metadataMap[QStringLiteral(u"homepage")] = GetHomepage();
1334  metadataMap[QStringLiteral(u"child_id")] = QString::number(GetChildID());
1335  metadataMap[QStringLiteral(u"browseable")] = GetDisplayBrowse(GetBrowse());
1336  metadataMap[QStringLiteral(u"watched")] = GetDisplayWatched(GetWatched());
1337  metadataMap[QStringLiteral(u"processed")] = GetDisplayProcessed(GetProcessed());
1338  metadataMap[QStringLiteral(u"category")] = GetCategory();
1339 }
1340 
1341 // This should be the equivalent of toMap, only the text strings
1342 // are computed one at a time as needed.
1343 QString VideoMetadata::GetText(const QString& name) const
1344 {
1345  if (name == QStringLiteral(u"filename"))
1346  return GetFilename();
1347  if (name == QStringLiteral(u"sortfilename"))
1348  return GetSortFilename();
1349  if (name == QStringLiteral(u"title"))
1350  return GetTitle();
1351  if (name == QStringLiteral(u"sorttitle"))
1352  return GetSortTitle();
1353  if (name == QStringLiteral(u"subtitle"))
1354  return GetSubtitle();
1355  if (name == QStringLiteral(u"sortsubtitle"))
1356  return GetSortSubtitle();
1357  if (name == QStringLiteral(u"tagline"))
1358  return GetTagline();
1359  if (name == QStringLiteral(u"director"))
1360  return GetDirector();
1361  if (name == QStringLiteral(u"studio"))
1362  return GetStudio();
1363  if ((name == QStringLiteral(u"description")) ||
1364  (name == QStringLiteral(u"description0")))
1365  return GetPlot();
1366  if (name == QStringLiteral(u"genres"))
1367  return GetDisplayGenres(*this);
1368  if (name == QStringLiteral(u"countries"))
1369  return GetDisplayCountries(*this);
1370  if (name == QStringLiteral(u"cast"))
1371  return GetDisplayCast(*this).join(", ");
1372  if (name == QStringLiteral(u"rating"))
1373  return GetDisplayRating(GetRating());
1374  if (name == QStringLiteral(u"length"))
1375  return GetDisplayLength(GetLength());
1376  if (name == QStringLiteral(u"playcount"))
1377  return QString::number(GetPlayCount());
1378  if (name == QStringLiteral(u"year"))
1379  return GetDisplayYear(GetYear());
1380 
1381  if (name == QStringLiteral(u"releasedate"))
1383 
1384  if (name == QStringLiteral(u"userrating"))
1386 
1387  if (GetSeason() > 0 || GetEpisode() > 0)
1388  {
1389  if (name == QStringLiteral(u"season"))
1391  if (name == QStringLiteral(u"episode"))
1393  if ((name == QStringLiteral(u"s##e##")) ||
1394  (name == QStringLiteral(u"s00e00")))
1395  {
1396  return QStringLiteral(u"s%1e%2")
1399  }
1400  if ((name == QStringLiteral(u"##x##")) ||
1401  (name == QStringLiteral(u"00x00")))
1402  {
1403  return QStringLiteral(u"%1x%2")
1406  }
1407  }
1408 
1409  if (name == QStringLiteral(u"insertdate"))
1410  return MythDate::toString(
1412  if (name == QStringLiteral(u"inetref"))
1413  return GetInetRef();
1414  if (name == QStringLiteral(u"homepage"))
1415  return GetHomepage();
1416  if (name == QStringLiteral(u"child_id"))
1417  return QString::number(GetChildID());
1418  if (name == QStringLiteral(u"browseable"))
1419  return GetDisplayBrowse(GetBrowse());
1420  if (name == QStringLiteral(u"watched"))
1421  return GetDisplayWatched(GetWatched());
1422  if (name == QStringLiteral(u"processed"))
1424  if (name == QStringLiteral(u"category"))
1425  return GetCategory();
1426  return {};
1427 }
1428 
1430 {
1431  stateMap[QStringLiteral(u"trailerstate")] = TrailerToState(GetTrailer());
1432  stateMap[QStringLiteral(u"userratingstate")] =
1433  QString::number((int)(GetUserRating()));
1434  stateMap[QStringLiteral(u"watchedstate")] = WatchedToState(GetWatched());
1435  stateMap[QStringLiteral(u"videolevel")] = ParentalLevelToState(GetShowLevel());
1436 }
1437 
1438 // This should be the equivalent of GetStateMap, only the state strings
1439 // are computed one at a time as needed.
1440 QString VideoMetadata::GetState(const QString& name) const
1441 {
1442  if (name == QStringLiteral(u"trailerstate"))
1443  return TrailerToState(GetTrailer());
1444  if (name == QStringLiteral(u"userratingstate"))
1445  return QString::number((int)(GetUserRating()));
1446  if (name == QStringLiteral(u"watchedstate"))
1447  return WatchedToState(GetWatched());
1448  if (name == QStringLiteral(u"videolevel"))
1450  return {};
1451 }
1452 
1454 {
1455  m_imp->GetImageMap(imageMap);
1456 }
1457 
1458 QString VideoMetadata::GetImage(const QString& name) const
1459 {
1460  return m_imp->GetImage(name);
1461 }
1462 
1463 void ClearMap(InfoMap &metadataMap)
1464 {
1465  metadataMap["coverfile"] = "";
1466  metadataMap["screenshotfile"] = "";
1467  metadataMap["bannerfile"] = "";
1468  metadataMap["fanartfile"] = "";
1469  metadataMap["filename"] = "";
1470  metadataMap["sortfilename"] = "";
1471  metadataMap["title"] = "";
1472  metadataMap["sorttitle"] = "";
1473  metadataMap["subtitle"] = "";
1474  metadataMap["sortsubtitle"] = "";
1475  metadataMap["tagline"] = "";
1476  metadataMap["director"] = "";
1477  metadataMap["studio"] = "";
1478  metadataMap["description"] = "";
1479  metadataMap["description0"] = "";
1480  metadataMap["genres"] = "";
1481  metadataMap["countries"] = "";
1482  metadataMap["cast"] = "";
1483  metadataMap["rating"] = "";
1484  metadataMap["length"] = "";
1485  metadataMap["playcount"] = "";
1486  metadataMap["year"] = "";
1487  metadataMap["releasedate"] = "";
1488  metadataMap["userrating"] = "";
1489  metadataMap["season"] = "";
1490  metadataMap["episode"] = "";
1491  metadataMap["s##e##"] = "";
1492  metadataMap["##x##"] = "";
1493  metadataMap["trailerstate"] = "";
1494  metadataMap["userratingstate"] = "";
1495  metadataMap["watchedstate"] = "";
1496  metadataMap["videolevel"] = "";
1497  metadataMap["insertdate"] = "";
1498  metadataMap["inetref"] = "";
1499  metadataMap["homepage"] = "";
1500  metadataMap["child_id"] = "";
1501  metadataMap["browseable"] = "";
1502  metadataMap["watched"] = "";
1503  metadataMap["category"] = "";
1504  metadataMap["processed"] = "";
1505 }
1506 
1507 QString VideoMetadata::MetadataGetTextCb(const QString& name, void *data)
1508 {
1509  if (data == nullptr)
1510  return {};
1511  auto *metadata = static_cast<VideoMetadata *>(data);
1512  QString result = metadata->GetText(name);
1513  if (!result.isEmpty())
1514  return result;
1515  result = metadata->GetImage(name);
1516  if (!result.isEmpty())
1517  return result;
1518  return metadata->GetState(name);
1519 }
1520 
1521 QString VideoMetadata::MetadataGetImageCb(const QString& name, void *data)
1522 {
1523  if (data == nullptr)
1524  return {};
1525  auto *metadata = static_cast<VideoMetadata *>(data);
1526  return metadata->GetImage(name);
1527 }
1528 
1529 QString VideoMetadata::MetadataGetStateCb(const QString& name, void *data)
1530 {
1531  if (data == nullptr)
1532  return {};
1533  auto *metadata = static_cast<VideoMetadata *>(data);
1534  return metadata->GetState(name);
1535 }
1536 
1537 const QString &VideoMetadata::GetPrefix() const
1538 {
1539  return m_imp->GetPrefix();
1540 }
1541 
1542 void VideoMetadata::SetPrefix(const QString &prefix)
1543 {
1545 }
1546 
1547 const QString &VideoMetadata::GetTitle() const
1548 {
1549  return m_imp->getTitle();
1550 }
1551 
1552 const QString &VideoMetadata::GetSortTitle() const
1553 {
1554  return m_imp->getSortTitle();
1555 }
1556 
1557 void VideoMetadata::SetTitle(const QString &title, const QString &sortTitle)
1558 {
1559  m_imp->SetTitle(title, sortTitle);
1560 }
1561 
1562 const QString &VideoMetadata::GetSubtitle() const
1563 {
1564  return m_imp->getSubtitle();
1565 }
1566 
1567 const QString &VideoMetadata::GetSortSubtitle() const
1568 {
1569  return m_imp->getSortSubtitle();
1570 }
1571 
1572 void VideoMetadata::SetSubtitle(const QString &subtitle, const QString &sortSubtitle)
1573 {
1574  m_imp->SetSubtitle(subtitle, sortSubtitle);
1575 }
1576 
1577 const QString &VideoMetadata::GetTagline() const
1578 {
1579  return m_imp->GetTagline();
1580 }
1581 
1582 void VideoMetadata::SetTagline(const QString &tagline)
1583 {
1584  m_imp->SetTagline(tagline);
1585 }
1586 
1588 {
1589  return m_imp->getYear();
1590 }
1591 
1593 {
1594  m_imp->SetYear(year);
1595 }
1596 
1598 {
1599  return m_imp->getReleaseDate();
1600 }
1601 
1602 void VideoMetadata::SetReleaseDate(QDate releasedate)
1603 {
1604  m_imp->SetReleaseDate(releasedate);
1605 }
1606 
1607 const QString &VideoMetadata::GetInetRef() const
1608 {
1609  return m_imp->GetInetRef();
1610 }
1611 
1612 void VideoMetadata::SetInetRef(const QString &inetRef)
1613 {
1614  m_imp->SetInetRef(inetRef);
1615 }
1616 
1618 {
1619  return m_imp->GetCollectionRef();
1620 }
1621 
1622 void VideoMetadata::SetCollectionRef(int collectionref)
1623 {
1624  m_imp->SetCollectionRef(collectionref);
1625 }
1626 
1627 const QString &VideoMetadata::GetHomepage() const
1628 {
1629  return m_imp->GetHomepage();
1630 }
1631 
1632 void VideoMetadata::SetHomepage(const QString &homepage)
1633 {
1634  m_imp->SetHomepage(homepage);
1635 }
1636 
1637 const QString &VideoMetadata::GetDirector() const
1638 {
1639  return m_imp->getDirector();
1640 }
1641 
1642 void VideoMetadata::SetDirector(const QString &director)
1643 {
1644  m_imp->SetDirector(director);
1645 }
1646 
1647 const QString &VideoMetadata::GetStudio() const
1648 {
1649  return m_imp->getStudio();
1650 }
1651 
1652 void VideoMetadata::SetStudio(const QString &studio)
1653 {
1654  m_imp->SetStudio(studio);
1655 }
1656 
1657 const QString &VideoMetadata::GetPlot() const
1658 {
1659  return m_imp->getPlot();
1660 }
1661 
1662 void VideoMetadata::SetPlot(const QString &plot)
1663 {
1664  m_imp->SetPlot(plot);
1665 }
1666 
1668 {
1669  return m_imp->GetUserRating();
1670 }
1671 
1672 void VideoMetadata::SetUserRating(float userRating)
1673 {
1674  m_imp->SetUserRating(userRating);
1675 }
1676 
1677 const QString &VideoMetadata::GetRating() const
1678 {
1679  return m_imp->GetRating();
1680 }
1681 
1682 void VideoMetadata::SetRating(const QString &rating)
1683 {
1685 }
1686 
1687 std::chrono::minutes VideoMetadata::GetLength() const
1688 {
1689  return m_imp->GetLength();
1690 }
1691 
1692 void VideoMetadata::SetLength(std::chrono::minutes length)
1693 {
1694  m_imp->SetLength(length);
1695 }
1696 
1697 unsigned int VideoMetadata::GetPlayCount() const
1698 {
1699  return m_imp->GetPlayCount();
1700 }
1701 
1703 {
1704  m_imp->SetPlayCount(count);
1705 }
1706 
1708 {
1709  return m_imp->GetSeason();
1710 }
1711 
1713 {
1714  m_imp->SetSeason(season);
1715 }
1716 
1718 {
1719  return m_imp->GetEpisode();
1720 }
1721 
1722 void VideoMetadata::SetEpisode(int episode)
1723 {
1724  m_imp->SetEpisode(episode);
1725 }
1726 
1728 {
1729  return m_imp->GetInsertdate();
1730 }
1731 
1733 {
1734  m_imp->SetInsertdate(date);
1735 }
1736 
1737 unsigned int VideoMetadata::GetID() const
1738 {
1739  return m_imp->GetID();
1740 }
1741 
1743 {
1744  m_imp->SetID(id);
1745 }
1746 
1748 {
1749  return m_imp->GetChildID();
1750 }
1751 
1752 void VideoMetadata::SetChildID(int childID)
1753 {
1754  m_imp->SetChildID(childID);
1755 }
1756 
1758 {
1759  return m_imp->GetBrowse();
1760 }
1761 
1762 void VideoMetadata::SetBrowse(bool browse)
1763 {
1764  m_imp->SetBrowse(browse);
1765 }
1766 
1768 {
1769  return m_imp->GetWatched();
1770 }
1771 
1772 void VideoMetadata::SetWatched(bool watched)
1773 {
1774  m_imp->SetWatched(watched);
1775 }
1776 
1778 {
1779  return m_imp->GetProcessed();
1780 }
1781 
1782 void VideoMetadata::SetProcessed(bool processed)
1783 {
1784  m_imp->SetProcessed(processed);
1785 }
1786 
1788 {
1789  return m_imp->GetContentType();
1790 }
1791 
1793 {
1794  m_imp->SetContentType(contenttype);
1795 }
1796 
1797 const QString &VideoMetadata::GetPlayCommand() const
1798 {
1799  return m_imp->getPlayCommand();
1800 }
1801 
1802 void VideoMetadata::SetPlayCommand(const QString &playCommand)
1803 {
1804  m_imp->SetPlayCommand(playCommand);
1805 }
1806 
1808 {
1809  return m_imp->GetShowLevel();
1810 }
1811 
1813 {
1814  m_imp->SetShowLevel(showLevel);
1815 }
1816 
1817 const QString &VideoMetadata::GetFilename() const
1818 {
1819  return m_imp->getFilename();
1820 }
1821 
1822 const QString &VideoMetadata::GetSortFilename() const
1823 {
1824  return m_imp->getSortFilename();
1825 }
1826 
1827 const QString &VideoMetadata::GetHash() const
1828 {
1829  return m_imp->GetHash();
1830 }
1831 
1832 void VideoMetadata::SetHash(const QString &hash)
1833 {
1834  m_imp->SetHash(hash);
1835 }
1836 
1837 const QString &VideoMetadata::GetHost() const
1838 {
1839  return m_imp->GetHost();
1840 }
1841 
1842 void VideoMetadata::SetHost(const QString &host)
1843 {
1844  m_imp->SetHost(host);
1845 }
1846 
1847 void VideoMetadata::SetFilename(const QString &filename, const QString &sortFilename)
1848 {
1849  m_imp->SetFilename(filename, sortFilename);
1850 }
1851 
1852 const QString &VideoMetadata::GetTrailer() const
1853 {
1854  return m_imp->GetTrailer();
1855 }
1856 
1857 void VideoMetadata::SetTrailer(const QString &trailer)
1858 {
1859  m_imp->SetTrailer(trailer);
1860 }
1861 
1862 const QString &VideoMetadata::GetCoverFile() const
1863 {
1864  return m_imp->GetCoverFile();
1865 }
1866 
1867 void VideoMetadata::SetCoverFile(const QString &coverFile)
1868 {
1869  m_imp->SetCoverFile(coverFile);
1870 }
1871 
1872 const QString &VideoMetadata::GetScreenshot() const
1873 {
1874  return m_imp->GetScreenshot();
1875 }
1876 
1877 void VideoMetadata::SetScreenshot(const QString &screenshot)
1878 {
1879  m_imp->SetScreenshot(screenshot);
1880 }
1881 
1882 const QString &VideoMetadata::GetBanner() const
1883 {
1884  return m_imp->GetBanner();
1885 }
1886 
1887 void VideoMetadata::SetBanner(const QString &banner)
1888 {
1889  m_imp->SetBanner(banner);
1890 }
1891 
1892 const QString &VideoMetadata::GetFanart() const
1893 {
1894  return m_imp->GetFanart();
1895 }
1896 
1897 void VideoMetadata::SetFanart(const QString &fanart)
1898 {
1899  m_imp->SetFanart(fanart);
1900 }
1901 
1902 const QString &VideoMetadata::GetCategory() const
1903 {
1904  return m_imp->GetCategory();
1905 }
1906 
1907 //void VideoMetadata::SetCategory(const QString &category)
1908 //{
1909 // m_imp->SetCategory(category);
1910 //}
1911 
1913 {
1914  return m_imp->getGenres();
1915 }
1916 
1918 {
1919  m_imp->SetGenres(genres);
1920 }
1921 
1923 {
1924  return m_imp->GetCast();
1925 }
1926 
1928 {
1929  m_imp->SetCast(cast);
1930 }
1931 
1933 {
1934  return m_imp->GetCountries();
1935 }
1936 
1938 {
1939  m_imp->SetCountries(countries);
1940 }
1941 
1943 {
1944  return m_imp->GetCategoryID();
1945 }
1946 
1948 {
1949  m_imp->SetCategoryID(id);
1950 }
1951 
1953 {
1954  m_imp->SaveToDatabase();
1955 }
1956 
1958 {
1959  m_imp->UpdateDatabase();
1960 }
1961 
1963 {
1964  return m_imp->DeleteFromDatabase();
1965 }
1966 
1967 #if 0
1968 bool VideoMetadata::fillDataFromID(const VideoMetadataListManager &cache)
1969 {
1970  if (m_imp->getID() == 0)
1971  return false;
1972 
1974  if (mp.get())
1975  {
1976  *this = *mp;
1977  return true;
1978  }
1979 
1980  return false;
1981 }
1982 #endif
1983 
1985 {
1986  if (m_imp->getFilename().isEmpty())
1987  return false;
1988 
1990  cache.byFilename(m_imp->getFilename());
1991  if (mp)
1992  {
1993  *this = *mp;
1994  return true;
1995  }
1996 
1997  return false;
1998 }
1999 
2001 {
2002  return m_imp->DeleteFile();
2003 }
2004 
2006 {
2007  m_imp->Reset();
2008 }
2009 
2011 {
2012  return m_imp->IsHostSet();
2013 }
2014 
2016 {
2017  return m_imp->sortBefore(rhs.m_imp);
2018 }
2019 
2020 bool operator==(const VideoMetadata& a, const VideoMetadata& b)
2021 {
2022  return a.GetFilename() == b.GetFilename();
2023 }
2024 
2025 bool operator!=(const VideoMetadata& a, const VideoMetadata& b)
2026 {
2027  return a.GetFilename() != b.GetFilename();
2028 }
VideoMetadataImp::GetFanart
const QString & GetFanart() const
Definition: videometadata.cpp:267
VideoMetadata::toMap
void toMap(InfoMap &metadataMap)
Definition: videometadata.cpp:1281
ternarycompare.h
VideoMetadataImp::fillGenres
void fillGenres()
Definition: videometadata.cpp:499
MSqlQuery::isActive
bool isActive(void) const
Definition: mythdbcon.h:216
VideoMetadataImp::SetEpisode
void SetEpisode(int episode)
Definition: videometadata.cpp:295
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:807
VideoMetadataImp::getStudio
const QString & getStudio() const
Definition: videometadata.cpp:208
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:128
VideoMetadataImp::m_inetref
QString m_inetref
Definition: videometadata.cpp:356
generate_file_url
QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
Definition: videoutils.h:65
VideoMetadata
Definition: videometadata.h:24
VideoMetadata::SetID
void SetID(int id)
Definition: videometadata.cpp:1742
VideoMetadata::SetTrailer
void SetTrailer(const QString &trailer)
Definition: videometadata.cpp:1857
VideoMetadataImp::m_processed
bool m_processed
Definition: videometadata.cpp:392
MythDate::toString
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:84
MSqlQuery::bindValueNoNull
void bindValueNoNull(const QString &placeholder, const QVariant &val)
Add a single binding, taking care not to set a NULL value.
Definition: mythdbcon.cpp:888
VideoMetadata::SetPlot
void SetPlot(const QString &plot)
Definition: videometadata.cpp:1662
VideoMetadata::SetCollectionRef
void SetCollectionRef(int collectionref)
Definition: videometadata.cpp:1622
VideoMetadata::FilenameToMeta
static QString FilenameToMeta(const QString &file_name, int position)
Definition: videometadata.cpp:1142
WatchedToState
QString WatchedToState(bool watched)
Definition: videoutils.cpp:272
VideoMetadataImp::getTitle
const QString & getTitle() const
Definition: videometadata.cpp:176
VideoMetadataImp::removeDir
bool removeDir(const QString &dirName)
Definition: videometadata.cpp:415
VideoMetadataImp::getFilename
const QString & getFilename() const
Definition: videometadata.cpp:241
VideoMetadataImp::SetScreenshot
void SetScreenshot(const QString &screenshot)
Definition: videometadata.cpp:262
VideoMetadataImp::m_homepage
QString m_homepage
Definition: videometadata.cpp:358
VideoMetadataImp::m_browse
bool m_browse
Definition: videometadata.cpp:388
VideoMetadata::GetReleaseDate
QDate GetReleaseDate() const
Definition: videometadata.cpp:1597
VideoMetadata::GetShowLevel
ParentalLevel::Level GetShowLevel() const
Definition: videometadata.cpp:1807
VideoMetadata::SetHomepage
void SetHomepage(const QString &homepage)
Definition: videometadata.cpp:1632
getMythSortHelper
std::shared_ptr< MythSortHelper > getMythSortHelper(void)
Get a pointer to the MythSortHelper singleton.
Definition: mythsorthelper.cpp:133
SingleValue::add
int add(const QString &name)
Definition: dbaccess.cpp:215
VideoMetadata::SetFanart
void SetFanart(const QString &fanart)
Definition: videometadata.cpp:1897
ParentalLevel::plLowest
@ plLowest
Definition: parentalcontrols.h:12
VideoMetadataImp::GetTagline
const QString & GetTagline() const
Definition: videometadata.cpp:193
mythdb.h
VideoMetadata::MetadataGetImageCb
static QString MetadataGetImageCb(const QString &name, void *data)
Definition: videometadata.cpp:1521
VideoMetadata::GetHost
const QString & GetHost() const
Definition: videometadata.cpp:1837
VideoMetadataImp::getSortFilename
const QString & getSortFilename() const
Definition: videometadata.cpp:242
VideoMetadataImp::SetCast
void SetCast(const cast_list &cast)
Definition: videometadata.cpp:236
VideoCountry
Definition: dbaccess.h:76
VideoMetadataListManager
Definition: videometadatalistmanager.h:10
VideoMetadataImp::SaveToDatabase
void SaveToDatabase()
Definition: videometadata.cpp:768
VideoMetadataImp::GetSeason
int GetSeason() const
Definition: videometadata.cpp:291
VideoMetadataImp::GetHomepage
const QString & GetHomepage() const
Definition: videometadata.cpp:202
VideoMetadataImp::SetCoverFile
void SetCoverFile(const QString &coverFile)
Definition: videometadata.cpp:259
RemoteFile::Exists
static bool Exists(const QString &url, struct stat *fileinfo)
Definition: remotefile.cpp:462
simple_ref_ptr
Definition: quicksp.h:24
VideoMetadataImp::SetFilename
void SetFilename(const QString &filename, const QString &sortFilename="")
Definition: videometadata.cpp:243
VideoMetadataImp::SetChildID
void SetChildID(int childID)
Definition: videometadata.cpp:277
VideoMetadataImp::m_tagline
QString m_tagline
Definition: videometadata.cpp:355
VideoCast
Definition: dbaccess.h:116
VideoMetadataImp::m_categoryID
int m_categoryID
Definition: videometadata.cpp:378
VideoMetadataImp::DeleteFile
bool DeleteFile()
Deletes the file associated with a metadata entry.
Definition: videometadata.cpp:444
StorageGroup::FindFile
QString FindFile(const QString &filename)
Definition: storagegroup.cpp:602
VideoMetadataImp::SetGenres
void SetGenres(const genre_list &genres)
Definition: videometadata.cpp:227
VideoMetadata::GetInsertdate
QDate GetInsertdate() const
Definition: videometadata.cpp:1727
VideoMetadata::GetChildID
int GetChildID() const
Definition: videometadata.cpp:1747
hardwareprofile.devicelist.cat
def cat(file_name)
Definition: devicelist.py:95
VideoMetadataImp::m_collectionref
int m_collectionref
Definition: videometadata.cpp:357
VideoMetadataImp::SetProcessed
void SetProcessed(bool processed)
Definition: videometadata.cpp:319
VideoMetadataImp::GetScreenshot
const QString & GetScreenshot() const
Definition: videometadata.cpp:261
VideoMetadata::SetFilename
void SetFilename(const QString &filename, const QString &sortFilename="")
Definition: videometadata.cpp:1847
VideoMetadata::GetFanart
const QString & GetFanart() const
Definition: videometadata.cpp:1892
VideoMetadataImp::SetHost
void SetHost(const QString &host)
Definition: videometadata.cpp:239
VideoMetadata::SetEpisode
void SetEpisode(int episode)
Definition: videometadata.cpp:1722
VideoMetadataImp::SetPlayCommand
void SetPlayCommand(const QString &playCommand)
Definition: videometadata.cpp:218
VideoMetadata::SetBanner
void SetBanner(const QString &banner)
Definition: videometadata.cpp:1887
VideoMetadataImp::UpdateDatabase
void UpdateDatabase()
Definition: videometadata.cpp:773
VideoMetadataImp::GetHost
const QString & GetHost() const
Definition: videometadata.cpp:238
VideoMetadata::SetUserRating
void SetUserRating(float userRating)
Definition: videometadata.cpp:1672
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:205
GetDisplayLength
QString GetDisplayLength(std::chrono::minutes length)
Definition: videoutils.cpp:155
VideoMetadataImp::m_childID
int m_childID
Definition: videometadata.cpp:379
GetDisplayProcessed
QString GetDisplayProcessed(bool processed)
Definition: videoutils.cpp:187
VideoMetadata::country_list
std::vector< country_entry > country_list
Definition: videometadata.h:33
ContentTypeFromString
VideoContentType ContentTypeFromString(const QString &type)
Definition: videoutils.cpp:282
VideoMetadataImp::SetFanart
void SetFanart(const QString &fanart)
Definition: videometadata.cpp:268
VideoMetadataImp::GetLength
std::chrono::minutes GetLength() const
Definition: videometadata.cpp:285
VideoMetadataImp::sortBefore
bool sortBefore(const VideoMetadataImp *rhs) const
Returns true if the object should appear before the argument.
Definition: videometadata.cpp:405
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:608
VideoMetadataListManager::byFilename
VideoMetadataPtr byFilename(const QString &file_name) const
Definition: videometadatalistmanager.cpp:171
VideoMetadataImp::SetYear
void SetYear(int year)
Definition: videometadata.cpp:280
VideoMetadata::GetPlayCommand
const QString & GetPlayCommand() const
Definition: videometadata.cpp:1797
ContentTypeToString
QString ContentTypeToString(VideoContentType type)
Definition: videoutils.cpp:300
VideoMetadataImp::cast_list
VideoMetadata::cast_list cast_list
Definition: videometadata.cpp:36
VideoMetadataImp::SetWatched
void SetWatched(bool watched)
Definition: videometadata.cpp:310
VideoMetadata::GetHomepage
const QString & GetHomepage() const
Definition: videometadata.cpp:1627
VideoMetadata::GetSeason
int GetSeason() const
Definition: videometadata.cpp:1707
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
VideoMetadata::genre_list
std::vector< genre_entry > genre_list
Definition: videometadata.h:32
VideoMetadata::SetPlayCount
void SetPlayCount(int count)
Definition: videometadata.cpp:1702
mythsorthelper.h
VideoMetadataImp::m_countries
country_list m_countries
Definition: videometadata.cpp:366
VideoMetadataImp::SetTagline
void SetTagline(const QString &tagline)
Definition: videometadata.cpp:194
VideoMetadata::SetInetRef
void SetInetRef(const QString &inetRef)
Definition: videometadata.cpp:1612
VideoMetadata::SetShowLevel
void SetShowLevel(ParentalLevel::Level showLevel)
Definition: videometadata.cpp:1812
VideoMetadataImp::m_genres
genre_list m_genres
Definition: videometadata.cpp:365
VideoMetadataImp::m_category
QString m_category
Definition: videometadata.cpp:364
VideoMetadataImp::ensureSortFields
void ensureSortFields(void)
Definition: videometadata.cpp:161
VideoMetadata::GetCategoryID
int GetCategoryID() const
Definition: videometadata.cpp:1942
VideoMetadataImp::updateGenres
void updateGenres()
Definition: videometadata.cpp:827
VideoMetadata::GetScreenshot
const QString & GetScreenshot() const
Definition: videometadata.cpp:1872
VideoMetadataImp::SetBanner
void SetBanner(const QString &banner)
Definition: videometadata.cpp:265
VideoMetadata::SetCast
void SetCast(const cast_list &cast)
Definition: videometadata.cpp:1927
remoteutil.h
VideoMetadata::GetDirector
const QString & GetDirector() const
Definition: videometadata.cpp:1637
VideoMetadataImp::SetHash
void SetHash(const QString &hash)
Definition: videometadata.cpp:253
VideoMetadataImp::m_coverfile
QString m_coverfile
Definition: videometadata.cpp:372
hardwareprofile.distros.mythtv_data.data_mythtv.prefix
string prefix
Definition: data_mythtv.py:40
VideoMetadata::GetPlot
const QString & GetPlot() const
Definition: videometadata.cpp:1657
VideoMetadataImp::m_rating
QString m_rating
Definition: videometadata.cpp:362
VideoMetadata::GetSubtitle
const QString & GetSubtitle() const
Definition: videometadata.cpp:1562
operator==
bool operator==(const VideoMetadata &a, const VideoMetadata &b)
Definition: videometadata.cpp:2020
VideoMetadataImp::GetCast
const cast_list & GetCast() const
Definition: videometadata.cpp:235
tmp
static guint32 * tmp
Definition: goom_core.cpp:32
VideoMetadataImp::m_director
QString m_director
Definition: videometadata.cpp:359
dbaccess.h
VideoMetadataImp::SetDirector
void SetDirector(const QString &director)
Definition: videometadata.cpp:206
VideoMetadataImp::GetID
unsigned int GetID() const
Definition: videometadata.cpp:312
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
VideoMetadataImp::m_sortFilename
QString m_sortFilename
Definition: videometadata.cpp:369
VideoMetadataImp::SetRating
void SetRating(const QString &rating)
Definition: videometadata.cpp:215
VideoMetadataImp::SetContentType
void SetContentType(VideoContentType contenttype)
Definition: videometadata.cpp:322
VideoMetadata::SetInsertdate
void SetInsertdate(QDate date)
Definition: videometadata.cpp:1732
VideoMetadataImp::getDirector
const QString & getDirector() const
Definition: videometadata.cpp:205
VideoGenreMap::getGenreMap
static VideoGenreMap & getGenreMap()
Definition: dbaccess.cpp:544
VideoMetadataImp::GetEpisode
int GetEpisode() const
Definition: videometadata.cpp:294
MythCoreContext::IsMasterBackend
bool IsMasterBackend(void)
is this the actual MBE process
Definition: mythcorecontext.cpp:699
VideoMetadataImp::VideoMetadataImp
VideoMetadataImp(MSqlQuery &query)
Definition: videometadata.cpp:93
mythdate.h
VideoMetadata::GetFilename
const QString & GetFilename() const
Definition: videometadata.cpp:1817
VideoMetadata::GetInetRef
const QString & GetInetRef() const
Definition: videometadata.cpp:1607
VideoMetadataImp::SetReleaseDate
void SetReleaseDate(QDate releasedate)
Definition: videometadata.cpp:283
GetDisplayRating
QString GetDisplayRating(const QString &rating)
Definition: videoutils.cpp:210
VideoMetadata::GetCountries
const country_list & GetCountries() const
Definition: videometadata.cpp:1932
programinfo.h
VideoMetadataImp::m_hash
QString m_hash
Definition: videometadata.cpp:370
VideoGenre::getGenre
static VideoGenre & getGenre()
Definition: dbaccess.cpp:516
mythlogging.h
VideoMetadataImp::GetBanner
const QString & GetBanner() const
Definition: videometadata.cpp:264
VideoMetadataImp::m_season
int m_season
Definition: videometadata.cpp:384
VideoMetadata::GetCategory
const QString & GetCategory() const
Definition: videometadata.cpp:1902
VideoMetadataImp::m_title
QString m_title
Definition: videometadata.cpp:351
ParentalLevel::plNone
@ plNone
Definition: parentalcontrols.h:12
VideoMetadata::GetProcessed
bool GetProcessed() const
Definition: videometadata.cpp:1777
GetDisplayUserRating
QString GetDisplayUserRating(float userrating)
Definition: videoutils.cpp:150
MultiValue::add
int add(int id, int value)
Definition: dbaccess.cpp:446
remotefile.h
VideoMetadataImp::m_fanart
QString m_fanart
Definition: videometadata.cpp:375
VideoMetadataImp::genre_list
VideoMetadata::genre_list genre_list
Definition: videometadata.cpp:34
VideoMetadata::SetLength
void SetLength(std::chrono::minutes length)
Definition: videometadata.cpp:1692
ParentalLevel::Level
Level
Definition: parentalcontrols.h:12
VideoMetadataImp::m_releasedate
QDate m_releasedate
Definition: videometadata.cpp:381
VideoMetadataImp::SetID
void SetID(int id)
Definition: videometadata.cpp:313
VideoMetadata::GetContentType
VideoContentType GetContentType() const
Definition: videometadata.cpp:1787
globals.h
VideoMetadataImp::fillCountries
void fillCountries()
Definition: videometadata.cpp:517
VideoMetadataImp::getPlot
const QString & getPlot() const
Definition: videometadata.cpp:211
VideoMetadataImp::m_length
std::chrono::minutes m_length
Definition: videometadata.cpp:382
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:540
VideoMetadataImp::GetBrowse
bool GetBrowse() const
Definition: videometadata.cpp:306
VideoMetadata::UpdateHashedDBRecord
static int UpdateHashedDBRecord(const QString &hash, const QString &file_name, const QString &host)
Definition: videometadata.cpp:1075
GetDisplayCountries
QString GetDisplayCountries(const VideoMetadata &item)
Definition: videoutils.cpp:224
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:227
VideoMetadataImp::SetCategoryID
void SetCategoryID(int id)
Definition: videometadata.cpp:802
VideoMetadata::SaveToDatabase
void SaveToDatabase()
Definition: videometadata.cpp:1952
VideoMetadataImp::getSortSubtitle
const QString & getSortSubtitle() const
Definition: videometadata.cpp:186
VideoMetadataImp::DeleteFromDatabase
bool DeleteFromDatabase()
Definition: videometadata.cpp:778
VideoMetadataImp::m_playcount
int m_playcount
Definition: videometadata.cpp:383
VideoMetadataImp::m_screenshot
QString m_screenshot
Definition: videometadata.cpp:373
hardwareprofile.scan.rating
def rating(profile, smoonURL, gate)
Definition: scan.py:39
VideoMetadataImp::SetBrowse
void SetBrowse(bool browse)
Definition: videometadata.cpp:307
StringUtil::naturalCompare
MBASE_PUBLIC int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive)
This method chops the input a and b into pieces of digits and non-digits (a1.05 becomes a | 1 | .
Definition: stringutil.cpp:156
VideoMetadata::GetCollectionRef
int GetCollectionRef() const
Definition: videometadata.cpp:1617
VideoMetadataImp::fromDBRow
void fromDBRow(MSqlQuery &query)
Sets metadata from a DB row.
Definition: videometadata.cpp:557
VIDEO_COVERFILE_DEFAULT
const QString VIDEO_COVERFILE_DEFAULT
Definition: globals.cpp:25
VideoMetadataImp::getGenres
const genre_list & getGenres() const
Definition: videometadata.cpp:226
VideoMetadataImp::SetCollectionRef
void SetCollectionRef(int collectionref)
Definition: videometadata.cpp:200
VideoMetadata::SetProcessed
void SetProcessed(bool processed)
Definition: videometadata.cpp:1782
operator!=
bool operator!=(const VideoMetadata &a, const VideoMetadata &b)
Definition: videometadata.cpp:2025
VideoMetadataImp::m_watched
bool m_watched
Definition: videometadata.cpp:389
VideoMetadata::DeleteFromDatabase
bool DeleteFromDatabase()
Definition: videometadata.cpp:1962
stringutil.h
VideoMetadataImp::m_sortSubtitle
QString m_sortSubtitle
Definition: videometadata.cpp:354
VIDEO_PLOT_DEFAULT
const QString VIDEO_PLOT_DEFAULT
Definition: globals.cpp:32
RemoteFile::GetFileHash
static QString GetFileHash(const QString &url)
Definition: remotefile.cpp:554
VideoCastMap
Definition: dbaccess.h:126
GetDisplayBrowse
QString GetDisplayBrowse(bool browse)
Definition: videoutils.cpp:163
VideoMetadataImp::m_cast
cast_list m_cast
Definition: videometadata.cpp:367
VideoMetadata::GetYear
int GetYear() const
Definition: videometadata.cpp:1587
kContentTelevision
@ kContentTelevision
Definition: metadatacommon.h:62
VideoMetadataImp::GetContentType
VideoContentType GetContentType() const
Definition: videometadata.cpp:321
VideoMetadata::GetImageMap
void GetImageMap(InfoMap &imageMap)
Definition: videometadata.cpp:1453
VideoCountry::getCountry
static VideoCountry & getCountry()
Definition: dbaccess.cpp:502
VideoMetadataImp::SetTitle
void SetTitle(const QString &title, const QString &sortTitle="")
Definition: videometadata.cpp:178
VideoMetadata::GetSortFilename
const QString & GetSortFilename() const
Definition: videometadata.cpp:1822
VideoMetadataImp::GetInetRef
const QString & GetInetRef() const
Definition: videometadata.cpp:196
VideoMetadataImp::m_filename
QString m_filename
Definition: videometadata.cpp:368
VideoMetadataImp::GetCountries
const country_list & GetCountries() const
Definition: videometadata.cpp:229
VideoMetadata::SetPrefix
void SetPrefix(const QString &prefix)
Definition: videometadata.cpp:1542
storagegroup.h
ternary_compare
int ternary_compare(const QDateTime &a, const QDateTime &b)
balanced ternary (three way) comparison This is equivalent to C++20's operator <=>.
Definition: mythdate.h:76
StringUtil::intToPaddedString
QString intToPaddedString(int n, int width=2)
Creates a zero padded string representation of an integer.
Definition: stringutil.h:24
VideoMetadata::GetGenres
const genre_list & GetGenres() const
Definition: videometadata.cpp:1912
VideoMetadataImp::m_trailer
QString m_trailer
Definition: videometadata.cpp:371
RemoteFile::DeleteFile
static bool DeleteFile(const QString &url)
Definition: remotefile.cpp:419
VideoCategory::GetCategory
static VideoCategory & GetCategory()
Definition: dbaccess.cpp:488
VideoMetadata::SetSubtitle
void SetSubtitle(const QString &subtitle, const QString &sortSubtitle="")
Definition: videometadata.cpp:1572
VIDEO_TRAILER_DEFAULT
const QString VIDEO_TRAILER_DEFAULT
Definition: globals.cpp:26
VideoMetadata::operator=
VideoMetadata & operator=(const VideoMetadata &rhs)
Definition: videometadata.cpp:1271
VideoGenre
Definition: dbaccess.h:86
VideoMetadataImp::m_banner
QString m_banner
Definition: videometadata.cpp:374
VideoMetadata::GetEpisode
int GetEpisode() const
Definition: videometadata.cpp:1717
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:59
VideoMetadataImp::GetPlayCount
unsigned int GetPlayCount() const
Definition: videometadata.cpp:288
VideoMetadata::GetPrefix
const QString & GetPrefix() const
Definition: videometadata.cpp:1537
VideoMetadataImp::m_year
int m_year
Definition: videometadata.cpp:380
VideoMetadataImp::m_contenttype
VideoContentType m_contenttype
Definition: videometadata.cpp:393
VideoMetadataImp::GetChildID
int GetChildID() const
Definition: videometadata.cpp:276
VideoMetadata::FillDataFromFilename
bool FillDataFromFilename(const VideoMetadataListManager &cache)
Definition: videometadata.cpp:1984
VideoMetadataImp::SetInsertdate
void SetInsertdate(QDate date)
Definition: videometadata.cpp:298
VideoMetadataImp::SetPlot
void SetPlot(const QString &plot)
Definition: videometadata.cpp:212
VIDEO_INETREF_DEFAULT
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
VideoMetadata::sortBefore
bool sortBefore(const VideoMetadata &rhs) const
Definition: videometadata.cpp:2015
VIDEO_FANART_DEFAULT
const QString VIDEO_FANART_DEFAULT
Definition: globals.cpp:29
videometadatalistmanager.h
VideoMetadataImp::updateCountries
void updateCountries()
Definition: videometadata.cpp:848
VideoMetadataImp::SetUserRating
void SetUserRating(float userRating)
Definition: videometadata.cpp:316
VideoMetadataImp::GetImage
QString GetImage(const QString &name) const
Definition: videometadata.cpp:962
VideoMetadataImp::m_insertdate
QDate m_insertdate
Definition: videometadata.cpp:386
VideoMetadata::SetGenres
void SetGenres(const genre_list &genres)
Definition: videometadata.cpp:1917
VideoMetadata::GetHash
const QString & GetHash() const
Definition: videometadata.cpp:1827
VideoMetadata::SetPlayCommand
void SetPlayCommand(const QString &playCommand)
Definition: videometadata.cpp:1802
VideoMetadata::SetTagline
void SetTagline(const QString &tagline)
Definition: videometadata.cpp:1582
ParentalLevelToState
QString ParentalLevelToState(const ParentalLevel &level)
Definition: videoutils.cpp:238
IsDefaultCoverFile
bool IsDefaultCoverFile(const QString &coverfile)
Definition: videoutils.cpp:126
VideoMetadataImp::m_showlevel
ParentalLevel::Level m_showlevel
Definition: videometadata.cpp:387
MythDate::fromString
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:34
VideoMetadataImp::GetCoverFile
const QString & GetCoverFile() const
Definition: videometadata.cpp:258
VideoMetadataImp::operator=
VideoMetadataImp & operator=(const VideoMetadataImp &rhs)
Definition: videometadata.cpp:104
VideoCountryMap::getCountryMap
static VideoCountryMap & getCountryMap()
Definition: dbaccess.cpp:559
VideoMetadata::SetCategoryID
void SetCategoryID(int id)
Definition: videometadata.cpp:1947
VideoMetadataImp::m_subtitle
QString m_subtitle
Definition: videometadata.cpp:353
VideoMetadataImp::GetCategory
const QString & GetCategory() const
Definition: videometadata.cpp:223
VideoMetadataImp::SetPlayCount
void SetPlayCount(int playcount)
Definition: videometadata.cpp:289
VideoMetadataImp::GetHash
const QString & GetHash() const
Definition: videometadata.cpp:252
VideoMetadataImp::saveToDatabase
void saveToDatabase()
Definition: videometadata.cpp:614
VideoMetadata::SetSeason
void SetSeason(int season)
Definition: videometadata.cpp:1712
VideoMetadata::SetRating
void SetRating(const QString &rating)
Definition: videometadata.cpp:1682
VideoMetadataImp::GetUserRating
float GetUserRating() const
Definition: videometadata.cpp:315
VideoContentType
VideoContentType
Definition: metadatacommon.h:60
mythmiscutil.h
VideoMetadata::SetCoverFile
void SetCoverFile(const QString &coverFile)
Definition: videometadata.cpp:1867
VideoMetadataImp::SetTrailer
void SetTrailer(const QString &trailer)
Definition: videometadata.cpp:256
VideoMetadataImp::SetHomepage
void SetHomepage(const QString &homepage)
Definition: videometadata.cpp:203
MythDate::kAddYear
@ kAddYear
Add year to string if not included.
Definition: mythdate.h:25
VideoMetadataImp::SetLength
void SetLength(std::chrono::minutes length)
Definition: videometadata.cpp:286
VideoMetadataImp::getSortTitle
const QString & getSortTitle() const
Definition: videometadata.cpp:177
mythcorecontext.h
VideoMetadataImp::getPlayCommand
const QString & getPlayCommand() const
Definition: videometadata.cpp:217
VideoMetadata::cast_list
std::vector< cast_entry > cast_list
Definition: videometadata.h:34
VideoMetadata::SetHost
void SetHost(const QString &host)
Definition: videometadata.cpp:1842
VideoMetadata::SetDirector
void SetDirector(const QString &director)
Definition: videometadata.cpp:1642
VideoMetadata::GetText
QString GetText(const QString &name) const
Definition: videometadata.cpp:1343
VideoCast::GetCast
static VideoCast & GetCast()
Definition: dbaccess.cpp:530
VideoMetadata::GetUserRating
float GetUserRating() const
Definition: videometadata.cpp:1667
VideoMetadata::IsHostSet
bool IsHostSet() const
Definition: videometadata.cpp:2010
ParentalLevel
Definition: parentalcontrols.h:9
VideoMetadata::UpdateDatabase
void UpdateDatabase()
Definition: videometadata.cpp:1957
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:883
VIDEO_RATING_DEFAULT
const QString VIDEO_RATING_DEFAULT
Definition: globals.cpp:30
VideoMetadataImp::Reset
void Reset()
Definition: videometadata.cpp:475
std
Definition: mythchrono.h:23
VideoMetadata::GetWatched
bool GetWatched() const
Definition: videometadata.cpp:1767
MultiValue::get
bool get(int id, entry &values)
Definition: dbaccess.cpp:451
VideoMetadataImp::m_episode
int m_episode
Definition: videometadata.cpp:385
VideoMetadata::GetState
QString GetState(const QString &name) const
Definition: videometadata.cpp:1440
VideoMetadataImp::GetTrailer
const QString & GetTrailer() const
Definition: videometadata.cpp:255
VideoMetadata::SetContentType
void SetContentType(VideoContentType contenttype)
Definition: videometadata.cpp:1792
VideoMetadata::GetCoverFile
const QString & GetCoverFile() const
Definition: videometadata.cpp:1862
VideoMetadata::SetTitle
void SetTitle(const QString &title, const QString &sortTitle="")
Definition: videometadata.cpp:1557
hardwareprofile.distros.all.get
def get()
Definition: all.py:22
VideoMetadataImp::SetCountries
void SetCountries(const country_list &countries)
Definition: videometadata.cpp:230
VideoMetadata::SetStudio
void SetStudio(const QString &studio)
Definition: videometadata.cpp:1652
VideoMetadataImp::IsHostSet
bool IsHostSet() const
Definition: videometadata.cpp:494
mythcontext.h
VideoMetadataImp::m_studio
QString m_studio
Definition: videometadata.cpp:360
VideoMetadataImp::GetPrefix
const QString & GetPrefix() const
Definition: videometadata.cpp:173
VideoMetadataImp::SetSubtitle
void SetSubtitle(const QString &subtitle, const QString &sortSubtitle="")
Definition: videometadata.cpp:187
MultiValue::remove
void remove(int id, int value)
Definition: dbaccess.cpp:456
VideoMetadataImp
Definition: videometadata.cpp:31
VideoMetadata::GetLength
std::chrono::minutes GetLength() const
Definition: videometadata.cpp:1687
StorageGroup
Definition: storagegroup.h:11
VideoMetadataImp::m_prefix
QString m_prefix
Definition: videometadata.cpp:396
VideoMetadata::SetBrowse
void SetBrowse(bool browse)
Definition: videometadata.cpp:1762
VideoMetadataImp::VideoMetadataImp
VideoMetadataImp(const VideoMetadataImp &other)
Definition: videometadata.cpp:99
VideoMetadataImp::m_userrating
float m_userrating
Definition: videometadata.cpp:391
VideoMetadataImp::getReleaseDate
QDate getReleaseDate() const
Definition: videometadata.cpp:282
VideoMetadataImp::getYear
int getYear() const
Definition: videometadata.cpp:279
VideoMetadata::GetID
unsigned int GetID() const
Definition: videometadata.cpp:1737
VideoMetadata::SetYear
void SetYear(int year)
Definition: videometadata.cpp:1592
VIDEO_YEAR_DEFAULT
@ VIDEO_YEAR_DEFAULT
Definition: videometadata.h:18
VideoMetadata::GetSortTitle
const QString & GetSortTitle() const
Definition: videometadata.cpp:1552
VideoMetadataImp::GetShowLevel
ParentalLevel::Level GetShowLevel() const
Definition: videometadata.cpp:300
VideoMetadata::VideoMetadata
VideoMetadata(const QString &filename=QString(), const QString &sortFilename=QString(), const QString &hash=QString(), const QString &trailer=QString(), const QString &coverfile=QString(), const QString &screenshot=QString(), const QString &banner=QString(), const QString &fanart=QString(), const QString &title=QString(), const QString &sortTitle=QString(), const QString &subtitle=QString(), const QString &sortSubtitle=QString(), const QString &tagline=QString(), int year=VIDEO_YEAR_DEFAULT, QDate releasedate=QDate(), const QString &inetref=QString(), int collectionref=0, const QString &homepage=QString(), const QString &director=QString(), const QString &studio=QString(), const QString &plot=QString(), float userrating=0.0, const QString &rating=QString(), int length=0, int playcount=0, int season=0, int episode=0, QDate insertdate=QDate(), int id=0, ParentalLevel::Level showlevel=ParentalLevel::plLowest, int categoryID=0, int childID=-1, bool browse=true, bool watched=false, const QString &playcommand=QString(), const QString &category=QString(), const genre_list &genres=genre_list(), const country_list &countries=country_list(), const cast_list &cast=cast_list(), const QString &host="", bool processed=false, VideoContentType contenttype=kContentUnknown)
Definition: videometadata.cpp:1229
VideoMetadata::GetTitle
const QString & GetTitle() const
Definition: videometadata.cpp:1547
kContentMovie
@ kContentMovie
Definition: metadatacommon.h:61
VideoMetadata::SetScreenshot
void SetScreenshot(const QString &screenshot)
Definition: videometadata.cpp:1877
MythDate::kDateFull
@ kDateFull
Default local time.
Definition: mythdate.h:19
GetDisplayGenres
QString GetDisplayGenres(const VideoMetadata &item)
Definition: videoutils.cpp:217
VideoMetadata::SetWatched
void SetWatched(bool watched)
Definition: videometadata.cpp:1772
VideoMetadata::SetHash
void SetHash(const QString &hash)
Definition: videometadata.cpp:1832
VideoMetadata::GetSortSubtitle
const QString & GetSortSubtitle() const
Definition: videometadata.cpp:1567
VideoMetadata::m_imp
class VideoMetadataImp * m_imp
Definition: videometadata.h:242
VideoMetadataImp::m_id
unsigned int m_id
Definition: videometadata.cpp:390
VideoMetadata::GetTrailer
const QString & GetTrailer() const
Definition: videometadata.cpp:1852
VideoMetadataImp::country_list
VideoMetadata::country_list country_list
Definition: videometadata.cpp:35
VideoMetadataImp::SetShowLevel
void SetShowLevel(ParentalLevel::Level showLevel)
Definition: videometadata.cpp:301
MultiValue::entry::values
values_type values
Definition: dbaccess.h:44
kContentUnknown
@ kContentUnknown
Definition: metadatacommon.h:66
MythCoreContext::IsThisHost
bool IsThisHost(const QString &addr)
is this address mapped to this host
Definition: mythcorecontext.cpp:725
VideoCastMap::getCastMap
static VideoCastMap & getCastMap()
Definition: dbaccess.cpp:574
VideoMetadata::GetImage
QString GetImage(const QString &name) const
Definition: videometadata.cpp:1458
TrailerToState
QString TrailerToState(const QString &trailerFile)
Definition: videoutils.cpp:262
VideoMetadataImp::updateCast
void updateCast()
Definition: videometadata.cpp:869
VIDEO_BANNER_DEFAULT
const QString VIDEO_BANNER_DEFAULT
Definition: globals.cpp:28
d
static const iso6937table * d
Definition: iso6937tables.cpp:1025
VideoMetadata::GetRating
const QString & GetRating() const
Definition: videometadata.cpp:1677
VideoMetadataImp::GetProcessed
bool GetProcessed() const
Definition: videometadata.cpp:318
VideoMetadataImp::GetInsertdate
QDate GetInsertdate() const
Definition: videometadata.cpp:297
VideoCountryMap
Definition: dbaccess.h:106
VideoMetadata::MetadataGetTextCb
static QString MetadataGetTextCb(const QString &name, void *data)
Definition: videometadata.cpp:1507
VideoMetadata::DeleteFile
bool DeleteFile()
Definition: videometadata.cpp:2000
VideoMetadata::~VideoMetadata
~VideoMetadata()
Definition: videometadata.cpp:1256
VideoMetadataImp::GetRating
const QString & GetRating() const
Definition: videometadata.cpp:214
VideoMetadata::Reset
void Reset()
Resets to default metadata.
Definition: videometadata.cpp:2005
VideoMetadataImp::GetCollectionRef
int GetCollectionRef() const
Definition: videometadata.cpp:199
VideoMetadata::MetadataGetStateCb
static QString MetadataGetStateCb(const QString &name, void *data)
Definition: videometadata.cpp:1529
VideoMetadataImp::SetInetRef
void SetInetRef(const QString &inetRef)
Definition: videometadata.cpp:197
VideoMetadata::GetTagline
const QString & GetTagline() const
Definition: videometadata.cpp:1577
VideoMetadataImp::GetWatched
bool GetWatched() const
Definition: videometadata.cpp:309
VideoMetadataImp::SetStudio
void SetStudio(const QString &studio)
Definition: videometadata.cpp:209
VideoMetadata::GetBrowse
bool GetBrowse() const
Definition: videometadata.cpp:1757
VideoMetadataImp::SetSeason
void SetSeason(int season)
Definition: videometadata.cpp:292
build_compdb.filename
filename
Definition: build_compdb.py:21
VideoMetadata::GetBanner
const QString & GetBanner() const
Definition: videometadata.cpp:1882
VideoMetadata::VideoFileHash
static QString VideoFileHash(const QString &file_name, const QString &host)
Definition: videometadata.cpp:1123
VideoMetadataImp::getSubtitle
const QString & getSubtitle() const
Definition: videometadata.cpp:185
FileHash
QString FileHash(const QString &filename)
Definition: mythmiscutil.cpp:553
GetDisplayWatched
QString GetDisplayWatched(bool watched)
Definition: videoutils.cpp:175
VideoMetadataImp::m_plot
QString m_plot
Definition: videometadata.cpp:361
VideoMetadataImp::VideoMetadataImp
VideoMetadataImp(QString filename, QString sortFilename, QString hash, QString trailer, QString coverfile, QString screenshot, QString banner, QString fanart, const QString &title, QString sortTitle, const QString &subtitle, QString sortSubtitle, QString tagline, int year, const QDate releasedate, QString inetref, int collectionref, QString homepage, QString director, QString studio, QString plot, float userrating, QString rating, int length, int playcount, int season, int episode, const QDate insertdate, int id, ParentalLevel::Level showlevel, int categoryID, int childID, bool browse, bool watched, QString playcommand, QString category, genre_list genres, country_list countries, cast_list cast, QString host="", bool processed=false, VideoContentType contenttype=kContentUnknown)
Definition: videometadata.cpp:39
ParentalLevel::GetLevel
Level GetLevel() const
Definition: parentalcontrols.cpp:128
VideoMetadata::GetPlayCount
unsigned int GetPlayCount() const
Definition: videometadata.cpp:1697
GetDisplayCast
QStringList GetDisplayCast(const VideoMetadata &item)
Definition: videoutils.cpp:231
VideoMetadata::SetReleaseDate
void SetReleaseDate(QDate releasedate)
Definition: videometadata.cpp:1602
VideoMetadata::SetChildID
void SetChildID(int childID)
Definition: videometadata.cpp:1752
VideoMetadata::GetCast
const cast_list & GetCast() const
Definition: videometadata.cpp:1922
SingleValue::get
bool get(int id, QString &category)
Definition: dbaccess.cpp:220
VideoMetadata::GetStudio
const QString & GetStudio() const
Definition: videometadata.cpp:1647
VideoMetadataImp::GetImageMap
void GetImageMap(InfoMap &imageMap) const
Definition: videometadata.cpp:890
videoutils.h
VideoMetadata::SetCountries
void SetCountries(const country_list &countries)
Definition: videometadata.cpp:1937
VIDEO_DIRECTOR_DEFAULT
const QString VIDEO_DIRECTOR_DEFAULT
Definition: globals.cpp:23
VideoMetadataImp::m_playcommand
QString m_playcommand
Definition: videometadata.cpp:363
VideoMetadataImp::m_sortTitle
QString m_sortTitle
Definition: videometadata.cpp:352
VideoMetadataImp::m_host
QString m_host
Definition: videometadata.cpp:376
VideoMetadataImp::SetPrefix
void SetPrefix(const QString &prefix)
Definition: videometadata.cpp:174
simple_ref_ptr::get
T * get() const
Definition: quicksp.h:73
VideoMetadataImp::fillCast
void fillCast()
Definition: videometadata.cpp:535
VideoMetadata::GetStateMap
void GetStateMap(InfoMap &stateMap) const
Definition: videometadata.cpp:1429
VideoGenreMap
Definition: dbaccess.h:96
VIDEO_SCREENSHOT_DEFAULT
const QString VIDEO_SCREENSHOT_DEFAULT
Definition: globals.cpp:27
GetDisplayYear
QString GetDisplayYear(int year)
Definition: videoutils.cpp:205
VideoMetadataImp::GetCategoryID
int GetCategoryID() const
Definition: videometadata.cpp:270
MultiValue::entry
Definition: dbaccess.h:40
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:832
ClearMap
void ClearMap(InfoMap &metadataMap)
Definition: videometadata.cpp:1463
VideoMetadataListManager::byID
VideoMetadataPtr byID(unsigned int db_id) const
Definition: videometadatalistmanager.cpp:177
VIDEO_DIRECTOR_UNKNOWN
const QString VIDEO_DIRECTOR_UNKNOWN
Definition: globals.cpp:9