MythTV  master
v2serviceUtil.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "libmyth/programinfo.h"
6 #include "libmythtv/cardutil.h"
11 #include "libmythtv/tv_rec.h"
12 
13 // MythBackend
14 #include "backendcontext.h"
15 #include "encoderlink.h"
16 #include "scheduler.h"
17 #include "v2encoder.h"
18 #include "v2frontend.h"
19 #include "v2serviceUtil.h"
20 
21 void V2FillProgramInfo( V2Program *pProgram,
22  ProgramInfo *pInfo,
23  bool bIncChannel /* = true */,
24  bool bDetails /* = true */,
25  bool bIncCast /* = true */,
26  bool bIncArtwork /* = true */,
27  bool bIncRecording /* = true */)
28 {
29  if ((pProgram == nullptr) || (pInfo == nullptr))
30  return;
31 
32  pProgram->setStartTime ( pInfo->GetScheduledStartTime());
33  pProgram->setEndTime ( pInfo->GetScheduledEndTime ());
34  pProgram->setTitle ( pInfo->GetTitle() );
35  pProgram->setSubTitle ( pInfo->GetSubtitle() );
36  pProgram->setCategory ( pInfo->GetCategory() );
37  pProgram->setCatType ( pInfo->GetCategoryTypeString());
38  pProgram->setRepeat ( pInfo->IsRepeat() );
39  pProgram->setVideoProps( pInfo->GetVideoProperties() );
40  pProgram->setVideoPropNames( pInfo->GetVideoPropertyNames() );
41  pProgram->setAudioProps( pInfo->GetAudioProperties() );
42  pProgram->setAudioPropNames( pInfo->GetAudioPropertyNames() );
43  pProgram->setSubProps ( pInfo->GetSubtitleType() );
44  pProgram->setSubPropNames( pInfo->GetSubtitleTypeNames() );
45 
46  if (bDetails)
47  {
48  pProgram->setSeriesId ( pInfo->GetSeriesID() );
49  pProgram->setProgramId ( pInfo->GetProgramID() );
50  pProgram->setStars ( pInfo->GetStars() );
51  pProgram->setLastModified( pInfo->GetLastModifiedTime() );
52  pProgram->setProgramFlags( pInfo->GetProgramFlags() );
53  pProgram->setProgramFlagNames( pInfo->GetProgramFlagNames() );
54 
55  // ----
56  // DEPRECATED - See RecordingInfo instead
57  pProgram->setFileName ( pInfo->GetPathname() );
58  pProgram->setFileSize ( pInfo->GetFilesize() );
59  pProgram->setHostName ( pInfo->GetHostname() );
60  // ----
61 
62  if (pInfo->GetOriginalAirDate().isValid())
63  pProgram->setAirdate( pInfo->GetOriginalAirDate() );
64  else if (pInfo->GetYearOfInitialRelease() > 0)
65  {
66  QDate year;
67  year.setDate(pInfo->GetYearOfInitialRelease(), 1, 1);
68  pProgram->setAirdate( year );
69  }
70 
71  pProgram->setDescription( pInfo->GetDescription() );
72  pProgram->setInetref ( pInfo->GetInetRef() );
73  pProgram->setSeason ( pInfo->GetSeason() );
74  pProgram->setEpisode ( pInfo->GetEpisode() );
75  pProgram->setTotalEpisodes( pInfo->GetEpisodeTotal() );
76  }
77 
78  if (bIncCast)
79  V2FillCastMemberList( pProgram->Cast(), pInfo );
80  else
81  pProgram->enableCast(false);
82 
83  if (bIncChannel)
84  {
85  // Build Channel Child Element
86  if (!V2FillChannelInfo( pProgram->Channel(), pInfo->GetChanID(), bDetails ))
87  {
88  // The channel associated with a given recording may no longer exist
89  // however the ChanID is one half of the unique identifier for the
90  // recording and therefore MUST be included in the return data
91  pProgram->Channel()->setChanId(pInfo->GetChanID());
92  }
93  }
94  else
95  pProgram->enableChannel(false);
96 
97  // Build Recording Child Element
98 
99  if ( bIncRecording && pInfo->GetRecordingStatus() != RecStatus::Unknown )
100  {
101  V2RecordingInfo *pRecording = pProgram->Recording();
102 
103  const RecordingInfo pRecInfo(*pInfo);
104 
105  pRecording->setRecordedId ( pRecInfo.GetRecordingID() );
106  pRecording->setStatus ( pRecInfo.GetRecordingStatus() );
107  pRecording->setPriority( pRecInfo.GetRecordingPriority() );
108  pRecording->setStartTs ( pRecInfo.GetRecordingStartTime() );
109  pRecording->setEndTs ( pRecInfo.GetRecordingEndTime() );
110 
111  if (bDetails)
112  {
113  pRecording->setFileName ( pRecInfo.GetPathname() );
114  pRecording->setFileSize ( pRecInfo.GetFilesize() );
115  pRecording->setHostName ( pRecInfo.GetHostname() );
116  pRecording->setLastModified( pRecInfo.GetLastModifiedTime() );
117 
118  pRecording->setRecordId ( pRecInfo.GetRecordingRuleID() );
119  pRecording->setRecGroup ( pRecInfo.GetRecordingGroup() );
120  pRecording->setPlayGroup ( pRecInfo.GetPlaybackGroup() );
121  pRecording->setStorageGroup( pRecInfo.GetStorageGroup() );
122  pRecording->setRecType ( pRecInfo.GetRecordingRuleType() );
123  pRecording->setDupInType ( pRecInfo.GetDuplicateCheckSource() );
124  pRecording->setDupMethod ( pRecInfo.GetDuplicateCheckMethod() );
125  pRecording->setEncoderId ( pRecInfo.GetInputID() );
126  pRecording->setEncoderName ( pRecInfo.GetInputName() );
127  pRecording->setProfile ( pRecInfo.GetProgramRecordingProfile() );
128  }
129  }
130  else
131  pProgram->enableRecording(false);
132 
133  if ( bIncArtwork && !pInfo->GetInetRef().isEmpty() )
134  V2FillArtworkInfoList( pProgram->Artwork(), pInfo->GetInetRef(), pInfo->GetSeason());
135  else
136  pProgram->enableArtwork(false);
137 }
138 
140 //
142 
144  uint nChanID,
145  bool bDetails /* = true */ )
146 {
147  ChannelInfo channel;
148  if (channel.Load(nChanID))
149  {
150  return V2FillChannelInfo(pChannel, channel, bDetails);
151  }
152 
153  return false;
154 }
155 
157 //
159 
161  const ChannelInfo &channelInfo,
162  bool bDetails /* = true */ )
163 {
164 
165  // TODO update V2ChannelInfo to match functionality of ChannelInfo,
166  // ultimately replacing it's progenitor?
167  pChannel->setChanId(channelInfo.m_chanId);
168  pChannel->setChanNum(channelInfo.m_chanNum);
169  pChannel->setCallSign(channelInfo.m_callSign);
170  if (!channelInfo.m_icon.isEmpty())
171  {
172  QString sIconURL = QString( "/Guide/GetChannelIcon?ChanId=%3")
173  .arg( channelInfo.m_chanId );
174  pChannel->setIconURL( sIconURL );
175  }
176  pChannel->setChannelName(channelInfo.m_name);
177  pChannel->setVisible(channelInfo.m_visible > kChannelNotVisible);
178  pChannel->setExtendedVisible(toRawString(channelInfo.m_visible));
179 
180  if (bDetails)
181  {
182  pChannel->setMplexId(channelInfo.m_mplexId);
183  pChannel->setServiceId(channelInfo.m_serviceId);
184  pChannel->setATSCMajorChan(channelInfo.m_atscMajorChan);
185  pChannel->setATSCMinorChan(channelInfo.m_atscMinorChan);
186  pChannel->setFormat(channelInfo.m_tvFormat);
187  pChannel->setFineTune(channelInfo.m_fineTune);
188  pChannel->setFrequencyId(channelInfo.m_freqId);
189  pChannel->setChanFilters(channelInfo.m_videoFilters);
190  pChannel->setSourceId(channelInfo.m_sourceId);
191  pChannel->setCommFree(channelInfo.m_commMethod == -2);
192  pChannel->setUseEIT(channelInfo.m_useOnAirGuide);
193  pChannel->setXMLTVID(channelInfo.m_xmltvId);
194  pChannel->setDefaultAuth(channelInfo.m_defaultAuthority);
195  pChannel->setServiceType(channelInfo.m_serviceType);
196 
197  QList<uint> groupIds = channelInfo.GetGroupIds();
198  QString sGroupIds;
199  for (int x = 0; x < groupIds.size(); x++)
200  {
201  if (x > 0)
202  sGroupIds += ",";
203 
204  sGroupIds += QString::number(groupIds.at(x));
205  }
206  pChannel->setChannelGroups(sGroupIds);
207 
208  QList<uint> inputIds = channelInfo.GetInputIds();
209  QString sInputIds;
210  for (int x = 0; x < inputIds.size(); x++)
211  {
212  if (x > 0)
213  sInputIds += ",";
214 
215  sInputIds += QString::number(inputIds.at(x));
216  }
217  pChannel->setInputs(sInputIds);
218  }
219 
220  return true;
221 }
222 
223 void V2FillChannelGroup(V2ChannelGroup* pGroup, const ChannelGroupItem& pGroupItem)
224 {
225  if (!pGroup)
226  return;
227 
228  pGroup->setGroupId(pGroupItem.m_grpId);
229  pGroup->setName(pGroupItem.m_name);
230  pGroup->setPassword(""); // Not currently supported
231 }
232 
234 //
236 
237 void V2FillRecRuleInfo( V2RecRule *pRecRule,
238  RecordingRule *pRule )
239 {
240  if ((pRecRule == nullptr) || (pRule == nullptr))
241  return;
242 
243  pRecRule->setId ( pRule->m_recordID );
244  pRecRule->setParentId ( pRule->m_parentRecID );
245  pRecRule->setInactive ( pRule->m_isInactive );
246  pRecRule->setTitle ( pRule->m_title );
247  pRecRule->setSubTitle ( pRule->m_subtitle );
248  pRecRule->setDescription ( pRule->m_description );
249  pRecRule->setSeason ( pRule->m_season );
250  pRecRule->setEpisode ( pRule->m_episode );
251  pRecRule->setCategory ( pRule->m_category );
252  pRecRule->setStartTime ( QDateTime(pRule->m_startdate,
253  pRule->m_starttime, Qt::UTC));
254  pRecRule->setEndTime ( QDateTime(pRule->m_enddate,
255  pRule->m_endtime, Qt::UTC));
256  pRecRule->setSeriesId ( pRule->m_seriesid );
257  pRecRule->setProgramId ( pRule->m_programid );
258  pRecRule->setInetref ( pRule->m_inetref );
259  pRecRule->setChanId ( pRule->m_channelid );
260  pRecRule->setCallSign ( pRule->m_station );
261  pRecRule->setFindDay ( pRule->m_findday );
262  pRecRule->setFindTime ( pRule->m_findtime );
263  pRecRule->setType ( toRawString(pRule->m_type) );
264  pRecRule->setSearchType ( toRawString(pRule->m_searchType));
265  pRecRule->setRecPriority ( pRule->m_recPriority );
266  pRecRule->setPreferredInput ( pRule->m_prefInput );
267  pRecRule->setStartOffset ( pRule->m_startOffset );
268  pRecRule->setEndOffset ( pRule->m_endOffset );
269  pRecRule->setDupMethod ( toRawString(pRule->m_dupMethod) );
270  pRecRule->setDupIn ( toRawString(pRule->m_dupIn) );
271  pRecRule->setNewEpisOnly ( newEpifromDupIn(pRule->m_dupIn) );
272  pRecRule->setFilter ( pRule->m_filter );
273  pRecRule->setRecProfile ( pRule->m_recProfile );
274  pRecRule->setRecGroup ( RecordingInfo::GetRecgroupString(pRule->m_recGroupID) );
275  pRecRule->setStorageGroup ( pRule->m_storageGroup );
276  pRecRule->setPlayGroup ( pRule->m_playGroup );
277  pRecRule->setAutoExpire ( pRule->m_autoExpire );
278  pRecRule->setMaxEpisodes ( pRule->m_maxEpisodes );
279  pRecRule->setMaxNewest ( pRule->m_maxNewest );
280  pRecRule->setAutoCommflag ( pRule->m_autoCommFlag );
281  pRecRule->setAutoTranscode ( pRule->m_autoTranscode );
282  pRecRule->setAutoMetaLookup ( pRule->m_autoMetadataLookup );
283  pRecRule->setAutoUserJob1 ( pRule->m_autoUserJob1 );
284  pRecRule->setAutoUserJob2 ( pRule->m_autoUserJob2 );
285  pRecRule->setAutoUserJob3 ( pRule->m_autoUserJob3 );
286  pRecRule->setAutoUserJob4 ( pRule->m_autoUserJob4 );
287  pRecRule->setTranscoder ( pRule->m_transcoder );
288  pRecRule->setNextRecording ( pRule->m_nextRecording );
289  pRecRule->setLastRecorded ( pRule->m_lastRecorded );
290  pRecRule->setLastDeleted ( pRule->m_lastDeleted );
291  pRecRule->setAverageDelay ( pRule->m_averageDelay );
292 }
293 
294 void V2FillArtworkInfoList( V2ArtworkInfoList *pArtworkInfoList,
295  const QString &sInetref,
296  uint nSeason )
297 {
298  ArtworkMap map = GetArtwork(sInetref, nSeason);
299  for (auto i = map.cbegin(); i != map.cend(); ++i)
300  {
301  V2ArtworkInfo *pArtInfo = pArtworkInfoList->AddNewArtworkInfo();
302  pArtInfo->setFileName(i.value().url);
303  switch (i.key())
304  {
305  case kArtworkFanart:
306  pArtInfo->setStorageGroup("Fanart");
307  pArtInfo->setType("fanart");
308  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
309  "&FileName=%2")
310  .arg("Fanart",
311  QString(QUrl::toPercentEncoding(
312  QUrl(i.value().url).path()))));
313  break;
314  case kArtworkBanner:
315  pArtInfo->setStorageGroup("Banners");
316  pArtInfo->setType("banner");
317  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
318  "&FileName=%2")
319  .arg("Banners",
320  QString(QUrl::toPercentEncoding(
321  QUrl(i.value().url).path()))));
322  break;
323  case kArtworkCoverart:
324  default:
325  pArtInfo->setStorageGroup("Coverart");
326  pArtInfo->setType("coverart");
327  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
328  "&FileName=%2")
329  .arg("Coverart",
330  QString(QUrl::toPercentEncoding(
331  QUrl(i.value().url).path()))));
332  break;
333  }
334  }
335 }
336 
337 void V2FillGenreList(V2GenreList* pGenreList, int videoID)
338 {
339  if (!pGenreList)
340  return;
341 
342  MSqlQuery query(MSqlQuery::InitCon());
343  query.prepare("SELECT genre from videogenre "
344  "LEFT JOIN videometadatagenre ON videometadatagenre.idgenre = videogenre.intid "
345  "WHERE idvideo = :ID "
346  "ORDER BY genre;");
347  query.bindValue(":ID", videoID);
348 
349  if (query.exec() && query.size() > 0)
350  {
351  while (query.next())
352  {
353  V2Genre *pGenre = pGenreList->AddNewGenre();
354  QString genre = query.value(0).toString();
355  pGenre->setName(genre);
356  }
357  }
358 }
359 
360 
362  V2VideoMetadataInfo *pVideoMetadataInfo,
364  bool bDetails)
365 {
366  pVideoMetadataInfo->setId(pMetadata->GetID());
367  pVideoMetadataInfo->setTitle(pMetadata->GetTitle());
368  pVideoMetadataInfo->setSubTitle(pMetadata->GetSubtitle());
369  pVideoMetadataInfo->setTagline(pMetadata->GetTagline());
370  pVideoMetadataInfo->setDirector(pMetadata->GetDirector());
371  pVideoMetadataInfo->setStudio(pMetadata->GetStudio());
372  pVideoMetadataInfo->setDescription(pMetadata->GetPlot());
373  pVideoMetadataInfo->setCertification(pMetadata->GetRating());
374  pVideoMetadataInfo->setInetref(pMetadata->GetInetRef());
375  pVideoMetadataInfo->setCollectionref(pMetadata->GetCollectionRef());
376  pVideoMetadataInfo->setHomePage(pMetadata->GetHomepage());
377  pVideoMetadataInfo->setReleaseDate(
378  QDateTime(pMetadata->GetReleaseDate(),
379  QTime(0,0),Qt::LocalTime).toUTC());
380  pVideoMetadataInfo->setAddDate(
381  QDateTime(pMetadata->GetInsertdate(),
382  QTime(0,0),Qt::LocalTime).toUTC());
383  pVideoMetadataInfo->setUserRating(pMetadata->GetUserRating());
384  pVideoMetadataInfo->setChildID(pMetadata->GetChildID());
385  pVideoMetadataInfo->setLength(pMetadata->GetLength().count());
386  pVideoMetadataInfo->setPlayCount(pMetadata->GetPlayCount());
387  pVideoMetadataInfo->setSeason(pMetadata->GetSeason());
388  pVideoMetadataInfo->setEpisode(pMetadata->GetEpisode());
389  pVideoMetadataInfo->setParentalLevel(pMetadata->GetShowLevel());
390  pVideoMetadataInfo->setVisible(pMetadata->GetBrowse());
391  pVideoMetadataInfo->setWatched(pMetadata->GetWatched());
392  pVideoMetadataInfo->setProcessed(pMetadata->GetProcessed());
393  pVideoMetadataInfo->setContentType(ContentTypeToString(
394  pMetadata->GetContentType()));
395  pVideoMetadataInfo->setFileName(pMetadata->GetFilename());
396  pVideoMetadataInfo->setHash(pMetadata->GetHash());
397  pVideoMetadataInfo->setHostName(pMetadata->GetHost());
398  pVideoMetadataInfo->setCoverart(pMetadata->GetCoverFile());
399  pVideoMetadataInfo->setFanart(pMetadata->GetFanart());
400  pVideoMetadataInfo->setBanner(pMetadata->GetBanner());
401  pVideoMetadataInfo->setScreenshot(pMetadata->GetScreenshot());
402  pVideoMetadataInfo->setTrailer(pMetadata->GetTrailer());
403 
404  if (bDetails)
405  {
406  if (!pMetadata->GetFanart().isEmpty())
407  {
408  V2ArtworkInfo *pArtInfo =
409  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
410  pArtInfo->setStorageGroup("Fanart");
411  pArtInfo->setType("fanart");
412  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
413  "&FileName=%2")
414  .arg("Fanart",
415  QString(
416  QUrl::toPercentEncoding(pMetadata->GetFanart()))));
417  }
418  if (!pMetadata->GetCoverFile().isEmpty())
419  {
420  V2ArtworkInfo *pArtInfo =
421  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
422  pArtInfo->setStorageGroup("Coverart");
423  pArtInfo->setType("coverart");
424  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
425  "&FileName=%2")
426  .arg("Coverart",
427  QString(
428  QUrl::toPercentEncoding(pMetadata->GetCoverFile()))));
429  }
430  if (!pMetadata->GetBanner().isEmpty())
431  {
432  V2ArtworkInfo *pArtInfo =
433  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
434  pArtInfo->setStorageGroup("Banners");
435  pArtInfo->setType("banner");
436  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
437  "&FileName=%2")
438  .arg("Banners",
439  QString(
440  QUrl::toPercentEncoding(pMetadata->GetBanner()))));
441  }
442  if (!pMetadata->GetScreenshot().isEmpty())
443  {
444  V2ArtworkInfo *pArtInfo =
445  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
446  pArtInfo->setStorageGroup("Screenshots");
447  pArtInfo->setType("screenshot");
448  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
449  "&FileName=%2")
450  .arg("Screenshots",
451  QString(
452  QUrl::toPercentEncoding(pMetadata->GetScreenshot()))));
453  }
454  }
455 
456  V2FillGenreList(pVideoMetadataInfo->Genres(), pVideoMetadataInfo->GetId());
457 }
458 
460 //
462 
464  MusicMetadata *pMetadata, bool bDetails)
465 {
466  pVideoMetadataInfo->setId(pMetadata->ID());
467  pVideoMetadataInfo->setArtist(pMetadata->Artist());
468  pVideoMetadataInfo->setCompilationArtist(pMetadata->CompilationArtist());
469  pVideoMetadataInfo->setAlbum(pMetadata->Album());
470  pVideoMetadataInfo->setTitle(pMetadata->Title());
471  pVideoMetadataInfo->setTrackNo(pMetadata->Track());
472  pVideoMetadataInfo->setGenre(pMetadata->Genre());
473  pVideoMetadataInfo->setYear(pMetadata->Year());
474  pVideoMetadataInfo->setPlayCount(pMetadata->PlayCount());
475  pVideoMetadataInfo->setLength(pMetadata->Length().count());
476  pVideoMetadataInfo->setRating(pMetadata->Rating());
477  pVideoMetadataInfo->setFileName(pMetadata->Filename());
478  pVideoMetadataInfo->setHostName(pMetadata->Hostname());
479  pVideoMetadataInfo->setLastPlayed(pMetadata->LastPlay());
480  pVideoMetadataInfo->setCompilation(pMetadata->Compilation());
481 
482  if (bDetails)
483  {
484  //TODO add coverart here
485  }
486 }
487 
488 void V2FillInputInfo(V2Input* input, const InputInfo& inputInfo)
489 {
490  input->setId(inputInfo.m_inputId);
491  input->setInputName(inputInfo.m_name);
492  input->setCardId(inputInfo.m_inputId);
493  input->setSourceId(inputInfo.m_sourceId);
494  input->setDisplayName(inputInfo.m_displayName);
495  input->setLiveTVOrder(inputInfo.m_liveTvOrder);
496  input->setScheduleOrder(inputInfo.m_scheduleOrder);
497  input->setRecPriority(inputInfo.m_recPriority);
498  input->setQuickTune(inputInfo.m_quickTune);
499 }
500 
501 
502 
504  ProgramInfo* pInfo)
505 {
506  if (!pCastMemberList || !pInfo)
507  return;
508 
509  MSqlQuery query(MSqlQuery::InitCon());
510 
511  QString table;
512  if (pInfo->GetFilesize() > 0) // FIXME: This shouldn't be the way to determine what is or isn't a recording!
513  table = "recordedcredits";
514  else
515  table = "credits";
516 
517  query.prepare(QString("SELECT role, people.name, roles.name FROM %1"
518  " AS credits"
519  " LEFT JOIN people ON"
520  " credits.person = people.person"
521  " LEFT JOIN roles ON"
522  " credits.roleid = roles.roleid"
523  " WHERE credits.chanid = :CHANID"
524  " AND credits.starttime = :STARTTIME"
525  " ORDER BY role, priority;").arg(table));
526 
527  query.bindValue(":CHANID", pInfo->GetChanID());
528  query.bindValue(":STARTTIME", pInfo->GetScheduledStartTime());
529 
530  if (query.exec() && query.size() > 0)
531  {
532  QMap<QString, QString> translations;
533  translations["ACTOR"] = QObject::tr("Actors");
534  translations["DIRECTOR"] = QObject::tr("Director");
535  translations["PRODUCER"] = QObject::tr("Producer");
536  translations["EXECUTIVE_PRODUCER"] = QObject::tr("Executive Producer");
537  translations["WRITER"] = QObject::tr("Writer");
538  translations["GUEST_STAR"] = QObject::tr("Guest Star");
539  translations["HOST"] = QObject::tr("Host");
540  translations["ADAPTER"] = QObject::tr("Adapter");
541  translations["PRESENTER"] = QObject::tr("Presenter");
542  translations["COMMENTATOR"] = QObject::tr("Commentator");
543  translations["GUEST"] = QObject::tr("Guest");
544 
545  while (query.next())
546  {
547  V2CastMember *pCastMember = pCastMemberList->AddNewCastMember();
548 
549  QString role = query.value(0).toString();
550  pCastMember->setTranslatedRole(translations.value(role.toUpper()));
551  pCastMember->setRole(role); // role is invalid after this call.
552  /* The people.name column uses utf8_bin collation.
553  * Qt-MySQL drivers use QVariant::ByteArray for string-type
554  * MySQL fields marked with the BINARY attribute (those using a
555  * *_bin collation) and QVariant::String for all others.
556  * Since QVariant::toString() uses QString::fromAscii()
557  * (through QVariant::convert()) when the QVariant's type is
558  * QVariant::ByteArray, we have to use QString::fromUtf8()
559  * explicitly to prevent corrupting characters.
560  * The following code should be changed to use the simpler
561  * toString() approach, as above, if we do a DB update to
562  * coalesce the people.name values that differ only in case and
563  * change the collation to utf8_general_ci, to match the
564  * majority of other columns, or we'll have the same problem in
565  * reverse.
566  */
567  pCastMember->setName(QString::fromUtf8(query.value(1)
568  .toByteArray().constData()));
569  pCastMember->setCharacterName(QString::fromUtf8(query.value(2)
570  .toByteArray().constData()));
571  }
572  }
573 
574 }
575 
576 
577 void V2FillCutList(V2CutList* pCutList, RecordingInfo* rInfo, int marktype)
578 {
579  frm_dir_map_t markMap;
580  frm_dir_map_t::const_iterator it;
581 
582  if (rInfo && rInfo->GetChanID())
583  {
584  rInfo->QueryCutList(markMap);
585 
586  for (it = markMap.cbegin(); it != markMap.cend(); ++it)
587  {
588  bool isend = (*it) == MARK_CUT_END || (*it) == MARK_COMM_END;
589  if (marktype == 0)
590  {
591  V2Cutting *pCutting = pCutList->AddNewCutting();
592  pCutting->setMark(*it);
593  pCutting->setOffset(it.key());
594  }
595  else if (marktype == 1)
596  {
597  uint64_t offset = 0;
598  if (rInfo->QueryKeyFramePosition(&offset, it.key(), isend))
599  {
600  V2Cutting *pCutting = pCutList->AddNewCutting();
601  pCutting->setMark(*it);
602  pCutting->setOffset(offset);
603  }
604  }
605  else if (marktype == 2)
606  {
607  uint64_t offset = 0;
608  if (rInfo->QueryKeyFrameDuration(&offset, it.key(), isend))
609  {
610  V2Cutting *pCutting = pCutList->AddNewCutting();
611  pCutting->setMark(*it);
612  pCutting->setOffset(offset);
613  }
614  }
615  }
616  }
617 }
618 
619 void V2FillCommBreak(V2CutList* pCutList, RecordingInfo* rInfo, int marktype)
620 {
621  frm_dir_map_t markMap;
622  frm_dir_map_t::const_iterator it;
623 
624  if (rInfo && rInfo->GetChanID())
625  {
626  rInfo->QueryCommBreakList(markMap);
627 
628  for (it = markMap.cbegin(); it != markMap.cend(); ++it)
629  {
630  bool isend = (*it) == MARK_CUT_END || (*it) == MARK_COMM_END;
631  if (marktype == 0)
632  {
633  V2Cutting *pCutting = pCutList->AddNewCutting();
634  pCutting->setMark(*it);
635  pCutting->setOffset(it.key());
636  }
637  else if (marktype == 1)
638  {
639  uint64_t offset = 0;
640  if (rInfo->QueryKeyFramePosition(&offset, it.key(), isend))
641  {
642  V2Cutting *pCutting = pCutList->AddNewCutting();
643  pCutting->setMark(*it);
644  pCutting->setOffset(offset);
645  }
646  }
647  else if (marktype == 2)
648  {
649  uint64_t offset = 0;
650  if (rInfo->QueryKeyFrameDuration(&offset, it.key(), isend))
651  {
652  V2Cutting *pCutting = pCutList->AddNewCutting();
653  pCutting->setMark(*it);
654  pCutting->setOffset(offset);
655  }
656  }
657  }
658  }
659 }
660 
662 //
664 
665 void V2FillSeek(V2CutList* pCutList, RecordingInfo* rInfo, MarkTypes marktype)
666 {
667  frm_pos_map_t markMap;
668  frm_pos_map_t::const_iterator it;
669 
670  if (rInfo && rInfo->GetChanID())
671  {
672  rInfo->QueryPositionMap(markMap, marktype);
673 
674  for (it = markMap.cbegin(); it != markMap.cend(); ++it)
675  {
676  V2Cutting *pCutting = pCutList->AddNewCutting();
677  pCutting->setMark(it.key());
678  pCutting->setOffset(it.value());
679  }
680  }
681 }
682 
683 void FillEncoderList(QVariantList &list, QObject* parent)
684 {
685  QReadLocker tvlocker(&TVRec::s_inputsLock);
686  QList<InputInfo> inputInfoList = CardUtil::GetAllInputInfo();
687  for (auto * elink : qAsConst(gTVList))
688  {
689  if (elink != nullptr)
690  {
691  // V2Encoder *pEncoder = list->AddNewEncoder();
692  auto *pEncoder = new V2Encoder( parent );
693  list.append( QVariant::fromValue<QObject *>( pEncoder ));
694 
695  pEncoder->setId ( elink->GetInputID() );
696  pEncoder->setState ( elink->GetState() );
697  pEncoder->setLocal ( elink->IsLocal() );
698  pEncoder->setConnected ( elink->IsConnected() );
699  pEncoder->setSleepStatus ( elink->GetSleepStatus() );
700 
701  if (pEncoder->GetLocal())
702  pEncoder->setHostName( gCoreContext->GetHostName() );
703  else
704  pEncoder->setHostName( elink->GetHostName() );
705 
706  for (const auto & inputInfo : qAsConst(inputInfoList))
707  {
708  if (inputInfo.m_inputId == static_cast<uint>(elink->GetInputID()))
709  {
710  V2Input *input = pEncoder->AddNewInput();
711  V2FillInputInfo(input, inputInfo);
712  }
713  }
714 
715  bool progFound = false;
716  V2Program *pProgram = pEncoder->Recording();
717  switch ( pEncoder->GetState() )
718  {
722  {
723  ProgramInfo *pInfo = elink->GetRecording();
724 
725  if (pInfo)
726  {
727  progFound= true;
728  V2FillProgramInfo( pProgram, pInfo, true, true );
729  delete pInfo;
730  }
731 
732  break;
733  }
734 
735  default:
736  break;
737  }
738  if (!progFound)
739  pProgram->setProperty("isNull",QVariant(true));
740  }
741  }
742 }
743 
744 // Note - special value -999 for nRecStatus means all values less than 0.
745 // This is needed by BackendStatus API
746 int FillUpcomingList(QVariantList &list, QObject* parent,
747  int& nStartIndex,
748  int& nCount,
749  bool bShowAll,
750  int nRecordId,
751  int nRecStatus )
752 {
753  RecordingList recordingList; // Auto-delete deque
754  RecList tmpList; // Standard deque, objects must be deleted
755 
756  if (nRecordId <= 0)
757  nRecordId = -1;
758 
759  // NOTE: Fetching this information directly from the schedule is
760  // significantly faster than using ProgramInfo::LoadFromScheduler()
761  auto *scheduler = dynamic_cast<Scheduler*>(gCoreContext->GetScheduler());
762  if (scheduler)
763  scheduler->GetAllPending(tmpList, nRecordId);
764 
765  // Sort the upcoming into only those which will record
766  // NOLINTNEXTLINE(modernize-loop-convert)
767  for (auto it = tmpList.begin(); it < tmpList.end(); ++it)
768  {
769  if ((nRecStatus == -999
770  && (*it)->GetRecordingStatus() >= 0)
771  || (nRecStatus != 0 && nRecStatus != -999
772  && (*it)->GetRecordingStatus() != nRecStatus))
773  {
774  delete *it;
775  *it = nullptr;
776  continue;
777  }
778 
779  if (!bShowAll && ((((*it)->GetRecordingStatus() >= RecStatus::Pending) &&
780  ((*it)->GetRecordingStatus() <= RecStatus::WillRecord)) ||
781  ((*it)->GetRecordingStatus() == RecStatus::Recorded) ||
782  ((*it)->GetRecordingStatus() == RecStatus::Conflict)) &&
783  ((*it)->GetRecordingEndTime() > MythDate::current()))
784  { // NOLINT(bugprone-branch-clone)
785  recordingList.push_back(new RecordingInfo(**it));
786  }
787  else if (bShowAll &&
788  ((*it)->GetRecordingEndTime() > MythDate::current()))
789  {
790  recordingList.push_back(new RecordingInfo(**it));
791  }
792 
793  delete *it;
794  *it = nullptr;
795  }
796 
797  // ----------------------------------------------------------------------
798  // Build Response
799  // ----------------------------------------------------------------------
800 
801  nStartIndex = (nStartIndex > 0) ? std::min( nStartIndex, (int)recordingList.size() ) : 0;
802  nCount = (nCount > 0) ? std::min( nCount, (int)recordingList.size() ) : recordingList.size();
803  int nEndIndex = std::min((nStartIndex + nCount), (int)recordingList.size() );
804 
805  for( int n = nStartIndex; n < nEndIndex; n++)
806  {
807  ProgramInfo *pInfo = recordingList[ n ];
808  auto *pProgram = new V2Program( parent );
809  list.append( QVariant::fromValue<QObject *>( pProgram ));
810  V2FillProgramInfo( pProgram, pInfo, true );
811  }
812 
813  return recordingList.size();
814 }
815 
816 void FillFrontendList(QVariantList &list, QObject* parent, bool OnLine)
817 {
818  QMap<QString, Frontend*> frontends;
819  if (OnLine)
820  frontends = gBackendContext->GetConnectedFrontends();
821  else
822  frontends = gBackendContext->GetFrontends();
823 
824  for (auto * fe : qAsConst(frontends))
825  {
826  auto *pFrontend = new V2Frontend( parent );
827  list.append( QVariant::fromValue<QObject *>( pFrontend ));
828  pFrontend->setName(fe->m_name);
829  pFrontend->setIP(fe->m_ip.toString());
830  int port = gCoreContext->GetNumSettingOnHost("FrontendStatusPort",
831  fe->m_name, 6547);
832  pFrontend->setPort(port);
833  pFrontend->setOnLine(fe->m_connectionCount > 0);
834  }
835 }
836 
837 
838 int V2CreateRecordingGroup(const QString& groupName)
839 {
840  int groupID = -1;
841  MSqlQuery query(MSqlQuery::InitCon());
842 
843  query.prepare("INSERT INTO recgroups SET recgroup = :NAME, "
844  "displayname = :DISPLAYNAME");
845  query.bindValue(":NAME", groupName);
846  query.bindValue(":DISPLAYNAME", groupName);
847 
848  if (query.exec())
849  groupID = query.lastInsertId().toInt();
850 
851  if (groupID <= 0)
852  LOG(VB_GENERAL, LOG_ERR, QString("Could not create recording group (%1). "
853  "Does it already exist?").arg(groupName));
854 
855  return groupID;
856 }
857 
858 DBCredits * V2jsonCastToCredits(const QJsonObject &cast)
859 {
860  int priority = 1;
861  auto* credits = new DBCredits;
862 
863  QJsonArray members = cast["CastMembers"].toArray();
864  for (const auto & m : members)
865  {
866  QJsonObject actor = m.toObject();
867  QString name = actor.value("Name").toString("");
868  QString character = actor.value("CharacterName").toString("");
869  QString role = actor.value("Role").toString("");
870 
871  credits->push_back(DBPerson(role, name, priority++, character));
872  }
873 
874  return credits;
875 }
ChannelInfo
Definition: channelinfo.h:31
V2FillGenreList
void V2FillGenreList(V2GenreList *pGenreList, int videoID)
Definition: v2serviceUtil.cpp:337
ChannelGroupItem::m_grpId
uint m_grpId
Definition: channelgroup.h:28
RecordingRule::m_channelid
int m_channelid
callsign?
Definition: recordingrule.h:99
Scheduler
Definition: scheduler.h:45
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
RecordingRule::m_autoTranscode
bool m_autoTranscode
Definition: recordingrule.h:132
ChannelInfo::m_serviceType
uint m_serviceType
Definition: channelinfo.h:112
RecordingRule::m_enddate
QDate m_enddate
Definition: recordingrule.h:90
MusicMetadata::Title
QString Title() const
Definition: musicmetadata.h:162
RecordingRule::m_playGroup
QString m_playGroup
Definition: recordingrule.h:122
MSqlQuery::size
int size(void) const
Definition: mythdbcon.h:215
RecordingRule::m_seriesid
QString m_seriesid
Definition: recordingrule.h:84
RecordingRule::m_parentRecID
int m_parentRecID
Definition: recordingrule.h:71
MusicMetadata::Filename
QString Filename(bool find=true)
Definition: musicmetadata.cpp:959
ProgramInfo::GetFilesize
virtual uint64_t GetFilesize(void) const
Definition: programinfo.cpp:6345
MARK_COMM_END
@ MARK_COMM_END
Definition: programtypes.h:61
backendcontext.h
V2FillProgramInfo
void V2FillProgramInfo(V2Program *pProgram, ProgramInfo *pInfo, bool bIncChannel, bool bDetails, bool bIncCast, bool bIncArtwork, bool bIncRecording)
Definition: v2serviceUtil.cpp:21
RecordingRule::m_description
QString m_description
Definition: recordingrule.h:81
MusicMetadata::Genre
QString Genre() const
Definition: musicmetadata.h:175
RecordingRule::m_autoCommFlag
bool m_autoCommFlag
Definition: recordingrule.h:131
RecordingRule::m_inetref
QString m_inetref
Definition: recordingrule.h:87
ProgramInfo::GetHostname
QString GetHostname(void) const
Definition: programinfo.h:421
ProgramInfo::GetInputName
QString GetInputName(void) const
Definition: programinfo.h:464
MythCoreContext::GetScheduler
MythScheduler * GetScheduler(void)
Definition: mythcorecontext.cpp:1894
RecordingRule::m_maxNewest
bool m_maxNewest
Definition: recordingrule.h:127
ProgramInfo::QueryPositionMap
void QueryPositionMap(frm_pos_map_t &posMap, MarkTypes type) const
Definition: programinfo.cpp:3763
RecordingRule::m_category
QString m_category
Definition: recordingrule.h:82
toRawString
QString toRawString(RecordingType rectype)
Converts "rectype" into an untranslated string.
Definition: recordingtypes.cpp:76
RecordingRule::m_nextRecording
QDateTime m_nextRecording
Definition: recordingrule.h:142
ChannelInfo::m_chanId
uint m_chanId
Definition: channelinfo.h:85
RecordingRule::m_starttime
QTime m_starttime
Definition: recordingrule.h:91
V2RecordingInfo
Definition: v2recording.h:23
DBPerson
Definition: programdata.h:24
V2ArtworkInfoList
Definition: v2artworkInfoList.h:22
V2Program::Recording
QObject Recording
Definition: v2programAndChannel.h:141
FillUpcomingList
int FillUpcomingList(QVariantList &list, QObject *parent, int &nStartIndex, int &nCount, bool bShowAll, int nRecordId, int nRecStatus)
Definition: v2serviceUtil.cpp:746
MusicMetadata::CompilationArtist
QString CompilationArtist() const
Definition: musicmetadata.h:138
simple_ref_ptr
Definition: quicksp.h:24
ChannelInfo::m_freqId
QString m_freqId
Definition: channelinfo.h:87
V2FillVideoMetadataInfo
void V2FillVideoMetadataInfo(V2VideoMetadataInfo *pVideoMetadataInfo, const VideoMetadataListManager::VideoMetadataPtr &pMetadata, bool bDetails)
Definition: v2serviceUtil.cpp:361
ChannelGroupItem
Definition: channelgroup.h:15
RecordingInfo
Holds information on a TV Program one might wish to record.
Definition: recordinginfo.h:35
newEpifromDupIn
bool newEpifromDupIn(RecordingDupInType recdupin)
Definition: recordingtypes.cpp:211
MARK_CUT_END
@ MARK_CUT_END
Definition: programtypes.h:56
RecordingInfo::GetFilesize
uint64_t GetFilesize(void) const override
Definition: recordinginfo.cpp:1757
ProgramInfo::GetRecordingID
uint GetRecordingID(void) const
Definition: programinfo.h:446
ChannelInfo::m_fineTune
int m_fineTune
Definition: channelinfo.h:95
MSqlQuery::lastInsertId
QVariant lastInsertId()
Return the id of the last inserted row.
Definition: mythdbcon.cpp:912
RecordingRule::m_title
QString m_title
Definition: recordingrule.h:77
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:205
V2ChannelGroup
Definition: v2channelGroup.h:19
ProgramInfo::GetCategory
QString GetCategory(void) const
Definition: programinfo.h:369
RecordingRule::m_averageDelay
int m_averageDelay
Definition: recordingrule.h:141
GetArtwork
ArtworkMap GetArtwork(const QString &inetref, uint season, bool strict)
Definition: metadataimagehelper.cpp:23
frm_dir_map_t
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
Definition: programtypes.h:119
RecordingRule::m_lastDeleted
QDateTime m_lastDeleted
Definition: recordingrule.h:144
RecStatus::Unknown
@ Unknown
Definition: recordingstatus.h:32
RecordingRule
Internal representation of a recording rule, mirrors the record table.
Definition: recordingrule.h:28
RecordingRule::m_endOffset
int m_endOffset
Definition: recordingrule.h:110
ChannelInfo::m_atscMajorChan
uint m_atscMajorChan
Definition: channelinfo.h:113
MusicMetadata::ID
IdType ID() const
Definition: musicmetadata.h:218
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:608
V2Frontend
Definition: v2frontend.h:18
ChannelInfo::m_name
QString m_name
Definition: channelinfo.h:92
MusicMetadata::Track
int Track() const
Definition: musicmetadata.h:199
RecStatus::Recorded
@ Recorded
Definition: recordingstatus.h:29
ContentTypeToString
QString ContentTypeToString(VideoContentType type)
Definition: videoutils.cpp:300
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
ProgramInfo::GetScheduledEndTime
QDateTime GetScheduledEndTime(void) const
The scheduled end time of the program.
Definition: programinfo.h:397
ProgramInfo::QueryKeyFrameDuration
bool QueryKeyFrameDuration(uint64_t *duration, uint64_t keyframe, bool backwards) const
Definition: programinfo.cpp:4217
MusicMetadata
Definition: musicmetadata.h:80
MusicMetadata::Length
std::chrono::milliseconds Length() const
Definition: musicmetadata.h:205
gBackendContext
BackendContext * gBackendContext
Definition: backendcontext.cpp:12
recordingtypes.h
RecordingRule::m_dupIn
RecordingDupInType m_dupIn
Definition: recordingrule.h:114
RecordingRule::m_isInactive
bool m_isInactive
Recording rule is enabled?
Definition: recordingrule.h:74
ProgramInfo::GetRecordingEndTime
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
Definition: programinfo.h:412
ProgramInfo::GetProgramFlags
uint32_t GetProgramFlags(void) const
Definition: programinfo.h:470
ProgramInfo::GetRecordingGroup
QString GetRecordingGroup(void) const
Definition: programinfo.h:419
MusicMetadata::Artist
QString Artist() const
Definition: musicmetadata.h:126
ProgramInfo::GetRecordingPriority
int GetRecordingPriority(void) const
Definition: programinfo.h:440
RecordingRule::m_season
uint m_season
Definition: recordingrule.h:94
V2Program::Channel
QObject Channel
Definition: v2programAndChannel.h:140
ChannelInfo::m_icon
QString m_icon
Definition: channelinfo.h:93
scheduler.h
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:14
ProgramInfo::GetRecordingStartTime
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
Definition: programinfo.h:404
ProgramInfo::GetPathname
QString GetPathname(void) const
Definition: programinfo.h:343
FillFrontendList
void FillFrontendList(QVariantList &list, QObject *parent, bool OnLine)
Definition: v2serviceUtil.cpp:816
DBCredits
std::vector< DBPerson > DBCredits
Definition: programdata.h:73
kState_WatchingRecording
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
Definition: tv.h:80
V2CutList::AddNewCutting
V2Cutting * AddNewCutting()
Definition: v2cutList.h:43
ProgramInfo::IsRepeat
bool IsRepeat(void) const
Definition: programinfo.h:487
RecStatus::WillRecord
@ WillRecord
Definition: recordingstatus.h:31
RecordingInfo::GetProgramRecordingProfile
QString GetProgramRecordingProfile(void) const
Returns recording profile name that will be, or was used, for this program, creating "record" field i...
Definition: recordinginfo.cpp:492
ProgramInfo::GetInetRef
QString GetInetRef(void) const
Definition: programinfo.h:437
ProgramInfo::GetVideoPropertyNames
QString GetVideoPropertyNames(void) const
Definition: programinfo.cpp:1509
RecordingRule::m_startOffset
int m_startOffset
Definition: recordingrule.h:109
ProgramInfo::GetYearOfInitialRelease
uint GetYearOfInitialRelease(void) const
Definition: programinfo.h:423
ChannelInfo::m_commMethod
int m_commMethod
Definition: channelinfo.h:119
V2FillInputInfo
void V2FillInputInfo(V2Input *input, const InputInfo &inputInfo)
Definition: v2serviceUtil.cpp:488
ChannelInfo::m_useOnAirGuide
bool m_useOnAirGuide
Definition: channelinfo.h:108
RecordingRule::m_episode
uint m_episode
Definition: recordingrule.h:95
InputInfo::m_recPriority
int m_recPriority
Definition: inputinfo.h:53
programinfo.h
CardUtil::GetAllInputInfo
static QList< InputInfo > GetAllInputInfo()
Definition: cardutil.cpp:1698
ProgramInfo::GetScheduledStartTime
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
Definition: programinfo.h:390
ProgramInfo::GetRecordingStatus
RecStatus::Type GetRecordingStatus(void) const
Definition: programinfo.h:447
V2VideoMetadataInfo::Artwork
QObject Artwork
Definition: v2videoMetadataInfo.h:46
v2serviceUtil.h
InputInfo::m_liveTvOrder
uint m_liveTvOrder
order for live TV use
Definition: inputinfo.h:55
RecordingRule::m_autoUserJob4
bool m_autoUserJob4
Definition: recordingrule.h:136
V2FillRecRuleInfo
void V2FillRecRuleInfo(V2RecRule *pRecRule, RecordingRule *pRule)
Definition: v2serviceUtil.cpp:237
ProgramInfo::GetProgramFlagNames
QString GetProgramFlagNames(void) const
Definition: programinfo.cpp:1498
ProgramInfo::GetSubtitleTypeNames
QString GetSubtitleTypeNames(void) const
Definition: programinfo.cpp:1503
ChannelInfo::GetGroupIds
QList< uint > GetGroupIds() const
Definition: channelinfo.h:57
v2encoder.h
FillEncoderList
void FillEncoderList(QVariantList &list, QObject *parent)
Definition: v2serviceUtil.cpp:683
ChannelInfo::m_atscMinorChan
uint m_atscMinorChan
Definition: channelinfo.h:114
RecordingInfo::GetRecgroupString
static QString GetRecgroupString(uint recGroupID)
Temporary helper during transition from string to ID.
Definition: recordinginfo.cpp:1707
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:540
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:361
ProgramInfo::GetDescription
QString GetDescription(void) const
Definition: programinfo.h:365
RecordingRule::m_autoUserJob2
bool m_autoUserJob2
Definition: recordingrule.h:134
BackendContext::GetFrontends
QMap< QString, Frontend * > GetFrontends() const
Definition: backendcontext.h:52
V2FillSeek
void V2FillSeek(V2CutList *pCutList, RecordingInfo *rInfo, MarkTypes marktype)
Definition: v2serviceUtil.cpp:665
ProgramInfo::GetEpisodeTotal
uint GetEpisodeTotal(void) const
Definition: programinfo.h:368
RecordingRule::m_findtime
QTime m_findtime
Time for timeslot rules.
Definition: recordingrule.h:101
V2FillCastMemberList
void V2FillCastMemberList(V2CastMemberList *pCastMemberList, ProgramInfo *pInfo)
Definition: v2serviceUtil.cpp:503
RecordingRule::m_lastRecorded
QDateTime m_lastRecorded
Definition: recordingrule.h:143
RecordingRule::m_autoExpire
bool m_autoExpire
Definition: recordingrule.h:126
V2Encoder
Definition: v2encoder.h:23
RecordingRule::m_recProfile
QString m_recProfile
Definition: recordingrule.h:120
ChannelInfo::m_chanNum
QString m_chanNum
Definition: channelinfo.h:86
ProgramInfo::QueryCutList
bool QueryCutList(frm_dir_map_t &delMap, bool loadAutosave=false) const
Definition: programinfo.cpp:3465
kArtworkFanart
@ kArtworkFanart
Definition: metadataimagehelper.h:12
RecordingRule::m_searchType
RecSearchType m_searchType
Definition: recordingrule.h:112
RecordingRule::m_type
RecordingType m_type
Definition: recordingrule.h:111
RecStatus::Conflict
@ Conflict
Definition: recordingstatus.h:39
MythCoreContext::GetNumSettingOnHost
int GetNumSettingOnHost(const QString &key, const QString &host, int defaultval=0)
Definition: mythcorecontext.cpp:943
RecordingRule::m_subtitle
QString m_subtitle
Definition: recordingrule.h:79
V2FillChannelGroup
void V2FillChannelGroup(V2ChannelGroup *pGroup, const ChannelGroupItem &pGroupItem)
Definition: v2serviceUtil.cpp:223
ProgramInfo::GetAudioProperties
uint GetAudioProperties(void) const
Definition: programinfo.h:497
V2CutList
Definition: v2cutList.h:21
ProgramInfo::GetPlaybackGroup
QString GetPlaybackGroup(void) const
Definition: programinfo.h:420
V2Genre
Definition: v2genre.h:21
RecordingRule::m_findday
int m_findday
Day of the week for once per week etc.
Definition: recordingrule.h:104
V2FillChannelInfo
bool V2FillChannelInfo(V2ChannelInfo *pChannel, uint nChanID, bool bDetails)
Definition: v2serviceUtil.cpp:143
RecordingRule::m_filter
unsigned m_filter
Definition: recordingrule.h:115
V2Program::Artwork
QObject Artwork
Definition: v2programAndChannel.h:142
TVRec::s_inputsLock
static QReadWriteLock s_inputsLock
Definition: tv_rec.h:432
uint
unsigned int uint
Definition: compat.h:79
gTVList
QMap< int, EncoderLink * > gTVList
Definition: backendcontext.cpp:7
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
ProgramInfo::GetSeriesID
QString GetSeriesID(void) const
Definition: programinfo.h:435
ChannelGroupItem::m_name
QString m_name
Definition: channelgroup.h:29
V2ArtworkInfoList::AddNewArtworkInfo
V2ArtworkInfo * AddNewArtworkInfo()
Definition: v2artworkInfoList.h:46
V2CreateRecordingGroup
int V2CreateRecordingGroup(const QString &groupName)
Definition: v2serviceUtil.cpp:838
ProgramInfo::GetStorageGroup
QString GetStorageGroup(void) const
Definition: programinfo.h:422
RecordingRule::m_maxEpisodes
int m_maxEpisodes
Definition: recordingrule.h:125
ProgramInfo::GetOriginalAirDate
QDate GetOriginalAirDate(void) const
Definition: programinfo.h:428
RecordingRule::m_programid
QString m_programid
Definition: recordingrule.h:85
channelutil.h
frm_pos_map_t
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
Definition: programtypes.h:46
InputInfo::m_inputId
uint m_inputId
unique key in DB for this input
Definition: inputinfo.h:49
ProgramInfo::GetVideoProperties
uint GetVideoProperties(void) const
Definition: programinfo.h:495
RecStatus::Pending
@ Pending
Definition: recordingstatus.h:17
RecordingRule::m_recGroupID
uint m_recGroupID
Definition: recordingrule.h:123
RecordingRule::m_endtime
QTime m_endtime
Definition: recordingrule.h:92
MusicMetadata::Album
QString Album() const
Definition: musicmetadata.h:150
InputInfo::m_quickTune
bool m_quickTune
Definition: inputinfo.h:56
BackendContext::GetConnectedFrontends
QMap< QString, Frontend * > GetConnectedFrontends() const
Definition: backendcontext.h:51
ProgramInfo::GetDuplicateCheckMethod
RecordingDupMethodType GetDuplicateCheckMethod(void) const
What should be compared to determine if two programs are the same?
Definition: programinfo.h:459
AutoDeleteDeque
Definition: autodeletedeque.h:8
channelinfo.h
ProgramInfo::GetInputID
uint GetInputID(void) const
Definition: programinfo.h:463
V2MusicMetadataInfo
Definition: v2musicMetadataInfo.h:22
InputInfo::m_scheduleOrder
uint m_scheduleOrder
Definition: inputinfo.h:54
InputInfo::m_sourceId
uint m_sourceId
associated channel listings source
Definition: inputinfo.h:48
recordinginfo.h
RecordingRule::m_storageGroup
QString m_storageGroup
Definition: recordingrule.h:121
ProgramInfo::GetChanID
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:372
ProgramInfo::GetRecordingRuleType
RecordingType GetRecordingRuleType(void) const
Definition: programinfo.h:451
ProgramInfo::GetEpisode
uint GetEpisode(void) const
Definition: programinfo.h:367
RecordingRule::m_transcoder
int m_transcoder
Definition: recordingrule.h:130
RecordingRule::m_autoUserJob1
bool m_autoUserJob1
Definition: recordingrule.h:133
AutoDeleteDeque::push_back
void push_back(T info)
Definition: autodeletedeque.h:69
V2Program::Cast
QObject Cast
Definition: v2programAndChannel.h:143
ChannelInfo::m_serviceId
uint m_serviceId
Definition: channelinfo.h:111
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
channelgroup.h
RecordingRule::m_recordID
int m_recordID
Unique Recording Rule ID.
Definition: recordingrule.h:70
ProgramInfo::GetAudioPropertyNames
QString GetAudioPropertyNames(void) const
Definition: programinfo.cpp:1514
ProgramInfo::QueryKeyFramePosition
bool QueryKeyFramePosition(uint64_t *position, uint64_t keyframe, bool backwards) const
Definition: programinfo.cpp:4199
MusicMetadata::Hostname
QString Hostname(void)
Definition: musicmetadata.h:230
ProgramInfo::GetLastModifiedTime
QDateTime GetLastModifiedTime(void) const
Definition: programinfo.h:429
mythscheduler.h
V2CastMember
Definition: v2castMember.h:19
ProgramInfo::GetSeason
uint GetSeason(void) const
Definition: programinfo.h:366
cardutil.h
v2frontend.h
RecordingRule::m_dupMethod
RecordingDupMethodType m_dupMethod
Definition: recordingrule.h:113
ProgramInfo::GetCategoryTypeString
QString GetCategoryTypeString(void) const
Returns catType as a string.
Definition: programinfo.cpp:1887
V2FillMusicMetadataInfo
void V2FillMusicMetadataInfo(V2MusicMetadataInfo *pVideoMetadataInfo, MusicMetadata *pMetadata, bool bDetails)
Definition: v2serviceUtil.cpp:463
ChannelInfo::Load
bool Load(uint lchanid=-1)
Definition: channelinfo.cpp:130
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:883
MarkTypes
MarkTypes
Definition: programtypes.h:48
MusicMetadata::LastPlay
QDateTime LastPlay() const
Definition: musicmetadata.h:244
MusicMetadata::Compilation
bool Compilation() const
Definition: musicmetadata.h:252
ChannelInfo::m_sourceId
uint m_sourceId
Definition: channelinfo.h:89
RecList
std::deque< RecordingInfo * > RecList
Definition: mythscheduler.h:12
ChannelInfo::m_tvFormat
QString m_tvFormat
Definition: channelinfo.h:105
V2Program
Definition: v2programAndChannel.h:98
tv_rec.h
kState_WatchingLiveTV
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
Definition: tv.h:63
ProgramInfo::GetDuplicateCheckSource
RecordingDupInType GetDuplicateCheckSource(void) const
Where should we check for duplicates?
Definition: programinfo.h:455
MusicMetadata::PlayCount
int PlayCount() const
Definition: musicmetadata.h:248
InputInfo
Definition: inputinfo.h:14
kArtworkBanner
@ kArtworkBanner
Definition: metadataimagehelper.h:13
V2FillCutList
void V2FillCutList(V2CutList *pCutList, RecordingInfo *rInfo, int marktype)
Definition: v2serviceUtil.cpp:577
V2CastMemberList
Definition: v2castMemberList.h:13
ChannelInfo::m_xmltvId
QString m_xmltvId
Definition: channelinfo.h:97
V2CastMemberList::AddNewCastMember
V2CastMember * AddNewCastMember()
Definition: v2castMemberList.h:37
ArtworkMap
QMultiMap< VideoArtworkType, ArtworkInfo > ArtworkMap
Definition: metadataimagehelper.h:31
ProgramInfo::QueryCommBreakList
void QueryCommBreakList(frm_dir_map_t &frames) const
Definition: programinfo.cpp:3551
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:838
ChannelInfo::m_videoFilters
QString m_videoFilters
Definition: channelinfo.h:96
Scheduler::GetAllPending
bool GetAllPending(RecList &retList, int recRuleId=0) const
Definition: scheduler.cpp:1741
MusicMetadata::Rating
int Rating() const
Definition: musicmetadata.h:239
V2GenreList
Definition: v2genreList.h:22
ProgramInfo::GetProgramID
QString GetProgramID(void) const
Definition: programinfo.h:436
ChannelInfo::GetInputIds
QList< uint > GetInputIds() const
Definition: channelinfo.h:67
RecordingRule::m_station
QString m_station
Definition: recordingrule.h:98
ProgramInfo::GetRecordingRuleID
uint GetRecordingRuleID(void) const
Definition: programinfo.h:449
V2VideoMetadataInfo::Genres
QObject Genres
Definition: v2videoMetadataInfo.h:48
RecordingRule::m_recPriority
int m_recPriority
Definition: recordingrule.h:107
V2GenreList::AddNewGenre
V2Genre * AddNewGenre()
Definition: v2genreList.h:48
ProgramInfo::GetSubtitleType
uint GetSubtitleType(void) const
Definition: programinfo.h:493
RecordingRule::m_autoUserJob3
bool m_autoUserJob3
Definition: recordingrule.h:135
ChannelInfo::m_mplexId
uint m_mplexId
Definition: channelinfo.h:110
ChannelInfo::m_visible
ChannelVisibleType m_visible
Definition: channelinfo.h:106
V2FillArtworkInfoList
void V2FillArtworkInfoList(V2ArtworkInfoList *pArtworkInfoList, const QString &sInetref, uint nSeason)
Definition: v2serviceUtil.cpp:294
V2ArtworkInfo
Definition: v2artworkInfo.h:21
InputInfo::m_displayName
QString m_displayName
Definition: inputinfo.h:52
kArtworkCoverart
@ kArtworkCoverart
Definition: metadataimagehelper.h:11
kState_RecordingOnly
@ kState_RecordingOnly
Recording Only is a TVRec only state for when we are recording a program, but there is no one current...
Definition: tv.h:84
V2Input
Definition: v2input.h:20
V2FillCommBreak
void V2FillCommBreak(V2CutList *pCutList, RecordingInfo *rInfo, int marktype)
Definition: v2serviceUtil.cpp:619
videoutils.h
MusicMetadata::Year
int Year() const
Definition: musicmetadata.h:196
RecordingRule::m_startdate
QDate m_startdate
Definition: recordingrule.h:89
ChannelInfo::m_defaultAuthority
QString m_defaultAuthority
Definition: channelinfo.h:118
ChannelInfo::m_callSign
QString m_callSign
Definition: channelinfo.h:91
RecordingRule::m_autoMetadataLookup
bool m_autoMetadataLookup
Definition: recordingrule.h:137
V2ChannelInfo
Definition: v2programAndChannel.h:27
AutoDeleteDeque::size
size_t size(void) const
Definition: autodeletedeque.h:67
V2Cutting
Definition: v2cutting.h:19
RecordingRule::m_prefInput
int m_prefInput
Definition: recordingrule.h:108
kChannelNotVisible
@ kChannelNotVisible
Definition: channelinfo.h:24
V2jsonCastToCredits
DBCredits * V2jsonCastToCredits(const QJsonObject &cast)
Definition: v2serviceUtil.cpp:858
V2VideoMetadataInfo
Definition: v2videoMetadataInfo.h:9
InputInfo::m_name
QString m_name
input name
Definition: inputinfo.h:47
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:832
V2RecRule
Definition: v2recRule.h:12
ProgramInfo::GetSubtitle
QString GetSubtitle(void) const
Definition: programinfo.h:363
ProgramInfo::GetStars
float GetStars(void) const
Definition: programinfo.h:442