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"
10 #include "libmythbase/mythdate.h"
11 #include "libmythbase/mythdb.h"
13 #include "libmythbase/mythmiscutil.h"// for FileHash
15 #include "libmythbase/remotefile.h"
16 #include "libmythbase/remoteutil.h"
18 #include "libmythbase/stringutil.h"
20 
21 #include "dbaccess.h"
22 #include "globals.h"
24 #include "videoutils.h"
25 
27 {
28  public:
32 
33  public:
34  VideoMetadataImp(QString filename, QString sortFilename,
35  QString hash, QString trailer,
36  QString coverfile, QString screenshot, QString banner,
37  QString fanart, const QString &title, QString sortTitle,
38  const QString &subtitle, QString sortSubtitle,
39  QString tagline, int year, const QDate releasedate,
40  QString inetref, int collectionref, QString homepage,
41  QString director, QString studio,
42  QString plot, float userrating,
43  QString rating, int length, int playcount,
44  int season, int episode, const QDate insertdate,
45  int id, ParentalLevel::Level showlevel, int categoryID,
46  int childID, bool browse, bool watched,
47  QString playcommand, QString category,
48  genre_list genres,
49  country_list countries,
50  cast_list cast,
51  QString host = "",
52  bool processed = false,
53  VideoContentType contenttype = kContentUnknown) :
54  m_title(title), m_sortTitle(std::move(sortTitle)), m_subtitle(subtitle),
55  m_sortSubtitle(std::move(sortSubtitle)), m_tagline(std::move(tagline)),
56  m_inetref(std::move(inetref)), m_collectionref(collectionref),
57  m_homepage(std::move(homepage)), m_director(std::move(director)),
58  m_studio(std::move(studio)), m_plot(std::move(plot)),
59  m_rating(std::move(rating)), m_playcommand(std::move(playcommand)),
60  m_category(std::move(category)), m_genres(std::move(genres)),
61  m_countries(std::move(countries)), m_cast(std::move(cast)),
62  m_filename(std::move(filename)), m_sortFilename(std::move(sortFilename)),
63  m_hash(std::move(hash)), m_trailer(std::move(trailer)),
64  m_coverfile(std::move(coverfile)), m_screenshot(std::move(screenshot)),
65  m_banner(std::move(banner)), m_fanart(std::move(fanart)),
66  m_host(std::move(host)), m_categoryID(categoryID), m_childID(childID),
67  m_year(year), m_releasedate(releasedate), m_length(length), m_playcount(playcount),
68  m_season(season), m_episode(episode), m_insertdate(insertdate), m_showlevel(showlevel),
69  m_browse(browse), m_watched(watched), m_id(id),
70  m_userrating(userrating), m_processed(processed),
71  m_contenttype(contenttype)
72  {
73  // Try to glean data if none provided.
74  if (title.isEmpty() and subtitle.isEmpty()
75  and season == 0 and episode == 0)
76  {
81  }
82 
84 
86  }
87 
88  explicit VideoMetadataImp(MSqlQuery &query)
89  {
90  fromDBRow(query);
92  }
93 
95  {
96  *this = other;
97  }
98 
100  {
101  if (this != &rhs)
102  {
103  m_title = rhs.m_title;
104  m_sortTitle = rhs.m_sortTitle;
105  m_subtitle = rhs.m_subtitle;
107  m_tagline = rhs.m_tagline;
108  m_inetref = rhs.m_inetref;
110  m_homepage = rhs.m_homepage;
111  m_director = rhs.m_director;
112  m_studio = rhs.m_studio;
113  m_plot = rhs.m_plot;
114  m_rating = rhs.m_rating;
116  m_category = rhs.m_category;
117  m_genres = rhs.m_genres;
118  m_countries = rhs.m_countries;
119  m_cast = rhs.m_cast;
120  m_filename = rhs.m_filename;
122  m_hash = rhs.m_hash;
123  m_trailer = rhs.m_trailer;
124  m_coverfile = rhs.m_coverfile;
126  m_banner = rhs.m_banner;
127  m_fanart = rhs.m_fanart;
128 
130  m_childID = rhs.m_childID;
131  m_year = rhs.m_year;
133  m_length = rhs.m_length;
134  m_playcount = rhs.m_playcount;
135  m_season = rhs.m_season;
136  m_episode = rhs.m_episode;
138  m_showlevel = rhs.m_showlevel;
139  m_browse = rhs.m_browse;
140  m_watched = rhs.m_watched;
141  m_id = rhs.m_id;
143  m_host = rhs.m_host;
144  m_processed = rhs.m_processed;
146 
147  // No DB vars
148  m_prefix = rhs.m_prefix;
149 
151  }
152 
153  return *this;
154  }
155 
156  void ensureSortFields(void)
157  {
158  std::shared_ptr<MythSortHelper>sh = getMythSortHelper();
159  if (m_sortTitle.isEmpty() and not m_title.isEmpty())
160  m_sortTitle = sh->doTitle(m_title);
161  if (m_sortSubtitle.isEmpty() and not m_subtitle.isEmpty())
162  m_sortSubtitle = sh->doTitle(m_subtitle);
163  if (m_sortFilename.isEmpty() and not m_filename.isEmpty())
164  m_sortFilename = sh->doPathname(m_filename);
165  }
166 
167  public:
168  const QString &GetPrefix() const { return m_prefix; }
169  void SetPrefix(const QString &prefix) { m_prefix = prefix; }
170 
171  const QString &getTitle() const { return m_title; }
172  const QString &getSortTitle() const { return m_sortTitle; }
173  void SetTitle(const QString& title, const QString& sortTitle = "")
174  {
175  m_title = title;
176  m_sortTitle = sortTitle;
178  }
179 
180  const QString &getSubtitle() const { return m_subtitle; }
181  const QString &getSortSubtitle() const { return m_sortSubtitle; }
182  void SetSubtitle(const QString &subtitle, const QString &sortSubtitle = "") {
183  m_subtitle = subtitle;
184  m_sortSubtitle = sortSubtitle;
186  }
187 
188  const QString &GetTagline() const { return m_tagline; }
189  void SetTagline(const QString &tagline) { m_tagline = tagline; }
190 
191  const QString &GetInetRef() const { return m_inetref; }
192  void SetInetRef(const QString &inetRef) { m_inetref = inetRef; }
193 
194  int GetCollectionRef() const { return m_collectionref; }
195  void SetCollectionRef(int collectionref) { m_collectionref = collectionref; }
196 
197  const QString &GetHomepage() const { return m_homepage; }
198  void SetHomepage(const QString &homepage) { m_homepage = homepage; }
199 
200  const QString &getDirector() const { return m_director; }
201  void SetDirector(const QString &director) { m_director = director; }
202 
203  const QString &getStudio() const { return m_studio; }
204  void SetStudio(const QString &studio) { m_studio = studio; }
205 
206  const QString &getPlot() const { return m_plot; }
207  void SetPlot(const QString &plot) { m_plot = plot; }
208 
209  const QString &GetRating() const { return m_rating; }
210  void SetRating(const QString &rating) { m_rating = rating; }
211 
212  const QString &getPlayCommand() const { return m_playcommand; }
213  void SetPlayCommand(const QString &playCommand)
214  {
215  m_playcommand = playCommand;
216  }
217 
218  const QString &GetCategory() const { return m_category; }
219 // void SetCategory(const QString &category) { m_category = category; }
220 
221  const genre_list &getGenres() const { return m_genres; }
222  void SetGenres(const genre_list &genres) { m_genres = genres; }
223 
224  const country_list &GetCountries() const { return m_countries; }
225  void SetCountries(const country_list &countries)
226  {
227  m_countries = countries;
228  }
229 
230  const cast_list &GetCast() const { return m_cast; }
231  void SetCast(const cast_list &cast) { m_cast = cast; }
232 
233  const QString &GetHost() const { return m_host; }
234  void SetHost(const QString &host) { m_host = host; }
235 
236  const QString &getFilename() const { return m_filename; }
237  const QString &getSortFilename() const { return m_sortFilename; }
238  void SetFilename(const QString &filename, const QString &sortFilename = "")
239  {
241  m_sortFilename = sortFilename;
243  }
244 
245  bool sortBefore(const VideoMetadataImp *rhs) const;
246 
247  const QString &GetHash() const { return m_hash; }
248  void SetHash(const QString &hash) { m_hash = hash; }
249 
250  const QString &GetTrailer() const { return m_trailer; }
251  void SetTrailer(const QString &trailer) { m_trailer = trailer; }
252 
253  const QString &GetCoverFile() const { return m_coverfile; }
254  void SetCoverFile(const QString &coverFile) { m_coverfile = coverFile; }
255 
256  const QString &GetScreenshot() const { return m_screenshot; }
257  void SetScreenshot(const QString &screenshot) { m_screenshot = screenshot; }
258 
259  const QString &GetBanner() const { return m_banner; }
260  void SetBanner(const QString &banner) { m_banner = banner; }
261 
262  const QString &GetFanart() const { return m_fanart; }
263  void SetFanart(const QString &fanart) { m_fanart = fanart; }
264 
265  int GetCategoryID() const
266  {
267  return m_categoryID;
268  }
269  void SetCategoryID(int id);
270 
271  int GetChildID() const { return m_childID; }
272  void SetChildID(int childID) { m_childID = childID; }
273 
274  int getYear() const { return m_year; }
275  void SetYear(int year) { m_year = year; }
276 
277  QDate getReleaseDate() const { return m_releasedate; }
278  void SetReleaseDate(QDate releasedate) { m_releasedate = releasedate; }
279 
280  std::chrono::minutes GetLength() const { return m_length; }
281  void SetLength(std::chrono::minutes length) { m_length = length; }
282 
283  unsigned int GetPlayCount() const { return m_playcount; }
284  void SetPlayCount(int playcount) { m_playcount = playcount; }
285 
286  int GetSeason() const { return m_season; }
287  void SetSeason(int season) { m_season = season; }
288 
289  int GetEpisode() const { return m_episode; }
290  void SetEpisode(int episode) { m_episode = episode; }
291 
292  QDate GetInsertdate() const { return m_insertdate;}
293  void SetInsertdate(QDate date) { m_insertdate = date;}
294 
297  {
298  m_showlevel = ParentalLevel(showLevel).GetLevel();
299  }
300 
301  bool GetBrowse() const { return m_browse; }
302  void SetBrowse(bool browse) { m_browse = browse; }
303 
304  bool GetWatched() const { return m_watched; }
305  void SetWatched(bool watched) { m_watched = watched; }
306 
307  unsigned int GetID() const { return m_id; }
308  void SetID(int id) { m_id = id; }
309 
310  float GetUserRating() const { return m_userrating; }
311  void SetUserRating(float userRating) { m_userrating = userRating; }
312 
313  bool GetProcessed() const { return m_processed; }
314  void SetProcessed(bool processed) { m_processed = processed; }
315 
317  void SetContentType(VideoContentType contenttype) { m_contenttype = contenttype; }
318 
320 
321  void SaveToDatabase();
322  void UpdateDatabase();
323  bool DeleteFromDatabase();
324 
325  bool DeleteFile();
326 
327  void Reset();
328 
329  bool IsHostSet() const;
330 
331  void GetImageMap(InfoMap &imageMap) const;
332  QString GetImage(const QString &name) const;
333 
334  private:
335  void fillCountries();
336  void updateCountries();
337  void fillGenres();
338  void fillCast();
339  void updateGenres();
340  void updateCast();
341  bool removeDir(const QString &dirName);
342  void fromDBRow(MSqlQuery &query);
343  void saveToDatabase();
344 
345  private:
346  QString m_title;
347  QString m_sortTitle;
348  QString m_subtitle;
349  QString m_sortSubtitle;
350  QString m_tagline;
351  QString m_inetref;
353  QString m_homepage;
354  QString m_director;
355  QString m_studio;
356  QString m_plot;
357  QString m_rating;
358  QString m_playcommand;
359  QString m_category;
363  QString m_filename;
364  QString m_sortFilename;
365  QString m_hash;
366  QString m_trailer;
367  QString m_coverfile;
368  QString m_screenshot;
369  QString m_banner;
370  QString m_fanart;
371  QString m_host;
372 
373  int m_categoryID {0};
374  int m_childID {-1};
377  std::chrono::minutes m_length {0min};
378  int m_playcount {0};
379  int m_season {0};
380  int m_episode {0};
383  bool m_browse {true};
384  bool m_watched {false};
385  unsigned int m_id {0}; // videometadata.intid
386  float m_userrating {0.0};
387  bool m_processed {false};
389 
390  // not in DB
391  QString m_prefix;
392 };
393 
397 
401 {
403  if (cmp == 0)
405  if (cmp == 0)
406  cmp = ternary_compare(m_id, rhs->m_id);
407  return cmp < 0;
408 }
409 
410 bool VideoMetadataImp::removeDir(const QString &dirName)
411 {
412  QDir d(dirName);
413 
414  d.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
415  QFileInfoList contents = d.entryInfoList();
416  if (contents.empty())
417  {
418  return d.rmdir(dirName);
419  }
420 
421  for (const auto& entry : std::as_const(contents))
422  {
423  if (entry.isDir())
424  {
425  QString fileName = entry.fileName();
426  if (!removeDir(fileName))
427  return false;
428  }
429  else
430  {
431  if (!QFile(entry.fileName()).remove())
432  return false;
433  }
434  }
435  return d.rmdir(dirName);
436 }
437 
440 {
441  bool isremoved = false;
442 
443  if (!m_host.isEmpty())
444  {
445  QString url = generate_file_url("Videos", m_host, m_filename);
446  isremoved = RemoteFile::DeleteFile(url);
447  }
448  else
449  {
450  QFileInfo fi(m_filename);
451  if (fi.isDir())
452  {
453  isremoved = removeDir(m_filename);
454  }
455  else
456  {
457  isremoved = QFile::remove(m_filename);
458  }
459  }
460 
461  if (!isremoved)
462  {
463  LOG(VB_GENERAL, LOG_DEBUG, QString("Could not delete file: %1")
464  .arg(m_filename));
465  }
466 
467  return isremoved;
468 }
469 
471 {
472  VideoMetadataImp tmp(m_filename, QString(),
475  VIDEO_FANART_DEFAULT, QString(), QString(), QString(), QString(),
476  QString(), VIDEO_YEAR_DEFAULT,
477  QDate(), VIDEO_INETREF_DEFAULT, -1, QString(), VIDEO_DIRECTOR_DEFAULT,
478  QString(), VIDEO_PLOT_DEFAULT, 0.0,
479  VIDEO_RATING_DEFAULT, 0, 0,
480  0, 0, QDate(), m_id,
481  ParentalLevel::plLowest, 0, -1, true, false, "", "",
483  VideoMetadata::cast_list(), m_host, false);
484  tmp.m_prefix = m_prefix;
485 
486  *this = tmp;
487 }
488 
490 {
491  return !m_host.isEmpty();
492 }
493 
495 {
496  m_genres.clear();
498  VideoGenreMap::entry genres;
499  if (vgm.get(m_id, genres))
500  {
502  for (long value : genres.values)
503  {
504  // Just add empty string for no-name genres
505  QString name;
506  vg.get(value, name);
507  m_genres.emplace_back(value, name);
508  }
509  }
510 }
511 
513 {
514  m_countries.clear();
516  VideoCountryMap::entry countries;
517  if (vcm.get(m_id, countries))
518  {
520  for (long value : countries.values)
521  {
522  // Just add empty string for no-name countries
523  QString name;
524  vc.get(value, name);
525  m_countries.emplace_back(value, name);
526  }
527  }
528 }
529 
531 {
532  m_cast.clear();
534  VideoCastMap::entry cast;
535  if (vcm.get(m_id, cast))
536  {
538  for (long value : cast.values)
539  {
540  // Just add empty string for no-name cast
541  QString name;
542  vc.get(value, name);
543  m_cast.emplace_back(value, name);
544  }
545  }
546 }
547 
553 {
554  m_title = query.value(0).toString();
555  m_director = query.value(1).toString();
556  m_studio = query.value(2).toString();
557  m_plot = query.value(3).toString();
558  m_rating = query.value(4).toString();
559  m_year = query.value(5).toInt();
560  m_releasedate = query.value(6).toDate();
561  m_userrating = (float)query.value(7).toDouble();
562  if (std::isnan(m_userrating) || m_userrating < 0)
563  m_userrating = 0.0;
564  if (m_userrating > 10.0F)
565  m_userrating = 10.0F;
566  m_length = std::chrono::minutes(query.value(8).toInt());
567  m_playcount = query.value(9).toInt();
568  m_filename = query.value(10).toString();
569  m_hash = query.value(11).toString();
570  m_showlevel = ParentalLevel(query.value(12).toInt()).GetLevel();
571  m_coverfile = query.value(13).toString();
572  m_inetref = query.value(14).toString();
573  m_collectionref = query.value(15).toUInt();
574  m_homepage = query.value(16).toString();
575  m_childID = query.value(17).toUInt();
576  m_browse = query.value(18).toBool();
577  m_watched = query.value(19).toBool();
578  m_playcommand = query.value(20).toString();
579  m_categoryID = query.value(21).toInt();
580  m_id = query.value(22).toInt();
581  m_trailer = query.value(23).toString();
582  m_screenshot = query.value(24).toString();
583  m_banner = query.value(25).toString();
584  m_fanart = query.value(26).toString();
585  m_subtitle = query.value(27).toString();
586  m_tagline = query.value(28).toString();
587  m_season = query.value(29).toInt();
588  m_episode = query.value(30).toInt();
589  m_host = query.value(31).toString();
590  m_insertdate = query.value(32).toDate();
591  m_processed = query.value(33).toBool();
592 
593  m_contenttype = ContentTypeFromString(query.value(34).toString());
594 
596 
598 
599  // Genres
600  fillGenres();
601 
602  //Countries
603  fillCountries();
604 
605  // Cast
606  fillCast();
607 }
608 
610 {
611  if (m_title.isEmpty())
613  if (m_hash.isEmpty())
615  if (m_subtitle.isEmpty())
617  if (m_director.isEmpty())
619  if (m_plot.isEmpty())
621  if (m_rating.isEmpty())
624 
625  InfoMap metadataMap;
626  GetImageMap(metadataMap);
627  QString coverfile = metadataMap["coverfile"];
628  QString screenshot = metadataMap["screenshotfile"];
629  QString bannerfile = metadataMap["bannerfile"];
630  QString fanartfile = metadataMap["fanartfile"];
631 
632  if (coverfile.isEmpty() || !RemoteFile::Exists(coverfile))
634  if (screenshot.isEmpty() || !RemoteFile::Exists(screenshot))
636  if (bannerfile.isEmpty() || !RemoteFile::Exists(bannerfile))
638  if (fanartfile.isEmpty() || !RemoteFile::Exists(fanartfile))
640  if (m_trailer.isEmpty())
642  if (m_inetref.isEmpty())
644  if (std::isnan(m_userrating))
645  m_userrating = 0.0;
646  if (m_userrating < -10.0F || m_userrating > 10.0F)
647  m_userrating = 0.0;
648  if (m_releasedate.toString().isEmpty())
649  m_releasedate = QDate::fromString("0000-00-00", "YYYY-MM-DD");
651  {
652  if (m_season > 0 || m_episode > 0)
654  else
656  }
657 
658  bool inserting = m_id == 0;
659 
660  MSqlQuery query(MSqlQuery::InitCon());
661 
662  if (inserting)
663  {
664  m_browse = true;
665 
666  m_watched = false;
667 
668  query.prepare("INSERT INTO videometadata (title,subtitle,tagline,director,studio,plot,"
669  "rating,year,userrating,length,season,episode,filename,hash,"
670  "showlevel,coverfile,inetref,homepage,browse,watched,trailer,"
671  "screenshot,banner,fanart,host,processed,contenttype) VALUES (:TITLE, :SUBTITLE, "
672  ":TAGLINE, :DIRECTOR, :STUDIO, :PLOT, :RATING, :YEAR, :USERRATING, "
673  ":LENGTH, :SEASON, :EPISODE, :FILENAME, :HASH, :SHOWLEVEL, "
674  ":COVERFILE, :INETREF, :HOMEPAGE, :BROWSE, :WATCHED, "
675  ":TRAILER, :SCREENSHOT, :BANNER, :FANART, :HOST, :PROCESSED, :CONTENTTYPE)");
676  }
677  else
678  {
679  query.prepare("UPDATE videometadata SET title = :TITLE, subtitle = :SUBTITLE, "
680  "tagline = :TAGLINE, director = :DIRECTOR, studio = :STUDIO, "
681  "plot = :PLOT, rating= :RATING, year = :YEAR, "
682  "releasedate = :RELEASEDATE, userrating = :USERRATING, "
683  "length = :LENGTH, playcount = :PLAYCOUNT, season = :SEASON, "
684  "episode = :EPISODE, filename = :FILENAME, hash = :HASH, trailer = :TRAILER, "
685  "showlevel = :SHOWLEVEL, coverfile = :COVERFILE, "
686  "screenshot = :SCREENSHOT, banner = :BANNER, fanart = :FANART, "
687  "inetref = :INETREF, collectionref = :COLLECTION, homepage = :HOMEPAGE, "
688  "browse = :BROWSE, watched = :WATCHED, host = :HOST, playcommand = :PLAYCOMMAND, "
689  "childid = :CHILDID, category = :CATEGORY, processed = :PROCESSED, "
690  "contenttype = :CONTENTTYPE WHERE intid = :INTID");
691 
692  query.bindValue(":PLAYCOMMAND", m_playcommand);
693  query.bindValue(":CHILDID", m_childID);
694  query.bindValue(":CATEGORY", m_categoryID);
695  query.bindValue(":INTID", m_id);
696  }
697 
698  query.bindValueNoNull(":TITLE", m_title);
699  query.bindValueNoNull(":SUBTITLE", m_subtitle);
700  query.bindValue(":TAGLINE", m_tagline);
701  query.bindValueNoNull(":DIRECTOR", m_director);
702  query.bindValue(":STUDIO", m_studio);
703  query.bindValue(":PLOT", m_plot);
704  query.bindValueNoNull(":RATING", m_rating);
705  query.bindValue(":YEAR", m_year);
706  query.bindValue(":RELEASEDATE", m_releasedate);
707  query.bindValue(":USERRATING", m_userrating);
708  query.bindValue(":LENGTH", static_cast<qint64>(m_length.count()));
709  query.bindValue(":PLAYCOUNT", m_playcount);
710  query.bindValue(":SEASON", m_season);
711  query.bindValue(":EPISODE", m_episode);
712  query.bindValue(":FILENAME", m_filename);
713  query.bindValue(":HASH", m_hash);
714  query.bindValueNoNull(":TRAILER", m_trailer);
715  query.bindValue(":SHOWLEVEL", m_showlevel);
716  query.bindValueNoNull(":COVERFILE", m_coverfile);
717  query.bindValueNoNull(":SCREENSHOT", m_screenshot);
718  query.bindValueNoNull(":BANNER", m_banner);
719  query.bindValueNoNull(":FANART", m_fanart);
720  query.bindValueNoNull(":INETREF", m_inetref);
721  query.bindValue(":COLLECTION", m_collectionref);
722  query.bindValueNoNull(":HOMEPAGE", m_homepage);
723  query.bindValue(":BROWSE", m_browse);
724  query.bindValue(":WATCHED", m_watched);
725  query.bindValue(":HOST", m_host);
726  query.bindValue(":PROCESSED", m_processed);
727  query.bindValue(":CONTENTTYPE", ContentTypeToString(m_contenttype));
728 
729  if (!query.exec() || !query.isActive())
730  {
731  MythDB::DBError("video metadata update", query);
732  return;
733  }
734 
735  if (inserting)
736  {
737  // Must make sure we have 'id' filled before we call updateGenres or
738  // updateCountries
739 
740  if (!query.exec("SELECT LAST_INSERT_ID()") || !query.next())
741  {
742  MythDB::DBError("metadata id get", query);
743  return;
744  }
745 
746  m_id = query.value(0).toUInt();
747 
748  if (0 == m_id)
749  {
750  LOG(VB_GENERAL, LOG_ERR,
751  QString("%1: The id of the last inserted row to "
752  "videometadata seems to be 0. This is odd.")
753  .arg(__FILE__));
754  return;
755  }
756  }
757 
758  updateGenres();
759  updateCountries();
760  updateCast();
761 }
762 
764 {
765  saveToDatabase();
766 }
767 
769 {
770  saveToDatabase();
771 }
772 
774 {
778 
779  MSqlQuery query(MSqlQuery::InitCon());
780  query.prepare("DELETE FROM videometadata WHERE intid = :ID");
781  query.bindValue(":ID", m_id);
782  if (!query.exec())
783  {
784  MythDB::DBError("delete from videometadata", query);
785  }
786 
787  query.prepare("DELETE FROM filemarkup WHERE filename = :FILENAME");
788  query.bindValue(":FILENAME", m_filename);
789  if (!query.exec())
790  {
791  MythDB::DBError("delete from filemarkup", query);
792  }
793 
794  return true;
795 }
796 
798 {
799  if (id == 0)
800  {
801  m_category = "";
802  m_categoryID = id;
803  }
804  else
805  {
806  if (m_categoryID != id)
807  {
808  QString cat;
810  {
811  m_category = cat;
812  m_categoryID = id;
813  }
814  else
815  {
816  LOG(VB_GENERAL, LOG_ERR, "Unknown category id");
817  }
818  }
819  }
820 }
821 
823 {
825 
826  // ensure that all genres we have are in the DB
827  auto genre = m_genres.begin();
828  while (genre != m_genres.end())
829  {
830  if (!genre->second.trimmed().isEmpty())
831  {
832  genre->first = VideoGenre::getGenre().add(genre->second);
833  VideoGenreMap::getGenreMap().add(m_id, genre->first);
834  ++genre;
835  }
836  else
837  {
838  genre = m_genres.erase(genre);
839  }
840  }
841 }
842 
844 {
845  // remove countries for this video
847 
848  auto country = m_countries.begin();
849  while (country != m_countries.end())
850  {
851  if (!country->second.trimmed().isEmpty())
852  {
853  country->first = VideoCountry::getCountry().add(country->second);
854  VideoCountryMap::getCountryMap().add(m_id, country->first);
855  ++country;
856  }
857  else
858  {
859  country = m_countries.erase(country);
860  }
861  }
862 }
863 
865 {
867 
868  // ensure that all cast we have are in the DB
869  auto cast = m_cast.begin();
870  while (cast != m_cast.end())
871  {
872  if (!cast->second.trimmed().isEmpty())
873  {
874  cast->first = VideoCast::GetCast().add(cast->second);
875  VideoCastMap::getCastMap().add(m_id, cast->first);
876  ++cast;
877  }
878  else
879  {
880  cast = m_cast.erase(cast);
881  }
882  }
883 }
884 
886 {
887  QString coverfile;
888  if (IsHostSet()
889  && !GetCoverFile().startsWith(u'/')
890  && !GetCoverFile().isEmpty()
892  {
893  coverfile = generate_file_url(QStringLiteral(u"Coverart"), GetHost(),
894  GetCoverFile());
895  }
896  else
897  {
898  coverfile = GetCoverFile();
899  }
900 
901  imageMap[QStringLiteral(u"coverfile")] = coverfile;
902  imageMap[QStringLiteral(u"coverart")] = coverfile;
903 
904  QString screenshotfile;
905  if (IsHostSet() && !GetScreenshot().startsWith(u'/')
906  && !GetScreenshot().isEmpty())
907  {
908  screenshotfile = generate_file_url(QStringLiteral(u"Screenshots"),
909  GetHost(), GetScreenshot());
910  }
911  else
912  {
913  screenshotfile = GetScreenshot();
914  }
915 
916  imageMap[QStringLiteral(u"screenshotfile")] = screenshotfile;
917  imageMap[QStringLiteral(u"screenshot")] = screenshotfile;
918 
919  QString bannerfile;
920  if (IsHostSet() && !GetBanner().startsWith(u'/')
921  && !GetBanner().isEmpty())
922  {
923  bannerfile = generate_file_url(QStringLiteral(u"Banners"), GetHost(),
924  GetBanner());
925  }
926  else
927  {
928  bannerfile = GetBanner();
929  }
930 
931  imageMap[QStringLiteral(u"bannerfile")] = bannerfile;
932  imageMap[QStringLiteral(u"banner")] = bannerfile;
933 
934  QString fanartfile;
935  if (IsHostSet() && !GetFanart().startsWith('/')
936  && !GetFanart().isEmpty())
937  {
938  fanartfile = generate_file_url(QStringLiteral(u"Fanart"), GetHost(),
939  GetFanart());
940  }
941  else
942  {
943  fanartfile = GetFanart();
944  }
945 
946  imageMap[QStringLiteral(u"fanartfile")] = fanartfile;
947  imageMap[QStringLiteral(u"fanart")] = fanartfile;
948 
949  QString smartimage = coverfile;
950  if (!screenshotfile.isEmpty () && (GetSeason() > 0 || GetEpisode() > 0))
951  smartimage = screenshotfile;
952  imageMap[QStringLiteral(u"smartimage")] = smartimage;
953 }
954 
955 // This should be the equivalent of GetImageMap, only the image names
956 // are computed one at a time as needed.
957 QString VideoMetadataImp::GetImage(const QString& name) const
958 {
959  if ((name == QStringLiteral(u"coverfile")) ||
960  (name == QStringLiteral(u"coverart")))
961  {
962  QString coverfile = GetCoverFile();
963  if (IsHostSet()
964  && !coverfile.startsWith(u'/')
965  && !coverfile.isEmpty()
966  && !IsDefaultCoverFile(coverfile))
967  return generate_file_url(QStringLiteral(u"Coverart"), GetHost(),
968  coverfile);
969  return coverfile;
970  }
971 
972  if ((name == QStringLiteral(u"screenshotfile")) ||
973  (name == QStringLiteral(u"screenshot")))
974  {
975  QString screenshot = GetScreenshot();
976  if (IsHostSet() && !screenshot.startsWith(u'/')
977  && !screenshot.isEmpty())
978  return generate_file_url(QStringLiteral(u"Screenshots"),
979  GetHost(), screenshot);
980  return screenshot;
981  }
982 
983  if ((name == QStringLiteral(u"bannerfile")) ||
984  (name == QStringLiteral(u"banner")))
985  {
986  QString bannerfile = GetBanner();
987  if (IsHostSet() && !bannerfile.startsWith(u'/')
988  && !bannerfile.isEmpty())
989  return generate_file_url(QStringLiteral(u"Banners"), GetHost(),
990  bannerfile);
991  return bannerfile;
992  }
993 
994  if ((name == QStringLiteral(u"fanartfile")) ||
995  (name == QStringLiteral(u"fanart")))
996  {
997  QString fanartfile = GetFanart();
998  if (IsHostSet() && !fanartfile.startsWith('/')
999  && !fanartfile.isEmpty())
1000  return generate_file_url(QStringLiteral(u"Fanart"), GetHost(),
1001  fanartfile);
1002  return fanartfile;
1003  }
1004 
1005  if ((name == QStringLiteral(u"smartimage")) ||
1006  (name == QStringLiteral(u"buttonimage")))
1007  {
1008  if (GetSeason() > 0 || GetEpisode() > 0)
1009  {
1010  QString screenshotfile = GetImage("screenshot");
1011  if (!screenshotfile.isEmpty())
1012  return screenshotfile;
1013  }
1014  return GetImage("coverart");
1015  }
1016 
1017  return {};
1018 }
1019 
1023 namespace
1024 {
1025  QString eatBraces(const QString &title, const QString &left_brace,
1026  const QString &right_brace)
1027  {
1028  QString ret(title);
1029  bool keep_checking = true;
1030 
1031  while (keep_checking)
1032  {
1033  int left_position = ret.indexOf(left_brace);
1034  int right_position = ret.indexOf(right_brace);
1035  if (left_position == -1 || right_position == -1)
1036  {
1037  //
1038  // No matching sets of these braces left.
1039  //
1040 
1041  keep_checking = false;
1042  }
1043  else
1044  {
1045  if (left_position < right_position)
1046  {
1047  //
1048  // We have a matching set like: ( foo )
1049  //
1050 
1051  ret = ret.left(left_position) +
1052  ret.right(ret.length() - right_position - 1);
1053  }
1054  else if (left_position > right_position)
1055  {
1056  //
1057  // We have a matching set like: ) foo (
1058  //
1059 
1060  ret = ret.left(right_position) +
1061  ret.right(ret.length() - left_position - 1);
1062  }
1063  }
1064  }
1065 
1066  return ret;
1067  }
1068 }
1069 
1070 int VideoMetadata::UpdateHashedDBRecord(const QString &hash,
1071  const QString &file_name,
1072  const QString &host)
1073 {
1074  MSqlQuery query(MSqlQuery::InitCon());
1075 
1076  query.prepare("SELECT intid,filename FROM videometadata WHERE "
1077  "hash = :HASH");
1078  query.bindValue(":HASH", hash);
1079 
1080  if (!query.exec() || !query.isActive())
1081  {
1082  MythDB::DBError("Video hashed metadata update", query);
1083  return -1;
1084  }
1085 
1086  if (!query.next())
1087  return -1;
1088 
1089  int intid = query.value(0).toInt();
1090  QString oldfilename = query.value(1).toString();
1091 
1092  query.prepare("UPDATE videometadata SET filename = :FILENAME, "
1093  "host = :HOST WHERE intid = :INTID");
1094  query.bindValue(":FILENAME", file_name);
1095  query.bindValue(":HOST", host);
1096  query.bindValue(":INTID", intid);
1097 
1098  if (!query.exec() || !query.isActive())
1099  {
1100  MythDB::DBError("Video hashed metadata update (videometadata)", query);
1101  return -1;
1102  }
1103 
1104  query.prepare("UPDATE filemarkup SET filename = :FILENAME "
1105  "WHERE filename = :OLDFILENAME");
1106  query.bindValue(":FILENAME", file_name);
1107  query.bindValue(":OLDFILENAME", oldfilename);
1108 
1109  if (!query.exec() || !query.isActive())
1110  {
1111  MythDB::DBError("Video hashed metadata update (filemarkup)", query);
1112  return -1;
1113  }
1114 
1115  return intid;
1116 }
1117 
1118 QString VideoMetadata::VideoFileHash(const QString &file_name,
1119  const QString &host)
1120 {
1121  if (host.isEmpty())
1122  return FileHash(file_name);
1123 
1125  {
1126  StorageGroup sgroup("Videos", host);
1127  QString fullname = sgroup.FindFile(file_name);
1128 
1129  return FileHash(fullname);
1130  }
1131 
1132  QString url = generate_file_url("Videos", host, file_name);
1133 
1134  return RemoteFile::GetFileHash(url);
1135 }
1136 
1137 QString VideoMetadata::FilenameToMeta(const QString &file_name, int position)
1138 {
1139  // position 1 returns title, 2 returns season,
1140  // 3 returns episode, 4 returns subtitle
1141 
1142  QString cleanFilename = file_name.left(file_name.lastIndexOf('.'));
1143  static const QRegularExpression kSpaceRE { "%20" };
1144  static const QRegularExpression kUnderscoreRE { "_" };
1145  static const QRegularExpression kDotRE { "\\." };
1146  cleanFilename.replace(kSpaceRE, " ");
1147  cleanFilename.replace(kUnderscoreRE, " ");
1148  cleanFilename.replace(kDotRE, " ");
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 {"0"};
1220 
1221  return {};
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")] = StringUtil::intToPaddedString(GetSeason(), 1);
1306  metadataMap[QStringLiteral(u"episode")] = StringUtil::intToPaddedString(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"))
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 {};
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 {};
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 {};
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 {};
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 {};
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:262
VideoMetadata::toMap
void toMap(InfoMap &metadataMap)
Definition: videometadata.cpp:1276
ternarycompare.h
VideoMetadataImp::fillGenres
void fillGenres()
Definition: videometadata.cpp:494
MSqlQuery::isActive
bool isActive(void) const
Definition: mythdbcon.h:215
VideoMetadataImp::SetEpisode
void SetEpisode(int episode)
Definition: videometadata.cpp:290
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:813
VideoMetadataImp::getStudio
const QString & getStudio() const
Definition: videometadata.cpp:203
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:127
VideoMetadataImp::m_inetref
QString m_inetref
Definition: videometadata.cpp:351
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:387
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:903
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:1137
WatchedToState
QString WatchedToState(bool watched)
Definition: videoutils.cpp:267
VideoMetadataImp::getTitle
const QString & getTitle() const
Definition: videometadata.cpp:171
VideoMetadataImp::removeDir
bool removeDir(const QString &dirName)
Definition: videometadata.cpp:410
VideoMetadataImp::getFilename
const QString & getFilename() const
Definition: videometadata.cpp:236
VideoMetadataImp::SetScreenshot
void SetScreenshot(const QString &screenshot)
Definition: videometadata.cpp:257
VideoMetadataImp::m_homepage
QString m_homepage
Definition: videometadata.cpp:353
VideoMetadataImp::m_browse
bool m_browse
Definition: videometadata.cpp:383
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:129
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:188
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:237
VideoMetadataImp::SetCast
void SetCast(const cast_list &cast)
Definition: videometadata.cpp:231
VideoCountry
Definition: dbaccess.h:76
VideoMetadataListManager
Definition: videometadatalistmanager.h:10
VideoMetadataImp::SaveToDatabase
void SaveToDatabase()
Definition: videometadata.cpp:763
VideoMetadataImp::GetSeason
int GetSeason() const
Definition: videometadata.cpp:286
VideoMetadataImp::GetHomepage
const QString & GetHomepage() const
Definition: videometadata.cpp:197
VideoMetadataImp::SetCoverFile
void SetCoverFile(const QString &coverFile)
Definition: videometadata.cpp:254
RemoteFile::Exists
static bool Exists(const QString &url, struct stat *fileinfo)
Definition: remotefile.cpp:454
simple_ref_ptr
Definition: quicksp.h:24
VideoMetadataImp::SetFilename
void SetFilename(const QString &filename, const QString &sortFilename="")
Definition: videometadata.cpp:238
VideoMetadataImp::SetChildID
void SetChildID(int childID)
Definition: videometadata.cpp:272
VideoMetadataImp::m_tagline
QString m_tagline
Definition: videometadata.cpp:350
VideoCast
Definition: dbaccess.h:116
VideoMetadataImp::m_categoryID
int m_categoryID
Definition: videometadata.cpp:373
VideoMetadataImp::DeleteFile
bool DeleteFile()
Deletes the file associated with a metadata entry.
Definition: videometadata.cpp:439
StorageGroup::FindFile
QString FindFile(const QString &filename)
Definition: storagegroup.cpp:597
VideoMetadataImp::SetGenres
void SetGenres(const genre_list &genres)
Definition: videometadata.cpp:222
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:352
VideoMetadataImp::SetProcessed
void SetProcessed(bool processed)
Definition: videometadata.cpp:314
VideoMetadataImp::GetScreenshot
const QString & GetScreenshot() const
Definition: videometadata.cpp:256
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:234
VideoMetadata::SetEpisode
void SetEpisode(int episode)
Definition: videometadata.cpp:1717
VideoMetadataImp::SetPlayCommand
void SetPlayCommand(const QString &playCommand)
Definition: videometadata.cpp:213
VideoMetadata::SetBanner
void SetBanner(const QString &banner)
Definition: videometadata.cpp:1882
VideoMetadataImp::UpdateDatabase
void UpdateDatabase()
Definition: videometadata.cpp:768
VideoMetadataImp::GetHost
const QString & GetHost() const
Definition: videometadata.cpp:233
VideoMetadata::SetUserRating
void SetUserRating(float userRating)
Definition: videometadata.cpp:1667
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:204
GetDisplayLength
QString GetDisplayLength(std::chrono::minutes length)
Definition: videoutils.cpp:150
VideoMetadataImp::m_childID
int m_childID
Definition: videometadata.cpp:374
GetDisplayProcessed
QString GetDisplayProcessed(bool processed)
Definition: videoutils.cpp:182
VideoMetadata::country_list
std::vector< country_entry > country_list
Definition: videometadata.h:33
ContentTypeFromString
VideoContentType ContentTypeFromString(const QString &type)
Definition: videoutils.cpp:277
VideoMetadataImp::SetFanart
void SetFanart(const QString &fanart)
Definition: videometadata.cpp:263
VideoMetadataImp::GetLength
std::chrono::minutes GetLength() const
Definition: videometadata.cpp:280
VideoMetadataImp::sortBefore
bool sortBefore(const VideoMetadataImp *rhs) const
Returns true if the object should appear before the argument.
Definition: videometadata.cpp:400
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:619
VideoMetadataListManager::byFilename
VideoMetadataPtr byFilename(const QString &file_name) const
Definition: videometadatalistmanager.cpp:174
VideoMetadataImp::SetYear
void SetYear(int year)
Definition: videometadata.cpp:275
VideoMetadata::GetPlayCommand
const QString & GetPlayCommand() const
Definition: videometadata.cpp:1792
ContentTypeToString
QString ContentTypeToString(VideoContentType type)
Definition: videoutils.cpp:295
VideoMetadataImp::cast_list
VideoMetadata::cast_list cast_list
Definition: videometadata.cpp:31
VideoMetadataImp::SetWatched
void SetWatched(bool watched)
Definition: videometadata.cpp:305
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:39
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:361
VideoMetadataImp::SetTagline
void SetTagline(const QString &tagline)
Definition: videometadata.cpp:189
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:360
VideoMetadataImp::m_category
QString m_category
Definition: videometadata.cpp:359
VideoMetadataImp::ensureSortFields
void ensureSortFields(void)
Definition: videometadata.cpp:156
VideoMetadata::GetCategoryID
int GetCategoryID() const
Definition: videometadata.cpp:1937
VideoMetadataImp::updateGenres
void updateGenres()
Definition: videometadata.cpp:822
VideoMetadata::GetScreenshot
const QString & GetScreenshot() const
Definition: videometadata.cpp:1867
VideoMetadataImp::SetBanner
void SetBanner(const QString &banner)
Definition: videometadata.cpp:260
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:248
VideoMetadataImp::m_coverfile
QString m_coverfile
Definition: videometadata.cpp:367
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:357
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:230
tmp
static guint32 * tmp
Definition: goom_core.cpp:26
VideoMetadataImp::m_director
QString m_director
Definition: videometadata.cpp:354
dbaccess.h
VideoMetadataImp::SetDirector
void SetDirector(const QString &director)
Definition: videometadata.cpp:201
VideoMetadataImp::GetID
unsigned int GetID() const
Definition: videometadata.cpp:307
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
VideoMetadataImp::m_sortFilename
QString m_sortFilename
Definition: videometadata.cpp:364
VideoMetadataImp::SetRating
void SetRating(const QString &rating)
Definition: videometadata.cpp:210
VideoMetadataImp::SetContentType
void SetContentType(VideoContentType contenttype)
Definition: videometadata.cpp:317
VideoMetadata::SetInsertdate
void SetInsertdate(QDate date)
Definition: videometadata.cpp:1727
VideoMetadataImp::getDirector
const QString & getDirector() const
Definition: videometadata.cpp:200
VideoGenreMap::getGenreMap
static VideoGenreMap & getGenreMap()
Definition: dbaccess.cpp:543
VideoMetadataImp::GetEpisode
int GetEpisode() const
Definition: videometadata.cpp:289
MythCoreContext::IsMasterBackend
bool IsMasterBackend(void)
is this the actual MBE process
Definition: mythcorecontext.cpp:695
VideoMetadataImp::VideoMetadataImp
VideoMetadataImp(MSqlQuery &query)
Definition: videometadata.cpp:88
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:278
GetDisplayRating
QString GetDisplayRating(const QString &rating)
Definition: videoutils.cpp:205
VideoMetadata::GetCountries
const country_list & GetCountries() const
Definition: videometadata.cpp:1927
VideoMetadataImp::m_hash
QString m_hash
Definition: videometadata.cpp:365
VideoGenre::getGenre
static VideoGenre & getGenre()
Definition: dbaccess.cpp:515
mythlogging.h
VideoMetadataImp::GetBanner
const QString & GetBanner() const
Definition: videometadata.cpp:259
VideoMetadataImp::m_season
int m_season
Definition: videometadata.cpp:379
VideoMetadata::GetCategory
const QString & GetCategory() const
Definition: videometadata.cpp:1897
VideoMetadataImp::m_title
QString m_title
Definition: videometadata.cpp:346
ParentalLevel::plNone
@ plNone
Definition: parentalcontrols.h:12
VideoMetadata::GetProcessed
bool GetProcessed() const
Definition: videometadata.cpp:1772
GetDisplayUserRating
QString GetDisplayUserRating(float userrating)
Definition: videoutils.cpp:145
MultiValue::add
int add(int id, int value)
Definition: dbaccess.cpp:445
remotefile.h
VideoMetadataImp::m_fanart
QString m_fanart
Definition: videometadata.cpp:370
VideoMetadataImp::genre_list
VideoMetadata::genre_list genre_list
Definition: videometadata.cpp:29
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:376
VideoMetadataImp::SetID
void SetID(int id)
Definition: videometadata.cpp:308
VideoMetadata::GetContentType
VideoContentType GetContentType() const
Definition: videometadata.cpp:1782
globals.h
VideoMetadataImp::fillCountries
void fillCountries()
Definition: videometadata.cpp:512
VideoMetadataImp::getPlot
const QString & getPlot() const
Definition: videometadata.cpp:206
VideoMetadataImp::m_length
std::chrono::minutes m_length
Definition: videometadata.cpp:377
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:551
VideoMetadataImp::GetBrowse
bool GetBrowse() const
Definition: videometadata.cpp:301
VideoMetadata::UpdateHashedDBRecord
static int UpdateHashedDBRecord(const QString &hash, const QString &file_name, const QString &host)
Definition: videometadata.cpp:1070
GetDisplayCountries
QString GetDisplayCountries(const VideoMetadata &item)
Definition: videoutils.cpp:219
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:226
VideoMetadataImp::SetCategoryID
void SetCategoryID(int id)
Definition: videometadata.cpp:797
VideoMetadata::SaveToDatabase
void SaveToDatabase()
Definition: videometadata.cpp:1947
VideoMetadataImp::getSortSubtitle
const QString & getSortSubtitle() const
Definition: videometadata.cpp:181
VideoMetadataImp::DeleteFromDatabase
bool DeleteFromDatabase()
Definition: videometadata.cpp:773
VideoMetadataImp::m_playcount
int m_playcount
Definition: videometadata.cpp:378
VideoMetadataImp::m_screenshot
QString m_screenshot
Definition: videometadata.cpp:368
hardwareprofile.scan.rating
def rating(profile, smoonURL, gate)
Definition: scan.py:37
VideoMetadataImp::SetBrowse
void SetBrowse(bool browse)
Definition: videometadata.cpp:302
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:160
VideoMetadata::GetCollectionRef
int GetCollectionRef() const
Definition: videometadata.cpp:1612
VideoMetadataImp::fromDBRow
void fromDBRow(MSqlQuery &query)
Sets metadata from a DB row.
Definition: videometadata.cpp:552
VIDEO_COVERFILE_DEFAULT
const QString VIDEO_COVERFILE_DEFAULT
Definition: globals.cpp:25
VideoMetadataImp::getGenres
const genre_list & getGenres() const
Definition: videometadata.cpp:221
VideoMetadataImp::SetCollectionRef
void SetCollectionRef(int collectionref)
Definition: videometadata.cpp:195
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:384
VideoMetadata::DeleteFromDatabase
bool DeleteFromDatabase()
Definition: videometadata.cpp:1957
stringutil.h
VideoMetadataImp::m_sortSubtitle
QString m_sortSubtitle
Definition: videometadata.cpp:349
VIDEO_PLOT_DEFAULT
const QString VIDEO_PLOT_DEFAULT
Definition: globals.cpp:32
RemoteFile::GetFileHash
static QString GetFileHash(const QString &url)
Definition: remotefile.cpp:546
VideoCastMap
Definition: dbaccess.h:126
GetDisplayBrowse
QString GetDisplayBrowse(bool browse)
Definition: videoutils.cpp:158
VideoMetadataImp::m_cast
cast_list m_cast
Definition: videometadata.cpp:362
VideoMetadata::GetYear
int GetYear() const
Definition: videometadata.cpp:1582
kContentTelevision
@ kContentTelevision
Definition: metadatacommon.h:62
VideoMetadataImp::GetContentType
VideoContentType GetContentType() const
Definition: videometadata.cpp:316
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:173
VideoMetadata::GetSortFilename
const QString & GetSortFilename() const
Definition: videometadata.cpp:1817
VideoMetadataImp::GetInetRef
const QString & GetInetRef() const
Definition: videometadata.cpp:191
VideoMetadataImp::m_filename
QString m_filename
Definition: videometadata.cpp:363
VideoMetadataImp::GetCountries
const country_list & GetCountries() const
Definition: videometadata.cpp:224
VideoMetadata::SetPrefix
void SetPrefix(const QString &prefix)
Definition: videometadata.cpp:1537
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:1907
VideoMetadataImp::m_trailer
QString m_trailer
Definition: videometadata.cpp:366
RemoteFile::DeleteFile
static bool DeleteFile(const QString &url)
Definition: remotefile.cpp:411
VideoCategory::GetCategory
static VideoCategory & GetCategory()
Definition: dbaccess.cpp:487
VideoMetadata::SetSubtitle
void SetSubtitle(const QString &subtitle, const QString &sortSubtitle="")
Definition: videometadata.cpp:1567
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:369
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:55
VideoMetadataImp::GetPlayCount
unsigned int GetPlayCount() const
Definition: videometadata.cpp:283
VideoMetadata::GetPrefix
const QString & GetPrefix() const
Definition: videometadata.cpp:1532
VideoMetadataImp::m_year
int m_year
Definition: videometadata.cpp:375
VideoMetadataImp::m_contenttype
VideoContentType m_contenttype
Definition: videometadata.cpp:388
VideoMetadataImp::GetChildID
int GetChildID() const
Definition: videometadata.cpp:271
VideoMetadata::FillDataFromFilename
bool FillDataFromFilename(const VideoMetadataListManager &cache)
Definition: videometadata.cpp:1979
VideoMetadataImp::SetInsertdate
void SetInsertdate(QDate date)
Definition: videometadata.cpp:293
VideoMetadataImp::SetPlot
void SetPlot(const QString &plot)
Definition: videometadata.cpp:207
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:843
VideoMetadataImp::SetUserRating
void SetUserRating(float userRating)
Definition: videometadata.cpp:311
VideoMetadataImp::GetImage
QString GetImage(const QString &name) const
Definition: videometadata.cpp:957
VideoMetadataImp::m_insertdate
QDate m_insertdate
Definition: videometadata.cpp:381
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:233
IsDefaultCoverFile
bool IsDefaultCoverFile(const QString &coverfile)
Definition: videoutils.cpp:121
VideoMetadataImp::m_showlevel
ParentalLevel::Level m_showlevel
Definition: videometadata.cpp:382
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:253
VideoMetadataImp::operator=
VideoMetadataImp & operator=(const VideoMetadataImp &rhs)
Definition: videometadata.cpp:99
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:348
VideoMetadataImp::GetCategory
const QString & GetCategory() const
Definition: videometadata.cpp:218
VideoMetadataImp::SetPlayCount
void SetPlayCount(int playcount)
Definition: videometadata.cpp:284
VideoMetadataImp::GetHash
const QString & GetHash() const
Definition: videometadata.cpp:247
VideoMetadataImp::saveToDatabase
void saveToDatabase()
Definition: videometadata.cpp:609
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:310
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:251
VideoMetadataImp::SetHomepage
void SetHomepage(const QString &homepage)
Definition: videometadata.cpp:198
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:281
VideoMetadataImp::getSortTitle
const QString & getSortTitle() const
Definition: videometadata.cpp:172
mythcorecontext.h
VideoMetadataImp::getPlayCommand
const QString & getPlayCommand() const
Definition: videometadata.cpp:212
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:889
VIDEO_RATING_DEFAULT
const QString VIDEO_RATING_DEFAULT
Definition: globals.cpp:30
VideoMetadataImp::Reset
void Reset()
Definition: videometadata.cpp:470
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:380
VideoMetadata::GetState
QString GetState(const QString &name) const
Definition: videometadata.cpp:1435
VideoMetadataImp::GetTrailer
const QString & GetTrailer() const
Definition: videometadata.cpp:250
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:225
VideoMetadata::SetStudio
void SetStudio(const QString &studio)
Definition: videometadata.cpp:1647
VideoMetadataImp::IsHostSet
bool IsHostSet() const
Definition: videometadata.cpp:489
mythcontext.h
VideoMetadataImp::m_studio
QString m_studio
Definition: videometadata.cpp:355
VideoMetadataImp::GetPrefix
const QString & GetPrefix() const
Definition: videometadata.cpp:168
VideoMetadataImp::SetSubtitle
void SetSubtitle(const QString &subtitle, const QString &sortSubtitle="")
Definition: videometadata.cpp:182
MultiValue::remove
void remove(int id, int value)
Definition: dbaccess.cpp:455
VideoMetadataImp
Definition: videometadata.cpp:26
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:391
VideoMetadata::SetBrowse
void SetBrowse(bool browse)
Definition: videometadata.cpp:1757
VideoMetadataImp::VideoMetadataImp
VideoMetadataImp(const VideoMetadataImp &other)
Definition: videometadata.cpp:94
VideoMetadataImp::m_userrating
float m_userrating
Definition: videometadata.cpp:386
VideoMetadataImp::getReleaseDate
QDate getReleaseDate() const
Definition: videometadata.cpp:277
VideoMetadataImp::getYear
int getYear() const
Definition: videometadata.cpp:274
VideoMetadata::GetID
unsigned int GetID() const
Definition: videometadata.cpp:1732
VideoMetadata::SetYear
void SetYear(int year)
Definition: videometadata.cpp:1587
VideoMetadata::GetSortTitle
const QString & GetSortTitle() const
Definition: videometadata.cpp:1547
VideoMetadataImp::GetShowLevel
ParentalLevel::Level GetShowLevel() const
Definition: videometadata.cpp:295
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:212
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:385
VideoMetadata::GetTrailer
const QString & GetTrailer() const
Definition: videometadata.cpp:1847
VideoMetadataImp::country_list
VideoMetadata::country_list country_list
Definition: videometadata.cpp:30
VideoMetadataImp::SetShowLevel
void SetShowLevel(ParentalLevel::Level showLevel)
Definition: videometadata.cpp:296
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:721
VideoCastMap::getCastMap
static VideoCastMap & getCastMap()
Definition: dbaccess.cpp:573
VIDEO_YEAR_DEFAULT
static constexpr uint16_t VIDEO_YEAR_DEFAULT
Definition: videometadata.h:18
VideoMetadata::GetImage
QString GetImage(const QString &name) const
Definition: videometadata.cpp:1453
TrailerToState
QString TrailerToState(const QString &trailerFile)
Definition: videoutils.cpp:257
VideoMetadataImp::updateCast
void updateCast()
Definition: videometadata.cpp:864
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:313
VideoMetadataImp::GetInsertdate
QDate GetInsertdate() const
Definition: videometadata.cpp:292
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:209
VideoMetadata::Reset
void Reset()
Resets to default metadata.
Definition: videometadata.cpp:2000
VideoMetadataImp::GetCollectionRef
int GetCollectionRef() const
Definition: videometadata.cpp:194
VideoMetadata::MetadataGetStateCb
static QString MetadataGetStateCb(const QString &name, void *data)
Definition: videometadata.cpp:1524
VideoMetadataImp::SetInetRef
void SetInetRef(const QString &inetRef)
Definition: videometadata.cpp:192
VideoMetadata::GetTagline
const QString & GetTagline() const
Definition: videometadata.cpp:1572
VideoMetadataImp::GetWatched
bool GetWatched() const
Definition: videometadata.cpp:304
VideoMetadataImp::SetStudio
void SetStudio(const QString &studio)
Definition: videometadata.cpp:204
VideoMetadata::GetBrowse
bool GetBrowse() const
Definition: videometadata.cpp:1752
VideoMetadataImp::SetSeason
void SetSeason(int season)
Definition: videometadata.cpp:287
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:1118
VideoMetadataImp::getSubtitle
const QString & getSubtitle() const
Definition: videometadata.cpp:180
FileHash
QString FileHash(const QString &filename)
Definition: mythmiscutil.cpp:548
GetDisplayWatched
QString GetDisplayWatched(bool watched)
Definition: videoutils.cpp:170
VideoMetadataImp::m_plot
QString m_plot
Definition: videometadata.cpp:356
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:34
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:226
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:885
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:358
VideoMetadataImp::m_sortTitle
QString m_sortTitle
Definition: videometadata.cpp:347
VideoMetadataImp::m_host
QString m_host
Definition: videometadata.cpp:371
VideoMetadataImp::SetPrefix
void SetPrefix(const QString &prefix)
Definition: videometadata.cpp:169
simple_ref_ptr::get
T * get() const
Definition: quicksp.h:73
VideoMetadataImp::fillCast
void fillCast()
Definition: videometadata.cpp:530
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:200
VideoMetadataImp::GetCategoryID
int GetCategoryID() const
Definition: videometadata.cpp:265
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:838
ClearMap
void ClearMap(InfoMap &metadataMap)
Definition: videometadata.cpp:1458
VideoMetadataListManager::byID
VideoMetadataPtr byID(unsigned int db_id) const
Definition: videometadatalistmanager.cpp:180
VIDEO_DIRECTOR_UNKNOWN
const QString VIDEO_DIRECTOR_UNKNOWN
Definition: globals.cpp:9