MythTV  master
v2video.cpp
Go to the documentation of this file.
1 // MythTV
4 #include "libmythbase/mythdb.h"
8 #include "libmythbase/mythversion.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 
184 // If CollapseSubDirs is true, then files in subdirectories are not returned.
185 // Instead, one row is returned for each subdirectory, with the full
186 // directory name in FileName and the lowest part of the directory name
187 // in Title. These directories are returned at the beginning of the list.
188 //
189 // Example: If the database has these files:
190 // one.mkv
191 // dir1/two.mkv
192 // dir1/dir2/two.mkv
193 //
194 // With no Folder name and CollapseSubDirs=true, you get
195 // one.mkv
196 // dir1 Title=dir1
197 //
198 // With Folder=dir1 and CollapseSubDirs=true, you get
199 // dir1/two.mkv
200 // dir1/dir2 Title=dir2
201 
203  const QString &Sort,
204  bool bDescending,
205  int nStartIndex,
206  int nCount,
207  bool CollapseSubDirs )
208 {
209  QString fields = "title,director,studio,plot,rating,year,releasedate,"
210  "userrating,length,playcount,filename,hash,showlevel,"
211  "coverfile,inetref,collectionref,homepage,childid,browse,watched,"
212  "playcommand,category,intid,trailer,screenshot,banner,fanart,"
213  "subtitle,tagline,season,episode,host,insertdate,processed,contenttype";
214 
215  QStringList sortFields = fields.split(',');
216 
218 
219  QString sql = "";
220  QString folder;
221  QString bindValue;
222  if (!Folder.isEmpty())
223  {
224  if (Folder.endsWith('/'))
225  folder = Folder;
226  else
227  folder = Folder + "/";
228  bindValue = folder + "%";
229  sql.append(" WHERE filename LIKE :BINDVALUE ");
230  }
231  sql.append(" ORDER BY ");
232  QString defSeq = " ASC";
233  if (bDescending)
234  defSeq = " DESC";
235 
236  QStringList sortList = Sort.toLower().split(',',Qt::SkipEmptyParts);
237  bool next = false;
238  for (const auto & item : std::as_const(sortList))
239  {
240  QStringList partList = item.split(' ',Qt::SkipEmptyParts);
241  if (partList.empty())
242  continue;
243  QString sort = partList[0];
244  if (sort == "added")
245  sort = "insertdate";
246  else if (sort == "released")
247  sort = "releasedate";
248  if (sortFields.contains(sort))
249  {
250  if (next)
251  sql.append(",");
252  sql.append(sort);
253  if (partList.length() > 1 && partList[1].compare("DESC",Qt::CaseInsensitive) == 0)
254  sql.append(" DESC");
255  else if (partList.length() > 1 && partList[1].compare("ASC",Qt::CaseInsensitive) == 0)
256  sql.append(" ASC");
257  else
258  sql.append(defSeq);
259  next = true;
260  }
261  }
262  if (!next)
263  {
264  sql.append("intid");
265  sql.append(defSeq);
266  }
267 
268  VideoMetadataListManager::loadAllFromDatabase(videolist, sql, bindValue);
269  std::vector<VideoMetadataListManager::VideoMetadataPtr> videos(videolist.begin(), videolist.end());
270 
271  // ----------------------------------------------------------------------
272  // Build Response
273  // ----------------------------------------------------------------------
274 
275  auto *pVideoMetadataInfos = new V2VideoMetadataInfoList();
276  QMap<QString, QString> map;
277  int folderlen = folder.length();
278 
279  nStartIndex = (nStartIndex > 0) ? std::min( nStartIndex, (int)videos.size() ) : 0;
280  int selectedCount = 0;
281  int totalCount = 0;
282  QString dir;
283 
284  // Make directory list
285  if (CollapseSubDirs)
286  {
287  for( const auto& metadata : videos )
288  {
289  if (!metadata)
290  break;
291  QString fnPart = metadata->GetFilename().mid(folderlen);
292  int slashPos = fnPart.indexOf('/',1);
293  if (slashPos >= 0)
294  {
295  dir = fnPart.mid(0, slashPos);
296  if (!map.contains(dir))
297  {
298  // use toLower here so that lower case are sorted in with
299  // upper case rather than separately at the end.
300  map.insert(dir.toLower(), dir);
301  }
302  }
303  }
304  // Insert directory entries at the front of the list, ordered ascending
305  // or descending, depending on the value of bDescending
306  QMapIterator<QString, QString> it(map);
307  if (bDescending)
308  it.toBack();
309 
310  while (bDescending? it.hasPrevious() : it.hasNext())
311  {
312  if (bDescending)
313  it.previous();
314  else
315  it.next();
316  if (totalCount >= nStartIndex && (nCount == 0 || selectedCount < nCount)) {
317  V2VideoMetadataInfo *pVideoMetadataInfo =
318  pVideoMetadataInfos->AddNewVideoMetadataInfo();
319  pVideoMetadataInfo->setContentType("DIRECTORY");
320  pVideoMetadataInfo->setFileName(folder + it.value());
321  pVideoMetadataInfo->setTitle(it.value());
322  selectedCount++;
323  }
324  totalCount++;
325  }
326  }
327 
328  for( const auto& metadata : videos )
329  {
330  if (!metadata)
331  break;
332 
333  if (CollapseSubDirs)
334  {
335  QString fnPart = metadata->GetFilename().mid(folderlen);
336  int slashPos = fnPart.indexOf('/',1);
337  if (slashPos >= 0)
338  continue;
339  }
340 
341  if (totalCount >= nStartIndex && (nCount == 0 || selectedCount < nCount)) {
342  V2VideoMetadataInfo *pVideoMetadataInfo = pVideoMetadataInfos->AddNewVideoMetadataInfo();
343  V2FillVideoMetadataInfo ( pVideoMetadataInfo, metadata, true );
344  selectedCount++;
345  }
346  totalCount++;
347  }
348 
349  int curPage = 0;
350  int totalPages = 0;
351  if (nCount == 0)
352  totalPages = 1;
353  else
354  totalPages = (int)ceil((float)totalCount / nCount);
355 
356  if (totalPages == 1)
357  curPage = 1;
358  else
359  {
360  curPage = (int)ceil((float)nStartIndex / nCount) + 1;
361  }
362 
363  pVideoMetadataInfos->setStartIndex ( nStartIndex );
364  pVideoMetadataInfos->setCount ( selectedCount );
365  pVideoMetadataInfos->setCurrentPage ( curPage );
366  pVideoMetadataInfos->setTotalPages ( totalPages );
367  pVideoMetadataInfos->setTotalAvailable( totalCount );
368  pVideoMetadataInfos->setAsOf ( MythDate::current() );
369  pVideoMetadataInfos->setVersion ( MYTH_BINARY_VERSION );
370  pVideoMetadataInfos->setProtoVer ( MYTH_PROTO_VERSION );
371 
372  return pVideoMetadataInfos;
373 }
374 
375 
377  const QString &Subtitle,
378  const QString &Inetref,
379  int Season,
380  int Episode,
381  const QString &GrabberType,
382  bool AllowGeneric )
383 {
384  auto *pVideoLookups = new V2VideoLookupList();
385 
386  MetadataLookupList list;
387 
388  auto *factory = new MetadataFactory(nullptr);
389 
390  if (factory)
391  {
392  list = factory->SynchronousLookup(Title, Subtitle,
393  Inetref, Season, Episode,
394  GrabberType, AllowGeneric);
395  }
396 
397  if ( list.empty() )
398  return pVideoLookups;
399 
400  //MetadataLookupList is a reference counted list.
401  //it will delete all its content at its end of life
402  for(const auto & lookup : std::as_const(list))
403  {
404  V2VideoLookup *pVideoLookup = pVideoLookups->AddNewVideoLookup();
405 
406  if (lookup)
407  {
408  pVideoLookup->setTitle(lookup->GetTitle());
409  pVideoLookup->setSubTitle(lookup->GetSubtitle());
410  pVideoLookup->setSeason(lookup->GetSeason());
411  pVideoLookup->setEpisode(lookup->GetEpisode());
412  pVideoLookup->setYear(lookup->GetYear());
413  pVideoLookup->setTagline(lookup->GetTagline());
414  pVideoLookup->setDescription(lookup->GetDescription());
415  pVideoLookup->setCertification(lookup->GetCertification());
416  pVideoLookup->setInetref(lookup->GetInetref());
417  pVideoLookup->setCollectionref(lookup->GetCollectionref());
418  pVideoLookup->setHomePage(lookup->GetHomepage());
419  pVideoLookup->setReleaseDate(
420  QDateTime(lookup->GetReleaseDate(),
421  QTime(0,0),Qt::LocalTime).toUTC());
422  pVideoLookup->setUserRating(lookup->GetUserRating());
423  pVideoLookup->setLength(lookup->GetRuntime().count());
424  pVideoLookup->setLanguage(lookup->GetLanguage());
425  pVideoLookup->setCountries(lookup->GetCountries());
426  pVideoLookup->setPopularity(lookup->GetPopularity());
427  pVideoLookup->setBudget(lookup->GetBudget());
428  pVideoLookup->setRevenue(lookup->GetRevenue());
429  pVideoLookup->setIMDB(lookup->GetIMDB());
430  pVideoLookup->setTMSRef(lookup->GetTMSref());
431 
432  ArtworkList coverartlist = lookup->GetArtwork(kArtworkCoverart);
433  ArtworkList::iterator c;
434  for (c = coverartlist.begin(); c != coverartlist.end(); ++c)
435  {
436  V2ArtworkItem *art = pVideoLookup->AddNewArtwork();
437  art->setType("coverart");
438  art->setUrl((*c).url);
439  art->setThumbnail((*c).thumbnail);
440  art->setWidth((*c).width);
441  art->setHeight((*c).height);
442  }
443  ArtworkList fanartlist = lookup->GetArtwork(kArtworkFanart);
444  ArtworkList::iterator f;
445  for (f = fanartlist.begin(); f != fanartlist.end(); ++f)
446  {
447  V2ArtworkItem *art = pVideoLookup->AddNewArtwork();
448  art->setType("fanart");
449  art->setUrl((*f).url);
450  art->setThumbnail((*f).thumbnail);
451  art->setWidth((*f).width);
452  art->setHeight((*f).height);
453  }
454  ArtworkList bannerlist = lookup->GetArtwork(kArtworkBanner);
455  ArtworkList::iterator b;
456  for (b = bannerlist.begin(); b != bannerlist.end(); ++b)
457  {
458  V2ArtworkItem *art = pVideoLookup->AddNewArtwork();
459  art->setType("banner");
460  art->setUrl((*b).url);
461  art->setThumbnail((*b).thumbnail);
462  art->setWidth((*b).width);
463  art->setHeight((*b).height);
464  }
465  ArtworkList screenshotlist = lookup->GetArtwork(kArtworkScreenshot);
466  ArtworkList::iterator s;
467  for (s = screenshotlist.begin(); s != screenshotlist.end(); ++s)
468  {
469  V2ArtworkItem *art = pVideoLookup->AddNewArtwork();
470  art->setType("screenshot");
471  art->setUrl((*s).url);
472  art->setThumbnail((*s).thumbnail);
473  art->setWidth((*s).width);
474  art->setHeight((*s).height);
475  }
476  }
477  }
478 
479  pVideoLookups->setCount ( list.count() );
480  pVideoLookups->setAsOf ( MythDate::current() );
481  pVideoLookups->setVersion ( MYTH_BINARY_VERSION );
482  pVideoLookups->setProtoVer ( MYTH_PROTO_VERSION );
483 
484  delete factory;
485 
486  return pVideoLookups;
487 }
488 
489 
491 {
492  bool bResult = false;
493 
496  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
497  mlm->setList(videolist);
498  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(Id);
499 
500  if (metadata)
501  bResult = metadata->DeleteFromDatabase();
502 
503  return bResult;
504 }
505 
506 bool V2Video::AddVideo( const QString &sFileName,
507  const QString &sHostName )
508 {
509  if ( sHostName.isEmpty() )
510  throw( QString( "Host not provided! Local storage is deprecated and "
511  "is not supported by the API." ));
512 
513  if ( sFileName.isEmpty() ||
514  (sFileName.contains("/../")) ||
515  (sFileName.startsWith("../")) )
516  {
517  throw( QString( "Filename not provided, or fails sanity checks!" ));
518  }
519 
520  StorageGroup sgroup("Videos", sHostName);
521 
522  QString fullname = sgroup.FindFile(sFileName);
523 
524  if ( !QFile::exists(fullname) )
525  throw( QString( "Provided filename does not exist!" ));
526 
527  QString hash = FileHash(fullname);
528 
529  if (hash == "NULL")
530  {
531  LOG(VB_GENERAL, LOG_ERR, "Video Hash Failed. Unless this is a DVD or "
532  "Blu-ray, something has probably gone wrong.");
533  hash = "";
534  }
535 
536  VideoMetadata newFile(sFileName, QString(), hash,
542  QString(), QString(), QString(), QString(),
543  QString(), VIDEO_YEAR_DEFAULT,
544  QDate::fromString("0000-00-00","YYYY-MM-DD"),
545  VIDEO_INETREF_DEFAULT, 0, QString(),
547  0.0, VIDEO_RATING_DEFAULT, 0, 0,
548  0, 0,
549  MythDate::current().date(), 0,
551 
552  newFile.SetHost(sHostName);
553  newFile.SaveToDatabase();
554 
555  return true;
556 }
557 
559 //
561 
563  bool bWatched )
564 {
567  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
568  mlm->setList(videolist);
569  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(nId);
570 
571  if ( !metadata )
572  return false;
573 
574  metadata->SetWatched(bWatched);
575  metadata->UpdateDatabase();
576 
577  return true;
578 }
579 
581  const QString &sTitle,
582  const QString &sSubTitle,
583  const QString &sTagLine,
584  const QString &sDirector,
585  const QString &sStudio,
586  const QString &sPlot,
587  const QString &sRating,
588  const QString &sInetref,
589  int nCollectionRef,
590  const QString &sHomePage,
591  int nYear,
592  QDate sReleasedate,
593  float fUserRating,
594  int nLength,
595  int nPlayCount,
596  int nSeason,
597  int nEpisode,
598  int nShowLevel,
599  const QString &sFileName,
600  const QString &sHash,
601  const QString &sCoverFile,
602  int nChildID,
603  bool bBrowse,
604  bool bWatched,
605  bool bProcessed,
606  const QString &sPlayCommand,
607  int nCategory,
608  const QString &sTrailer,
609  const QString &sHost,
610  const QString &sScreenshot,
611  const QString &sBanner,
612  const QString &sFanart,
613  QDate sInsertDate,
614  const QString &sContentType,
615  const QString &sGenres,
616  const QString &sCast,
617  const QString &sCountries)
618 {
619  bool update_required = false;
622  QScopedPointer<VideoMetadataListManager> mlm(new VideoMetadataListManager());
623  mlm->setList(videolist);
624  VideoMetadataListManager::VideoMetadataPtr metadata = mlm->byID(nId);
625 
626  if (!metadata)
627  {
628  LOG(VB_GENERAL, LOG_ERR, QString("UpdateVideoMetadata: Id=%1 not found")
629  .arg(nId));
630  return false;
631  }
632 
633  if (HAS_PARAMv2("Title"))
634  {
635  metadata->SetTitle(sTitle);
636  update_required = true;
637  }
638 
639  if (HAS_PARAMv2("SubTitle"))
640  {
641  metadata->SetSubtitle(sSubTitle);
642  update_required = true;
643  }
644 
645  if (HAS_PARAMv2("TagLine"))
646  {
647  metadata->SetTagline(sTagLine);
648  update_required = true;
649  }
650 
651  if (HAS_PARAMv2("Director"))
652  {
653  metadata->SetDirector(sDirector);
654  update_required = true;
655  }
656 
657  if (HAS_PARAMv2("Studio"))
658  {
659  metadata->SetStudio(sStudio);
660  update_required = true;
661  }
662 
663  if (HAS_PARAMv2("Plot"))
664  {
665  metadata->SetPlot(sPlot);
666  update_required = true;
667  }
668 
669  if (HAS_PARAMv2("UserRating"))
670  {
671  metadata->SetUserRating(fUserRating);
672  update_required = true;
673  }
674 
675  if (HAS_PARAMv2("Inetref"))
676  {
677  metadata->SetInetRef(sInetref);
678  update_required = true;
679  }
680 
681  if (HAS_PARAMv2("CollectionRef"))
682  {
683  metadata->SetCollectionRef(nCollectionRef);
684  update_required = true;
685  }
686 
687  if (HAS_PARAMv2("HomePage"))
688  {
689  metadata->SetHomepage(sHomePage);
690  update_required = true;
691  }
692 
693  if (HAS_PARAMv2("Year"))
694  {
695  metadata->SetYear(nYear);
696  update_required = true;
697  }
698 
699  if (HAS_PARAMv2("ReleaseDate"))
700  {
701  metadata->SetReleaseDate(sReleasedate);
702  update_required = true;
703  }
704 
705  if (HAS_PARAMv2("Rating"))
706  {
707  metadata->SetRating(sRating);
708  update_required = true;
709  }
710 
711  if (HAS_PARAMv2("Length"))
712  {
713  metadata->SetLength(std::chrono::minutes(nLength));
714  update_required = true;
715  }
716 
717  if (HAS_PARAMv2("PlayCount"))
718  {
719  metadata->SetPlayCount(nPlayCount);
720  update_required = true;
721  }
722 
723  if (HAS_PARAMv2("Season"))
724  {
725  metadata->SetSeason(nSeason);
726  update_required = true;
727  }
728 
729  if (HAS_PARAMv2("Episode"))
730  {
731  metadata->SetEpisode(nEpisode);
732  update_required = true;
733  }
734 
735  if (HAS_PARAMv2("ShowLevel"))
736  {
737  metadata->SetShowLevel(ParentalLevel::Level(nShowLevel));
738  update_required = true;
739  }
740 
741  if (HAS_PARAMv2("FileName"))
742  {
743  metadata->SetFilename(sFileName);
744  update_required = true;
745  }
746 
747  if (HAS_PARAMv2("Hash"))
748  {
749  metadata->SetHash(sHash);
750  update_required = true;
751  }
752 
753  if (HAS_PARAMv2("CoverFile"))
754  {
755  metadata->SetCoverFile(sCoverFile);
756  update_required = true;
757  }
758 
759  if (HAS_PARAMv2("ChildID"))
760  {
761  metadata->SetChildID(nChildID);
762  update_required = true;
763  }
764 
765  if (HAS_PARAMv2("Browse"))
766  {
767  metadata->SetBrowse(bBrowse);
768  update_required = true;
769  }
770 
771  if (HAS_PARAMv2("Watched"))
772  {
773  metadata->SetWatched(bWatched);
774  update_required = true;
775  }
776 
777  if (HAS_PARAMv2("Processed"))
778  {
779  metadata->SetProcessed(bProcessed);
780  update_required = true;
781  }
782 
783  if (HAS_PARAMv2("PlayCommand"))
784  {
785  metadata->SetPlayCommand(sPlayCommand);
786  update_required = true;
787  }
788 
789  if (HAS_PARAMv2("Category"))
790  {
791  metadata->SetCategoryID(nCategory);
792  update_required = true;
793  }
794 
795  if (HAS_PARAMv2("Trailer"))
796  {
797  metadata->SetTrailer(sTrailer);
798  update_required = true;
799  }
800 
801  if (HAS_PARAMv2("Host"))
802  {
803  metadata->SetHost(sHost);
804  update_required = true;
805  }
806 
807  if (HAS_PARAMv2("Screenshot"))
808  {
809  metadata->SetScreenshot(sScreenshot);
810  update_required = true;
811  }
812 
813  if (HAS_PARAMv2("Banner"))
814  {
815  metadata->SetBanner(sBanner);
816  update_required = true;
817  }
818 
819  if (HAS_PARAMv2("Fanart"))
820  {
821  metadata->SetFanart(sFanart);
822  update_required = true;
823  }
824 
825  if (HAS_PARAMv2("InsertDate"))
826  {
827  metadata->SetInsertdate(sInsertDate);
828  update_required = true;
829  }
830 
831  if (HAS_PARAMv2("ContentType"))
832  {
833  // valid values for ContentType are 'MOVIE','TELEVISION','ADULT','MUSICVIDEO','HOMEVIDEO'
834  VideoContentType contentType = kContentUnknown;
835  if (sContentType == "MOVIE")
836  contentType = kContentMovie;
837 
838  if (sContentType == "TELEVISION")
839  contentType = kContentTelevision;
840 
841  if (sContentType == "ADULT")
842  contentType = kContentAdult;
843 
844  if (sContentType == "MUSICVIDEO")
845  contentType = kContentMusicVideo;
846 
847  if (sContentType == "HOMEVIDEO")
848  contentType = kContentHomeMovie;
849 
850  if (contentType != kContentUnknown)
851  {
852  metadata->SetContentType(contentType);
853  update_required = true;
854  }
855  else
856  LOG(VB_GENERAL, LOG_ERR, QString("UpdateVideoMetadata: Ignoring unknown ContentType: %1").arg(sContentType));
857  }
858 
859  if (HAS_PARAMv2("Genres"))
860  {
862  QStringList genresList = sGenres.split(',', Qt::SkipEmptyParts);
863  std::transform(genresList.cbegin(), genresList.cend(), std::back_inserter(genres),
864  [](const QString& name)
865  {return VideoMetadata::genre_list::value_type(-1, name.simplified());} );
866 
867  metadata->SetGenres(genres);
868  update_required = true;
869  }
870 
871  if (HAS_PARAMv2("Cast"))
872  {
874  QStringList castList = sCast.split(',', Qt::SkipEmptyParts);
875  std::transform(castList.cbegin(), castList.cend(), std::back_inserter(cast),
876  [](const QString& name)
877  {return VideoMetadata::cast_list::value_type(-1, name.simplified());} );
878 
879  metadata->SetCast(cast);
880  update_required = true;
881  }
882 
883  if (HAS_PARAMv2("Countries"))
884  {
885  VideoMetadata::country_list countries;
886  QStringList countryList = sCountries.split(',', Qt::SkipEmptyParts);
887  std::transform(countryList.cbegin(), countryList.cend(), std::back_inserter(countries),
888  [](const QString& name)
889  {return VideoMetadata::country_list::value_type(-1, name.simplified());} );
890 
891  metadata->SetCountries(countries);
892  update_required = true;
893  }
894 
895  if (update_required)
896  metadata->UpdateDatabase();
897 
898  return true;
899 }
900 
902 // Set bookmark of a video as a frame number.
904 
905 bool V2Video::SetSavedBookmark( int Id, long Offset )
906 {
907  MSqlQuery query(MSqlQuery::InitCon());
908 
909  query.prepare("SELECT filename "
910  "FROM videometadata "
911  "WHERE intid = :ID ");
912  query.bindValue(":ID", Id);
913 
914  if (!query.exec())
915  {
916  MythDB::DBError("Video::SetSavedBookmark", query);
917  return false;
918  }
919 
920  QString fileName;
921 
922  if (query.next())
923  fileName = query.value(0).toString();
924  else
925  {
926  LOG(VB_GENERAL, LOG_ERR, QString("Video/SetSavedBookmark Video id %1 Not found.").arg(Id));
927  return false;
928  }
929 
930  ProgramInfo pi(fileName,
931  nullptr, // _plot,
932  nullptr, // _title,
933  nullptr, // const QString &_sortTitle,
934  nullptr, // const QString &_subtitle,
935  nullptr, // const QString &_sortSubtitle,
936  nullptr, // const QString &_director,
937  0, // int _season,
938  0, // int _episode,
939  nullptr, // const QString &_inetref,
940  0min, // uint _length_in_minutes,
941  0, // uint _year,
942  nullptr); //const QString &_programid);
943 
944  pi.SaveBookmark(Offset);
945  return true;
946 }
947 
949 // Set bookmark of a video as a frame number.
951 
952 bool V2Video::SetLastPlayPos( int Id, long Offset )
953 {
954  MSqlQuery query(MSqlQuery::InitCon());
955 
956  query.prepare("SELECT filename "
957  "FROM videometadata "
958  "WHERE intid = :ID ");
959  query.bindValue(":ID", Id);
960 
961  if (!query.exec())
962  {
963  MythDB::DBError("Video::SetLastPlayPos", query);
964  return false;
965  }
966 
967  QString fileName;
968 
969  if (query.next())
970  fileName = query.value(0).toString();
971  else
972  {
973  LOG(VB_GENERAL, LOG_ERR, QString("Video/SetLastPlayPos Video id %1 Not found.").arg(Id));
974  return false;
975  }
976 
977  ProgramInfo pi(fileName,
978  nullptr, // _plot,
979  nullptr, // _title,
980  nullptr, // const QString &_sortTitle,
981  nullptr, // const QString &_subtitle,
982  nullptr, // const QString &_sortSubtitle,
983  nullptr, // const QString &_director,
984  0, // int _season,
985  0, // int _episode,
986  nullptr, // const QString &_inetref,
987  0min, // uint _length_in_minutes,
988  0, // uint _year,
989  nullptr); //const QString &_programid);
990 
991  pi.SaveLastPlayPos(Offset);
992  return true;
993 }
994 
995 
996 V2BlurayInfo* V2Video::GetBluray( const QString &sPath )
997 {
998  QString path = sPath;
999 
1000  if (sPath.isEmpty())
1001  path = gCoreContext->GetSetting( "BluRayMountpoint", "/media/cdrom");
1002 
1003  LOG(VB_GENERAL, LOG_NOTICE,
1004  QString("Parsing Blu-ray at path: %1 ").arg(path));
1005 
1006  auto *bdmeta = new BlurayMetadata(path);
1007 
1008  if ( !bdmeta )
1009  throw( QString( "Unable to open Blu-ray Metadata Parser!" ));
1010 
1011  if ( !bdmeta->OpenDisc() )
1012  throw( QString( "Unable to open Blu-ray Disc/Path!" ));
1013 
1014  if ( !bdmeta->ParseDisc() )
1015  throw( QString( "Unable to parse metadata from Blu-ray Disc/Path!" ));
1016 
1017  auto *pBlurayInfo = new V2BlurayInfo();
1018 
1019  pBlurayInfo->setPath(path);
1020  pBlurayInfo->setTitle(bdmeta->GetTitle());
1021  pBlurayInfo->setAltTitle(bdmeta->GetAlternateTitle());
1022  pBlurayInfo->setDiscLang(bdmeta->GetDiscLanguage());
1023  pBlurayInfo->setDiscNum(bdmeta->GetCurrentDiscNumber());
1024  pBlurayInfo->setTotalDiscNum(bdmeta->GetTotalDiscNumber());
1025  pBlurayInfo->setTitleCount(bdmeta->GetTitleCount());
1026  pBlurayInfo->setThumbCount(bdmeta->GetThumbnailCount());
1027  pBlurayInfo->setTopMenuSupported(bdmeta->GetTopMenuSupported());
1028  pBlurayInfo->setFirstPlaySupported(bdmeta->GetFirstPlaySupported());
1029  pBlurayInfo->setNumHDMVTitles(bdmeta->GetNumHDMVTitles());
1030  pBlurayInfo->setNumBDJTitles(bdmeta->GetNumBDJTitles());
1031  pBlurayInfo->setNumUnsupportedTitles(bdmeta->GetNumUnsupportedTitles());
1032  pBlurayInfo->setAACSDetected(bdmeta->GetAACSDetected());
1033  pBlurayInfo->setLibAACSDetected(bdmeta->GetLibAACSDetected());
1034  pBlurayInfo->setAACSHandled(bdmeta->GetAACSHandled());
1035  pBlurayInfo->setBDPlusDetected(bdmeta->GetBDPlusDetected());
1036  pBlurayInfo->setLibBDPlusDetected(bdmeta->GetLibBDPlusDetected());
1037  pBlurayInfo->setBDPlusHandled(bdmeta->GetBDPlusHandled());
1038 
1039  QStringList thumbs = bdmeta->GetThumbnails();
1040  if (!thumbs.empty())
1041  pBlurayInfo->setThumbPath(thumbs.at(0));
1042 
1043  delete bdmeta;
1044 
1045  return pBlurayInfo;
1046 }
1047 
1048 
1050 // Jun 3, 2020
1051 // Service to get stream info for all streams in a media file.
1052 // This gets some basic info. If anything more is needed it can be added,
1053 // depending on whether it is available from ffmpeg avformat apis.
1054 // See the MythStreamInfoList class for the code that uses avformat to
1055 // extract the information.
1057 
1059  ( const QString &storageGroup,
1060  const QString &FileName )
1061 {
1062 
1063  // Search for the filename
1064 
1065  StorageGroup storage( storageGroup );
1066  QString sFullFileName = storage.FindFile( FileName );
1067  MythStreamInfoList infos(sFullFileName);
1068 
1069  // The constructor of this class reads the file and gets the needed
1070  // information.
1071  auto *pVideoStreamInfos = new V2VideoStreamInfoList();
1072 
1073  pVideoStreamInfos->setCount ( infos.m_streamInfoList.size() );
1074  pVideoStreamInfos->setAsOf ( MythDate::current() );
1075  pVideoStreamInfos->setVersion ( MYTH_BINARY_VERSION );
1076  pVideoStreamInfos->setProtoVer ( MYTH_PROTO_VERSION );
1077  pVideoStreamInfos->setErrorCode ( infos.m_errorCode );
1078  pVideoStreamInfos->setErrorMsg ( infos.m_errorMsg );
1079 
1080  for (const auto & info : std::as_const(infos.m_streamInfoList))
1081  {
1082  V2VideoStreamInfo *pVideoStreamInfo = pVideoStreamInfos->AddNewVideoStreamInfo();
1083  pVideoStreamInfo->setCodecType ( QString(QChar(info.m_codecType)) );
1084  pVideoStreamInfo->setCodecName ( info.m_codecName );
1085  pVideoStreamInfo->setWidth ( info.m_width );
1086  pVideoStreamInfo->setHeight ( info.m_height );
1087  pVideoStreamInfo->setAspectRatio ( info.m_SampleAspectRatio );
1088  pVideoStreamInfo->setFieldOrder ( info.m_fieldOrder );
1089  pVideoStreamInfo->setFrameRate ( info.m_frameRate );
1090  pVideoStreamInfo->setAvgFrameRate ( info.m_avgFrameRate );
1091  pVideoStreamInfo->setChannels ( info.m_channels );
1092  pVideoStreamInfo->setDuration ( info.m_duration );
1093 
1094  }
1095  return pVideoStreamInfos;
1096 }
1097 
1099 // October 26,2022
1100 // Support for Cut List for Videos
1102 
1104  const QString &offsettype )
1105 {
1106  MSqlQuery query(MSqlQuery::InitCon());
1107 
1108  query.prepare("SELECT filename "
1109  "FROM videometadata "
1110  "WHERE intid = :ID ");
1111  query.bindValue(":ID", Id);
1112 
1113  if (!query.exec())
1114  {
1115  MythDB::DBError("V2Video::GetVideoCommBreak", query);
1116  throw QString("Database Error.");
1117  }
1118 
1119  QString fileName;
1120 
1121  if (query.next())
1122  fileName = query.value(0).toString();
1123  else
1124  {
1125  LOG(VB_GENERAL, LOG_ERR, QString("V2Video/GetVideoCommBreak Video id %1 Not found.").arg(Id));
1126  throw QString("Video Not Found.");
1127  }
1128 
1129  ProgramInfo pi(fileName,
1130  nullptr, // _plot,
1131  nullptr, // _title,
1132  nullptr, // const QString &_sortTitle,
1133  nullptr, // const QString &_subtitle,
1134  nullptr, // const QString &_sortSubtitle,
1135  nullptr, // const QString &_director,
1136  0, // int _season,
1137  0, // int _episode,
1138  nullptr, // const QString &_inetref,
1139  0min, // uint _length_in_minutes,
1140  0, // uint _year,
1141  nullptr); //const QString &_programid);
1142 
1143 
1144  int marktype = 0;
1145 
1146  auto* pCutList = new V2CutList();
1147  if (offsettype.toLower() == "position")
1148  marktype = 1;
1149  else if (offsettype.toLower() == "duration")
1150  marktype = 2;
1151  else
1152  marktype = 0;
1153 
1154  V2FillCutList(pCutList, &pi, marktype);
1155 
1156  return pCutList;
1157 }
1158 
1160 // October 26,2022
1161 // Support for Commercial Break List for Videos
1163 
1165  const QString &offsettype )
1166 {
1167  MSqlQuery query(MSqlQuery::InitCon());
1168 
1169  query.prepare("SELECT filename "
1170  "FROM videometadata "
1171  "WHERE intid = :ID ");
1172  query.bindValue(":ID", Id);
1173 
1174  if (!query.exec())
1175  {
1176  MythDB::DBError("V2Video::GetVideoCommBreak", query);
1177  throw QString("Database Error.");
1178  }
1179 
1180  QString fileName;
1181 
1182  if (query.next())
1183  fileName = query.value(0).toString();
1184  else
1185  {
1186  LOG(VB_GENERAL, LOG_ERR, QString("V2Video/GetVideoCommBreak Video id %1 Not found.").arg(Id));
1187  throw QString("Video Not Found.");
1188  }
1189 
1190  ProgramInfo pi(fileName,
1191  nullptr, // _plot,
1192  nullptr, // _title,
1193  nullptr, // const QString &_sortTitle,
1194  nullptr, // const QString &_subtitle,
1195  nullptr, // const QString &_sortSubtitle,
1196  nullptr, // const QString &_director,
1197  0, // int _season,
1198  0, // int _episode,
1199  nullptr, // const QString &_inetref,
1200  0min, // uint _length_in_minutes,
1201  0, // uint _year,
1202  nullptr); //const QString &_programid);
1203 
1204 
1205  int marktype = 0;
1206 
1207  auto* pCutList = new V2CutList();
1208  if (offsettype.toLower() == "position")
1209  marktype = 1;
1210  else if (offsettype.toLower() == "duration")
1211  marktype = 2;
1212  else
1213  marktype = 0;
1214 
1215  V2FillCommBreak(pCutList, &pi, marktype);
1216 
1217  return pCutList;
1218 }
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:102
BlurayMetadata
Definition: bluraymetadata.h:25
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:813
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:127
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:506
GrabberType
GrabberType
Definition: metadatagrabber.h:20
V2Video::GetVideoCommBreak
static V2CutList * GetVideoCommBreak(int Id, const QString &OffsetType)
Definition: v2video.cpp:1164
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:2669
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:376
VideoMetadataListManager
Definition: videometadatalistmanager.h:10
V2FillCommBreak
void V2FillCommBreak(V2CutList *pCutList, ProgramInfo *rInfo, int marktype)
Definition: v2serviceUtil.cpp:644
simple_ref_ptr
Definition: quicksp.h:24
V2Video::GetBluray
static V2BlurayInfo * GetBluray(const QString &Path)
Definition: v2video.cpp:996
ArtworkList
QList< ArtworkInfo > ArtworkList
Definition: metadataimagehelper.h:30
V2FillVideoMetadataInfo
void V2FillVideoMetadataInfo(V2VideoMetadataInfo *pVideoMetadataInfo, const VideoMetadataListManager::VideoMetadataPtr &pMetadata, bool bDetails)
Definition: v2serviceUtil.cpp:386
StorageGroup::FindFile
QString FindFile(const QString &filename)
Definition: storagegroup.cpp:597
MythStreamInfoList
Definition: mythavutil.h:98
V2BlurayInfo
Definition: v2blurayInfo.h:20
V2ArtworkItem
Definition: v2videoLookupInfo.h:22
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:204
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:952
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:619
V2Video::GetVideo
static V2VideoMetadataInfo * GetVideo(int Id)
Definition: v2video.cpp:55
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
VideoMetadata::genre_list
std::vector< genre_entry > genre_list
Definition: videometadata.h:32
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:14
V2VideoStreamInfo
Definition: v2videoStreamInfo.h:21
V2VideoLookup
Definition: v2videoLookupInfo.h:58
VideoMetadataListManager::loadAllFromDatabase
static void loadAllFromDatabase(metadata_list &items, const QString &sql="", const QString &bindValue="")
Load videometadata database into memory.
Definition: videometadatalistmanager.cpp:128
ProgramInfo::QueryBookmark
uint64_t QueryBookmark(void) const
Gets any bookmark position in database, unless the ignore bookmark flag is set.
Definition: programinfo.cpp:2793
MythStreamInfoList::m_errorCode
int m_errorCode
Definition: mythavutil.h:101
V2Video::GetStreamInfo
static V2VideoStreamInfoList * GetStreamInfo(const QString &StorageGroup, const QString &FileName)
Definition: v2video.cpp:1059
V2Video::SetSavedBookmark
static bool SetSavedBookmark(int Id, long Offset)
Definition: v2video.cpp:905
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:580
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:551
V2Video::RemoveVideoFromDB
static bool RemoveVideoFromDB(int Id)
Definition: v2video.cpp:490
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:226
VideoMetadata::SaveToDatabase
void SaveToDatabase()
Definition: videometadata.cpp:1947
V2Video::GetVideoList
static V2VideoMetadataInfoList * GetVideoList(const QString &Folder, const QString &Sort, bool Descending, int StartIndex, int Count, bool CollapseSubDirs)
Definition: v2video.cpp:202
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
kContentTelevision
@ kContentTelevision
Definition: metadatacommon.h:62
VIDEO_HANDLE
#define VIDEO_HANDLE
Definition: v2video.h:14
V2CutList
Definition: v2cutList.h:21
storagegroup.h
VIDEO_TRAILER_DEFAULT
const QString VIDEO_TRAILER_DEFAULT
Definition: globals.cpp:26
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
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
MythDate::fromString
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:34
v2artworkInfoList.h
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:562
mythcorecontext.h
VideoMetadata::cast_list
std::vector< cast_entry > cast_list
Definition: videometadata.h:34
VideoMetadata::SetHost
void SetHost(const QString &host)
Definition: videometadata.cpp:1837
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:889
VIDEO_RATING_DEFAULT
const QString VIDEO_RATING_DEFAULT
Definition: globals.cpp:30
V2FillCutList
void V2FillCutList(V2CutList *pCutList, ProgramInfo *rInfo, int marktype)
Definition: v2serviceUtil.cpp:602
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
kContentMovie
@ kContentMovie
Definition: metadatacommon.h:61
VideoMetadataListManager::metadata_list
std::list< VideoMetadataPtr > metadata_list
Definition: videometadatalistmanager.h:14
v2genreList.h
ProgramInfo::QueryLastPlayPos
uint64_t QueryLastPlayPos(void) const
Gets any lastplaypos position in database, unless the ignore lastplaypos flag is set.
Definition: programinfo.cpp:2820
kContentUnknown
@ kContentUnknown
Definition: metadatacommon.h:66
VIDEO_YEAR_DEFAULT
static constexpr uint16_t VIDEO_YEAR_DEFAULT
Definition: videometadata.h:18
VIDEO_BANNER_DEFAULT
const QString VIDEO_BANNER_DEFAULT
Definition: globals.cpp:28
kArtworkScreenshot
@ kArtworkScreenshot
Definition: metadataimagehelper.h:14
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:548
V2Video::GetSavedBookmark
static long GetSavedBookmark(int Id)
Definition: v2video.cpp:93
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:1103
ProgramInfo::SaveLastPlayPos
void SaveLastPlayPos(uint64_t frame)
TODO Move to RecordingInfo.
Definition: programinfo.cpp:2706
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:898
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:838
MythStreamInfoList::m_streamInfoList
QVector< MythStreamInfo > m_streamInfoList
Definition: mythavutil.h:103