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 <math.h>
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 = QString(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 {
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  delete mlm;
173 
174  return pVideoMetadataInfo;
175 }
176 
178 //
180 
182  const QString &Subtitle,
183  const QString &Inetref,
184  int Season,
185  int Episode,
186  const QString &GrabberType,
187  bool AllowGeneric )
188 {
189  DTC::VideoLookupList *pVideoLookups = new DTC::VideoLookupList();
190 
191  MetadataLookupList list;
192 
193  MetadataFactory *factory = new MetadataFactory(NULL);
194 
195  if (factory)
196  list = factory->SynchronousLookup(Title, Subtitle,
197  Inetref, Season, Episode,
198  GrabberType, AllowGeneric);
199 
200  if ( !list.size() )
201  return pVideoLookups;
202 
203  //MetadataLookupList is a reference counted list.
204  //it will delete all its content at its end of life
205  for( int n = 0; n < list.size(); n++ )
206  {
207  DTC::VideoLookup *pVideoLookup = pVideoLookups->AddNewVideoLookup();
208 
209  MetadataLookup *lookup = list[n];
210 
211  if (lookup)
212  {
213  pVideoLookup->setTitle(lookup->GetTitle());
214  pVideoLookup->setSubTitle(lookup->GetSubtitle());
215  pVideoLookup->setSeason(lookup->GetSeason());
216  pVideoLookup->setEpisode(lookup->GetEpisode());
217  pVideoLookup->setYear(lookup->GetYear());
218  pVideoLookup->setTagline(lookup->GetTagline());
219  pVideoLookup->setDescription(lookup->GetDescription());
220  pVideoLookup->setCertification(lookup->GetCertification());
221  pVideoLookup->setInetref(lookup->GetInetref());
222  pVideoLookup->setCollectionref(lookup->GetCollectionref());
223  pVideoLookup->setHomePage(lookup->GetHomepage());
224  pVideoLookup->setReleaseDate(
225  QDateTime(lookup->GetReleaseDate(),
226  QTime(0,0),Qt::LocalTime).toUTC());
227  pVideoLookup->setUserRating(lookup->GetUserRating());
228  pVideoLookup->setLength(lookup->GetRuntime());
229  pVideoLookup->setLanguage(lookup->GetLanguage());
230  pVideoLookup->setCountries(lookup->GetCountries());
231  pVideoLookup->setPopularity(lookup->GetPopularity());
232  pVideoLookup->setBudget(lookup->GetBudget());
233  pVideoLookup->setRevenue(lookup->GetRevenue());
234  pVideoLookup->setIMDB(lookup->GetIMDB());
235  pVideoLookup->setTMSRef(lookup->GetTMSref());
236 
237  ArtworkList coverartlist = lookup->GetArtwork(kArtworkCoverart);
238  ArtworkList::iterator c;
239  for (c = coverartlist.begin(); c != coverartlist.end(); ++c)
240  {
241  DTC::ArtworkItem *art = pVideoLookup->AddNewArtwork();
242  art->setType("coverart");
243  art->setUrl((*c).url);
244  art->setThumbnail((*c).thumbnail);
245  art->setWidth((*c).width);
246  art->setHeight((*c).height);
247  }
248  ArtworkList fanartlist = lookup->GetArtwork(kArtworkFanart);
249  ArtworkList::iterator f;
250  for (f = fanartlist.begin(); f != fanartlist.end(); ++f)
251  {
252  DTC::ArtworkItem *art = pVideoLookup->AddNewArtwork();
253  art->setType("fanart");
254  art->setUrl((*f).url);
255  art->setThumbnail((*f).thumbnail);
256  art->setWidth((*f).width);
257  art->setHeight((*f).height);
258  }
259  ArtworkList bannerlist = lookup->GetArtwork(kArtworkBanner);
260  ArtworkList::iterator b;
261  for (b = bannerlist.begin(); b != bannerlist.end(); ++b)
262  {
263  DTC::ArtworkItem *art = pVideoLookup->AddNewArtwork();
264  art->setType("banner");
265  art->setUrl((*b).url);
266  art->setThumbnail((*b).thumbnail);
267  art->setWidth((*b).width);
268  art->setHeight((*b).height);
269  }
270  ArtworkList screenshotlist = lookup->GetArtwork(kArtworkScreenshot);
271  ArtworkList::iterator s;
272  for (s = screenshotlist.begin(); s != screenshotlist.end(); ++s)
273  {
274  DTC::ArtworkItem *art = pVideoLookup->AddNewArtwork();
275  art->setType("screenshot");
276  art->setUrl((*s).url);
277  art->setThumbnail((*s).thumbnail);
278  art->setWidth((*s).width);
279  art->setHeight((*s).height);
280  }
281  }
282  }
283 
284  pVideoLookups->setCount ( list.count() );
285  pVideoLookups->setAsOf ( MythDate::current() );
286  pVideoLookups->setVersion ( MYTH_BINARY_VERSION );
287  pVideoLookups->setProtoVer ( MYTH_PROTO_VERSION );
288 
289  delete factory;
290 
291  return pVideoLookups;
292 }
293 
295 //
297 
299 {
300  bool bResult = false;
301 
305  mlm->setList(videolist);
307 
308  if (metadata)
309  bResult = metadata->DeleteFromDatabase();
310 
311  delete mlm;
312 
313  return bResult;
314 }
315 
317 //
319 
320 bool Video::AddVideo( const QString &sFileName,
321  const QString &sHostName )
322 {
323  if ( sHostName.isEmpty() )
324  throw( QString( "Host not provided! Local storage is deprecated and "
325  "is not supported by the API." ));
326 
327  if ( sFileName.isEmpty() ||
328  (sFileName.contains("/../")) ||
329  (sFileName.startsWith("../")) )
330  {
331  throw( QString( "Filename not provided, or fails sanity checks!" ));
332  }
333 
334  StorageGroup sgroup("Videos", sHostName);
335 
336  QString fullname = sgroup.FindFile(sFileName);
337 
338  if ( !QFile::exists(fullname) )
339  throw( QString( "Provided filename does not exist!" ));
340 
341  QString hash = FileHash(fullname);
342 
343  if (hash == "NULL")
344  {
345  LOG(VB_GENERAL, LOG_ERR, "Video Hash Failed. Unless this is a DVD or "
346  "Blu-ray, something has probably gone wrong.");
347  hash = "";
348  }
349 
350  VideoMetadata newFile(sFileName, hash,
356  VideoMetadata::FilenameToMeta(sFileName, 1),
357  VideoMetadata::FilenameToMeta(sFileName, 4),
358  QString(), VIDEO_YEAR_DEFAULT,
359  QDate::fromString("0000-00-00","YYYY-MM-DD"),
360  VIDEO_INETREF_DEFAULT, 0, QString(),
362  0.0, VIDEO_RATING_DEFAULT, 0, 0,
363  VideoMetadata::FilenameToMeta(sFileName, 2).toInt(),
364  VideoMetadata::FilenameToMeta(sFileName, 3).toInt(),
365  MythDate::current().date(), 0,
367 
368  newFile.SetHost(sHostName);
369  newFile.SaveToDatabase();
370 
371  return true;
372 }
373 
375 //
377 
379  bool bWatched )
380 {
383  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
384  mlm->setList(videolist);
385  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(nId);
386 
387  if ( !metadata )
388  return false;
389 
390  metadata->SetWatched(bWatched);
391  metadata->UpdateDatabase();
392 
393  return true;
394 }
395 
397 //
399 
400 DTC::BlurayInfo* Video::GetBluray( const QString &sPath )
401 {
402  QString path = sPath;
403 
404  if (sPath.isEmpty())
405  path = gCoreContext->GetSetting( "BluRayMountpoint", "/media/cdrom");
406 
407  LOG(VB_GENERAL, LOG_NOTICE,
408  QString("Parsing Blu-ray at path: %1 ").arg(path));
409 
410  BlurayMetadata *bdmeta = new BlurayMetadata(path);
411 
412  if ( !bdmeta )
413  throw( QString( "Unable to open Blu-ray Metadata Parser!" ));
414 
415  if ( !bdmeta->OpenDisc() )
416  throw( QString( "Unable to open Blu-ray Disc/Path!" ));
417 
418  if ( !bdmeta->ParseDisc() )
419  throw( QString( "Unable to parse metadata from Blu-ray Disc/Path!" ));
420 
421  DTC::BlurayInfo *pBlurayInfo = new DTC::BlurayInfo();
422 
423  pBlurayInfo->setPath(path);
424  pBlurayInfo->setTitle(bdmeta->GetTitle());
425  pBlurayInfo->setAltTitle(bdmeta->GetAlternateTitle());
426  pBlurayInfo->setDiscLang(bdmeta->GetDiscLanguage());
427  pBlurayInfo->setDiscNum(bdmeta->GetCurrentDiscNumber());
428  pBlurayInfo->setTotalDiscNum(bdmeta->GetTotalDiscNumber());
429  pBlurayInfo->setTitleCount(bdmeta->GetTitleCount());
430  pBlurayInfo->setThumbCount(bdmeta->GetThumbnailCount());
431  pBlurayInfo->setTopMenuSupported(bdmeta->GetTopMenuSupported());
432  pBlurayInfo->setFirstPlaySupported(bdmeta->GetFirstPlaySupported());
433  pBlurayInfo->setNumHDMVTitles((uint)bdmeta->GetNumHDMVTitles());
434  pBlurayInfo->setNumBDJTitles((uint)bdmeta->GetNumBDJTitles());
435  pBlurayInfo->setNumUnsupportedTitles((uint)bdmeta->GetNumUnsupportedTitles());
436  pBlurayInfo->setAACSDetected(bdmeta->GetAACSDetected());
437  pBlurayInfo->setLibAACSDetected(bdmeta->GetLibAACSDetected());
438  pBlurayInfo->setAACSHandled(bdmeta->GetAACSHandled());
439  pBlurayInfo->setBDPlusDetected(bdmeta->GetBDPlusDetected());
440  pBlurayInfo->setLibBDPlusDetected(bdmeta->GetLibBDPlusDetected());
441  pBlurayInfo->setBDPlusHandled(bdmeta->GetBDPlusHandled());
442 
443  QStringList thumbs = bdmeta->GetThumbnails();
444  if (thumbs.size())
445  pBlurayInfo->setThumbPath(thumbs.at(0));
446 
447  delete bdmeta;
448 
449  return pBlurayInfo;
450 }
451 
453 //
455 
457  const QString &sTitle,
458  const QString &sSubTitle,
459  const QString &sTagLine,
460  const QString &sDirector,
461  const QString &sStudio,
462  const QString &sPlot,
463  const QString &sRating,
464  const QString &sInetref,
465  int nCollectionRef,
466  const QString &sHomePage,
467  int nYear,
468  const QDate &sReleasedate,
469  float fUserRating,
470  int nLength,
471  int nPlayCount,
472  int nSeason,
473  int nEpisode,
474  int nShowLevel,
475  const QString &sFileName,
476  const QString &sHash,
477  const QString &sCoverFile,
478  int nChildID,
479  bool bBrowse,
480  bool bWatched,
481  bool bProcessed,
482  const QString &sPlayCommand,
483  int nCategory,
484  const QString &sTrailer,
485  const QString &sHost,
486  const QString &sScreenshot,
487  const QString &sBanner,
488  const QString &sFanart,
489  const QDate &sInsertDate,
490  const QString &sContentType,
491  const QString &sGenres,
492  const QString &sCast,
493  const QString &sCountries)
494 {
495  bool update_required = false;
498  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
499  mlm->setList(videolist);
500  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(nId);
501 
502  if (!metadata)
503  {
504  LOG(VB_GENERAL, LOG_ERR, QString("UpdateVideoMetadata: Id=%1 not found")
505  .arg(nId));
506  return false;
507  }
508 
509  if (m_parsedParams.contains("title"))
510  {
511  metadata->SetTitle(sTitle);
512  update_required = true;
513  }
514 
515  if (m_parsedParams.contains("subtitle"))
516  {
517  metadata->SetSubtitle(sSubTitle);
518  update_required = true;
519  }
520 
521  if (m_parsedParams.contains("tagline"))
522  {
523  metadata->SetTagline(sTagLine);
524  update_required = true;
525  }
526 
527  if (m_parsedParams.contains("director"))
528  {
529  metadata->SetDirector(sDirector);
530  update_required = true;
531  }
532 
533  if (m_parsedParams.contains("studio"))
534  {
535  metadata->SetStudio(sStudio);
536  update_required = true;
537  }
538 
539  if (m_parsedParams.contains("plot"))
540  {
541  metadata->SetPlot(sPlot);
542  update_required = true;
543  }
544 
545  if (m_parsedParams.contains("userrating"))
546  {
547  metadata->SetUserRating(fUserRating);
548  update_required = true;
549  }
550 
551  if (m_parsedParams.contains("inetref"))
552  {
553  metadata->SetInetRef(sInetref);
554  update_required = true;
555  }
556 
557  if (m_parsedParams.contains("collectionref"))
558  {
559  metadata->SetCollectionRef(nCollectionRef);
560  update_required = true;
561  }
562 
563  if (m_parsedParams.contains("homepage"))
564  {
565  metadata->SetHomepage(sHomePage);
566  update_required = true;
567  }
568 
569  if (m_parsedParams.contains("year"))
570  {
571  metadata->SetYear(nYear);
572  update_required = true;
573  }
574 
575  if (m_parsedParams.contains("releasedate"))
576  {
577  metadata->SetReleaseDate(sReleasedate);
578  update_required = true;
579  }
580 
581  if (m_parsedParams.contains("rating"))
582  {
583  metadata->SetRating(sRating);
584  update_required = true;
585  }
586 
587  if (m_parsedParams.contains("length"))
588  {
589  metadata->SetLength(nLength);
590  update_required = true;
591  }
592 
593  if (m_parsedParams.contains("playcount"))
594  {
595  metadata->SetPlayCount(nPlayCount);
596  update_required = true;
597  }
598 
599  if (m_parsedParams.contains("season"))
600  {
601  metadata->SetSeason(nSeason);
602  update_required = true;
603  }
604 
605  if (m_parsedParams.contains("episode"))
606  {
607  metadata->SetEpisode(nEpisode);
608  update_required = true;
609  }
610 
611  if (m_parsedParams.contains("showlevel"))
612  {
613  metadata->SetShowLevel(ParentalLevel::Level(nShowLevel));
614  update_required = true;
615  }
616 
617  if (m_parsedParams.contains("filename"))
618  {
619  metadata->SetFilename(sFileName);
620  update_required = true;
621  }
622 
623  if (m_parsedParams.contains("hash"))
624  {
625  metadata->SetHash(sHash);
626  update_required = true;
627  }
628 
629  if (m_parsedParams.contains("coverfile"))
630  {
631  metadata->SetCoverFile(sCoverFile);
632  update_required = true;
633  }
634 
635  if (m_parsedParams.contains("childid"))
636  {
637  metadata->SetChildID(nChildID);
638  update_required = true;
639  }
640 
641  if (m_parsedParams.contains("browse"))
642  {
643  metadata->SetBrowse(bBrowse);
644  update_required = true;
645  }
646 
647  if (m_parsedParams.contains("watched"))
648  {
649  metadata->SetWatched(bWatched);
650  update_required = true;
651  }
652 
653  if (m_parsedParams.contains("processed"))
654  {
655  metadata->SetProcessed(bProcessed);
656  update_required = true;
657  }
658 
659  if (m_parsedParams.contains("playcommand"))
660  {
661  metadata->SetPlayCommand(sPlayCommand);
662  update_required = true;
663  }
664 
665  if (m_parsedParams.contains("category"))
666  {
667  metadata->SetCategoryID(nCategory);
668  update_required = true;
669  }
670 
671  if (m_parsedParams.contains("trailer"))
672  {
673  metadata->SetTrailer(sTrailer);
674  update_required = true;
675  }
676 
677  if (m_parsedParams.contains("host"))
678  {
679  metadata->SetHost(sHost);
680  update_required = true;
681  }
682 
683  if (m_parsedParams.contains("screenshot"))
684  {
685  metadata->SetScreenshot(sScreenshot);
686  update_required = true;
687  }
688 
689  if (m_parsedParams.contains("banner"))
690  {
691  metadata->SetBanner(sBanner);
692  update_required = true;
693  }
694 
695  if (m_parsedParams.contains("fanart"))
696  {
697  metadata->SetFanart(sFanart);
698  update_required = true;
699  }
700 
701  if (m_parsedParams.contains("insertdate"))
702  {
703  metadata->SetInsertdate(sInsertDate);
704  update_required = true;
705  }
706 
707  if (m_parsedParams.contains("contenttype"))
708  {
709  // valid values for ContentType are 'MOVIE','TELEVISION','ADULT','MUSICVIDEO','HOMEVIDEO'
710  VideoContentType contentType = kContentUnknown;
711  if (sContentType == "MOVIE")
712  contentType = kContentMovie;
713 
714  if (sContentType == "TELEVISION")
715  contentType = kContentTelevision;
716 
717  if (sContentType == "ADULT")
718  contentType = kContentAdult;
719 
720  if (sContentType == "MUSICVIDEO")
721  contentType = kContentMusicVideo;
722 
723  if (sContentType == "HOMEVIDEO")
724  contentType = kContentHomeMovie;
725 
726  if (contentType != kContentUnknown)
727  {
728  metadata->SetContentType(contentType);
729  update_required = true;
730  }
731  else
732  LOG(VB_GENERAL, LOG_ERR, QString("UpdateVideoMetadata: Ignoring unknown ContentType: %1").arg(sContentType));
733  }
734 
735  if (m_parsedParams.contains("genres"))
736  {
738  QStringList genresList = sGenres.split(',', QString::SkipEmptyParts);
739 
740  for (int x = 0; x < genresList.size(); x++)
741  {
742  QString genre = genresList.at(x).simplified();
743  genres.push_back(VideoMetadata::genre_list::value_type(-1, genre));
744  }
745 
746  metadata->SetGenres(genres);
747  update_required = true;
748  }
749 
750  if (m_parsedParams.contains("cast"))
751  {
753  QStringList castList = sCast.split(',', QString::SkipEmptyParts);
754 
755  for (int x = 0; x < castList.size(); x++)
756  {
757  QString castName = castList.at(x).simplified();
758  cast.push_back(VideoMetadata::cast_list::value_type(-1, castName));
759  }
760 
761  metadata->SetCast(cast);
762  update_required = true;
763  }
764 
765  if (m_parsedParams.contains("countries"))
766  {
767  VideoMetadata::country_list countries;
768  QStringList countryList = sCountries.split(',', QString::SkipEmptyParts);
769 
770  for (int x = 0; x < countryList.size(); x++)
771  {
772  QString country = countryList.at(x).simplified();
773  countries.push_back(VideoMetadata::country_list::value_type(-1, country));
774  }
775 
776  metadata->SetCountries(countries);
777  update_required = true;
778  }
779 
780  if (update_required == true)
781  metadata->UpdateDatabase();
782 
783  return true;
784 }
785 
787 //
std::vector< cast_entry > cast_list
Definition: videometadata.h:36
QString FileHash(QString filename)
ArtworkList GetArtwork(VideoArtworkType type) const
uint GetTotalDiscNumber(void)
const QString VIDEO_SCREENSHOT_DEFAULT
Definition: globals.cpp:27
QString GetIMDB() const
uint32_t GetNumHDMVTitles(void)
static void loadAllFromDatabase(metadata_list &items, const QString &sql="")
uint GetYear() const
QString GetAlternateTitle(void)
QString GetDescription() const
DTC::VideoMetadataInfo * GetVideo(int Id)
Definition: video.cpp:138
DTC::VideoLookupList * LookupVideo(const QString &Title, const QString &Subtitle, const QString &Inetref, int Season, int Episode, const QString &GrabberType, bool AllowGeneric)
Definition: video.cpp:181
QString GetTMSref() const
GrabberType
QList< QString > m_parsedParams
Definition: service.h:67
unsigned int uint
Definition: compat.h:136
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
std::vector< country_entry > country_list
Definition: videometadata.h:35
bool GetTopMenuSupported(void)
VideoLookup * AddNewVideoLookup()
bool ParseDisc(void)
QString GetSubtitle() const
float GetUserRating() const
uint GetSeason() const
QString GetTitle() const
unsigned char b
Definition: ParseText.cpp:339
uint GetEpisode() const
QString GetTagline() const
void setList(metadata_list &list)
uint GetRevenue() const
const QString VIDEO_PLOT_DEFAULT
Definition: globals.cpp:32
bool AddVideo(const QString &FileName, const QString &HostName)
Definition: video.cpp:320
VideoMetadataPtr byFilename(const QString &file_name) const
const QString VIDEO_TRAILER_DEFAULT
Definition: globals.cpp:26
bool GetAACSHandled(void)
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)
DTC::VideoMetadataInfoList * GetVideoList(const QString &Folder, const QString &Sort, bool Descending, int StartIndex, int Count)
Definition: video.cpp:52
MetadataLookupList SynchronousLookup(QString title, QString subtitle, QString inetref, int season, int episode, QString grabber, bool allowgeneric=false)
bool OpenDisc(void)
QString GetLanguage() const
QString GetDiscLanguage(void)
static QString FilenameToMeta(const QString &file_name, int position)
std::vector< genre_entry > genre_list
Definition: videometadata.h:34
QString GetInetref() const
bool GetFirstPlaySupported(void)
bool GetAACSDetected(void)
QString GetTitle(void)
QStringList GetThumbnails(void)
QList< ArtworkInfo > ArtworkList
void SetHost(const QString &host)
std::list< VideoMetadataPtr > metadata_list
QDate GetReleaseDate() const
ArtworkItem * AddNewArtwork()
DTC::BlurayInfo * GetBluray(const QString &Path)
Definition: video.cpp:400
void FillVideoMetadataInfo(DTC::VideoMetadataInfo *pVideoMetadataInfo, VideoMetadataListManager::VideoMetadataPtr pMetadata, bool bDetails)
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
QString FindFile(const QString &filename)
QString GetCollectionref() 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)
Definition: video.cpp:456
DTC::VideoMetadataInfo * GetVideoByFileName(const QString &FileName)
Definition: video.cpp:157
QString GetHomepage() const
uint32_t GetNumUnsupportedTitles(void)
bool RemoveVideoFromDB(int Id)
Definition: video.cpp:298
const QString VIDEO_COVERFILE_DEFAULT
Definition: globals.cpp:25
VideoMetadataPtr byID(unsigned int db_id) const
uint GetTitleCount(void)
uint GetRuntime() const
bool UpdateVideoWatchedStatus(int Id, bool Watched)
Definition: video.cpp:378
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)
const QString VIDEO_DIRECTOR_DEFAULT
Definition: globals.cpp:23
static VideoMetadataPtr loadOneFromDatabase(uint id)
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:34
uint GetPopularity() const
bool GetLibAACSDetected(void)
bool GetBDPlusHandled(void)
QString GetCertification() const
const QString VIDEO_BANNER_DEFAULT
Definition: globals.cpp:28
uint GetBudget() const