MythTV  master
v2video.cpp
Go to the documentation of this file.
1 // MythTV
4 #include "libmythbase/mythdb.h"
15 #include "libmythtv/mythavutil.h"
16 
17 // MythBackend
18 #include "v2artworkInfoList.h"
19 #include "v2castMemberList.h"
20 #include "v2genreList.h"
21 #include "v2serviceUtil.h"
22 #include "v2video.h"
23 
24 
25 // This will be initialised in a thread safe manner on first use
27  (VIDEO_HANDLE, V2Video::staticMetaObject, &V2Video::RegisterCustomTypes))
28 
30 {
31  qRegisterMetaType<V2VideoMetadataInfo*>("V2VideoMetadataInfo");
32  qRegisterMetaType<V2VideoMetadataInfoList*>("V2VideoMetadataInfoList");
33  qRegisterMetaType<V2VideoLookupList*>("V2VideoLookupList");
34  qRegisterMetaType<V2BlurayInfo*>("V2BlurayInfo");
35  qRegisterMetaType<V2VideoStreamInfoList*>("V2VideoStreamInfoList");
36  qRegisterMetaType<V2VideoStreamInfo*>("V2VideoStreamInfo");
37  qRegisterMetaType<V2ArtworkInfoList*>("V2ArtworkInfoList");
38  qRegisterMetaType<V2ArtworkInfo*>("V2ArtworkInfo");
39  qRegisterMetaType<V2CastMemberList*>("V2CastMemberList");
40  qRegisterMetaType<V2CastMember*>("V2CastMember");
41  qRegisterMetaType<V2GenreList*>("V2GenreList");
42  qRegisterMetaType<V2Genre*>("V2Genre");
43  qRegisterMetaType<V2VideoLookupList*>("V2VideoLookupList");
44  qRegisterMetaType<V2VideoLookup*>("V2VideoLookup");
45  qRegisterMetaType<V2ArtworkItem*>("V2ArtworkItem");
46  qRegisterMetaType<V2CutList*>("V2CutList");
47  qRegisterMetaType<V2Cutting*>("V2Cutting");
48 }
49 
51  : MythHTTPService(s_service)
52 {
53 }
54 
56 {
59 
60  if ( !metadata )
61  throw( QString( "No metadata found for selected ID!." ));
62 
63  auto *pVideoMetadataInfo = new V2VideoMetadataInfo();
64 
65  V2FillVideoMetadataInfo ( pVideoMetadataInfo, metadata, true );
66 
67  return pVideoMetadataInfo;
68 }
69 
71 {
74  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
75  mlm->setList(videolist);
76  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byFilename(FileName);
77 
78  if ( !metadata )
79  throw( QString( "No metadata found for selected filename!." ));
80 
81  auto *pVideoMetadataInfo = new V2VideoMetadataInfo();
82 
83  V2FillVideoMetadataInfo ( pVideoMetadataInfo, metadata, true );
84 
85  return pVideoMetadataInfo;
86 }
87 
88 
90 // Get bookmark of a video as a frame number.
92 
94 {
96 
97  query.prepare("SELECT filename "
98  "FROM videometadata "
99  "WHERE intid = :ID ");
100  query.bindValue(":ID", Id);
101 
102  if (!query.exec())
103  {
104  MythDB::DBError("V2Video::GetSavedBookmark", query);
105  return 0;
106  }
107 
108  QString fileName;
109 
110  if (query.next())
111  fileName = query.value(0).toString();
112  else
113  {
114  LOG(VB_GENERAL, LOG_ERR, QString("V2Video/GetSavedBookmark Video id %1 Not found.").arg(Id));
115  return -1;
116  }
117 
118  ProgramInfo pi(fileName,
119  nullptr, // _plot,
120  nullptr, // _title,
121  nullptr, // const QString &_sortTitle,
122  nullptr, // const QString &_subtitle,
123  nullptr, // const QString &_sortSubtitle,
124  nullptr, // const QString &_director,
125  0, // int _season,
126  0, // int _episode,
127  nullptr, // const QString &_inetref,
128  0min, // uint _length_in_minutes,
129  0, // uint _year,
130  nullptr); //const QString &_programid);
131 
132  long ret = pi.QueryBookmark();
133  return ret;
134 }
135 
137 // Get last play pos of a video as a frame number.
139 
141 {
142  MSqlQuery query(MSqlQuery::InitCon());
143 
144  query.prepare("SELECT filename "
145  "FROM videometadata "
146  "WHERE intid = :ID ");
147  query.bindValue(":ID", Id);
148 
149  if (!query.exec())
150  {
151  MythDB::DBError("V2Video::GetLastPlayPos", query);
152  return 0;
153  }
154 
155  QString fileName;
156 
157  if (query.next())
158  fileName = query.value(0).toString();
159  else
160  {
161  LOG(VB_GENERAL, LOG_ERR, QString("V2Video/GetLastPlayPos Video id %1 Not found.").arg(Id));
162  return -1;
163  }
164 
165  ProgramInfo pi(fileName,
166  nullptr, // _plot,
167  nullptr, // _title,
168  nullptr, // const QString &_sortTitle,
169  nullptr, // const QString &_subtitle,
170  nullptr, // const QString &_sortSubtitle,
171  nullptr, // const QString &_director,
172  0, // int _season,
173  0, // int _episode,
174  nullptr, // const QString &_inetref,
175  0min, // uint _length_in_minutes,
176  0, // uint _year,
177  nullptr); //const QString &_programid);
178 
179  long ret = pi.QueryLastPlayPos();
180  return ret;
181 }
182 
183 
185  const QString &Sort,
186  bool bDescending,
187  int nStartIndex,
188  int nCount )
189 {
190  QString fields = "title,director,studio,plot,rating,year,releasedate,"
191  "userrating,length,playcount,filename,hash,showlevel,"
192  "coverfile,inetref,collectionref,homepage,childid,browse,watched,"
193  "playcommand,category,intid,trailer,screenshot,banner,fanart,"
194  "subtitle,tagline,season,episode,host,insertdate,processed,contenttype";
195 
196  QStringList sortFields = fields.split(',');
197 
199 
200  QString sql = "";
201  if (!Folder.isEmpty())
202  sql.append(" WHERE filename LIKE '" + Folder + "%'");
203  sql.append(" ORDER BY ");
204  QString sort = Sort.toLower();
205  if (sort == "added")
206  sql.append("insertdate");
207  else if (sort == "released")
208  sql.append("releasedate");
209  else if (sortFields.contains(sort))
210  sql.append(sort);
211  else
212  sql.append("intid");
213 
214  if (bDescending)
215  sql += " DESC";
217 
218  std::vector<VideoMetadataListManager::VideoMetadataPtr> videos(videolist.begin(), videolist.end());
219 
220  // ----------------------------------------------------------------------
221  // Build Response
222  // ----------------------------------------------------------------------
223 
224  auto *pVideoMetadataInfos = new V2VideoMetadataInfoList();
225 
226  nStartIndex = (nStartIndex > 0) ? std::min( nStartIndex, (int)videos.size() ) : 0;
227  nCount = (nCount > 0) ? std::min( nCount, (int)videos.size() ) : videos.size();
228  int nEndIndex = std::min((nStartIndex + nCount), (int)videos.size() );
229 
230  for( int n = nStartIndex; n < nEndIndex; n++ )
231  {
232  V2VideoMetadataInfo *pVideoMetadataInfo = pVideoMetadataInfos->AddNewVideoMetadataInfo();
233 
234  VideoMetadataListManager::VideoMetadataPtr metadata = videos[n];
235 
236  if (metadata)
237  V2FillVideoMetadataInfo ( pVideoMetadataInfo, metadata, true );
238  }
239 
240  int curPage = 0;
241  int totalPages = 0;
242  if (nCount == 0)
243  totalPages = 1;
244  else
245  totalPages = (int)ceil((float)videos.size() / nCount);
246 
247  if (totalPages == 1)
248  curPage = 1;
249  else
250  {
251  curPage = (int)ceil((float)nStartIndex / nCount) + 1;
252  }
253 
254  pVideoMetadataInfos->setStartIndex ( nStartIndex );
255  pVideoMetadataInfos->setCount ( nCount );
256  pVideoMetadataInfos->setCurrentPage ( curPage );
257  pVideoMetadataInfos->setTotalPages ( totalPages );
258  pVideoMetadataInfos->setTotalAvailable( videos.size() );
259  pVideoMetadataInfos->setAsOf ( MythDate::current() );
260  pVideoMetadataInfos->setVersion ( MYTH_BINARY_VERSION );
261  pVideoMetadataInfos->setProtoVer ( MYTH_PROTO_VERSION );
262 
263  return pVideoMetadataInfos;
264 }
265 
266 
268  const QString &Subtitle,
269  const QString &Inetref,
270  int Season,
271  int Episode,
272  const QString &GrabberType,
273  bool AllowGeneric )
274 {
275  auto *pVideoLookups = new V2VideoLookupList();
276 
277  MetadataLookupList list;
278 
279  auto *factory = new MetadataFactory(nullptr);
280 
281  if (factory)
282  {
283  list = factory->SynchronousLookup(Title, Subtitle,
284  Inetref, Season, Episode,
285  GrabberType, AllowGeneric);
286  }
287 
288  if ( list.empty() )
289  return pVideoLookups;
290 
291  //MetadataLookupList is a reference counted list.
292  //it will delete all its content at its end of life
293  for( int n = 0; n < list.size(); n++ )
294  {
295  V2VideoLookup *pVideoLookup = pVideoLookups->AddNewVideoLookup();
296 
297  MetadataLookup *lookup = list[n];
298 
299  if (lookup)
300  {
301  pVideoLookup->setTitle(lookup->GetTitle());
302  pVideoLookup->setSubTitle(lookup->GetSubtitle());
303  pVideoLookup->setSeason(lookup->GetSeason());
304  pVideoLookup->setEpisode(lookup->GetEpisode());
305  pVideoLookup->setYear(lookup->GetYear());
306  pVideoLookup->setTagline(lookup->GetTagline());
307  pVideoLookup->setDescription(lookup->GetDescription());
308  pVideoLookup->setCertification(lookup->GetCertification());
309  pVideoLookup->setInetref(lookup->GetInetref());
310  pVideoLookup->setCollectionref(lookup->GetCollectionref());
311  pVideoLookup->setHomePage(lookup->GetHomepage());
312  pVideoLookup->setReleaseDate(
313  QDateTime(lookup->GetReleaseDate(),
314  QTime(0,0),Qt::LocalTime).toUTC());
315  pVideoLookup->setUserRating(lookup->GetUserRating());
316  pVideoLookup->setLength(lookup->GetRuntime().count());
317  pVideoLookup->setLanguage(lookup->GetLanguage());
318  pVideoLookup->setCountries(lookup->GetCountries());
319  pVideoLookup->setPopularity(lookup->GetPopularity());
320  pVideoLookup->setBudget(lookup->GetBudget());
321  pVideoLookup->setRevenue(lookup->GetRevenue());
322  pVideoLookup->setIMDB(lookup->GetIMDB());
323  pVideoLookup->setTMSRef(lookup->GetTMSref());
324 
325  ArtworkList coverartlist = lookup->GetArtwork(kArtworkCoverart);
326  ArtworkList::iterator c;
327  for (c = coverartlist.begin(); c != coverartlist.end(); ++c)
328  {
329  V2ArtworkItem *art = pVideoLookup->AddNewArtwork();
330  art->setType("coverart");
331  art->setUrl((*c).url);
332  art->setThumbnail((*c).thumbnail);
333  art->setWidth((*c).width);
334  art->setHeight((*c).height);
335  }
336  ArtworkList fanartlist = lookup->GetArtwork(kArtworkFanart);
337  ArtworkList::iterator f;
338  for (f = fanartlist.begin(); f != fanartlist.end(); ++f)
339  {
340  V2ArtworkItem *art = pVideoLookup->AddNewArtwork();
341  art->setType("fanart");
342  art->setUrl((*f).url);
343  art->setThumbnail((*f).thumbnail);
344  art->setWidth((*f).width);
345  art->setHeight((*f).height);
346  }
347  ArtworkList bannerlist = lookup->GetArtwork(kArtworkBanner);
348  ArtworkList::iterator b;
349  for (b = bannerlist.begin(); b != bannerlist.end(); ++b)
350  {
351  V2ArtworkItem *art = pVideoLookup->AddNewArtwork();
352  art->setType("banner");
353  art->setUrl((*b).url);
354  art->setThumbnail((*b).thumbnail);
355  art->setWidth((*b).width);
356  art->setHeight((*b).height);
357  }
358  ArtworkList screenshotlist = lookup->GetArtwork(kArtworkScreenshot);
359  ArtworkList::iterator s;
360  for (s = screenshotlist.begin(); s != screenshotlist.end(); ++s)
361  {
362  V2ArtworkItem *art = pVideoLookup->AddNewArtwork();
363  art->setType("screenshot");
364  art->setUrl((*s).url);
365  art->setThumbnail((*s).thumbnail);
366  art->setWidth((*s).width);
367  art->setHeight((*s).height);
368  }
369  }
370  }
371 
372  pVideoLookups->setCount ( list.count() );
373  pVideoLookups->setAsOf ( MythDate::current() );
374  pVideoLookups->setVersion ( MYTH_BINARY_VERSION );
375  pVideoLookups->setProtoVer ( MYTH_PROTO_VERSION );
376 
377  delete factory;
378 
379  return pVideoLookups;
380 }
381 
382 
384 {
385  bool bResult = false;
386 
389  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
390  mlm->setList(videolist);
391  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(Id);
392 
393  if (metadata)
394  bResult = metadata->DeleteFromDatabase();
395 
396  return bResult;
397 }
398 
399 bool V2Video::AddVideo( const QString &sFileName,
400  const QString &sHostName )
401 {
402  if ( sHostName.isEmpty() )
403  throw( QString( "Host not provided! Local storage is deprecated and "
404  "is not supported by the API." ));
405 
406  if ( sFileName.isEmpty() ||
407  (sFileName.contains("/../")) ||
408  (sFileName.startsWith("../")) )
409  {
410  throw( QString( "Filename not provided, or fails sanity checks!" ));
411  }
412 
413  StorageGroup sgroup("Videos", sHostName);
414 
415  QString fullname = sgroup.FindFile(sFileName);
416 
417  if ( !QFile::exists(fullname) )
418  throw( QString( "Provided filename does not exist!" ));
419 
420  QString hash = FileHash(fullname);
421 
422  if (hash == "NULL")
423  {
424  LOG(VB_GENERAL, LOG_ERR, "Video Hash Failed. Unless this is a DVD or "
425  "Blu-ray, something has probably gone wrong.");
426  hash = "";
427  }
428 
429  VideoMetadata newFile(sFileName, QString(), hash,
435  QString(), QString(), QString(), QString(),
436  QString(), VIDEO_YEAR_DEFAULT,
437  QDate::fromString("0000-00-00","YYYY-MM-DD"),
438  VIDEO_INETREF_DEFAULT, 0, QString(),
440  0.0, VIDEO_RATING_DEFAULT, 0, 0,
441  0, 0,
442  MythDate::current().date(), 0,
444 
445  newFile.SetHost(sHostName);
446  newFile.SaveToDatabase();
447 
448  return true;
449 }
450 
452 //
454 
456  bool bWatched )
457 {
460  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
461  mlm->setList(videolist);
462  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(nId);
463 
464  if ( !metadata )
465  return false;
466 
467  metadata->SetWatched(bWatched);
468  metadata->UpdateDatabase();
469 
470  return true;
471 }
472 
474  const QString &sTitle,
475  const QString &sSubTitle,
476  const QString &sTagLine,
477  const QString &sDirector,
478  const QString &sStudio,
479  const QString &sPlot,
480  const QString &sRating,
481  const QString &sInetref,
482  int nCollectionRef,
483  const QString &sHomePage,
484  int nYear,
485  QDate sReleasedate,
486  float fUserRating,
487  int nLength,
488  int nPlayCount,
489  int nSeason,
490  int nEpisode,
491  int nShowLevel,
492  const QString &sFileName,
493  const QString &sHash,
494  const QString &sCoverFile,
495  int nChildID,
496  bool bBrowse,
497  bool bWatched,
498  bool bProcessed,
499  const QString &sPlayCommand,
500  int nCategory,
501  const QString &sTrailer,
502  const QString &sHost,
503  const QString &sScreenshot,
504  const QString &sBanner,
505  const QString &sFanart,
506  QDate sInsertDate,
507  const QString &sContentType,
508  const QString &sGenres,
509  const QString &sCast,
510  const QString &sCountries)
511 {
512  bool update_required = false;
515  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
516  mlm->setList(videolist);
517  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(nId);
518 
519  if (!metadata)
520  {
521  LOG(VB_GENERAL, LOG_ERR, QString("UpdateVideoMetadata: Id=%1 not found")
522  .arg(nId));
523  return false;
524  }
525 
526  if (HAS_PARAMv2("Title"))
527  {
528  metadata->SetTitle(sTitle);
529  update_required = true;
530  }
531 
532  if (HAS_PARAMv2("SubTitle"))
533  {
534  metadata->SetSubtitle(sSubTitle);
535  update_required = true;
536  }
537 
538  if (HAS_PARAMv2("TagLine"))
539  {
540  metadata->SetTagline(sTagLine);
541  update_required = true;
542  }
543 
544  if (HAS_PARAMv2("Director"))
545  {
546  metadata->SetDirector(sDirector);
547  update_required = true;
548  }
549 
550  if (HAS_PARAMv2("Studio"))
551  {
552  metadata->SetStudio(sStudio);
553  update_required = true;
554  }
555 
556  if (HAS_PARAMv2("Plot"))
557  {
558  metadata->SetPlot(sPlot);
559  update_required = true;
560  }
561 
562  if (HAS_PARAMv2("UserRating"))
563  {
564  metadata->SetUserRating(fUserRating);
565  update_required = true;
566  }
567 
568  if (HAS_PARAMv2("Inetref"))
569  {
570  metadata->SetInetRef(sInetref);
571  update_required = true;
572  }
573 
574  if (HAS_PARAMv2("CollectionRef"))
575  {
576  metadata->SetCollectionRef(nCollectionRef);
577  update_required = true;
578  }
579 
580  if (HAS_PARAMv2("HomePage"))
581  {
582  metadata->SetHomepage(sHomePage);
583  update_required = true;
584  }
585 
586  if (HAS_PARAMv2("Year"))
587  {
588  metadata->SetYear(nYear);
589  update_required = true;
590  }
591 
592  if (HAS_PARAMv2("ReleaseDate"))
593  {
594  metadata->SetReleaseDate(sReleasedate);
595  update_required = true;
596  }
597 
598  if (HAS_PARAMv2("Rating"))
599  {
600  metadata->SetRating(sRating);
601  update_required = true;
602  }
603 
604  if (HAS_PARAMv2("Length"))
605  {
606  metadata->SetLength(std::chrono::minutes(nLength));
607  update_required = true;
608  }
609 
610  if (HAS_PARAMv2("PlayCount"))
611  {
612  metadata->SetPlayCount(nPlayCount);
613  update_required = true;
614  }
615 
616  if (HAS_PARAMv2("Season"))
617  {
618  metadata->SetSeason(nSeason);
619  update_required = true;
620  }
621 
622  if (HAS_PARAMv2("Episode"))
623  {
624  metadata->SetEpisode(nEpisode);
625  update_required = true;
626  }
627 
628  if (HAS_PARAMv2("ShowLevel"))
629  {
630  metadata->SetShowLevel(ParentalLevel::Level(nShowLevel));
631  update_required = true;
632  }
633 
634  if (HAS_PARAMv2("FileName"))
635  {
636  metadata->SetFilename(sFileName);
637  update_required = true;
638  }
639 
640  if (HAS_PARAMv2("Hash"))
641  {
642  metadata->SetHash(sHash);
643  update_required = true;
644  }
645 
646  if (HAS_PARAMv2("CoverFile"))
647  {
648  metadata->SetCoverFile(sCoverFile);
649  update_required = true;
650  }
651 
652  if (HAS_PARAMv2("ChildID"))
653  {
654  metadata->SetChildID(nChildID);
655  update_required = true;
656  }
657 
658  if (HAS_PARAMv2("Browse"))
659  {
660  metadata->SetBrowse(bBrowse);
661  update_required = true;
662  }
663 
664  if (HAS_PARAMv2("Watched"))
665  {
666  metadata->SetWatched(bWatched);
667  update_required = true;
668  }
669 
670  if (HAS_PARAMv2("Processed"))
671  {
672  metadata->SetProcessed(bProcessed);
673  update_required = true;
674  }
675 
676  if (HAS_PARAMv2("PlayCommand"))
677  {
678  metadata->SetPlayCommand(sPlayCommand);
679  update_required = true;
680  }
681 
682  if (HAS_PARAMv2("Category"))
683  {
684  metadata->SetCategoryID(nCategory);
685  update_required = true;
686  }
687 
688  if (HAS_PARAMv2("Trailer"))
689  {
690  metadata->SetTrailer(sTrailer);
691  update_required = true;
692  }
693 
694  if (HAS_PARAMv2("Host"))
695  {
696  metadata->SetHost(sHost);
697  update_required = true;
698  }
699 
700  if (HAS_PARAMv2("Screenshot"))
701  {
702  metadata->SetScreenshot(sScreenshot);
703  update_required = true;
704  }
705 
706  if (HAS_PARAMv2("Banner"))
707  {
708  metadata->SetBanner(sBanner);
709  update_required = true;
710  }
711 
712  if (HAS_PARAMv2("Fanart"))
713  {
714  metadata->SetFanart(sFanart);
715  update_required = true;
716  }
717 
718  if (HAS_PARAMv2("InsertDate"))
719  {
720  metadata->SetInsertdate(sInsertDate);
721  update_required = true;
722  }
723 
724  if (HAS_PARAMv2("ContentType"))
725  {
726  // valid values for ContentType are 'MOVIE','TELEVISION','ADULT','MUSICVIDEO','HOMEVIDEO'
727  VideoContentType contentType = kContentUnknown;
728  if (sContentType == "MOVIE")
729  contentType = kContentMovie;
730 
731  if (sContentType == "TELEVISION")
732  contentType = kContentTelevision;
733 
734  if (sContentType == "ADULT")
735  contentType = kContentAdult;
736 
737  if (sContentType == "MUSICVIDEO")
738  contentType = kContentMusicVideo;
739 
740  if (sContentType == "HOMEVIDEO")
741  contentType = kContentHomeMovie;
742 
743  if (contentType != kContentUnknown)
744  {
745  metadata->SetContentType(contentType);
746  update_required = true;
747  }
748  else
749  LOG(VB_GENERAL, LOG_ERR, QString("UpdateVideoMetadata: Ignoring unknown ContentType: %1").arg(sContentType));
750  }
751 
752  if (HAS_PARAMv2("Genres"))
753  {
755 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
756  QStringList genresList = sGenres.split(',', QString::SkipEmptyParts);
757 #else
758  QStringList genresList = sGenres.split(',', Qt::SkipEmptyParts);
759 #endif
760 
761  std::transform(genresList.cbegin(), genresList.cend(), std::back_inserter(genres),
762  [](const QString& name)
763  {return VideoMetadata::genre_list::value_type(-1, name.simplified());} );
764 
765  metadata->SetGenres(genres);
766  update_required = true;
767  }
768 
769  if (HAS_PARAMv2("Cast"))
770  {
772 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
773  QStringList castList = sCast.split(',', QString::SkipEmptyParts);
774 #else
775  QStringList castList = sCast.split(',', Qt::SkipEmptyParts);
776 #endif
777 
778  std::transform(castList.cbegin(), castList.cend(), std::back_inserter(cast),
779  [](const QString& name)
780  {return VideoMetadata::cast_list::value_type(-1, name.simplified());} );
781 
782  metadata->SetCast(cast);
783  update_required = true;
784  }
785 
786  if (HAS_PARAMv2("Countries"))
787  {
788  VideoMetadata::country_list countries;
789 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
790  QStringList countryList = sCountries.split(',', QString::SkipEmptyParts);
791 #else
792  QStringList countryList = sCountries.split(',', Qt::SkipEmptyParts);
793 #endif
794 
795  std::transform(countryList.cbegin(), countryList.cend(), std::back_inserter(countries),
796  [](const QString& name)
797  {return VideoMetadata::country_list::value_type(-1, name.simplified());} );
798 
799  metadata->SetCountries(countries);
800  update_required = true;
801  }
802 
803  if (update_required)
804  metadata->UpdateDatabase();
805 
806  return true;
807 }
808 
810 // Set bookmark of a video as a frame number.
812 
813 bool V2Video::SetSavedBookmark( int Id, long Offset )
814 {
815  MSqlQuery query(MSqlQuery::InitCon());
816 
817  query.prepare("SELECT filename "
818  "FROM videometadata "
819  "WHERE intid = :ID ");
820  query.bindValue(":ID", Id);
821 
822  if (!query.exec())
823  {
824  MythDB::DBError("Video::SetSavedBookmark", query);
825  return false;
826  }
827 
828  QString fileName;
829 
830  if (query.next())
831  fileName = query.value(0).toString();
832  else
833  {
834  LOG(VB_GENERAL, LOG_ERR, QString("Video/SetSavedBookmark Video id %1 Not found.").arg(Id));
835  return false;
836  }
837 
838  ProgramInfo pi(fileName,
839  nullptr, // _plot,
840  nullptr, // _title,
841  nullptr, // const QString &_sortTitle,
842  nullptr, // const QString &_subtitle,
843  nullptr, // const QString &_sortSubtitle,
844  nullptr, // const QString &_director,
845  0, // int _season,
846  0, // int _episode,
847  nullptr, // const QString &_inetref,
848  0min, // uint _length_in_minutes,
849  0, // uint _year,
850  nullptr); //const QString &_programid);
851 
852  pi.SaveBookmark(Offset);
853  return true;
854 }
855 
857 // Set bookmark of a video as a frame number.
859 
860 bool V2Video::SetLastPlayPos( int Id, long Offset )
861 {
862  MSqlQuery query(MSqlQuery::InitCon());
863 
864  query.prepare("SELECT filename "
865  "FROM videometadata "
866  "WHERE intid = :ID ");
867  query.bindValue(":ID", Id);
868 
869  if (!query.exec())
870  {
871  MythDB::DBError("Video::SetLastPlayPos", query);
872  return false;
873  }
874 
875  QString fileName;
876 
877  if (query.next())
878  fileName = query.value(0).toString();
879  else
880  {
881  LOG(VB_GENERAL, LOG_ERR, QString("Video/SetLastPlayPos Video id %1 Not found.").arg(Id));
882  return false;
883  }
884 
885  ProgramInfo pi(fileName,
886  nullptr, // _plot,
887  nullptr, // _title,
888  nullptr, // const QString &_sortTitle,
889  nullptr, // const QString &_subtitle,
890  nullptr, // const QString &_sortSubtitle,
891  nullptr, // const QString &_director,
892  0, // int _season,
893  0, // int _episode,
894  nullptr, // const QString &_inetref,
895  0min, // uint _length_in_minutes,
896  0, // uint _year,
897  nullptr); //const QString &_programid);
898 
899  pi.SaveLastPlayPos(Offset);
900  return true;
901 }
902 
903 
904 V2BlurayInfo* V2Video::GetBluray( const QString &sPath )
905 {
906  QString path = sPath;
907 
908  if (sPath.isEmpty())
909  path = gCoreContext->GetSetting( "BluRayMountpoint", "/media/cdrom");
910 
911  LOG(VB_GENERAL, LOG_NOTICE,
912  QString("Parsing Blu-ray at path: %1 ").arg(path));
913 
914  auto *bdmeta = new BlurayMetadata(path);
915 
916  if ( !bdmeta )
917  throw( QString( "Unable to open Blu-ray Metadata Parser!" ));
918 
919  if ( !bdmeta->OpenDisc() )
920  throw( QString( "Unable to open Blu-ray Disc/Path!" ));
921 
922  if ( !bdmeta->ParseDisc() )
923  throw( QString( "Unable to parse metadata from Blu-ray Disc/Path!" ));
924 
925  auto *pBlurayInfo = new V2BlurayInfo();
926 
927  pBlurayInfo->setPath(path);
928  pBlurayInfo->setTitle(bdmeta->GetTitle());
929  pBlurayInfo->setAltTitle(bdmeta->GetAlternateTitle());
930  pBlurayInfo->setDiscLang(bdmeta->GetDiscLanguage());
931  pBlurayInfo->setDiscNum(bdmeta->GetCurrentDiscNumber());
932  pBlurayInfo->setTotalDiscNum(bdmeta->GetTotalDiscNumber());
933  pBlurayInfo->setTitleCount(bdmeta->GetTitleCount());
934  pBlurayInfo->setThumbCount(bdmeta->GetThumbnailCount());
935  pBlurayInfo->setTopMenuSupported(bdmeta->GetTopMenuSupported());
936  pBlurayInfo->setFirstPlaySupported(bdmeta->GetFirstPlaySupported());
937  pBlurayInfo->setNumHDMVTitles(bdmeta->GetNumHDMVTitles());
938  pBlurayInfo->setNumBDJTitles(bdmeta->GetNumBDJTitles());
939  pBlurayInfo->setNumUnsupportedTitles(bdmeta->GetNumUnsupportedTitles());
940  pBlurayInfo->setAACSDetected(bdmeta->GetAACSDetected());
941  pBlurayInfo->setLibAACSDetected(bdmeta->GetLibAACSDetected());
942  pBlurayInfo->setAACSHandled(bdmeta->GetAACSHandled());
943  pBlurayInfo->setBDPlusDetected(bdmeta->GetBDPlusDetected());
944  pBlurayInfo->setLibBDPlusDetected(bdmeta->GetLibBDPlusDetected());
945  pBlurayInfo->setBDPlusHandled(bdmeta->GetBDPlusHandled());
946 
947  QStringList thumbs = bdmeta->GetThumbnails();
948  if (!thumbs.empty())
949  pBlurayInfo->setThumbPath(thumbs.at(0));
950 
951  delete bdmeta;
952 
953  return pBlurayInfo;
954 }
955 
956 
958 // Jun 3, 2020
959 // Service to get stream info for all streams in a media file.
960 // This gets some basic info. If anything more is needed it can be added,
961 // depending on whether it is available from ffmpeg avformat apis.
962 // See the MythStreamInfoList class for the code that uses avformat to
963 // extract the information.
965 
967  ( const QString &storageGroup,
968  const QString &FileName )
969 {
970 
971  // Search for the filename
972 
973  StorageGroup storage( storageGroup );
974  QString sFullFileName = storage.FindFile( FileName );
975  MythStreamInfoList infos(sFullFileName);
976 
977  // The constructor of this class reads the file and gets the needed
978  // information.
979  auto *pVideoStreamInfos = new V2VideoStreamInfoList();
980 
981  pVideoStreamInfos->setCount ( infos.m_streamInfoList.size() );
982  pVideoStreamInfos->setAsOf ( MythDate::current() );
983  pVideoStreamInfos->setVersion ( MYTH_BINARY_VERSION );
984  pVideoStreamInfos->setProtoVer ( MYTH_PROTO_VERSION );
985  pVideoStreamInfos->setErrorCode ( infos.m_errorCode );
986  pVideoStreamInfos->setErrorMsg ( infos.m_errorMsg );
987 
988  for (const auto & info : qAsConst(infos.m_streamInfoList))
989  {
990  V2VideoStreamInfo *pVideoStreamInfo = pVideoStreamInfos->AddNewVideoStreamInfo();
991  pVideoStreamInfo->setCodecType ( QString(QChar(info.m_codecType)) );
992  pVideoStreamInfo->setCodecName ( info.m_codecName );
993  pVideoStreamInfo->setWidth ( info.m_width );
994  pVideoStreamInfo->setHeight ( info.m_height );
995  pVideoStreamInfo->setAspectRatio ( info.m_SampleAspectRatio );
996  pVideoStreamInfo->setFieldOrder ( info.m_fieldOrder );
997  pVideoStreamInfo->setFrameRate ( info.m_frameRate );
998  pVideoStreamInfo->setAvgFrameRate ( info.m_avgFrameRate );
999  pVideoStreamInfo->setChannels ( info.m_channels );
1000  pVideoStreamInfo->setDuration ( info.m_duration );
1001 
1002  }
1003  return pVideoStreamInfos;
1004 }
1005 
1007 // October 26,2022
1008 // Support for Cut List for Videos
1010 
1012  const QString &offsettype )
1013 {
1014  MSqlQuery query(MSqlQuery::InitCon());
1015 
1016  query.prepare("SELECT filename "
1017  "FROM videometadata "
1018  "WHERE intid = :ID ");
1019  query.bindValue(":ID", Id);
1020 
1021  if (!query.exec())
1022  {
1023  MythDB::DBError("V2Video::GetVideoCommBreak", query);
1024  throw QString("Database Error.");
1025  }
1026 
1027  QString fileName;
1028 
1029  if (query.next())
1030  fileName = query.value(0).toString();
1031  else
1032  {
1033  LOG(VB_GENERAL, LOG_ERR, QString("V2Video/GetVideoCommBreak Video id %1 Not found.").arg(Id));
1034  throw QString("Video Not Found.");
1035  }
1036 
1037  ProgramInfo pi(fileName,
1038  nullptr, // _plot,
1039  nullptr, // _title,
1040  nullptr, // const QString &_sortTitle,
1041  nullptr, // const QString &_subtitle,
1042  nullptr, // const QString &_sortSubtitle,
1043  nullptr, // const QString &_director,
1044  0, // int _season,
1045  0, // int _episode,
1046  nullptr, // const QString &_inetref,
1047  0min, // uint _length_in_minutes,
1048  0, // uint _year,
1049  nullptr); //const QString &_programid);
1050 
1051 
1052  int marktype = 0;
1053 
1054  auto* pCutList = new V2CutList();
1055  if (offsettype.toLower() == "position")
1056  marktype = 1;
1057  else if (offsettype.toLower() == "duration")
1058  marktype = 2;
1059  else
1060  marktype = 0;
1061 
1062  V2FillCutList(pCutList, &pi, marktype);
1063 
1064  return pCutList;
1065 }
1066 
1068 // October 26,2022
1069 // Support for Commercial Break List for Videos
1071 
1073  const QString &offsettype )
1074 {
1075  MSqlQuery query(MSqlQuery::InitCon());
1076 
1077  query.prepare("SELECT filename "
1078  "FROM videometadata "
1079  "WHERE intid = :ID ");
1080  query.bindValue(":ID", Id);
1081 
1082  if (!query.exec())
1083  {
1084  MythDB::DBError("V2Video::GetVideoCommBreak", query);
1085  throw QString("Database Error.");
1086  }
1087 
1088  QString fileName;
1089 
1090  if (query.next())
1091  fileName = query.value(0).toString();
1092  else
1093  {
1094  LOG(VB_GENERAL, LOG_ERR, QString("V2Video/GetVideoCommBreak Video id %1 Not found.").arg(Id));
1095  throw QString("Video Not Found.");
1096  }
1097 
1098  ProgramInfo pi(fileName,
1099  nullptr, // _plot,
1100  nullptr, // _title,
1101  nullptr, // const QString &_sortTitle,
1102  nullptr, // const QString &_subtitle,
1103  nullptr, // const QString &_sortSubtitle,
1104  nullptr, // const QString &_director,
1105  0, // int _season,
1106  0, // int _episode,
1107  nullptr, // const QString &_inetref,
1108  0min, // uint _length_in_minutes,
1109  0, // uint _year,
1110  nullptr); //const QString &_programid);
1111 
1112 
1113  int marktype = 0;
1114 
1115  auto* pCutList = new V2CutList();
1116  if (offsettype.toLower() == "position")
1117  marktype = 1;
1118  else if (offsettype.toLower() == "duration")
1119  marktype = 2;
1120  else
1121  marktype = 0;
1122 
1123  V2FillCommBreak(pCutList, &pi, marktype);
1124 
1125  return pCutList;
1126 }
MythHTTPService::HAS_PARAMv2
bool HAS_PARAMv2(const QString &p)
Definition: mythhttpservice.h:36
V2VideoLookup::AddNewArtwork
V2ArtworkItem * AddNewArtwork()
Definition: v2videoLookupInfo.h:129
MythStreamInfoList::m_errorMsg
QString m_errorMsg
Definition: mythavutil.h:110
BlurayMetadata
Definition: bluraymetadata.h:25
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:807
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:128
VideoMetadata
Definition: videometadata.h:24
V2VideoStreamInfoList
Definition: v2videoStreamInfoList.h:20
v2video.h
V2Video::AddVideo
static bool AddVideo(const QString &FileName, const QString &HostName)
Definition: v2video.cpp:399
GrabberType
GrabberType
Definition: metadatagrabber.h:20
MetadataLookup::GetTMSref
QString GetTMSref() const
Definition: metadatacommon.h:359
V2Video::GetVideoCommBreak
static V2CutList * GetVideoCommBreak(int Id, const QString &OffsetType)
Definition: v2video.cpp:1072
ProgramInfo::SaveBookmark
void SaveBookmark(uint64_t frame)
Clears any existing bookmark in DB and if frame is greater than 0 sets a new bookmark.
Definition: programinfo.cpp:2677
ParentalLevel::plLowest
@ plLowest
Definition: parentalcontrols.h:12
V2VideoLookupList
Definition: v2videoLookupInfoList.h:21
videometadata.h
mythdb.h
V2Video::LookupVideo
static V2VideoLookupList * LookupVideo(const QString &Title, const QString &Subtitle, const QString &Inetref, int Season, int Episode, const QString &GrabberType, bool AllowGeneric)
Definition: v2video.cpp:267
MetadataLookup::GetTitle
QString GetTitle() const
Definition: metadatacommon.h:299
VideoMetadataListManager
Definition: videometadatalistmanager.h:10
V2FillCommBreak
void V2FillCommBreak(V2CutList *pCutList, ProgramInfo *rInfo, int marktype)
Definition: v2serviceUtil.cpp:619
simple_ref_ptr
Definition: quicksp.h:24
V2Video::GetBluray
static V2BlurayInfo * GetBluray(const QString &Path)
Definition: v2video.cpp:904
ArtworkList
QList< ArtworkInfo > ArtworkList
Definition: metadataimagehelper.h:30
V2FillVideoMetadataInfo
void V2FillVideoMetadataInfo(V2VideoMetadataInfo *pVideoMetadataInfo, const VideoMetadataListManager::VideoMetadataPtr &pMetadata, bool bDetails)
Definition: v2serviceUtil.cpp:361
StorageGroup::FindFile
QString FindFile(const QString &filename)
Definition: storagegroup.cpp:602
MetadataLookup::GetLanguage
QString GetLanguage() const
Definition: metadatacommon.h:304
MythStreamInfoList
Definition: mythavutil.h:106
V2BlurayInfo
Definition: v2blurayInfo.h:20
V2ArtworkItem
Definition: v2videoLookupInfo.h:22
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:205
mythdbcon.h
VideoMetadata::country_list
std::vector< country_entry > country_list
Definition: videometadata.h:33
mythhttpmetaservice.h
V2Video::SetLastPlayPos
static bool SetLastPlayPos(int Id, long Offset)
Definition: v2video.cpp:860
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:608
V2Video::GetVideo
static V2VideoMetadataInfo * GetVideo(int Id)
Definition: v2video.cpp:55
MetadataLookup::GetArtwork
ArtworkList GetArtwork(VideoArtworkType type) const
Definition: metadatacommon.cpp:330
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
VideoMetadata::genre_list
std::vector< genre_entry > genre_list
Definition: videometadata.h:32
MetadataLookup::GetCertification
QString GetCertification() const
Definition: metadatacommon.h:335
MetadataLookup::GetBudget
uint GetBudget() const
Definition: metadatacommon.h:338
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:14
VideoMetadataListManager::loadAllFromDatabase
static void loadAllFromDatabase(metadata_list &items, const QString &sql="")
Load videometadata database into memory.
Definition: videometadatalistmanager.cpp:128
V2VideoStreamInfo
Definition: v2videoStreamInfo.h:21
mythversion.h
V2VideoLookup
Definition: v2videoLookupInfo.h:58
MetadataLookup
Definition: metadatacommon.h:87
ProgramInfo::QueryBookmark
uint64_t QueryBookmark(void) const
Gets any bookmark position in database, unless the ignore bookmark flag is set.
Definition: programinfo.cpp:2801
MYTH_PROTO_VERSION
static constexpr const char * MYTH_PROTO_VERSION
Increment this whenever the MythTV network protocol changes.
Definition: mythversion.h:47
MythStreamInfoList::m_errorCode
int m_errorCode
Definition: mythavutil.h:109
V2Video::GetStreamInfo
static V2VideoStreamInfoList * GetStreamInfo(const QString &StorageGroup, const QString &FileName)
Definition: v2video.cpp:967
V2Video::SetSavedBookmark
static bool SetSavedBookmark(int Id, long Offset)
Definition: v2video.cpp:813
programinfo.h
mythlogging.h
V2Video::UpdateVideoMetadata
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, 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, QDate InsertDate, const QString &ContentType, const QString &Genres, const QString &Cast, const QString &Countries)
Definition: v2video.cpp:473
MetadataLookup::GetEpisode
uint GetEpisode() const
Definition: metadatacommon.h:315
MetadataLookup::GetDescription
QString GetDescription() const
Definition: metadatacommon.h:312
MetadataLookup::GetIMDB
QString GetIMDB() const
Definition: metadatacommon.h:358
v2serviceUtil.h
ParentalLevel::Level
Level
Definition: parentalcontrols.h:12
globals.h
RefCountedList< MetadataLookup >
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:540
V2Video::RemoveVideoFromDB
static bool RemoveVideoFromDB(int Id)
Definition: v2video.cpp:383
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:227
VideoMetadata::SaveToDatabase
void SaveToDatabase()
Definition: videometadata.cpp:1951
VIDEO_COVERFILE_DEFAULT
const QString VIDEO_COVERFILE_DEFAULT
Definition: globals.cpp:25
Q_GLOBAL_STATIC_WITH_ARGS
Q_GLOBAL_STATIC_WITH_ARGS(MythHTTPMetaService, s_service,(VIDEO_HANDLE, V2Video::staticMetaObject, &V2Video::RegisterCustomTypes)) void V2Video
Definition: v2video.cpp:26
VIDEO_PLOT_DEFAULT
const QString VIDEO_PLOT_DEFAULT
Definition: globals.cpp:32
kArtworkFanart
@ kArtworkFanart
Definition: metadataimagehelper.h:12
MetadataLookup::GetSubtitle
QString GetSubtitle() const
Definition: metadatacommon.h:310
kContentTelevision
@ kContentTelevision
Definition: metadatacommon.h:62
VIDEO_HANDLE
#define VIDEO_HANDLE
Definition: v2video.h:14
MetadataLookup::GetCountries
QStringList GetCountries() const
Definition: metadatacommon.h:336
V2CutList
Definition: v2cutList.h:21
storagegroup.h
MetadataLookup::GetYear
uint GetYear() const
Definition: metadatacommon.h:349
MetadataLookup::GetCollectionref
QString GetCollectionref() const
Definition: metadatacommon.h:357
VIDEO_TRAILER_DEFAULT
const QString VIDEO_TRAILER_DEFAULT
Definition: globals.cpp:26
MYTH_BINARY_VERSION
static constexpr const char * MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
Definition: mythversion.h:15
MetadataLookup::GetUserRating
float GetUserRating() const
Definition: metadatacommon.h:302
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:54
MythHTTPService
Definition: mythhttpservice.h:19
V2Video::V2Video
V2Video()
Definition: v2video.cpp:50
VIDEO_INETREF_DEFAULT
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
VIDEO_FANART_DEFAULT
const QString VIDEO_FANART_DEFAULT
Definition: globals.cpp:29
MetadataFactory
Definition: metadatafactory.h:85
MetadataLookup::GetSeason
uint GetSeason() const
Definition: metadatacommon.h:314
MythDate::fromString
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:34
MetadataLookup::GetPopularity
float GetPopularity() const
Definition: metadatacommon.h:337
v2artworkInfoList.h
MetadataLookup::GetRuntime
std::chrono::minutes GetRuntime() const
Definition: metadatacommon.h:352
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
VideoContentType
VideoContentType
Definition: metadatacommon.h:60
V2Video::GetLastPlayPos
static long GetLastPlayPos(int Id)
Definition: v2video.cpp:140
mythmiscutil.h
V2Video::UpdateVideoWatchedStatus
static bool UpdateVideoWatchedStatus(int Id, bool Watched)
Definition: v2video.cpp:455
mythcorecontext.h
MetadataLookup::GetTagline
QString GetTagline() const
Definition: metadatacommon.h:311
VideoMetadata::cast_list
std::vector< cast_entry > cast_list
Definition: videometadata.h:34
VideoMetadata::SetHost
void SetHost(const QString &host)
Definition: videometadata.cpp:1841
MetadataLookup::GetRevenue
uint GetRevenue() const
Definition: metadatacommon.h:339
MetadataLookup::GetInetref
QString GetInetref() const
Definition: metadatacommon.h:356
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:883
VIDEO_RATING_DEFAULT
const QString VIDEO_RATING_DEFAULT
Definition: globals.cpp:30
V2FillCutList
void V2FillCutList(V2CutList *pCutList, ProgramInfo *rInfo, int marktype)
Definition: v2serviceUtil.cpp:577
VideoMetadataListManager::loadOneFromDatabase
static VideoMetadataPtr loadOneFromDatabase(uint id)
Definition: videometadatalistmanager.cpp:111
bluraymetadata.h
mythavutil.h
V2Video::RegisterCustomTypes
static void RegisterCustomTypes()
metadatafactory.h
StorageGroup
Definition: storagegroup.h:11
kContentAdult
@ kContentAdult
Definition: metadatacommon.h:63
V2VideoMetadataInfoList
Definition: v2videoMetadataInfoList.h:20
kArtworkBanner
@ kArtworkBanner
Definition: metadataimagehelper.h:13
kContentMusicVideo
@ kContentMusicVideo
Definition: metadatacommon.h:64
VIDEO_YEAR_DEFAULT
@ VIDEO_YEAR_DEFAULT
Definition: videometadata.h:18
kContentMovie
@ kContentMovie
Definition: metadatacommon.h:61
VideoMetadataListManager::metadata_list
std::list< VideoMetadataPtr > metadata_list
Definition: videometadatalistmanager.h:14
v2genreList.h
MetadataLookup::GetReleaseDate
QDate GetReleaseDate() const
Definition: metadatacommon.h:350
ProgramInfo::QueryLastPlayPos
uint64_t QueryLastPlayPos(void) const
Gets any lastplaypos position in database, unless the ignore lastplaypos flag is set.
Definition: programinfo.cpp:2828
kContentUnknown
@ kContentUnknown
Definition: metadatacommon.h:66
VIDEO_BANNER_DEFAULT
const QString VIDEO_BANNER_DEFAULT
Definition: globals.cpp:28
kArtworkScreenshot
@ kArtworkScreenshot
Definition: metadataimagehelper.h:14
MetadataLookup::GetHomepage
QString GetHomepage() const
Definition: metadatacommon.h:367
kContentHomeMovie
@ kContentHomeMovie
Definition: metadatacommon.h:65
V2Video::GetVideoByFileName
static V2VideoMetadataInfo * GetVideoByFileName(const QString &FileName)
Definition: v2video.cpp:70
FileHash
QString FileHash(const QString &filename)
Definition: mythmiscutil.cpp:549
V2Video::GetSavedBookmark
static long GetSavedBookmark(int Id)
Definition: v2video.cpp:93
V2Video::GetVideoList
static V2VideoMetadataInfoList * GetVideoList(const QString &Folder, const QString &Sort, bool Descending, int StartIndex, int Count)
Definition: v2video.cpp:184
v2castMemberList.h
kArtworkCoverart
@ kArtworkCoverart
Definition: metadataimagehelper.h:11
MythHTTPMetaService
Definition: mythhttpmetaservice.h:10
VIDEO_DIRECTOR_DEFAULT
const QString VIDEO_DIRECTOR_DEFAULT
Definition: globals.cpp:23
V2Video::GetVideoCutList
static V2CutList * GetVideoCutList(int Id, const QString &OffsetType)
Definition: v2video.cpp:1011
ProgramInfo::SaveLastPlayPos
void SaveLastPlayPos(uint64_t frame)
TODO Move to RecordingInfo.
Definition: programinfo.cpp:2714
VIDEO_SCREENSHOT_DEFAULT
const QString VIDEO_SCREENSHOT_DEFAULT
Definition: globals.cpp:27
V2VideoMetadataInfo
Definition: v2videoMetadataInfo.h:9
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:896
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:832
MythStreamInfoList::m_streamInfoList
QVector< MythStreamInfo > m_streamInfoList
Definition: mythavutil.h:111