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