MythTV  master
videometadata.cpp
Go to the documentation of this file.
1 #include <algorithm>
2 #include <cmath> // for isnan()
3 
4 #include <QDir>
5 #include <QFile>
6 #include <QFileInfo>
7 #include <QRegularExpression>
8 
9 #include "libmyth/mythcontext.h"
11 #include "libmythbase/mythdate.h"
12 #include "libmythbase/mythdb.h"
14 #include "libmythbase/mythmiscutil.h"// for FileHash
16 #include "libmythbase/remotefile.h"
17 #include "libmythbase/remoteutil.h"
19 #include "libmythbase/stringutil.h"
21 
22 #include "dbaccess.h"
23 #include "globals.h"
25 #include "videoutils.h"
26 
28 {
29  public:
33 
34  public:
35  VideoMetadataImp(QString filename, QString sortFilename,
36  QString hash, QString trailer,
37  QString coverfile, QString screenshot, QString banner,
38  QString fanart, const QString &title, QString sortTitle,
39  const QString &subtitle, QString sortSubtitle,
40  QString tagline, int year, const QDate releasedate,
41  QString inetref, int collectionref, QString homepage,
42  QString director, QString studio,
43  QString plot, float userrating,
44  QString rating, int length, int playcount,
45  int season, int episode, const QDate insertdate,
46  int id, ParentalLevel::Level showlevel, int categoryID,
47  int childID, bool browse, bool watched,
48  QString playcommand, QString category,
49  genre_list genres,
50  country_list countries,
51  cast_list cast,
52  QString host = "",
53  bool processed = false,
54  VideoContentType contenttype = kContentUnknown) :
55  m_title(title), m_sortTitle(std::move(sortTitle)), m_subtitle(subtitle),
56  m_sortSubtitle(std::move(sortSubtitle)), m_tagline(std::move(tagline)),
57  m_inetref(std::move(inetref)), m_collectionref(collectionref),
58  m_homepage(std::move(homepage)), m_director(std::move(director)),
59  m_studio(std::move(studio)), m_plot(std::move(plot)),
60  m_rating(std::move(rating)), m_playcommand(std::move(playcommand)),
61  m_category(std::move(category)), m_genres(std::move(genres)),
62  m_countries(std::move(countries)), m_cast(std::move(cast)),
63  m_filename(std::move(filename)), m_sortFilename(std::move(sortFilename)),
64  m_hash(std::move(hash)), m_trailer(std::move(trailer)),
65  m_coverfile(std::move(coverfile)), m_screenshot(std::move(screenshot)),
66  m_banner(std::move(banner)), m_fanart(std::move(fanart)),
67  m_host(std::move(host)), m_categoryID(categoryID), m_childID(childID),
68  m_year(year), m_releasedate(releasedate), m_length(length), m_playcount(playcount),
69  m_season(season), m_episode(episode), m_insertdate(insertdate), m_showlevel(showlevel),
70  m_browse(browse), m_watched(watched), m_id(id),
71  m_userrating(userrating), m_processed(processed),
72  m_contenttype(contenttype)
73  {
74  // Try to glean data if none provided.
75  if (title.isEmpty() and subtitle.isEmpty()
76  and season == 0 and episode == 0)
77  {
82  }
83 
85 
87  }
88 
89  explicit VideoMetadataImp(MSqlQuery &query)
90  {
91  fromDBRow(query);
93  }
94 
96  {
97  *this = other;
98  }
99 
101  {
102  if (this != &rhs)
103  {
104  m_title = rhs.m_title;
105  m_sortTitle = rhs.m_sortTitle;
106  m_subtitle = rhs.m_subtitle;
108  m_tagline = rhs.m_tagline;
109  m_inetref = rhs.m_inetref;
111  m_homepage = rhs.m_homepage;
112  m_director = rhs.m_director;
113  m_studio = rhs.m_studio;
114  m_plot = rhs.m_plot;
115  m_rating = rhs.m_rating;
117  m_category = rhs.m_category;
118  m_genres = rhs.m_genres;
119  m_countries = rhs.m_countries;
120  m_cast = rhs.m_cast;
121  m_filename = rhs.m_filename;
123  m_hash = rhs.m_hash;
124  m_trailer = rhs.m_trailer;
125  m_coverfile = rhs.m_coverfile;
127  m_banner = rhs.m_banner;
128  m_fanart = rhs.m_fanart;
129 
131  m_childID = rhs.m_childID;
132  m_year = rhs.m_year;
134  m_length = rhs.m_length;
135  m_playcount = rhs.m_playcount;
136  m_season = rhs.m_season;
137  m_episode = rhs.m_episode;
139  m_showlevel = rhs.m_showlevel;
140  m_browse = rhs.m_browse;
141  m_watched = rhs.m_watched;
142  m_id = rhs.m_id;
144  m_host = rhs.m_host;
145  m_processed = rhs.m_processed;
147 
148  // No DB vars
149  m_prefix = rhs.m_prefix;
150 
152  }
153 
154  return *this;
155  }
156 
157  void ensureSortFields(void)
158  {
159  std::shared_ptr<MythSortHelper>sh = getMythSortHelper();
160  if (m_sortTitle.isEmpty() and not m_title.isEmpty())
161  m_sortTitle = sh->doTitle(m_title);
162  if (m_sortSubtitle.isEmpty() and not m_subtitle.isEmpty())
164  if (m_sortFilename.isEmpty() and not m_filename.isEmpty())
166  }
167 
168  public:
169  const QString &GetPrefix() const { return m_prefix; }
170  void SetPrefix(const QString &prefix) { m_prefix = prefix; }
171 
172  const QString &getTitle() const { return m_title; }
173  const QString &getSortTitle() const { return m_sortTitle; }
174  void SetTitle(const QString& title, const QString& sortTitle = "")
175  {
176  m_title = title;
177  m_sortTitle = sortTitle;
179  }
180 
181  const QString &getSubtitle() const { return m_subtitle; }
182  const QString &getSortSubtitle() const { return m_sortSubtitle; }
183  void SetSubtitle(const QString &subtitle, const QString &sortSubtitle = "") {
184  m_subtitle = subtitle;
185  m_sortSubtitle = sortSubtitle;
187  }
188 
189  const QString &GetTagline() const { return m_tagline; }
190  void SetTagline(const QString &tagline) { m_tagline = tagline; }
191 
192  const QString &GetInetRef() const { return m_inetref; }
193  void SetInetRef(const QString &inetRef) { m_inetref = inetRef; }
194 
195  int GetCollectionRef() const { return m_collectionref; }
196  void SetCollectionRef(int collectionref) { m_collectionref = collectionref; }
197 
198  const QString &GetHomepage() const { return m_homepage; }
199  void SetHomepage(const QString &homepage) { m_homepage = homepage; }
200 
201  const QString &getDirector() const { return m_director; }
202  void SetDirector(const QString &director) { m_director = director; }
203 
204  const QString &getStudio() const { return m_studio; }
205  void SetStudio(const QString &studio) { m_studio = studio; }
206 
207  const QString &getPlot() const { return m_plot; }
208  void SetPlot(const QString &plot) { m_plot = plot; }
209 
210  const QString &GetRating() const { return m_rating; }
211  void SetRating(const QString &rating) { m_rating = rating; }
212 
213  const QString &getPlayCommand() const { return m_playcommand; }
214  void SetPlayCommand(const QString &playCommand)
215  {
216  m_playcommand = playCommand;
217  }
218 
219  const QString &GetCategory() const { return m_category; }
220 // void SetCategory(const QString &category) { m_category = category; }
221 
222  const genre_list &getGenres() const { return m_genres; }
223  void SetGenres(const genre_list &genres) { m_genres = genres; }
224 
225  const country_list &GetCountries() const { return m_countries; }
226  void SetCountries(const country_list &countries)
227  {
228  m_countries = countries;
229  }
230 
231  const cast_list &GetCast() const { return m_cast; }
232  void SetCast(const cast_list &cast) { m_cast = cast; }
233 
234  const QString &GetHost() const { return m_host; }
235  void SetHost(const QString &host) { m_host = host; }
236 
237  const QString &getFilename() const { return m_filename; }
238  const QString &getSortFilename() const { return m_sortFilename; }
239  void SetFilename(const QString &filename, const QString &sortFilename = "")
240  {
242  m_sortFilename = sortFilename;
244  }
245 
246  bool sortBefore(const VideoMetadataImp *rhs) const;
247 
248  const QString &GetHash() const { return m_hash; }
249  void SetHash(const QString &hash) { m_hash = hash; }
250 
251  const QString &GetTrailer() const { return m_trailer; }
252  void SetTrailer(const QString &trailer) { m_trailer = trailer; }
253 
254  const QString &GetCoverFile() const { return m_coverfile; }
255  void SetCoverFile(const QString &coverFile) { m_coverfile = coverFile; }
256 
257  const QString &GetScreenshot() const { return m_screenshot; }
258  void SetScreenshot(const QString &screenshot) { m_screenshot = screenshot; }
259 
260  const QString &GetBanner() const { return m_banner; }
261  void SetBanner(const QString &banner) { m_banner = banner; }
262 
263  const QString &GetFanart() const { return m_fanart; }
264  void SetFanart(const QString &fanart) { m_fanart = fanart; }
265 
266  int GetCategoryID() const
267  {
268  return m_categoryID;
269  }
270  void SetCategoryID(int id);
271 
272  int GetChildID() const { return m_childID; }
273  void SetChildID(int childID) { m_childID = childID; }
274 
275  int getYear() const { return m_year; }
276  void SetYear(int year) { m_year = year; }
277 
278  QDate getReleaseDate() const { return m_releasedate; }
279  void SetReleaseDate(QDate releasedate) { m_releasedate = releasedate; }
280 
281  std::chrono::minutes GetLength() const { return m_length; }
282  void SetLength(std::chrono::minutes length) { m_length = length; }
283 
284  unsigned int GetPlayCount() const { return m_playcount; }
285  void SetPlayCount(int playcount) { m_playcount = playcount; }
286 
287  int GetSeason() const { return m_season; }
288  void SetSeason(int season) { m_season = season; }
289 
290  int GetEpisode() const { return m_episode; }
291  void SetEpisode(int episode) { m_episode = episode; }
292 
293  QDate GetInsertdate() const { return m_insertdate;}
294  void SetInsertdate(QDate date) { m_insertdate = date;}
295 
298  {
299  m_showlevel = ParentalLevel(showLevel).GetLevel();
300  }
301 
302  bool GetBrowse() const { return m_browse; }
303  void SetBrowse(bool browse) { m_browse = browse; }
304 
305  bool GetWatched() const { return m_watched; }
306  void SetWatched(bool watched) { m_watched = watched; }
307 
308  unsigned int GetID() const { return m_id; }
309  void SetID(int id) { m_id = id; }
310 
311  float GetUserRating() const { return m_userrating; }
312  void SetUserRating(float userRating) { m_userrating = userRating; }
313 
314  bool GetProcessed() const { return m_processed; }
315  void SetProcessed(bool processed) { m_processed = processed; }
316 
318  void SetContentType(VideoContentType contenttype) { m_contenttype = contenttype; }
319 
321 
322  void SaveToDatabase();
323  void UpdateDatabase();
324  bool DeleteFromDatabase();
325 
326  bool DeleteFile();
327 
328  void Reset();
329 
330  bool IsHostSet() const;
331 
332  void GetImageMap(InfoMap &imageMap) const;
333  QString GetImage(const QString &name) const;
334 
335  private:
336  void fillCountries();
337  void updateCountries();
338  void fillGenres();
339  void fillCast();
340  void updateGenres();
341  void updateCast();
342  bool removeDir(const QString &dirName);
343  void fromDBRow(MSqlQuery &query);
344  void saveToDatabase();
345 
346  private:
347  QString m_title;
348  QString m_sortTitle;
349  QString m_subtitle;
350  QString m_sortSubtitle;
351  QString m_tagline;
352  QString m_inetref;
354  QString m_homepage;
355  QString m_director;
356  QString m_studio;
357  QString m_plot;
358  QString m_rating;
359  QString m_playcommand;
360  QString m_category;
364  QString m_filename;
365  QString m_sortFilename;
366  QString m_hash;
367  QString m_trailer;
368  QString m_coverfile;
369  QString m_screenshot;
370  QString m_banner;
371  QString m_fanart;
372  QString m_host;
373 
374  int m_categoryID {0};
375  int m_childID {-1};
378  std::chrono::minutes m_length {0min};
379  int m_playcount {0};
380  int m_season {0};
381  int m_episode {0};
384  bool m_browse {true};
385  bool m_watched {false};
386  unsigned int m_id {0}; // videometadata.intid
387  float m_userrating {0.0};
388  bool m_processed {false};
390 
391  // not in DB
392  QString m_prefix;
393 };
394 
398 
402 {
404  if (cmp == 0)
406  if (cmp == 0)
407  cmp = ternary_compare(m_id, rhs->m_id);
408  return cmp < 0;
409 }
410 
411 bool VideoMetadataImp::removeDir(const QString &dirName)
412 {
413  QDir d(dirName);
414 
415  d.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
416  QFileInfoList contents = d.entryInfoList();
417  if (contents.empty())
418  {
419  return d.rmdir(dirName);
420  }
421 
422  for (const auto& entry : std::as_const(contents))
423  {
424  if (entry.isDir())
425  {
426  QString fileName = entry.fileName();
427  if (!removeDir(fileName))
428  return false;
429  }
430  else
431  {
432  if (!QFile(entry.fileName()).remove())
433  return false;
434  }
435  }
436  return d.rmdir(dirName);
437 }
438 
441 {
442  bool isremoved = false;
443 
444  if (!m_host.isEmpty())
445  {
446  QString url = generate_file_url("Videos", m_host, m_filename);
447  isremoved = RemoteFile::DeleteFile(url);
448  }
449  else
450  {
451  QFileInfo fi(m_filename);
452  if (fi.isDir())
453  {
454  isremoved = removeDir(m_filename);
455  }
456  else
457  {
458  isremoved = QFile::remove(m_filename);
459  }
460  }
461 
462  if (!isremoved)
463  {
464  LOG(VB_GENERAL, LOG_DEBUG, QString("Could not delete file: %1")
465  .arg(m_filename));
466  }
467 
468  return isremoved;
469 }
470 
472 {
473  VideoMetadataImp tmp(m_filename, QString(),
476  VIDEO_FANART_DEFAULT, QString(), QString(), QString(), QString(),
477  QString(), VIDEO_YEAR_DEFAULT,
478  QDate(), VIDEO_INETREF_DEFAULT, -1, QString(), VIDEO_DIRECTOR_DEFAULT,
479  QString(), VIDEO_PLOT_DEFAULT, 0.0,
480  VIDEO_RATING_DEFAULT, 0, 0,
481  0, 0, QDate(), m_id,
482  ParentalLevel::plLowest, 0, -1, true, false, "", "",
484  VideoMetadata::cast_list(), m_host, false);
485  tmp.m_prefix = m_prefix;
486 
487  *this = tmp;
488 }
489 
491 {
492  return !m_host.isEmpty();
493 }
494 
496 {
497  m_genres.clear();
499  VideoGenreMap::entry genres;
500  if (vgm.get(m_id, genres))
501  {
503  for (long value : genres.values)
504  {
505  // Just add empty string for no-name genres
506  QString name;
507  vg.get(value, name);
508  m_genres.emplace_back(value, name);
509  }
510  }
511 }
512 
514 {
515  m_countries.clear();
517  VideoCountryMap::entry countries;
518  if (vcm.get(m_id, countries))
519  {
521  for (long value : countries.values)
522  {
523  // Just add empty string for no-name countries
524  QString name;
525  vc.get(value, name);
526  m_countries.emplace_back(value, name);
527  }
528  }
529 }
530 
532 {
533  m_cast.clear();
535  VideoCastMap::entry cast;
536  if (vcm.get(m_id, cast))
537  {
539  for (long value : cast.values)
540  {
541  // Just add empty string for no-name cast
542  QString name;
543  vc.get(value, name);
544  m_cast.emplace_back(value, name);
545  }
546  }
547 }
548 
554 {
555  m_title = query.value(0).toString();
556  m_director = query.value(1).toString();
557  m_studio = query.value(2).toString();
558  m_plot = query.value(3).toString();
559  m_rating = query.value(4).toString();
560  m_year = query.value(5).toInt();
561  m_releasedate = query.value(6).toDate();
562  m_userrating = (float)query.value(7).toDouble();
563  if (std::isnan(m_userrating) || m_userrating < 0)
564  m_userrating = 0.0;
565  m_userrating = std::min(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  {
1220  return {"0"};
1221  }
1222 
1223  return {};
1224 }
1225 
1226 VideoMetadata::VideoMetadata(const QString &filename, const QString &sortFilename,
1227  const QString &hash, const QString &trailer, const QString &coverfile,
1228  const QString &screenshot, const QString &banner, const QString &fanart,
1229  const QString &title, const QString &sortTitle,
1230  const QString &subtitle, const QString &sortSubtitle, const QString &tagline,
1231  int year, const QDate releasedate, const QString &inetref, int collectionref,
1232  const QString &homepage, const QString &director, const QString &studio,
1233  const QString &plot, float userrating, const QString &rating,
1234  int length, int playcount, int season, int episode, const QDate insertdate,
1235  int id, ParentalLevel::Level showlevel, int categoryID,
1236  int childID, bool browse, bool watched,
1237  const QString &playcommand, const QString &category,
1238  const genre_list &genres,
1239  const country_list &countries,
1240  const cast_list &cast,
1241  const QString &host, bool processed,
1242  VideoContentType contenttype)
1243 {
1244  m_imp = new VideoMetadataImp(filename, sortFilename, hash, trailer, coverfile,
1245  screenshot, banner, fanart, title, sortTitle, subtitle,
1246  sortSubtitle, tagline, year, releasedate, inetref,
1247  collectionref, homepage, director, studio, plot, userrating, rating,
1248  length, playcount, season, episode, insertdate, id, showlevel, categoryID,
1249  childID, browse, watched, playcommand, category, genres, countries,
1250  cast, host, processed, contenttype);
1251 }
1252 
1254 {
1255  delete m_imp;
1256 }
1257 
1259  : m_imp(new VideoMetadataImp(query))
1260 {
1261 }
1262 
1263 VideoMetadata::VideoMetadata(const VideoMetadata &rhs) : m_imp(nullptr)
1264 {
1265  *this = rhs;
1266 }
1267 
1269 {
1270  if (this != &rhs)
1271  {
1272  m_imp = new VideoMetadataImp(*(rhs.m_imp));
1273  }
1274 
1275  return *this;
1276 }
1277 
1278 void VideoMetadata::toMap(InfoMap &metadataMap)
1279 {
1280  GetImageMap(metadataMap);
1281 
1282  metadataMap[QStringLiteral(u"filename")] = GetFilename();
1283  metadataMap[QStringLiteral(u"sortfilename")] = GetSortFilename();
1284  metadataMap[QStringLiteral(u"title")] = GetTitle();
1285  metadataMap[QStringLiteral(u"sorttitle")] = GetSortTitle();
1286  metadataMap[QStringLiteral(u"subtitle")] = GetSubtitle();
1287  metadataMap[QStringLiteral(u"sortsubtitle")] = GetSortSubtitle();
1288  metadataMap[QStringLiteral(u"tagline")] = GetTagline();
1289  metadataMap[QStringLiteral(u"director")] = GetDirector();
1290  metadataMap[QStringLiteral(u"studio")] = GetStudio();
1291  metadataMap[QStringLiteral(u"description0")] = metadataMap[QStringLiteral(u"description")] = GetPlot();
1292  metadataMap[QStringLiteral(u"genres")] = GetDisplayGenres(*this);
1293  metadataMap[QStringLiteral(u"countries")] = GetDisplayCountries(*this);
1294  metadataMap[QStringLiteral(u"cast")] = GetDisplayCast(*this).join(", ");
1295  metadataMap[QStringLiteral(u"rating")] = GetDisplayRating(GetRating());
1296  metadataMap[QStringLiteral(u"length")] = GetDisplayLength(GetLength());
1297  metadataMap[QStringLiteral(u"playcount")] = QString::number(GetPlayCount());
1298  metadataMap[QStringLiteral(u"year")] = GetDisplayYear(GetYear());
1299 
1300  metadataMap[QStringLiteral(u"releasedate")] = MythDate::toString(
1302 
1303  metadataMap[QStringLiteral(u"userrating")] = GetDisplayUserRating(GetUserRating());
1304 
1305  if (GetSeason() > 0 || GetEpisode() > 0)
1306  {
1307  metadataMap[QStringLiteral(u"season")] = StringUtil::intToPaddedString(GetSeason(), 1);
1308  metadataMap[QStringLiteral(u"episode")] = StringUtil::intToPaddedString(GetEpisode(), 1);
1309  QString usingSE = QStringLiteral(u"s%1e%2")
1312  metadataMap[QStringLiteral(u"s##e##")] = metadataMap[QStringLiteral(u"s00e00")] = usingSE;
1313  QString usingX = QStringLiteral(u"%1x%2")
1316  metadataMap[QStringLiteral(u"##x##")] = metadataMap[QStringLiteral(u"00x00")] = usingX;
1317  }
1318  else
1319  {
1320  metadataMap[QStringLiteral(u"s##e##")] = metadataMap[QStringLiteral(u"##x##")] = QString();
1321  metadataMap[QStringLiteral(u"s00e00")] = metadataMap[QStringLiteral(u"00x00")] = QString();
1322  metadataMap[QStringLiteral(u"season")] = metadataMap[QStringLiteral(u"episode")] = QString();
1323  }
1324 
1325  GetStateMap(metadataMap);
1326 
1327  metadataMap[QStringLiteral(u"insertdate")] = MythDate::toString(
1329  metadataMap[QStringLiteral(u"inetref")] = GetInetRef();
1330  metadataMap[QStringLiteral(u"homepage")] = GetHomepage();
1331  metadataMap[QStringLiteral(u"child_id")] = QString::number(GetChildID());
1332  metadataMap[QStringLiteral(u"browseable")] = GetDisplayBrowse(GetBrowse());
1333  metadataMap[QStringLiteral(u"watched")] = GetDisplayWatched(GetWatched());
1334  metadataMap[QStringLiteral(u"processed")] = GetDisplayProcessed(GetProcessed());
1335  metadataMap[QStringLiteral(u"category")] = GetCategory();
1336 }
1337 
1338 // This should be the equivalent of toMap, only the text strings
1339 // are computed one at a time as needed.
1340 QString VideoMetadata::GetText(const QString& name) const
1341 {
1342  if (name == QStringLiteral(u"filename"))
1343  return GetFilename();
1344  if (name == QStringLiteral(u"sortfilename"))
1345  return GetSortFilename();
1346  if (name == QStringLiteral(u"title"))
1347  return GetTitle();
1348  if (name == QStringLiteral(u"sorttitle"))
1349  return GetSortTitle();
1350  if (name == QStringLiteral(u"subtitle"))
1351  return GetSubtitle();
1352  if (name == QStringLiteral(u"sortsubtitle"))
1353  return GetSortSubtitle();
1354  if (name == QStringLiteral(u"tagline"))
1355  return GetTagline();
1356  if (name == QStringLiteral(u"director"))
1357  return GetDirector();
1358  if (name == QStringLiteral(u"studio"))
1359  return GetStudio();
1360  if ((name == QStringLiteral(u"description")) ||
1361  (name == QStringLiteral(u"description0")))
1362  return GetPlot();
1363  if (name == QStringLiteral(u"genres"))
1364  return GetDisplayGenres(*this);
1365  if (name == QStringLiteral(u"countries"))
1366  return GetDisplayCountries(*this);
1367  if (name == QStringLiteral(u"cast"))
1368  return GetDisplayCast(*this).join(", ");
1369  if (name == QStringLiteral(u"rating"))
1370  return GetDisplayRating(GetRating());
1371  if (name == QStringLiteral(u"length"))
1372  return GetDisplayLength(GetLength());
1373  if (name == QStringLiteral(u"playcount"))
1374  return QString::number(GetPlayCount());
1375  if (name == QStringLiteral(u"year"))
1376  return GetDisplayYear(GetYear());
1377 
1378  if (name == QStringLiteral(u"releasedate"))
1380 
1381  if (name == QStringLiteral(u"userrating"))
1383 
1384  if (GetSeason() > 0 || GetEpisode() > 0)
1385  {
1386  if (name == QStringLiteral(u"season"))
1388  if (name == QStringLiteral(u"episode"))
1390  if ((name == QStringLiteral(u"s##e##")) ||
1391  (name == QStringLiteral(u"s00e00")))
1392  {
1393  return QStringLiteral(u"s%1e%2")
1396  }
1397  if ((name == QStringLiteral(u"##x##")) ||
1398  (name == QStringLiteral(u"00x00")))
1399  {
1400  return QStringLiteral(u"%1x%2")
1403  }
1404  }
1405 
1406  if (name == QStringLiteral(u"insertdate"))
1407  return MythDate::toString(
1409  if (name == QStringLiteral(u"inetref"))
1410  return GetInetRef();
1411  if (name == QStringLiteral(u"homepage"))
1412  return GetHomepage();
1413  if (name == QStringLiteral(u"child_id"))
1414  return QString::number(GetChildID());
1415  if (name == QStringLiteral(u"browseable"))
1416  return GetDisplayBrowse(GetBrowse());
1417  if (name == QStringLiteral(u"watched"))
1418  return GetDisplayWatched(GetWatched());
1419  if (name == QStringLiteral(u"processed"))
1421  if (name == QStringLiteral(u"category"))
1422  return GetCategory();
1423  return {};
1424 }
1425 
1427 {
1428  stateMap[QStringLiteral(u"trailerstate")] = TrailerToState(GetTrailer());
1429  stateMap[QStringLiteral(u"userratingstate")] =
1430  QString::number((int)(GetUserRating()));
1431  stateMap[QStringLiteral(u"watchedstate")] = WatchedToState(GetWatched());
1432  stateMap[QStringLiteral(u"videolevel")] = ParentalLevelToState(GetShowLevel());
1433 }
1434 
1435 // This should be the equivalent of GetStateMap, only the state strings
1436 // are computed one at a time as needed.
1437 QString VideoMetadata::GetState(const QString& name) const
1438 {
1439  if (name == QStringLiteral(u"trailerstate"))
1440  return TrailerToState(GetTrailer());
1441  if (name == QStringLiteral(u"userratingstate"))
1442  return QString::number((int)(GetUserRating()));
1443  if (name == QStringLiteral(u"watchedstate"))
1444  return WatchedToState(GetWatched());
1445  if (name == QStringLiteral(u"videolevel"))
1447  return {};
1448 }
1449 
1451 {
1452  m_imp->GetImageMap(imageMap);
1453 }
1454 
1455 QString VideoMetadata::GetImage(const QString& name) const
1456 {
1457  return m_imp->GetImage(name);
1458 }
1459 
1460 void ClearMap(InfoMap &metadataMap)
1461 {
1462  metadataMap["coverfile"] = "";
1463  metadataMap["screenshotfile"] = "";
1464  metadataMap["bannerfile"] = "";
1465  metadataMap["fanartfile"] = "";
1466  metadataMap["filename"] = "";
1467  metadataMap["sortfilename"] = "";
1468  metadataMap["title"] = "";
1469  metadataMap["sorttitle"] = "";
1470  metadataMap["subtitle"] = "";
1471  metadataMap["sortsubtitle"] = "";
1472  metadataMap["tagline"] = "";
1473  metadataMap["director"] = "";
1474  metadataMap["studio"] = "";
1475  metadataMap["description"] = "";
1476  metadataMap["description0"] = "";
1477  metadataMap["genres"] = "";
1478  metadataMap["countries"] = "";
1479  metadataMap["cast"] = "";
1480  metadataMap["rating"] = "";
1481  metadataMap["length"] = "";
1482  metadataMap["playcount"] = "";
1483  metadataMap["year"] = "";
1484  metadataMap["releasedate"] = "";
1485  metadataMap["userrating"] = "";
1486  metadataMap["season"] = "";
1487  metadataMap["episode"] = "";
1488  metadataMap["s##e##"] = "";
1489  metadataMap["##x##"] = "";
1490  metadataMap["trailerstate"] = "";
1491  metadataMap["userratingstate"] = "";
1492  metadataMap["watchedstate"] = "";
1493  metadataMap["videolevel"] = "";
1494  metadataMap["insertdate"] = "";
1495  metadataMap["inetref"] = "";
1496  metadataMap["homepage"] = "";
1497  metadataMap["child_id"] = "";
1498  metadataMap["browseable"] = "";
1499  metadataMap["watched"] = "";
1500  metadataMap["category"] = "";
1501  metadataMap["processed"] = "";
1502 }
1503 
1504 QString VideoMetadata::MetadataGetTextCb(const QString& name, void *data)
1505 {
1506  if (data == nullptr)
1507  return {};
1508  auto *metadata = static_cast<VideoMetadata *>(data);
1509  QString result = metadata->GetText(name);
1510  if (!result.isEmpty())
1511  return result;
1512  result = metadata->GetImage(name);
1513  if (!result.isEmpty())
1514  return result;
1515  return metadata->GetState(name);
1516 }
1517 
1518 QString VideoMetadata::MetadataGetImageCb(const QString& name, void *data)
1519 {
1520  if (data == nullptr)
1521  return {};
1522  auto *metadata = static_cast<VideoMetadata *>(data);
1523  return metadata->GetImage(name);
1524 }
1525 
1526 QString VideoMetadata::MetadataGetStateCb(const QString& name, void *data)
1527 {
1528  if (data == nullptr)
1529  return {};
1530  auto *metadata = static_cast<VideoMetadata *>(data);
1531  return metadata->GetState(name);
1532 }
1533 
1534 const QString &VideoMetadata::GetPrefix() const
1535 {
1536  return m_imp->GetPrefix();
1537 }
1538 
1539 void VideoMetadata::SetPrefix(const QString &prefix)
1540 {
1542 }
1543 
1544 const QString &VideoMetadata::GetTitle() const
1545 {
1546  return m_imp->getTitle();
1547 }
1548 
1549 const QString &VideoMetadata::GetSortTitle() const
1550 {
1551  return m_imp->getSortTitle();
1552 }
1553 
1554 void VideoMetadata::SetTitle(const QString &title, const QString &sortTitle)
1555 {
1556  m_imp->SetTitle(title, sortTitle);
1557 }
1558 
1559 const QString &VideoMetadata::GetSubtitle() const
1560 {
1561  return m_imp->getSubtitle();
1562 }
1563 
1564 const QString &VideoMetadata::GetSortSubtitle() const
1565 {
1566  return m_imp->getSortSubtitle();
1567 }
1568 
1569 void VideoMetadata::SetSubtitle(const QString &subtitle, const QString &sortSubtitle)
1570 {
1571  m_imp->SetSubtitle(subtitle, sortSubtitle);
1572 }
1573 
1574 const QString &VideoMetadata::GetTagline() const
1575 {
1576  return m_imp->GetTagline();
1577 }
1578 
1579 void VideoMetadata::SetTagline(const QString &tagline)
1580 {
1581  m_imp->SetTagline(tagline);
1582 }
1583 
1585 {
1586  return m_imp->getYear();
1587 }
1588 
1590 {
1591  m_imp->SetYear(year);
1592 }
1593 
1595 {
1596  return m_imp->getReleaseDate();
1597 }
1598 
1599 void VideoMetadata::SetReleaseDate(QDate releasedate)
1600 {
1601  m_imp->SetReleaseDate(releasedate);
1602 }
1603 
1604 const QString &VideoMetadata::GetInetRef() const
1605 {
1606  return m_imp->GetInetRef();
1607 }
1608 
1609 void VideoMetadata::SetInetRef(const QString &inetRef)
1610 {
1611  m_imp->SetInetRef(inetRef);
1612 }
1613 
1615 {
1616  return m_imp->GetCollectionRef();
1617 }
1618 
1619 void VideoMetadata::SetCollectionRef(int collectionref)
1620 {
1621  m_imp->SetCollectionRef(collectionref);
1622 }
1623 
1624 const QString &VideoMetadata::GetHomepage() const
1625 {
1626  return m_imp->GetHomepage();
1627 }
1628 
1629 void VideoMetadata::SetHomepage(const QString &homepage)
1630 {
1631  m_imp->SetHomepage(homepage);
1632 }
1633 
1634 const QString &VideoMetadata::GetDirector() const
1635 {
1636  return m_imp->getDirector();
1637 }
1638 
1639 void VideoMetadata::SetDirector(const QString &director)
1640 {
1641  m_imp->SetDirector(director);
1642 }
1643 
1644 const QString &VideoMetadata::GetStudio() const
1645 {
1646  return m_imp->getStudio();
1647 }
1648 
1649 void VideoMetadata::SetStudio(const QString &studio)
1650 {
1651  m_imp->SetStudio(studio);
1652 }
1653 
1654 const QString &VideoMetadata::GetPlot() const
1655 {
1656  return m_imp->getPlot();
1657 }
1658 
1659 void VideoMetadata::SetPlot(const QString &plot)
1660 {
1661  m_imp->SetPlot(plot);
1662 }
1663 
1665 {
1666  return m_imp->GetUserRating();
1667 }
1668 
1669 void VideoMetadata::SetUserRating(float userRating)
1670 {
1671  m_imp->SetUserRating(userRating);
1672 }
1673 
1674 const QString &VideoMetadata::GetRating() const
1675 {
1676  return m_imp->GetRating();
1677 }
1678 
1679 void VideoMetadata::SetRating(const QString &rating)
1680 {
1682 }
1683 
1684 std::chrono::minutes VideoMetadata::GetLength() const
1685 {
1686  return m_imp->GetLength();
1687 }
1688 
1689 void VideoMetadata::SetLength(std::chrono::minutes length)
1690 {
1691  m_imp->SetLength(length);
1692 }
1693 
1694 unsigned int VideoMetadata::GetPlayCount() const
1695 {
1696  return m_imp->GetPlayCount();
1697 }
1698 
1700 {
1701  m_imp->SetPlayCount(count);
1702 }
1703 
1705 {
1706  return m_imp->GetSeason();
1707 }
1708 
1710 {
1711  m_imp->SetSeason(season);
1712 }
1713 
1715 {
1716  return m_imp->GetEpisode();
1717 }
1718 
1719 void VideoMetadata::SetEpisode(int episode)
1720 {
1721  m_imp->SetEpisode(episode);
1722 }
1723 
1725 {
1726  return m_imp->GetInsertdate();
1727 }
1728 
1730 {
1731  m_imp->SetInsertdate(date);
1732 }
1733 
1734 unsigned int VideoMetadata::GetID() const
1735 {
1736  return m_imp->GetID();
1737 }
1738 
1740 {
1741  m_imp->SetID(id);
1742 }
1743 
1745 {
1746  return m_imp->GetChildID();
1747 }
1748 
1749 void VideoMetadata::SetChildID(int childID)
1750 {
1751  m_imp->SetChildID(childID);
1752 }
1753 
1755 {
1756  return m_imp->GetBrowse();
1757 }
1758 
1759 void VideoMetadata::SetBrowse(bool browse)
1760 {
1761  m_imp->SetBrowse(browse);
1762 }
1763 
1765 {
1766  return m_imp->GetWatched();
1767 }
1768 
1769 void VideoMetadata::SetWatched(bool watched)
1770 {
1771  m_imp->SetWatched(watched);
1772 }
1773 
1775 {
1776  return m_imp->GetProcessed();
1777 }
1778 
1779 void VideoMetadata::SetProcessed(bool processed)
1780 {
1781  m_imp->SetProcessed(processed);
1782 }
1783 
1785 {
1786  return m_imp->GetContentType();
1787 }
1788 
1790 {
1791  m_imp->SetContentType(contenttype);
1792 }
1793 
1794 const QString &VideoMetadata::GetPlayCommand() const
1795 {
1796  return m_imp->getPlayCommand();
1797 }
1798 
1799 void VideoMetadata::SetPlayCommand(const QString &playCommand)
1800 {
1801  m_imp->SetPlayCommand(playCommand);
1802 }
1803 
1805 {
1806  return m_imp->GetShowLevel();
1807 }
1808 
1810 {
1811  m_imp->SetShowLevel(showLevel);
1812 }
1813 
1814 const QString &VideoMetadata::GetFilename() const
1815 {
1816  return m_imp->getFilename();
1817 }
1818 
1819 const QString &VideoMetadata::GetSortFilename() const
1820 {
1821  return m_imp->getSortFilename();
1822 }
1823 
1824 const QString &VideoMetadata::GetHash() const
1825 {
1826  return m_imp->GetHash();
1827 }
1828 
1829 void VideoMetadata::SetHash(const QString &hash)
1830 {
1831  m_imp->SetHash(hash);
1832 }
1833 
1834 const QString &VideoMetadata::GetHost() const
1835 {
1836  return m_imp->GetHost();
1837 }
1838 
1839 void VideoMetadata::SetHost(const QString &host)
1840 {
1841  m_imp->SetHost(host);
1842 }
1843 
1844 void VideoMetadata::SetFilename(const QString &filename, const QString &sortFilename)
1845 {
1846  m_imp->SetFilename(filename, sortFilename);
1847 }
1848 
1849 const QString &VideoMetadata::GetTrailer() const
1850 {
1851  return m_imp->GetTrailer();
1852 }
1853 
1854 void VideoMetadata::SetTrailer(const QString &trailer)
1855 {
1856  m_imp->SetTrailer(trailer);
1857 }
1858 
1859 const QString &VideoMetadata::GetCoverFile() const
1860 {
1861  return m_imp->GetCoverFile();
1862 }
1863 
1864 void VideoMetadata::SetCoverFile(const QString &coverFile)
1865 {
1866  m_imp->SetCoverFile(coverFile);
1867 }
1868 
1869 const QString &VideoMetadata::GetScreenshot() const
1870 {
1871  return m_imp->GetScreenshot();
1872 }
1873 
1874 void VideoMetadata::SetScreenshot(const QString &screenshot)
1875 {
1876  m_imp->SetScreenshot(screenshot);
1877 }
1878 
1879 const QString &VideoMetadata::GetBanner() const
1880 {
1881  return m_imp->GetBanner();
1882 }
1883 
1884 void VideoMetadata::SetBanner(const QString &banner)
1885 {
1886  m_imp->SetBanner(banner);
1887 }
1888 
1889 const QString &VideoMetadata::GetFanart() const
1890 {
1891  return m_imp->GetFanart();
1892 }
1893 
1894 void VideoMetadata::SetFanart(const QString &fanart)
1895 {
1896  m_imp->SetFanart(fanart);
1897 }
1898 
1899 const QString &VideoMetadata::GetCategory() const
1900 {
1901  return m_imp->GetCategory();
1902 }
1903 
1904 //void VideoMetadata::SetCategory(const QString &category)
1905 //{
1906 // m_imp->SetCategory(category);
1907 //}
1908 
1910 {
1911  return m_imp->getGenres();
1912 }
1913 
1915 {
1916  m_imp->SetGenres(genres);
1917 }
1918 
1920 {
1921  return m_imp->GetCast();
1922 }
1923 
1925 {
1926  m_imp->SetCast(cast);
1927 }
1928 
1930 {
1931  return m_imp->GetCountries();
1932 }
1933 
1935 {
1936  m_imp->SetCountries(countries);
1937 }
1938 
1940 {
1941  return m_imp->GetCategoryID();
1942 }
1943 
1945 {
1946  m_imp->SetCategoryID(id);
1947 }
1948 
1950 {
1951  m_imp->SaveToDatabase();
1952 }
1953 
1955 {
1956  m_imp->UpdateDatabase();
1957 }
1958 
1960 {
1961  return m_imp->DeleteFromDatabase();
1962 }
1963 
1964 #if 0
1965 bool VideoMetadata::fillDataFromID(const VideoMetadataListManager &cache)
1966 {
1967  if (m_imp->getID() == 0)
1968  return false;
1969 
1971  if (mp.get())
1972  {
1973  *this = *mp;
1974  return true;
1975  }
1976 
1977  return false;
1978 }
1979 #endif
1980 
1982 {
1983  if (m_imp->getFilename().isEmpty())
1984  return false;
1985 
1987  cache.byFilename(m_imp->getFilename());
1988  if (mp)
1989  {
1990  *this = *mp;
1991  return true;
1992  }
1993 
1994  return false;
1995 }
1996 
1998 {
1999  return m_imp->DeleteFile();
2000 }
2001 
2003 {
2004  m_imp->Reset();
2005 }
2006 
2008 {
2009  return m_imp->IsHostSet();
2010 }
2011 
2013 {
2014  return m_imp->sortBefore(rhs.m_imp);
2015 }
2016 
2017 bool operator==(const VideoMetadata& a, const VideoMetadata& b)
2018 {
2019  return a.GetFilename() == b.GetFilename();
2020 }
2021 
2022 bool operator!=(const VideoMetadata& a, const VideoMetadata& b)
2023 {
2024  return a.GetFilename() != b.GetFilename();
2025 }
VideoMetadataImp::GetFanart
const QString & GetFanart() const
Definition: videometadata.cpp:263
VideoMetadata::toMap
void toMap(InfoMap &metadataMap)
Definition: videometadata.cpp:1278
ternarycompare.h
VideoMetadataImp::fillGenres
void fillGenres()
Definition: videometadata.cpp:495
MSqlQuery::isActive
bool isActive(void) const
Definition: mythdbcon.h:215
VideoMetadataImp::SetEpisode
void SetEpisode(int episode)
Definition: videometadata.cpp:291
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:812
VideoMetadataImp::getStudio
const QString & getStudio() const
Definition: videometadata.cpp:204
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:352
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:1739
VideoMetadata::SetTrailer
void SetTrailer(const QString &trailer)
Definition: videometadata.cpp:1854
VideoMetadataImp::m_processed
bool m_processed
Definition: videometadata.cpp:388
MythDate::toString
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:93
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:902
VideoMetadata::SetPlot
void SetPlot(const QString &plot)
Definition: videometadata.cpp:1659
VideoMetadata::SetCollectionRef
void SetCollectionRef(int collectionref)
Definition: videometadata.cpp:1619
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:172
VideoMetadataImp::removeDir
bool removeDir(const QString &dirName)
Definition: videometadata.cpp:411
VideoMetadataImp::getFilename
const QString & getFilename() const
Definition: videometadata.cpp:237
VideoMetadataImp::SetScreenshot
void SetScreenshot(const QString &screenshot)
Definition: videometadata.cpp:258
VideoMetadataImp::m_homepage
QString m_homepage
Definition: videometadata.cpp:354
VideoMetadataImp::m_browse
bool m_browse
Definition: videometadata.cpp:384
VideoMetadata::GetReleaseDate
QDate GetReleaseDate() const
Definition: videometadata.cpp:1594
VideoMetadata::GetShowLevel
ParentalLevel::Level GetShowLevel() const
Definition: videometadata.cpp:1804
VideoMetadata::SetHomepage
void SetHomepage(const QString &homepage)
Definition: videometadata.cpp:1629
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:216
VideoMetadata::SetFanart
void SetFanart(const QString &fanart)
Definition: videometadata.cpp:1894
VideoMetadataImp::GetTagline
const QString & GetTagline() const
Definition: videometadata.cpp:189
mythdb.h
VideoMetadata::MetadataGetImageCb
static QString MetadataGetImageCb(const QString &name, void *data)
Definition: videometadata.cpp:1518
VideoMetadata::GetHost
const QString & GetHost() const
Definition: videometadata.cpp:1834
VideoMetadataImp::getSortFilename
const QString & getSortFilename() const
Definition: videometadata.cpp:238
VideoMetadataImp::SetCast
void SetCast(const cast_list &cast)
Definition: videometadata.cpp:232
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:287
VideoMetadataImp::GetHomepage
const QString & GetHomepage() const
Definition: videometadata.cpp:198
VideoMetadataImp::SetCoverFile
void SetCoverFile(const QString &coverFile)
Definition: videometadata.cpp:255
RemoteFile::Exists
static bool Exists(const QString &url, struct stat *fileinfo)
Definition: remotefile.cpp:460
simple_ref_ptr
Definition: quicksp.h:24
VideoMetadataImp::SetFilename
void SetFilename(const QString &filename, const QString &sortFilename="")
Definition: videometadata.cpp:239
VideoMetadataImp::SetChildID
void SetChildID(int childID)
Definition: videometadata.cpp:273
VideoMetadataImp::m_tagline
QString m_tagline
Definition: videometadata.cpp:351
VideoCast
Definition: dbaccess.h:116
VideoMetadataImp::m_categoryID
int m_categoryID
Definition: videometadata.cpp:374
VideoMetadataImp::DeleteFile
bool DeleteFile()
Deletes the file associated with a metadata entry.
Definition: videometadata.cpp:440
StorageGroup::FindFile
QString FindFile(const QString &filename)
Definition: storagegroup.cpp:597
VideoMetadataImp::SetGenres
void SetGenres(const genre_list &genres)
Definition: videometadata.cpp:223
VideoMetadata::GetInsertdate
QDate GetInsertdate() const
Definition: videometadata.cpp:1724
VideoMetadata::GetChildID
int GetChildID() const
Definition: videometadata.cpp:1744
hardwareprofile.devicelist.cat
def cat(file_name)
Definition: devicelist.py:95
VideoMetadataImp::m_collectionref
int m_collectionref
Definition: videometadata.cpp:353
VideoMetadataImp::SetProcessed
void SetProcessed(bool processed)
Definition: videometadata.cpp:315
VideoMetadataImp::GetScreenshot
const QString & GetScreenshot() const
Definition: videometadata.cpp:257
VideoMetadata::SetFilename
void SetFilename(const QString &filename, const QString &sortFilename="")
Definition: videometadata.cpp:1844
VideoMetadata::GetFanart
const QString & GetFanart() const
Definition: videometadata.cpp:1889
VideoMetadataImp::SetHost
void SetHost(const QString &host)
Definition: videometadata.cpp:235
VideoMetadata::SetEpisode
void SetEpisode(int episode)
Definition: videometadata.cpp:1719
VideoMetadataImp::SetPlayCommand
void SetPlayCommand(const QString &playCommand)
Definition: videometadata.cpp:214
VideoMetadata::SetBanner
void SetBanner(const QString &banner)
Definition: videometadata.cpp:1884
VideoMetadataImp::UpdateDatabase
void UpdateDatabase()
Definition: videometadata.cpp:768
VideoMetadataImp::GetHost
const QString & GetHost() const
Definition: videometadata.cpp:234
VideoMetadata::SetUserRating
void SetUserRating(float userRating)
Definition: videometadata.cpp:1669
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:375
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:264
VideoMetadataImp::GetLength
std::chrono::minutes GetLength() const
Definition: videometadata.cpp:281
VideoMetadataImp::sortBefore
bool sortBefore(const VideoMetadataImp *rhs) const
Returns true if the object should appear before the argument.
Definition: videometadata.cpp:401
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:618
VideoMetadataListManager::byFilename
VideoMetadataPtr byFilename(const QString &file_name) const
Definition: videometadatalistmanager.cpp:174
VideoMetadataImp::SetYear
void SetYear(int year)
Definition: videometadata.cpp:276
VideoMetadata::GetPlayCommand
const QString & GetPlayCommand() const
Definition: videometadata.cpp:1794
ContentTypeToString
QString ContentTypeToString(VideoContentType type)
Definition: videoutils.cpp:295
VideoMetadataImp::cast_list
VideoMetadata::cast_list cast_list
Definition: videometadata.cpp:32
VideoMetadataImp::SetWatched
void SetWatched(bool watched)
Definition: videometadata.cpp:306
VideoMetadata::GetHomepage
const QString & GetHomepage() const
Definition: videometadata.cpp:1624
VideoMetadata::GetSeason
int GetSeason() const
Definition: videometadata.cpp:1704
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
VideoMetadata::genre_list
std::vector< genre_entry > genre_list
Definition: videometadata.h:32
VideoMetadata::SetPlayCount
void SetPlayCount(int count)
Definition: videometadata.cpp:1699
mythsorthelper.h
VideoMetadataImp::m_countries
country_list m_countries
Definition: videometadata.cpp:362
VideoMetadataImp::SetTagline
void SetTagline(const QString &tagline)
Definition: videometadata.cpp:190
VideoMetadata::SetInetRef
void SetInetRef(const QString &inetRef)
Definition: videometadata.cpp:1609
VideoMetadata::SetShowLevel
void SetShowLevel(ParentalLevel::Level showLevel)
Definition: videometadata.cpp:1809
VideoMetadataImp::m_genres
genre_list m_genres
Definition: videometadata.cpp:361
VideoMetadataImp::m_category
QString m_category
Definition: videometadata.cpp:360
VideoMetadataImp::ensureSortFields
void ensureSortFields(void)
Definition: videometadata.cpp:157
VideoMetadata::GetCategoryID
int GetCategoryID() const
Definition: videometadata.cpp:1939
VideoMetadataImp::updateGenres
void updateGenres()
Definition: videometadata.cpp:822
VideoMetadata::GetScreenshot
const QString & GetScreenshot() const
Definition: videometadata.cpp:1869
VideoMetadataImp::SetBanner
void SetBanner(const QString &banner)
Definition: videometadata.cpp:261
VideoMetadata::SetCast
void SetCast(const cast_list &cast)
Definition: videometadata.cpp:1924
remoteutil.h
VideoMetadata::GetDirector
const QString & GetDirector() const
Definition: videometadata.cpp:1634
VideoMetadataImp::SetHash
void SetHash(const QString &hash)
Definition: videometadata.cpp:249
VideoMetadataImp::m_coverfile
QString m_coverfile
Definition: videometadata.cpp:368
hardwareprofile.distros.mythtv_data.data_mythtv.prefix
string prefix
Definition: data_mythtv.py:40
VideoMetadata::GetPlot
const QString & GetPlot() const
Definition: videometadata.cpp:1654
VideoMetadataImp::m_rating
QString m_rating
Definition: videometadata.cpp:358
VideoMetadata::GetSubtitle
const QString & GetSubtitle() const
Definition: videometadata.cpp:1559
operator==
bool operator==(const VideoMetadata &a, const VideoMetadata &b)
Definition: videometadata.cpp:2017
VideoMetadataImp::GetCast
const cast_list & GetCast() const
Definition: videometadata.cpp:231
tmp
static guint32 * tmp
Definition: goom_core.cpp:26
VideoMetadataImp::m_director
QString m_director
Definition: videometadata.cpp:355
dbaccess.h
MythSortHelper::doPathname
QString doPathname(const QString &pathname) const
Create the sortable form of an item.
Definition: mythsorthelper.cpp:196
VideoMetadataImp::SetDirector
void SetDirector(const QString &director)
Definition: videometadata.cpp:202
VideoMetadataImp::GetID
unsigned int GetID() const
Definition: videometadata.cpp:308
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
VideoMetadataImp::m_sortFilename
QString m_sortFilename
Definition: videometadata.cpp:365
VideoMetadataImp::SetRating
void SetRating(const QString &rating)
Definition: videometadata.cpp:211
VideoMetadataImp::SetContentType
void SetContentType(VideoContentType contenttype)
Definition: videometadata.cpp:318
VideoMetadata::SetInsertdate
void SetInsertdate(QDate date)
Definition: videometadata.cpp:1729
VideoMetadataImp::getDirector
const QString & getDirector() const
Definition: videometadata.cpp:201
VideoGenreMap::getGenreMap
static VideoGenreMap & getGenreMap()
Definition: dbaccess.cpp:545
VideoMetadataImp::GetEpisode
int GetEpisode() const
Definition: videometadata.cpp:290
MythCoreContext::IsMasterBackend
bool IsMasterBackend(void)
is this the actual MBE process
Definition: mythcorecontext.cpp:699
VideoMetadataImp::VideoMetadataImp
VideoMetadataImp(MSqlQuery &query)
Definition: videometadata.cpp:89
ParentalLevel::plLowest
@ plLowest
Definition: parentalcontrols.h:13
mythdate.h
VideoMetadata::GetFilename
const QString & GetFilename() const
Definition: videometadata.cpp:1814
VideoMetadata::GetInetRef
const QString & GetInetRef() const
Definition: videometadata.cpp:1604
VideoMetadataImp::SetReleaseDate
void SetReleaseDate(QDate releasedate)
Definition: videometadata.cpp:279
GetDisplayRating
QString GetDisplayRating(const QString &rating)
Definition: videoutils.cpp:205
VideoMetadata::GetCountries
const country_list & GetCountries() const
Definition: videometadata.cpp:1929
VideoMetadataImp::m_hash
QString m_hash
Definition: videometadata.cpp:366
VideoGenre::getGenre
static VideoGenre & getGenre()
Definition: dbaccess.cpp:517
mythlogging.h
MythSortHelper::doTitle
QString doTitle(const QString &title) const
Create the sortable form of an title string.
Definition: mythsorthelper.cpp:163
VideoMetadataImp::GetBanner
const QString & GetBanner() const
Definition: videometadata.cpp:260
VideoMetadataImp::m_season
int m_season
Definition: videometadata.cpp:380
VideoMetadata::GetCategory
const QString & GetCategory() const
Definition: videometadata.cpp:1899
VideoMetadataImp::m_title
QString m_title
Definition: videometadata.cpp:347
VideoMetadata::GetProcessed
bool GetProcessed() const
Definition: videometadata.cpp:1774
GetDisplayUserRating
QString GetDisplayUserRating(float userrating)
Definition: videoutils.cpp:145
MultiValue::add
int add(int id, int value)
Definition: dbaccess.cpp:447
remotefile.h
VideoMetadataImp::m_fanart
QString m_fanart
Definition: videometadata.cpp:371
VideoMetadataImp::genre_list
VideoMetadata::genre_list genre_list
Definition: videometadata.cpp:30
VideoMetadata::SetLength
void SetLength(std::chrono::minutes length)
Definition: videometadata.cpp:1689
VideoMetadataImp::m_releasedate
QDate m_releasedate
Definition: videometadata.cpp:377
VideoMetadataImp::SetID
void SetID(int id)
Definition: videometadata.cpp:309
VideoMetadata::GetContentType
VideoContentType GetContentType() const
Definition: videometadata.cpp:1784
globals.h
VideoMetadataImp::fillCountries
void fillCountries()
Definition: videometadata.cpp:513
VideoMetadataImp::getPlot
const QString & getPlot() const
Definition: videometadata.cpp:207
VideoMetadataImp::m_length
std::chrono::minutes m_length
Definition: videometadata.cpp:378
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:550
VideoMetadataImp::GetBrowse
bool GetBrowse() const
Definition: videometadata.cpp:302
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:225
VideoMetadataImp::SetCategoryID
void SetCategoryID(int id)
Definition: videometadata.cpp:797
VideoMetadata::SaveToDatabase
void SaveToDatabase()
Definition: videometadata.cpp:1949
VideoMetadataImp::getSortSubtitle
const QString & getSortSubtitle() const
Definition: videometadata.cpp:182
VideoMetadataImp::DeleteFromDatabase
bool DeleteFromDatabase()
Definition: videometadata.cpp:773
VideoMetadataImp::m_playcount
int m_playcount
Definition: videometadata.cpp:379
VideoMetadataImp::m_screenshot
QString m_screenshot
Definition: videometadata.cpp:369
hardwareprofile.scan.rating
def rating(profile, smoonURL, gate)
Definition: scan.py:37
VideoMetadataImp::SetBrowse
void SetBrowse(bool browse)
Definition: videometadata.cpp:303
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:1614
VideoMetadataImp::fromDBRow
void fromDBRow(MSqlQuery &query)
Sets metadata from a DB row.
Definition: videometadata.cpp:553
VIDEO_COVERFILE_DEFAULT
const QString VIDEO_COVERFILE_DEFAULT
Definition: globals.cpp:25
VideoMetadataImp::getGenres
const genre_list & getGenres() const
Definition: videometadata.cpp:222
VideoMetadataImp::SetCollectionRef
void SetCollectionRef(int collectionref)
Definition: videometadata.cpp:196
VideoMetadata::SetProcessed
void SetProcessed(bool processed)
Definition: videometadata.cpp:1779
operator!=
bool operator!=(const VideoMetadata &a, const VideoMetadata &b)
Definition: videometadata.cpp:2022
VideoMetadataImp::m_watched
bool m_watched
Definition: videometadata.cpp:385
VideoMetadata::DeleteFromDatabase
bool DeleteFromDatabase()
Definition: videometadata.cpp:1959
stringutil.h
VideoMetadataImp::m_sortSubtitle
QString m_sortSubtitle
Definition: videometadata.cpp:350
VIDEO_PLOT_DEFAULT
const QString VIDEO_PLOT_DEFAULT
Definition: globals.cpp:32
RemoteFile::GetFileHash
static QString GetFileHash(const QString &url)
Definition: remotefile.cpp:552
VideoCastMap
Definition: dbaccess.h:126
GetDisplayBrowse
QString GetDisplayBrowse(bool browse)
Definition: videoutils.cpp:158
VideoMetadataImp::m_cast
cast_list m_cast
Definition: videometadata.cpp:363
VideoMetadata::GetYear
int GetYear() const
Definition: videometadata.cpp:1584
VideoMetadataImp::GetContentType
VideoContentType GetContentType() const
Definition: videometadata.cpp:317
VideoMetadata::GetImageMap
void GetImageMap(InfoMap &imageMap)
Definition: videometadata.cpp:1450
VideoCountry::getCountry
static VideoCountry & getCountry()
Definition: dbaccess.cpp:503
VideoMetadataImp::SetTitle
void SetTitle(const QString &title, const QString &sortTitle="")
Definition: videometadata.cpp:174
VideoMetadata::GetSortFilename
const QString & GetSortFilename() const
Definition: videometadata.cpp:1819
VideoMetadataImp::GetInetRef
const QString & GetInetRef() const
Definition: videometadata.cpp:192
VideoMetadataImp::m_filename
QString m_filename
Definition: videometadata.cpp:364
VideoMetadataImp::GetCountries
const country_list & GetCountries() const
Definition: videometadata.cpp:225
VideoMetadata::SetPrefix
void SetPrefix(const QString &prefix)
Definition: videometadata.cpp:1539
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:27
VideoMetadata::GetGenres
const genre_list & GetGenres() const
Definition: videometadata.cpp:1909
VideoMetadataImp::m_trailer
QString m_trailer
Definition: videometadata.cpp:367
RemoteFile::DeleteFile
static bool DeleteFile(const QString &url)
Definition: remotefile.cpp:417
VideoCategory::GetCategory
static VideoCategory & GetCategory()
Definition: dbaccess.cpp:489
VideoMetadata::SetSubtitle
void SetSubtitle(const QString &subtitle, const QString &sortSubtitle="")
Definition: videometadata.cpp:1569
VIDEO_TRAILER_DEFAULT
const QString VIDEO_TRAILER_DEFAULT
Definition: globals.cpp:26
VideoMetadata::operator=
VideoMetadata & operator=(const VideoMetadata &rhs)
Definition: videometadata.cpp:1268
VideoGenre
Definition: dbaccess.h:86
VideoMetadataImp::m_banner
QString m_banner
Definition: videometadata.cpp:370
VideoMetadata::GetEpisode
int GetEpisode() const
Definition: videometadata.cpp:1714
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
VideoMetadataImp::GetPlayCount
unsigned int GetPlayCount() const
Definition: videometadata.cpp:284
VideoMetadata::GetPrefix
const QString & GetPrefix() const
Definition: videometadata.cpp:1534
VideoMetadataImp::m_year
int m_year
Definition: videometadata.cpp:376
VideoMetadataImp::m_contenttype
VideoContentType m_contenttype
Definition: videometadata.cpp:389
VideoMetadataImp::GetChildID
int GetChildID() const
Definition: videometadata.cpp:272
VideoMetadata::FillDataFromFilename
bool FillDataFromFilename(const VideoMetadataListManager &cache)
Definition: videometadata.cpp:1981
ParentalLevel::plNone
@ plNone
Definition: parentalcontrols.h:13
VideoMetadataImp::SetInsertdate
void SetInsertdate(QDate date)
Definition: videometadata.cpp:294
VideoMetadataImp::SetPlot
void SetPlot(const QString &plot)
Definition: videometadata.cpp:208
VIDEO_INETREF_DEFAULT
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
VideoMetadata::sortBefore
bool sortBefore(const VideoMetadata &rhs) const
Definition: videometadata.cpp:2012
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:312
VideoMetadataImp::GetImage
QString GetImage(const QString &name) const
Definition: videometadata.cpp:957
VideoMetadataImp::m_insertdate
QDate m_insertdate
Definition: videometadata.cpp:382
VideoMetadata::SetGenres
void SetGenres(const genre_list &genres)
Definition: videometadata.cpp:1914
VideoMetadata::GetHash
const QString & GetHash() const
Definition: videometadata.cpp:1824
VideoMetadata::SetPlayCommand
void SetPlayCommand(const QString &playCommand)
Definition: videometadata.cpp:1799
VideoMetadata::SetTagline
void SetTagline(const QString &tagline)
Definition: videometadata.cpp:1579
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:383
MythDate::fromString
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:39
VideoMetadataImp::GetCoverFile
const QString & GetCoverFile() const
Definition: videometadata.cpp:254
VideoMetadataImp::operator=
VideoMetadataImp & operator=(const VideoMetadataImp &rhs)
Definition: videometadata.cpp:100
VideoCountryMap::getCountryMap
static VideoCountryMap & getCountryMap()
Definition: dbaccess.cpp:560
VideoMetadata::SetCategoryID
void SetCategoryID(int id)
Definition: videometadata.cpp:1944
VideoMetadataImp::m_subtitle
QString m_subtitle
Definition: videometadata.cpp:349
VideoMetadataImp::GetCategory
const QString & GetCategory() const
Definition: videometadata.cpp:219
VideoMetadataImp::SetPlayCount
void SetPlayCount(int playcount)
Definition: videometadata.cpp:285
VideoMetadataImp::GetHash
const QString & GetHash() const
Definition: videometadata.cpp:248
kContentUnknown
@ kContentUnknown
Definition: metadatacommon.h:66
VideoMetadataImp::saveToDatabase
void saveToDatabase()
Definition: videometadata.cpp:609
VideoMetadata::SetSeason
void SetSeason(int season)
Definition: videometadata.cpp:1709
VideoMetadata::SetRating
void SetRating(const QString &rating)
Definition: videometadata.cpp:1679
VideoMetadataImp::GetUserRating
float GetUserRating() const
Definition: videometadata.cpp:311
mythmiscutil.h
VideoMetadata::SetCoverFile
void SetCoverFile(const QString &coverFile)
Definition: videometadata.cpp:1864
VideoMetadataImp::SetTrailer
void SetTrailer(const QString &trailer)
Definition: videometadata.cpp:252
VideoMetadataImp::SetHomepage
void SetHomepage(const QString &homepage)
Definition: videometadata.cpp:199
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:282
VideoMetadataImp::getSortTitle
const QString & getSortTitle() const
Definition: videometadata.cpp:173
mythcorecontext.h
VideoMetadataImp::getPlayCommand
const QString & getPlayCommand() const
Definition: videometadata.cpp:213
VideoMetadata::cast_list
std::vector< cast_entry > cast_list
Definition: videometadata.h:34
kContentTelevision
@ kContentTelevision
Definition: metadatacommon.h:62
VideoMetadata::SetHost
void SetHost(const QString &host)
Definition: videometadata.cpp:1839
VideoMetadata::SetDirector
void SetDirector(const QString &director)
Definition: videometadata.cpp:1639
VideoMetadata::GetText
QString GetText(const QString &name) const
Definition: videometadata.cpp:1340
VideoCast::GetCast
static VideoCast & GetCast()
Definition: dbaccess.cpp:531
VideoMetadata::GetUserRating
float GetUserRating() const
Definition: videometadata.cpp:1664
VideoMetadata::IsHostSet
bool IsHostSet() const
Definition: videometadata.cpp:2007
ParentalLevel
Definition: parentalcontrols.h:9
VideoMetadata::UpdateDatabase
void UpdateDatabase()
Definition: videometadata.cpp:1954
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:888
VIDEO_RATING_DEFAULT
const QString VIDEO_RATING_DEFAULT
Definition: globals.cpp:30
VideoMetadataImp::Reset
void Reset()
Definition: videometadata.cpp:471
VideoMetadata::GetWatched
bool GetWatched() const
Definition: videometadata.cpp:1764
MultiValue::get
bool get(int id, entry &values)
Definition: dbaccess.cpp:452
VideoMetadataImp::m_episode
int m_episode
Definition: videometadata.cpp:381
VideoMetadata::GetState
QString GetState(const QString &name) const
Definition: videometadata.cpp:1437
VideoMetadataImp::GetTrailer
const QString & GetTrailer() const
Definition: videometadata.cpp:251
VideoMetadata::SetContentType
void SetContentType(VideoContentType contenttype)
Definition: videometadata.cpp:1789
VideoMetadata::GetCoverFile
const QString & GetCoverFile() const
Definition: videometadata.cpp:1859
VideoMetadata::SetTitle
void SetTitle(const QString &title, const QString &sortTitle="")
Definition: videometadata.cpp:1554
hardwareprofile.distros.all.get
def get()
Definition: all.py:22
VideoMetadataImp::SetCountries
void SetCountries(const country_list &countries)
Definition: videometadata.cpp:226
VideoMetadata::SetStudio
void SetStudio(const QString &studio)
Definition: videometadata.cpp:1649
VideoMetadataImp::IsHostSet
bool IsHostSet() const
Definition: videometadata.cpp:490
mythcontext.h
VideoMetadataImp::m_studio
QString m_studio
Definition: videometadata.cpp:356
VideoMetadataImp::GetPrefix
const QString & GetPrefix() const
Definition: videometadata.cpp:169
VideoMetadataImp::SetSubtitle
void SetSubtitle(const QString &subtitle, const QString &sortSubtitle="")
Definition: videometadata.cpp:183
MultiValue::remove
void remove(int id, int value)
Definition: dbaccess.cpp:457
VideoMetadataImp
Definition: videometadata.cpp:27
VideoMetadata::GetLength
std::chrono::minutes GetLength() const
Definition: videometadata.cpp:1684
StorageGroup
Definition: storagegroup.h:11
VideoMetadataImp::m_prefix
QString m_prefix
Definition: videometadata.cpp:392
VideoMetadata::SetBrowse
void SetBrowse(bool browse)
Definition: videometadata.cpp:1759
VideoMetadataImp::VideoMetadataImp
VideoMetadataImp(const VideoMetadataImp &other)
Definition: videometadata.cpp:95
VideoMetadataImp::m_userrating
float m_userrating
Definition: videometadata.cpp:387
VideoMetadataImp::getReleaseDate
QDate getReleaseDate() const
Definition: videometadata.cpp:278
VideoMetadataImp::getYear
int getYear() const
Definition: videometadata.cpp:275
VideoContentType
VideoContentType
Definition: metadatacommon.h:60
VideoMetadata::GetID
unsigned int GetID() const
Definition: videometadata.cpp:1734
VideoMetadata::SetYear
void SetYear(int year)
Definition: videometadata.cpp:1589
VideoMetadata::GetSortTitle
const QString & GetSortTitle() const
Definition: videometadata.cpp:1549
VideoMetadataImp::GetShowLevel
ParentalLevel::Level GetShowLevel() const
Definition: videometadata.cpp:296
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:1226
VideoMetadata::GetTitle
const QString & GetTitle() const
Definition: videometadata.cpp:1544
VideoMetadata::SetScreenshot
void SetScreenshot(const QString &screenshot)
Definition: videometadata.cpp:1874
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:1769
VideoMetadata::SetHash
void SetHash(const QString &hash)
Definition: videometadata.cpp:1829
VideoMetadata::GetSortSubtitle
const QString & GetSortSubtitle() const
Definition: videometadata.cpp:1564
anonymous_namespace{videometadata.cpp}::eatBraces
QString eatBraces(const QString &title, const QString &left_brace, const QString &right_brace)
Definition: videometadata.cpp:1025
VideoMetadata::m_imp
class VideoMetadataImp * m_imp
Definition: videometadata.h:242
VideoMetadataImp::m_id
unsigned int m_id
Definition: videometadata.cpp:386
VideoMetadata::GetTrailer
const QString & GetTrailer() const
Definition: videometadata.cpp:1849
VideoMetadataImp::country_list
VideoMetadata::country_list country_list
Definition: videometadata.cpp:31
VideoMetadataImp::SetShowLevel
void SetShowLevel(ParentalLevel::Level showLevel)
Definition: videometadata.cpp:297
MultiValue::entry::values
values_type values
Definition: dbaccess.h:44
MythCoreContext::IsThisHost
bool IsThisHost(const QString &addr)
is this address mapped to this host
Definition: mythcorecontext.cpp:725
VideoCastMap::getCastMap
static VideoCastMap & getCastMap()
Definition: dbaccess.cpp:575
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:1455
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:1674
ParentalLevel::Level
Level
Definition: parentalcontrols.h:12
VideoMetadataImp::GetProcessed
bool GetProcessed() const
Definition: videometadata.cpp:314
VideoMetadataImp::GetInsertdate
QDate GetInsertdate() const
Definition: videometadata.cpp:293
VideoCountryMap
Definition: dbaccess.h:106
VideoMetadata::MetadataGetTextCb
static QString MetadataGetTextCb(const QString &name, void *data)
Definition: videometadata.cpp:1504
VideoMetadata::DeleteFile
bool DeleteFile()
Definition: videometadata.cpp:1997
VideoMetadata::~VideoMetadata
~VideoMetadata()
Definition: videometadata.cpp:1253
VideoMetadataImp::GetRating
const QString & GetRating() const
Definition: videometadata.cpp:210
VideoMetadata::Reset
void Reset()
Resets to default metadata.
Definition: videometadata.cpp:2002
VideoMetadataImp::GetCollectionRef
int GetCollectionRef() const
Definition: videometadata.cpp:195
VideoMetadata::MetadataGetStateCb
static QString MetadataGetStateCb(const QString &name, void *data)
Definition: videometadata.cpp:1526
VideoMetadataImp::SetInetRef
void SetInetRef(const QString &inetRef)
Definition: videometadata.cpp:193
VideoMetadata::GetTagline
const QString & GetTagline() const
Definition: videometadata.cpp:1574
VideoMetadataImp::GetWatched
bool GetWatched() const
Definition: videometadata.cpp:305
VideoMetadataImp::SetStudio
void SetStudio(const QString &studio)
Definition: videometadata.cpp:205
VideoMetadata::GetBrowse
bool GetBrowse() const
Definition: videometadata.cpp:1754
VideoMetadataImp::SetSeason
void SetSeason(int season)
Definition: videometadata.cpp:288
build_compdb.filename
filename
Definition: build_compdb.py:21
VideoMetadata::GetBanner
const QString & GetBanner() const
Definition: videometadata.cpp:1879
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:181
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:357
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:35
ParentalLevel::GetLevel
Level GetLevel() const
Definition: parentalcontrols.cpp:128
VideoMetadata::GetPlayCount
unsigned int GetPlayCount() const
Definition: videometadata.cpp:1694
GetDisplayCast
QStringList GetDisplayCast(const VideoMetadata &item)
Definition: videoutils.cpp:226
VideoMetadata::SetReleaseDate
void SetReleaseDate(QDate releasedate)
Definition: videometadata.cpp:1599
VideoMetadata::SetChildID
void SetChildID(int childID)
Definition: videometadata.cpp:1749
VideoMetadata::GetCast
const cast_list & GetCast() const
Definition: videometadata.cpp:1919
SingleValue::get
bool get(int id, QString &category)
Definition: dbaccess.cpp:221
VideoMetadata::GetStudio
const QString & GetStudio() const
Definition: videometadata.cpp:1644
VideoMetadataImp::GetImageMap
void GetImageMap(InfoMap &imageMap) const
Definition: videometadata.cpp:885
videoutils.h
VideoMetadata::SetCountries
void SetCountries(const country_list &countries)
Definition: videometadata.cpp:1934
VIDEO_DIRECTOR_DEFAULT
const QString VIDEO_DIRECTOR_DEFAULT
Definition: globals.cpp:23
kContentMovie
@ kContentMovie
Definition: metadatacommon.h:61
VideoMetadataImp::m_playcommand
QString m_playcommand
Definition: videometadata.cpp:359
VideoMetadataImp::m_sortTitle
QString m_sortTitle
Definition: videometadata.cpp:348
VideoMetadataImp::m_host
QString m_host
Definition: videometadata.cpp:372
VideoMetadataImp::SetPrefix
void SetPrefix(const QString &prefix)
Definition: videometadata.cpp:170
simple_ref_ptr::get
T * get() const
Definition: quicksp.h:73
VideoMetadataImp::fillCast
void fillCast()
Definition: videometadata.cpp:531
VideoMetadata::GetStateMap
void GetStateMap(InfoMap &stateMap) const
Definition: videometadata.cpp:1426
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:266
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:837
ClearMap
void ClearMap(InfoMap &metadataMap)
Definition: videometadata.cpp:1460
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