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