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