MythTV  master
video.cpp
Go to the documentation of this file.
1 // Program Name: video.cpp
3 // Created : Apr. 21, 2011
4 //
5 // Copyright (c) 2011 Robert McNamara <rmcnamara@mythtv.org>
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //
25 
26 #include <QList>
27 #include <QFile>
28 #include <QMutex>
29 
30 #include <cmath>
31 
32 #include "video.h"
33 
34 #include "videometadata.h"
35 #include "metadatafactory.h"
36 #include "bluraymetadata.h"
37 
38 #include "compat.h"
39 #include "mythversion.h"
40 #include "mythcorecontext.h"
41 #include "storagegroup.h"
42 #include "remotefile.h"
43 #include "globals.h"
44 #include "mythdate.h"
45 #include "serviceUtil.h"
46 #include "mythmiscutil.h"
47 
49 //
51 
53  const QString &Sort,
54  bool bDescending,
55  int nStartIndex,
56  int nCount )
57 {
58  QString fields = "title,director,studio,plot,rating,year,releasedate,"
59  "userrating,length,playcount,filename,hash,showlevel,"
60  "coverfile,inetref,collectionref,homepage,childid,browse,watched,"
61  "playcommand,category,intid,trailer,screenshot,banner,fanart,"
62  "subtitle,tagline,season,episode,host,insertdate,processed,contenttype";
63 
64  QStringList sortFields = fields.split(',');
65 
67 
68  QString sql = "";
69  if (!Folder.isEmpty())
70  sql.append(" WHERE filename LIKE '" + Folder + "%'");
71 
72  sql.append(" ORDER BY ");
73  QString sort = Sort.toLower();
74  if (sort == "added")
75  sql.append("insertdate");
76  else if (sort == "released")
77  sql.append("releasedate");
78  else if (sortFields.contains(sort))
79  sql.append(sort);
80  else
81  sql.append("intid");
82 
83  if (bDescending)
84  sql += " DESC";
86 
87  std::vector<VideoMetadataListManager::VideoMetadataPtr> videos(videolist.begin(), videolist.end());
88 
89  // ----------------------------------------------------------------------
90  // Build Response
91  // ----------------------------------------------------------------------
92 
93  DTC::VideoMetadataInfoList *pVideoMetadataInfos = new DTC::VideoMetadataInfoList();
94 
95  nStartIndex = (nStartIndex > 0) ? min( nStartIndex, (int)videos.size() ) : 0;
96  nCount = (nCount > 0) ? min( nCount, (int)videos.size() ) : videos.size();
97  int nEndIndex = min((nStartIndex + nCount), (int)videos.size() );
98 
99  for( int n = nStartIndex; n < nEndIndex; n++ )
100  {
101  DTC::VideoMetadataInfo *pVideoMetadataInfo = pVideoMetadataInfos->AddNewVideoMetadataInfo();
102 
103  VideoMetadataListManager::VideoMetadataPtr metadata = videos[n];
104 
105  if (metadata)
106  FillVideoMetadataInfo ( pVideoMetadataInfo, metadata, true );
107  }
108 
109  int curPage = 0, totalPages = 0;
110  if (nCount == 0)
111  totalPages = 1;
112  else
113  totalPages = (int)ceil((float)videos.size() / nCount);
114 
115  if (totalPages == 1)
116  curPage = 1;
117  else
118  {
119  curPage = (int)ceil((float)nStartIndex / nCount) + 1;
120  }
121 
122  pVideoMetadataInfos->setStartIndex ( nStartIndex );
123  pVideoMetadataInfos->setCount ( nCount );
124  pVideoMetadataInfos->setCurrentPage ( curPage );
125  pVideoMetadataInfos->setTotalPages ( totalPages );
126  pVideoMetadataInfos->setTotalAvailable( videos.size() );
127  pVideoMetadataInfos->setAsOf ( MythDate::current() );
128  pVideoMetadataInfos->setVersion ( MYTH_BINARY_VERSION );
129  pVideoMetadataInfos->setProtoVer ( MYTH_PROTO_VERSION );
130 
131  return pVideoMetadataInfos;
132 }
133 
135 //
137 
139 {
142 
143  if ( !metadata )
144  throw( QString( "No metadata found for selected ID!." ));
145 
146  DTC::VideoMetadataInfo *pVideoMetadataInfo = new DTC::VideoMetadataInfo();
147 
148  FillVideoMetadataInfo ( pVideoMetadataInfo, metadata, true );
149 
150  return pVideoMetadataInfo;
151 }
152 
154 //
156 
158 {
161  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
162  mlm->setList(videolist);
163  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byFilename(FileName);
164 
165  if ( !metadata )
166  throw( QString( "No metadata found for selected filename!." ));
167 
168  DTC::VideoMetadataInfo *pVideoMetadataInfo = new DTC::VideoMetadataInfo();
169 
170  FillVideoMetadataInfo ( pVideoMetadataInfo, metadata, true );
171 
172  return pVideoMetadataInfo;
173 }
174 
176 //
178 
180  const QString &Subtitle,
181  const QString &Inetref,
182  int Season,
183  int Episode,
184  const QString &GrabberType,
185  bool AllowGeneric )
186 {
187  DTC::VideoLookupList *pVideoLookups = new DTC::VideoLookupList();
188 
189  MetadataLookupList list;
190 
191  MetadataFactory *factory = new MetadataFactory(nullptr);
192 
193  if (factory)
194  list = factory->SynchronousLookup(Title, Subtitle,
195  Inetref, Season, Episode,
196  GrabberType, AllowGeneric);
197 
198  if ( list.empty() )
199  return pVideoLookups;
200 
201  //MetadataLookupList is a reference counted list.
202  //it will delete all its content at its end of life
203  for( int n = 0; n < list.size(); n++ )
204  {
205  DTC::VideoLookup *pVideoLookup = pVideoLookups->AddNewVideoLookup();
206 
207  MetadataLookup *lookup = list[n];
208 
209  if (lookup)
210  {
211  pVideoLookup->setTitle(lookup->GetTitle());
212  pVideoLookup->setSubTitle(lookup->GetSubtitle());
213  pVideoLookup->setSeason(lookup->GetSeason());
214  pVideoLookup->setEpisode(lookup->GetEpisode());
215  pVideoLookup->setYear(lookup->GetYear());
216  pVideoLookup->setTagline(lookup->GetTagline());
217  pVideoLookup->setDescription(lookup->GetDescription());
218  pVideoLookup->setCertification(lookup->GetCertification());
219  pVideoLookup->setInetref(lookup->GetInetref());
220  pVideoLookup->setCollectionref(lookup->GetCollectionref());
221  pVideoLookup->setHomePage(lookup->GetHomepage());
222  pVideoLookup->setReleaseDate(
223  QDateTime(lookup->GetReleaseDate(),
224  QTime(0,0),Qt::LocalTime).toUTC());
225  pVideoLookup->setUserRating(lookup->GetUserRating());
226  pVideoLookup->setLength(lookup->GetRuntime());
227  pVideoLookup->setLanguage(lookup->GetLanguage());
228  pVideoLookup->setCountries(lookup->GetCountries());
229  pVideoLookup->setPopularity(lookup->GetPopularity());
230  pVideoLookup->setBudget(lookup->GetBudget());
231  pVideoLookup->setRevenue(lookup->GetRevenue());
232  pVideoLookup->setIMDB(lookup->GetIMDB());
233  pVideoLookup->setTMSRef(lookup->GetTMSref());
234 
235  ArtworkList coverartlist = lookup->GetArtwork(kArtworkCoverart);
236  ArtworkList::iterator c;
237  for (c = coverartlist.begin(); c != coverartlist.end(); ++c)
238  {
239  DTC::ArtworkItem *art = pVideoLookup->AddNewArtwork();
240  art->setType("coverart");
241  art->setUrl((*c).url);
242  art->setThumbnail((*c).thumbnail);
243  art->setWidth((*c).width);
244  art->setHeight((*c).height);
245  }
246  ArtworkList fanartlist = lookup->GetArtwork(kArtworkFanart);
247  ArtworkList::iterator f;
248  for (f = fanartlist.begin(); f != fanartlist.end(); ++f)
249  {
250  DTC::ArtworkItem *art = pVideoLookup->AddNewArtwork();
251  art->setType("fanart");
252  art->setUrl((*f).url);
253  art->setThumbnail((*f).thumbnail);
254  art->setWidth((*f).width);
255  art->setHeight((*f).height);
256  }
257  ArtworkList bannerlist = lookup->GetArtwork(kArtworkBanner);
258  ArtworkList::iterator b;
259  for (b = bannerlist.begin(); b != bannerlist.end(); ++b)
260  {
261  DTC::ArtworkItem *art = pVideoLookup->AddNewArtwork();
262  art->setType("banner");
263  art->setUrl((*b).url);
264  art->setThumbnail((*b).thumbnail);
265  art->setWidth((*b).width);
266  art->setHeight((*b).height);
267  }
268  ArtworkList screenshotlist = lookup->GetArtwork(kArtworkScreenshot);
269  ArtworkList::iterator s;
270  for (s = screenshotlist.begin(); s != screenshotlist.end(); ++s)
271  {
272  DTC::ArtworkItem *art = pVideoLookup->AddNewArtwork();
273  art->setType("screenshot");
274  art->setUrl((*s).url);
275  art->setThumbnail((*s).thumbnail);
276  art->setWidth((*s).width);
277  art->setHeight((*s).height);
278  }
279  }
280  }
281 
282  pVideoLookups->setCount ( list.count() );
283  pVideoLookups->setAsOf ( MythDate::current() );
284  pVideoLookups->setVersion ( MYTH_BINARY_VERSION );
285  pVideoLookups->setProtoVer ( MYTH_PROTO_VERSION );
286 
287  delete factory;
288 
289  return pVideoLookups;
290 }
291 
293 //
295 
297 {
298  bool bResult = false;
299 
302  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
303  mlm->setList(videolist);
304  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(Id);
305 
306  if (metadata)
307  bResult = metadata->DeleteFromDatabase();
308 
309  return bResult;
310 }
311 
313 //
315 
316 bool Video::AddVideo( const QString &sFileName,
317  const QString &sHostName )
318 {
319  if ( sHostName.isEmpty() )
320  throw( QString( "Host not provided! Local storage is deprecated and "
321  "is not supported by the API." ));
322 
323  if ( sFileName.isEmpty() ||
324  (sFileName.contains("/../")) ||
325  (sFileName.startsWith("../")) )
326  {
327  throw( QString( "Filename not provided, or fails sanity checks!" ));
328  }
329 
330  StorageGroup sgroup("Videos", sHostName);
331 
332  QString fullname = sgroup.FindFile(sFileName);
333 
334  if ( !QFile::exists(fullname) )
335  throw( QString( "Provided filename does not exist!" ));
336 
337  QString hash = FileHash(fullname);
338 
339  if (hash == "NULL")
340  {
341  LOG(VB_GENERAL, LOG_ERR, "Video Hash Failed. Unless this is a DVD or "
342  "Blu-ray, something has probably gone wrong.");
343  hash = "";
344  }
345 
346  VideoMetadata newFile(sFileName, QString(), hash,
352  QString(), QString(), QString(), QString(),
353  QString(), VIDEO_YEAR_DEFAULT,
354  QDate::fromString("0000-00-00","YYYY-MM-DD"),
355  VIDEO_INETREF_DEFAULT, 0, QString(),
357  0.0, VIDEO_RATING_DEFAULT, 0, 0,
358  0, 0,
359  MythDate::current().date(), 0,
361 
362  newFile.SetHost(sHostName);
363  newFile.SaveToDatabase();
364 
365  return true;
366 }
367 
369 //
371 
373  bool bWatched )
374 {
377  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
378  mlm->setList(videolist);
379  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(nId);
380 
381  if ( !metadata )
382  return false;
383 
384  metadata->SetWatched(bWatched);
385  metadata->UpdateDatabase();
386 
387  return true;
388 }
389 
391 //
393 
394 DTC::BlurayInfo* Video::GetBluray( const QString &sPath )
395 {
396  QString path = sPath;
397 
398  if (sPath.isEmpty())
399  path = gCoreContext->GetSetting( "BluRayMountpoint", "/media/cdrom");
400 
401  LOG(VB_GENERAL, LOG_NOTICE,
402  QString("Parsing Blu-ray at path: %1 ").arg(path));
403 
404  BlurayMetadata *bdmeta = new BlurayMetadata(path);
405 
406  if ( !bdmeta )
407  throw( QString( "Unable to open Blu-ray Metadata Parser!" ));
408 
409  if ( !bdmeta->OpenDisc() )
410  throw( QString( "Unable to open Blu-ray Disc/Path!" ));
411 
412  if ( !bdmeta->ParseDisc() )
413  throw( QString( "Unable to parse metadata from Blu-ray Disc/Path!" ));
414 
415  DTC::BlurayInfo *pBlurayInfo = new DTC::BlurayInfo();
416 
417  pBlurayInfo->setPath(path);
418  pBlurayInfo->setTitle(bdmeta->GetTitle());
419  pBlurayInfo->setAltTitle(bdmeta->GetAlternateTitle());
420  pBlurayInfo->setDiscLang(bdmeta->GetDiscLanguage());
421  pBlurayInfo->setDiscNum(bdmeta->GetCurrentDiscNumber());
422  pBlurayInfo->setTotalDiscNum(bdmeta->GetTotalDiscNumber());
423  pBlurayInfo->setTitleCount(bdmeta->GetTitleCount());
424  pBlurayInfo->setThumbCount(bdmeta->GetThumbnailCount());
425  pBlurayInfo->setTopMenuSupported(bdmeta->GetTopMenuSupported());
426  pBlurayInfo->setFirstPlaySupported(bdmeta->GetFirstPlaySupported());
427  pBlurayInfo->setNumHDMVTitles(bdmeta->GetNumHDMVTitles());
428  pBlurayInfo->setNumBDJTitles(bdmeta->GetNumBDJTitles());
429  pBlurayInfo->setNumUnsupportedTitles(bdmeta->GetNumUnsupportedTitles());
430  pBlurayInfo->setAACSDetected(bdmeta->GetAACSDetected());
431  pBlurayInfo->setLibAACSDetected(bdmeta->GetLibAACSDetected());
432  pBlurayInfo->setAACSHandled(bdmeta->GetAACSHandled());
433  pBlurayInfo->setBDPlusDetected(bdmeta->GetBDPlusDetected());
434  pBlurayInfo->setLibBDPlusDetected(bdmeta->GetLibBDPlusDetected());
435  pBlurayInfo->setBDPlusHandled(bdmeta->GetBDPlusHandled());
436 
437  QStringList thumbs = bdmeta->GetThumbnails();
438  if (!thumbs.empty())
439  pBlurayInfo->setThumbPath(thumbs.at(0));
440 
441  delete bdmeta;
442 
443  return pBlurayInfo;
444 }
445 
447 //
449 
451  const QString &sTitle,
452  const QString &sSubTitle,
453  const QString &sTagLine,
454  const QString &sDirector,
455  const QString &sStudio,
456  const QString &sPlot,
457  const QString &sRating,
458  const QString &sInetref,
459  int nCollectionRef,
460  const QString &sHomePage,
461  int nYear,
462  const QDate &sReleasedate,
463  float fUserRating,
464  int nLength,
465  int nPlayCount,
466  int nSeason,
467  int nEpisode,
468  int nShowLevel,
469  const QString &sFileName,
470  const QString &sHash,
471  const QString &sCoverFile,
472  int nChildID,
473  bool bBrowse,
474  bool bWatched,
475  bool bProcessed,
476  const QString &sPlayCommand,
477  int nCategory,
478  const QString &sTrailer,
479  const QString &sHost,
480  const QString &sScreenshot,
481  const QString &sBanner,
482  const QString &sFanart,
483  const QDate &sInsertDate,
484  const QString &sContentType,
485  const QString &sGenres,
486  const QString &sCast,
487  const QString &sCountries)
488 {
489  bool update_required = false;
492  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
493  mlm->setList(videolist);
494  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(nId);
495 
496  if (!metadata)
497  {
498  LOG(VB_GENERAL, LOG_ERR, QString("UpdateVideoMetadata: Id=%1 not found")
499  .arg(nId));
500  return false;
501  }
502 
503  if (m_parsedParams.contains("title"))
504  {
505  metadata->SetTitle(sTitle);
506  update_required = true;
507  }
508 
509  if (m_parsedParams.contains("subtitle"))
510  {
511  metadata->SetSubtitle(sSubTitle);
512  update_required = true;
513  }
514 
515  if (m_parsedParams.contains("tagline"))
516  {
517  metadata->SetTagline(sTagLine);
518  update_required = true;
519  }
520 
521  if (m_parsedParams.contains("director"))
522  {
523  metadata->SetDirector(sDirector);
524  update_required = true;
525  }
526 
527  if (m_parsedParams.contains("studio"))
528  {
529  metadata->SetStudio(sStudio);
530  update_required = true;
531  }
532 
533  if (m_parsedParams.contains("plot"))
534  {
535  metadata->SetPlot(sPlot);
536  update_required = true;
537  }
538 
539  if (m_parsedParams.contains("userrating"))
540  {
541  metadata->SetUserRating(fUserRating);
542  update_required = true;
543  }
544 
545  if (m_parsedParams.contains("inetref"))
546  {
547  metadata->SetInetRef(sInetref);
548  update_required = true;
549  }
550 
551  if (m_parsedParams.contains("collectionref"))
552  {
553  metadata->SetCollectionRef(nCollectionRef);
554  update_required = true;
555  }
556 
557  if (m_parsedParams.contains("homepage"))
558  {
559  metadata->SetHomepage(sHomePage);
560  update_required = true;
561  }
562 
563  if (m_parsedParams.contains("year"))
564  {
565  metadata->SetYear(nYear);
566  update_required = true;
567  }
568 
569  if (m_parsedParams.contains("releasedate"))
570  {
571  metadata->SetReleaseDate(sReleasedate);
572  update_required = true;
573  }
574 
575  if (m_parsedParams.contains("rating"))
576  {
577  metadata->SetRating(sRating);
578  update_required = true;
579  }
580 
581  if (m_parsedParams.contains("length"))
582  {
583  metadata->SetLength(nLength);
584  update_required = true;
585  }
586 
587  if (m_parsedParams.contains("playcount"))
588  {
589  metadata->SetPlayCount(nPlayCount);
590  update_required = true;
591  }
592 
593  if (m_parsedParams.contains("season"))
594  {
595  metadata->SetSeason(nSeason);
596  update_required = true;
597  }
598 
599  if (m_parsedParams.contains("episode"))
600  {
601  metadata->SetEpisode(nEpisode);
602  update_required = true;
603  }
604 
605  if (m_parsedParams.contains("showlevel"))
606  {
607  metadata->SetShowLevel(ParentalLevel::Level(nShowLevel));
608  update_required = true;
609  }
610 
611  if (m_parsedParams.contains("filename"))
612  {
613  metadata->SetFilename(sFileName);
614  update_required = true;
615  }
616 
617  if (m_parsedParams.contains("hash"))
618  {
619  metadata->SetHash(sHash);
620  update_required = true;
621  }
622 
623  if (m_parsedParams.contains("coverfile"))
624  {
625  metadata->SetCoverFile(sCoverFile);
626  update_required = true;
627  }
628 
629  if (m_parsedParams.contains("childid"))
630  {
631  metadata->SetChildID(nChildID);
632  update_required = true;
633  }
634 
635  if (m_parsedParams.contains("browse"))
636  {
637  metadata->SetBrowse(bBrowse);
638  update_required = true;
639  }
640 
641  if (m_parsedParams.contains("watched"))
642  {
643  metadata->SetWatched(bWatched);
644  update_required = true;
645  }
646 
647  if (m_parsedParams.contains("processed"))
648  {
649  metadata->SetProcessed(bProcessed);
650  update_required = true;
651  }
652 
653  if (m_parsedParams.contains("playcommand"))
654  {
655  metadata->SetPlayCommand(sPlayCommand);
656  update_required = true;
657  }
658 
659  if (m_parsedParams.contains("category"))
660  {
661  metadata->SetCategoryID(nCategory);
662  update_required = true;
663  }
664 
665  if (m_parsedParams.contains("trailer"))
666  {
667  metadata->SetTrailer(sTrailer);
668  update_required = true;
669  }
670 
671  if (m_parsedParams.contains("host"))
672  {
673  metadata->SetHost(sHost);
674  update_required = true;
675  }
676 
677  if (m_parsedParams.contains("screenshot"))
678  {
679  metadata->SetScreenshot(sScreenshot);
680  update_required = true;
681  }
682 
683  if (m_parsedParams.contains("banner"))
684  {
685  metadata->SetBanner(sBanner);
686  update_required = true;
687  }
688 
689  if (m_parsedParams.contains("fanart"))
690  {
691  metadata->SetFanart(sFanart);
692  update_required = true;
693  }
694 
695  if (m_parsedParams.contains("insertdate"))
696  {
697  metadata->SetInsertdate(sInsertDate);
698  update_required = true;
699  }
700 
701  if (m_parsedParams.contains("contenttype"))
702  {
703  // valid values for ContentType are 'MOVIE','TELEVISION','ADULT','MUSICVIDEO','HOMEVIDEO'
704  VideoContentType contentType = kContentUnknown;
705  if (sContentType == "MOVIE")
706  contentType = kContentMovie;
707 
708  if (sContentType == "TELEVISION")
709  contentType = kContentTelevision;
710 
711  if (sContentType == "ADULT")
712  contentType = kContentAdult;
713 
714  if (sContentType == "MUSICVIDEO")
715  contentType = kContentMusicVideo;
716 
717  if (sContentType == "HOMEVIDEO")
718  contentType = kContentHomeMovie;
719 
720  if (contentType != kContentUnknown)
721  {
722  metadata->SetContentType(contentType);
723  update_required = true;
724  }
725  else
726  LOG(VB_GENERAL, LOG_ERR, QString("UpdateVideoMetadata: Ignoring unknown ContentType: %1").arg(sContentType));
727  }
728 
729  if (m_parsedParams.contains("genres"))
730  {
732  QStringList genresList = sGenres.split(',', QString::SkipEmptyParts);
733 
734  for (int x = 0; x < genresList.size(); x++)
735  {
736  QString genre = genresList.at(x).simplified();
737  genres.push_back(VideoMetadata::genre_list::value_type(-1, genre));
738  }
739 
740  metadata->SetGenres(genres);
741  update_required = true;
742  }
743 
744  if (m_parsedParams.contains("cast"))
745  {
747  QStringList castList = sCast.split(',', QString::SkipEmptyParts);
748 
749  for (int x = 0; x < castList.size(); x++)
750  {
751  QString castName = castList.at(x).simplified();
752  cast.push_back(VideoMetadata::cast_list::value_type(-1, castName));
753  }
754 
755  metadata->SetCast(cast);
756  update_required = true;
757  }
758 
759  if (m_parsedParams.contains("countries"))
760  {
761  VideoMetadata::country_list countries;
762  QStringList countryList = sCountries.split(',', QString::SkipEmptyParts);
763 
764  for (int x = 0; x < countryList.size(); x++)
765  {
766  QString country = countryList.at(x).simplified();
767  countries.push_back(VideoMetadata::country_list::value_type(-1, country));
768  }
769 
770  metadata->SetCountries(countries);
771  update_required = true;
772  }
773 
774  if (update_required)
775  metadata->UpdateDatabase();
776 
777  return true;
778 }
779 
781 //
std::vector< cast_entry > cast_list
Definition: videometadata.h:34
ArtworkList GetArtwork(VideoArtworkType type) const
uint GetTotalDiscNumber(void)
const QString VIDEO_SCREENSHOT_DEFAULT
Definition: globals.cpp:27
QString GetIMDB() const
MetadataLookupList SynchronousLookup(const QString &title, const QString &subtitle, const QString &inetref, int season, int episode, const QString &grabber, bool allowgeneric=false)
uint32_t GetNumHDMVTitles(void)
static void loadAllFromDatabase(metadata_list &items, const QString &sql="")
Load videometadata database into memory.
uint GetYear() const
bool UpdateVideoMetadata(int Id, const QString &Title, const QString &SubTitle, const QString &TagLine, const QString &Director, const QString &Studio, const QString &Plot, const QString &Rating, const QString &Inetref, int CollectionRef, const QString &HomePage, int Year, const QDate &ReleaseDate, float UserRating, int Length, int PlayCount, int Season, int Episode, int ShowLevel, const QString &FileName, const QString &Hash, const QString &CoverFile, int ChildID, bool Browse, bool Watched, bool Processed, const QString &PlayCommand, int Category, const QString &Trailer, const QString &Host, const QString &Screenshot, const QString &Banner, const QString &Fanart, const QDate &InsertDate, const QString &ContentType, const QString &Genres, const QString &Cast, const QString &Countries) override
Definition: video.cpp:450
QString GetAlternateTitle(void)
QString GetDescription() const
DTC::VideoMetadataInfoList * GetVideoList(const QString &Folder, const QString &Sort, bool Descending, int StartIndex, int Count) override
Definition: video.cpp:52
QString GetTMSref() const
GrabberType
QList< QString > m_parsedParams
Definition: service.h:67
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
std::vector< country_entry > country_list
Definition: videometadata.h:33
bool GetTopMenuSupported(void)
VideoLookup * AddNewVideoLookup()
DTC::VideoMetadataInfo * GetVideo(int Id) override
Definition: video.cpp:138
bool ParseDisc(void)
QString GetSubtitle() const
float GetUserRating() const
uint GetSeason() const
QString GetTitle() const
unsigned char b
Definition: ParseText.cpp:329
DTC::VideoMetadataInfo * GetVideoByFileName(const QString &FileName) override
Definition: video.cpp:157
uint GetEpisode() const
QString GetTagline() const
uint GetRevenue() const
const QString VIDEO_PLOT_DEFAULT
Definition: globals.cpp:32
const QString VIDEO_TRAILER_DEFAULT
Definition: globals.cpp:26
bool GetAACSHandled(void)
DTC::VideoLookupList * LookupVideo(const QString &Title, const QString &Subtitle, const QString &Inetref, int Season, int Episode, const QString &GrabberType, bool AllowGeneric) override
Definition: video.cpp:179
bool GetBDPlusDetected(void)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
QString GetSetting(const QString &key, const QString &defaultval="")
QStringList GetCountries() const
uint32_t GetNumBDJTitles(void)
float GetPopularity() const
bool OpenDisc(void)
QString GetLanguage() const
#define MYTH_PROTO_VERSION
Increment this whenever the MythTV network protocol changes.
Definition: mythversion.h:48
QString GetDiscLanguage(void)
std::vector< genre_entry > genre_list
Definition: videometadata.h:32
QString GetInetref() const
bool AddVideo(const QString &FileName, const QString &HostName) override
Definition: video.cpp:316
bool GetFirstPlaySupported(void)
bool GetAACSDetected(void)
QString GetTitle(void)
QStringList GetThumbnails(void)
QList< ArtworkInfo > ArtworkList
void SetHost(const QString &host)
bool UpdateVideoWatchedStatus(int Id, bool Watched) override
Definition: video.cpp:372
std::list< VideoMetadataPtr > metadata_list
QDate GetReleaseDate() const
ArtworkItem * AddNewArtwork()
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
QString FindFile(const QString &filename)
QString GetCollectionref() const
QString GetHomepage() const
uint32_t GetNumUnsupportedTitles(void)
bool RemoveVideoFromDB(int Id) override
Definition: video.cpp:296
const QString VIDEO_COVERFILE_DEFAULT
Definition: globals.cpp:25
#define MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
Definition: mythversion.h:16
uint GetTitleCount(void)
uint GetRuntime() const
uint GetCurrentDiscNumber(void)
const QString VIDEO_RATING_DEFAULT
Definition: globals.cpp:30
VideoContentType
uint GetThumbnailCount(void)
const QString VIDEO_FANART_DEFAULT
Definition: globals.cpp:29
bool GetLibBDPlusDetected(void)
void FillVideoMetadataInfo(DTC::VideoMetadataInfo *pVideoMetadataInfo, const VideoMetadataListManager::VideoMetadataPtr &pMetadata, bool bDetails)
DTC::BlurayInfo * GetBluray(const QString &Path) override
Definition: video.cpp:394
const QString VIDEO_DIRECTOR_DEFAULT
Definition: globals.cpp:23
QString FileHash(const QString &filename)
static VideoMetadataPtr loadOneFromDatabase(uint id)
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:30
bool GetLibAACSDetected(void)
bool GetBDPlusHandled(void)
QString GetCertification() const
const QString VIDEO_BANNER_DEFAULT
Definition: globals.cpp:28
uint GetBudget() const