MythTV  master
serviceUtil.cpp
Go to the documentation of this file.
1 // Program Name: serviceUtil.cpp
3 // Created : Mar. 7, 2011
4 //
5 // Copyright (c) 2011 David Blain <dblain@mythtv.org>
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //
25 
26 // Qt
27 #include <QJsonArray>
28 #include <QJsonObject>
29 #include <QUrl>
30 
31 // MythTV
36 #include "libmythtv/cardutil.h"
37 #include "libmythtv/channelinfo.h"
38 #include "libmythtv/channelutil.h"
41 
42 // MythBackend
43 #include "serviceUtil.h"
44 
46 //
48 
49 void FillProgramInfo( DTC::Program *pProgram,
50  ProgramInfo *pInfo,
51  bool bIncChannel /* = true */,
52  bool bDetails /* = true */,
53  bool bIncCast /* = true */)
54 {
55  if ((pProgram == nullptr) || (pInfo == nullptr))
56  return;
57 
58  pProgram->setStartTime ( pInfo->GetScheduledStartTime());
59  pProgram->setEndTime ( pInfo->GetScheduledEndTime ());
60  pProgram->setTitle ( pInfo->GetTitle() );
61  pProgram->setSubTitle ( pInfo->GetSubtitle() );
62  pProgram->setCategory ( pInfo->GetCategory() );
63  pProgram->setCatType ( pInfo->GetCategoryTypeString());
64  pProgram->setRepeat ( pInfo->IsRepeat() );
65  pProgram->setVideoProps( pInfo->GetVideoProperties() );
66  pProgram->setVideoPropNames( pInfo->GetVideoPropertyNames() );
67  pProgram->setAudioProps( pInfo->GetAudioProperties() );
68  pProgram->setAudioPropNames( pInfo->GetAudioPropertyNames() );
69  pProgram->setSubProps ( pInfo->GetSubtitleType() );
70  pProgram->setSubPropNames( pInfo->GetSubtitleTypeNames() );
71 
72  pProgram->setSerializeDetails( bDetails );
73 
74  if (bDetails)
75  {
76  pProgram->setSeriesId ( pInfo->GetSeriesID() );
77  pProgram->setProgramId ( pInfo->GetProgramID() );
78  pProgram->setStars ( pInfo->GetStars() );
79  pProgram->setLastModified( pInfo->GetLastModifiedTime() );
80  pProgram->setProgramFlags( pInfo->GetProgramFlags() );
81  pProgram->setProgramFlagNames( pInfo->GetProgramFlagNames() );
82 
83  // ----
84  // DEPRECATED - See RecordingInfo instead
85  pProgram->setFileName ( pInfo->GetPathname() );
86  pProgram->setFileSize ( pInfo->GetFilesize() );
87  pProgram->setHostName ( pInfo->GetHostname() );
88  // ----
89 
90  if (pInfo->GetOriginalAirDate().isValid())
91  pProgram->setAirdate( pInfo->GetOriginalAirDate() );
92  else if (pInfo->GetYearOfInitialRelease() > 0)
93  {
94  QDate year;
95  year.setDate(pInfo->GetYearOfInitialRelease(), 1, 1);
96  pProgram->setAirdate( year );
97  }
98 
99  pProgram->setDescription( pInfo->GetDescription() );
100  pProgram->setInetref ( pInfo->GetInetRef() );
101  pProgram->setSeason ( pInfo->GetSeason() );
102  pProgram->setEpisode ( pInfo->GetEpisode() );
103  pProgram->setTotalEpisodes( pInfo->GetEpisodeTotal() );
104  }
105 
106  pProgram->setSerializeCast(bIncCast);
107  if (bIncCast)
108  {
109  FillCastMemberList( pProgram->Cast(), pInfo );
110  }
111 
112  pProgram->setSerializeChannel( bIncChannel );
113 
114  if ( bIncChannel )
115  {
116  // Build Channel Child Element
117  if (!FillChannelInfo( pProgram->Channel(), pInfo->GetChanID(), bDetails ))
118  {
119  // The channel associated with a given recording may no longer exist
120  // however the ChanID is one half of the unique identifier for the
121  // recording and therefore MUST be included in the return data
122  pProgram->Channel()->setChanId(pInfo->GetChanID());
123  }
124  }
125 
126  // Build Recording Child Element
127 
128  if ( pInfo->GetRecordingStatus() != RecStatus::Unknown )
129  {
130  pProgram->setSerializeRecording( true );
131 
132  DTC::RecordingInfo *pRecording = pProgram->Recording();
133 
134  const RecordingInfo pRecInfo(*pInfo);
135 
136  pRecording->setRecordedId ( pRecInfo.GetRecordingID() );
137  pRecording->setStatus ( pRecInfo.GetRecordingStatus() );
138  pRecording->setPriority( pRecInfo.GetRecordingPriority() );
139  pRecording->setStartTs ( pRecInfo.GetRecordingStartTime() );
140  pRecording->setEndTs ( pRecInfo.GetRecordingEndTime() );
141 
142  pRecording->setSerializeDetails( bDetails );
143 
144  if (bDetails)
145  {
146  pRecording->setFileName ( pRecInfo.GetPathname() );
147  pRecording->setFileSize ( pRecInfo.GetFilesize() );
148  pRecording->setHostName ( pRecInfo.GetHostname() );
149  pRecording->setLastModified( pRecInfo.GetLastModifiedTime() );
150 
151  pRecording->setRecordId ( pRecInfo.GetRecordingRuleID() );
152  pRecording->setRecGroup ( pRecInfo.GetRecordingGroup() );
153  pRecording->setPlayGroup ( pRecInfo.GetPlaybackGroup() );
154  pRecording->setStorageGroup( pRecInfo.GetStorageGroup() );
155  pRecording->setRecType ( pRecInfo.GetRecordingRuleType() );
156  pRecording->setDupInType ( pRecInfo.GetDuplicateCheckSource() );
157  pRecording->setDupMethod ( pRecInfo.GetDuplicateCheckMethod() );
158  pRecording->setEncoderId ( pRecInfo.GetInputID() );
159  pRecording->setEncoderName ( pRecInfo.GetInputName() );
160  pRecording->setProfile ( pRecInfo.GetProgramRecordingProfile() );
161  }
162  }
163 
164  if (!pInfo->GetInetRef().isEmpty() )
165  {
166  pProgram->setSerializeArtwork( true );
167 
168  FillArtworkInfoList( pProgram->Artwork(), pInfo->GetInetRef(),
169  pInfo->GetSeason());
170  }
171 }
172 
174 //
176 
178  uint nChanID,
179  bool bDetails /* = true */ )
180 {
181  ChannelInfo channel;
182  if (channel.Load(nChanID))
183  {
184  return FillChannelInfo(pChannel, channel, bDetails);
185  }
186 
187  return false;
188 }
189 
191 //
193 
195  const ChannelInfo &channelInfo,
196  bool bDetails /* = true */ )
197 {
198 
199  // TODO update DTC::ChannelInfo to match functionality of ChannelInfo,
200  // ultimately replacing it's progenitor?
201  pChannel->setChanId(channelInfo.m_chanId);
202  pChannel->setChanNum(channelInfo.m_chanNum);
203  pChannel->setCallSign(channelInfo.m_callSign);
204  if (!channelInfo.m_icon.isEmpty())
205  {
206  QString sIconURL = QString( "/Guide/GetChannelIcon?ChanId=%3")
207  .arg( channelInfo.m_chanId );
208  pChannel->setIconURL( sIconURL );
209  }
210  pChannel->setChannelName(channelInfo.m_name);
211  pChannel->setVisible(channelInfo.m_visible > kChannelNotVisible);
212  #ifndef _WIN32 // Needs fixing for Windows
213  pChannel->setExtendedVisible(toRawString(channelInfo.m_visible));
214  #endif
215 
216  pChannel->setSerializeDetails( bDetails );
217 
218  if (bDetails)
219  {
220  pChannel->setMplexId(channelInfo.m_mplexId);
221  pChannel->setServiceId(channelInfo.m_serviceId);
222  pChannel->setATSCMajorChan(channelInfo.m_atscMajorChan);
223  pChannel->setATSCMinorChan(channelInfo.m_atscMinorChan);
224  pChannel->setFormat(channelInfo.m_tvFormat);
225  pChannel->setFineTune(channelInfo.m_fineTune);
226  pChannel->setFrequencyId(channelInfo.m_freqId);
227  pChannel->setChanFilters(channelInfo.m_videoFilters);
228  pChannel->setSourceId(channelInfo.m_sourceId);
229  pChannel->setCommFree(channelInfo.m_commMethod == -2);
230  pChannel->setUseEIT(channelInfo.m_useOnAirGuide);
231  pChannel->setXMLTVID(channelInfo.m_xmltvId);
232  pChannel->setDefaultAuth(channelInfo.m_defaultAuthority);
233  pChannel->setServiceType(channelInfo.m_serviceType);
234 
235  QList<uint> groupIds = channelInfo.GetGroupIds();
236  QString sGroupIds;
237  for (int x = 0; x < groupIds.size(); x++)
238  {
239  if (x > 0)
240  sGroupIds += ",";
241 
242  sGroupIds += QString::number(groupIds.at(x));
243  }
244  pChannel->setChannelGroups(sGroupIds);
245 
246  QList<uint> inputIds = channelInfo.GetInputIds();
247  QString sInputIds;
248  for (int x = 0; x < inputIds.size(); x++)
249  {
250  if (x > 0)
251  sInputIds += ",";
252 
253  sInputIds += QString::number(inputIds.at(x));
254  }
255  pChannel->setInputs(sInputIds);
256  }
257 
258  return true;
259 }
260 
262 //
264 
265 void FillChannelGroup(DTC::ChannelGroup* pGroup, const ChannelGroupItem& pGroupItem)
266 {
267  if (!pGroup)
268  return;
269 
270  pGroup->setGroupId(pGroupItem.m_grpId);
271  pGroup->setName(pGroupItem.m_name);
272  pGroup->setPassword(""); // Not currently supported
273 }
274 
276 //
278 
280  RecordingRule *pRule )
281 {
282  if ((pRecRule == nullptr) || (pRule == nullptr))
283  return;
284 
285  pRecRule->setId ( pRule->m_recordID );
286  pRecRule->setParentId ( pRule->m_parentRecID );
287  pRecRule->setInactive ( pRule->m_isInactive );
288  pRecRule->setTitle ( pRule->m_title );
289  pRecRule->setSubTitle ( pRule->m_subtitle );
290  pRecRule->setDescription ( pRule->m_description );
291  pRecRule->setSeason ( pRule->m_season );
292  pRecRule->setEpisode ( pRule->m_episode );
293  pRecRule->setCategory ( pRule->m_category );
294  pRecRule->setStartTime ( QDateTime(pRule->m_startdate,
295  pRule->m_starttime, Qt::UTC));
296  pRecRule->setEndTime ( QDateTime(pRule->m_enddate,
297  pRule->m_endtime, Qt::UTC));
298  pRecRule->setSeriesId ( pRule->m_seriesid );
299  pRecRule->setProgramId ( pRule->m_programid );
300  pRecRule->setInetref ( pRule->m_inetref );
301  pRecRule->setChanId ( pRule->m_channelid );
302  pRecRule->setCallSign ( pRule->m_station );
303  pRecRule->setFindDay ( pRule->m_findday );
304  pRecRule->setFindTime ( pRule->m_findtime );
305  pRecRule->setType ( toRawString(pRule->m_type) );
306  pRecRule->setSearchType ( toRawString(pRule->m_searchType));
307  pRecRule->setRecPriority ( pRule->m_recPriority );
308  pRecRule->setPreferredInput ( pRule->m_prefInput );
309  pRecRule->setStartOffset ( pRule->m_startOffset );
310  pRecRule->setEndOffset ( pRule->m_endOffset );
311  pRecRule->setDupMethod ( toRawString(pRule->m_dupMethod) );
312  pRecRule->setDupIn ( toRawString(pRule->m_dupIn) );
313  pRecRule->setNewEpisOnly ( newEpifromDupIn(pRule->m_dupIn) );
314  pRecRule->setFilter ( pRule->m_filter );
315  pRecRule->setRecProfile ( pRule->m_recProfile );
316  pRecRule->setRecGroup ( RecordingInfo::GetRecgroupString(pRule->m_recGroupID) );
317  pRecRule->setStorageGroup ( pRule->m_storageGroup );
318  pRecRule->setPlayGroup ( pRule->m_playGroup );
319  pRecRule->setAutoExpire ( pRule->m_autoExpire );
320  pRecRule->setMaxEpisodes ( pRule->m_maxEpisodes );
321  pRecRule->setMaxNewest ( pRule->m_maxNewest );
322  pRecRule->setAutoCommflag ( pRule->m_autoCommFlag );
323  pRecRule->setAutoTranscode ( pRule->m_autoTranscode );
324  pRecRule->setAutoMetaLookup ( pRule->m_autoMetadataLookup );
325  pRecRule->setAutoUserJob1 ( pRule->m_autoUserJob1 );
326  pRecRule->setAutoUserJob2 ( pRule->m_autoUserJob2 );
327  pRecRule->setAutoUserJob3 ( pRule->m_autoUserJob3 );
328  pRecRule->setAutoUserJob4 ( pRule->m_autoUserJob4 );
329  pRecRule->setTranscoder ( pRule->m_transcoder );
330  pRecRule->setNextRecording ( pRule->m_nextRecording );
331  pRecRule->setLastRecorded ( pRule->m_lastRecorded );
332  pRecRule->setLastDeleted ( pRule->m_lastDeleted );
333  pRecRule->setAverageDelay ( pRule->m_averageDelay );
334 }
335 
337 //
339 
341  const QString &sInetref,
342  uint nSeason )
343 {
344  ArtworkMap map = GetArtwork(sInetref, nSeason);
345  for (auto i = map.cbegin(); i != map.cend(); ++i)
346  {
347  DTC::ArtworkInfo *pArtInfo = pArtworkInfoList->AddNewArtworkInfo();
348  pArtInfo->setFileName(i.value().url);
349  switch (i.key())
350  {
351  case kArtworkFanart:
352  pArtInfo->setStorageGroup("Fanart");
353  pArtInfo->setType("fanart");
354  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
355  "&FileName=%2")
356  .arg("Fanart",
357  QString(QUrl::toPercentEncoding(
358  QUrl(i.value().url).path()))));
359  break;
360  case kArtworkBanner:
361  pArtInfo->setStorageGroup("Banners");
362  pArtInfo->setType("banner");
363  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
364  "&FileName=%2")
365  .arg("Banners",
366  QString(QUrl::toPercentEncoding(
367  QUrl(i.value().url).path()))));
368  break;
369  case kArtworkCoverart:
370  default:
371  pArtInfo->setStorageGroup("Coverart");
372  pArtInfo->setType("coverart");
373  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
374  "&FileName=%2")
375  .arg("Coverart",
376  QString(QUrl::toPercentEncoding(
377  QUrl(i.value().url).path()))));
378  break;
379  }
380  }
381 }
382 
384 //
386 
387 void FillGenreList(DTC::GenreList* pGenreList, int videoID)
388 {
389  if (!pGenreList)
390  return;
391 
392  MSqlQuery query(MSqlQuery::InitCon());
393  query.prepare("SELECT genre from videogenre "
394  "LEFT JOIN videometadatagenre ON videometadatagenre.idgenre = videogenre.intid "
395  "WHERE idvideo = :ID "
396  "ORDER BY genre;");
397  query.bindValue(":ID", videoID);
398 
399  if (query.exec() && query.size() > 0)
400  {
401  while (query.next())
402  {
403  DTC::Genre *pGenre = pGenreList->AddNewGenre();
404  QString genre = query.value(0).toString();
405  pGenre->setName(genre);
406  }
407  }
408 }
409 
411 //
413 
415  DTC::VideoMetadataInfo *pVideoMetadataInfo,
417  bool bDetails)
418 {
419  pVideoMetadataInfo->setId(pMetadata->GetID());
420  pVideoMetadataInfo->setTitle(pMetadata->GetTitle());
421  pVideoMetadataInfo->setSubTitle(pMetadata->GetSubtitle());
422  pVideoMetadataInfo->setTagline(pMetadata->GetTagline());
423  pVideoMetadataInfo->setDirector(pMetadata->GetDirector());
424  pVideoMetadataInfo->setStudio(pMetadata->GetStudio());
425  pVideoMetadataInfo->setDescription(pMetadata->GetPlot());
426  pVideoMetadataInfo->setCertification(pMetadata->GetRating());
427  pVideoMetadataInfo->setInetref(pMetadata->GetInetRef());
428  pVideoMetadataInfo->setCollectionref(pMetadata->GetCollectionRef());
429  pVideoMetadataInfo->setHomePage(pMetadata->GetHomepage());
430  pVideoMetadataInfo->setReleaseDate(
431  QDateTime(pMetadata->GetReleaseDate(),
432  QTime(0,0),Qt::LocalTime).toUTC());
433  pVideoMetadataInfo->setAddDate(
434  QDateTime(pMetadata->GetInsertdate(),
435  QTime(0,0),Qt::LocalTime).toUTC());
436  pVideoMetadataInfo->setUserRating(pMetadata->GetUserRating());
437  pVideoMetadataInfo->setChildID(pMetadata->GetChildID());
438  pVideoMetadataInfo->setLength(pMetadata->GetLength().count());
439  pVideoMetadataInfo->setPlayCount(pMetadata->GetPlayCount());
440  pVideoMetadataInfo->setSeason(pMetadata->GetSeason());
441  pVideoMetadataInfo->setEpisode(pMetadata->GetEpisode());
442  pVideoMetadataInfo->setParentalLevel(pMetadata->GetShowLevel());
443  pVideoMetadataInfo->setVisible(pMetadata->GetBrowse());
444  pVideoMetadataInfo->setWatched(pMetadata->GetWatched());
445  pVideoMetadataInfo->setProcessed(pMetadata->GetProcessed());
446  pVideoMetadataInfo->setContentType(ContentTypeToString(
447  pMetadata->GetContentType()));
448  pVideoMetadataInfo->setFileName(pMetadata->GetFilename());
449  pVideoMetadataInfo->setHash(pMetadata->GetHash());
450  pVideoMetadataInfo->setHostName(pMetadata->GetHost());
451  pVideoMetadataInfo->setCoverart(pMetadata->GetCoverFile());
452  pVideoMetadataInfo->setFanart(pMetadata->GetFanart());
453  pVideoMetadataInfo->setBanner(pMetadata->GetBanner());
454  pVideoMetadataInfo->setScreenshot(pMetadata->GetScreenshot());
455  pVideoMetadataInfo->setTrailer(pMetadata->GetTrailer());
456  pVideoMetadataInfo->setSerializeArtwork( true );
457 
458  if (bDetails)
459  {
460  if (!pMetadata->GetFanart().isEmpty())
461  {
462  DTC::ArtworkInfo *pArtInfo =
463  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
464  pArtInfo->setStorageGroup("Fanart");
465  pArtInfo->setType("fanart");
466  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
467  "&FileName=%2")
468  .arg("Fanart",
469  QString(
470  QUrl::toPercentEncoding(pMetadata->GetFanart()))));
471  }
472  if (!pMetadata->GetCoverFile().isEmpty())
473  {
474  DTC::ArtworkInfo *pArtInfo =
475  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
476  pArtInfo->setStorageGroup("Coverart");
477  pArtInfo->setType("coverart");
478  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
479  "&FileName=%2")
480  .arg("Coverart",
481  QString(
482  QUrl::toPercentEncoding(pMetadata->GetCoverFile()))));
483  }
484  if (!pMetadata->GetBanner().isEmpty())
485  {
486  DTC::ArtworkInfo *pArtInfo =
487  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
488  pArtInfo->setStorageGroup("Banners");
489  pArtInfo->setType("banner");
490  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
491  "&FileName=%2")
492  .arg("Banners",
493  QString(
494  QUrl::toPercentEncoding(pMetadata->GetBanner()))));
495  }
496  if (!pMetadata->GetScreenshot().isEmpty())
497  {
498  DTC::ArtworkInfo *pArtInfo =
499  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
500  pArtInfo->setStorageGroup("Screenshots");
501  pArtInfo->setType("screenshot");
502  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
503  "&FileName=%2")
504  .arg("Screenshots",
505  QString(
506  QUrl::toPercentEncoding(pMetadata->GetScreenshot()))));
507  }
508  }
509 
510  FillGenreList(pVideoMetadataInfo->Genres(), pVideoMetadataInfo->Id());
511 }
512 
514 //
516 
518  MusicMetadata *pMetadata, bool bDetails)
519 {
520  pVideoMetadataInfo->setId(pMetadata->ID());
521  pVideoMetadataInfo->setArtist(pMetadata->Artist());
522  pVideoMetadataInfo->setCompilationArtist(pMetadata->CompilationArtist());
523  pVideoMetadataInfo->setAlbum(pMetadata->Album());
524  pVideoMetadataInfo->setTitle(pMetadata->Title());
525  pVideoMetadataInfo->setTrackNo(pMetadata->Track());
526  pVideoMetadataInfo->setGenre(pMetadata->Genre());
527  pVideoMetadataInfo->setYear(pMetadata->Year());
528  pVideoMetadataInfo->setPlayCount(pMetadata->PlayCount());
529  pVideoMetadataInfo->setLength(pMetadata->Length().count());
530  pVideoMetadataInfo->setRating(pMetadata->Rating());
531  pVideoMetadataInfo->setFileName(pMetadata->Filename());
532  pVideoMetadataInfo->setHostName(pMetadata->Hostname());
533  pVideoMetadataInfo->setLastPlayed(pMetadata->LastPlay());
534  pVideoMetadataInfo->setCompilation(pMetadata->Compilation());
535 
536  if (bDetails)
537  {
538  //TODO add coverart here
539  }
540 }
541 
543 //
545 
546 void FillInputInfo(DTC::Input* input, const InputInfo& inputInfo)
547 {
548  input->setId(inputInfo.m_inputId);
549  input->setInputName(inputInfo.m_name);
550  input->setCardId(inputInfo.m_inputId);
551  input->setSourceId(inputInfo.m_sourceId);
552  input->setDisplayName(inputInfo.m_displayName);
553  input->setLiveTVOrder(inputInfo.m_liveTvOrder);
554  input->setScheduleOrder(inputInfo.m_scheduleOrder);
555  input->setRecPriority(inputInfo.m_recPriority);
556  input->setQuickTune(inputInfo.m_quickTune);
557 }
558 
560 //
562 
564  ProgramInfo* pInfo)
565 {
566  if (!pCastMemberList || !pInfo)
567  return;
568 
569  MSqlQuery query(MSqlQuery::InitCon());
570 
571  QString table;
572  if (pInfo->GetFilesize() > 0) // FIXME: This shouldn't be the way to determine what is or isn't a recording!
573  table = "recordedcredits";
574  else
575  table = "credits";
576 
577  query.prepare(QString("SELECT role, people.name, roles.name FROM %1"
578  " AS credits"
579  " LEFT JOIN people ON"
580  " credits.person = people.person"
581  " LEFT JOIN roles ON"
582  " credits.roleid = roles.roleid"
583  " WHERE credits.chanid = :CHANID"
584  " AND credits.starttime = :STARTTIME"
585  " ORDER BY role, priority;").arg(table));
586 
587  query.bindValue(":CHANID", pInfo->GetChanID());
588  query.bindValue(":STARTTIME", pInfo->GetScheduledStartTime());
589 
590  if (query.exec() && query.size() > 0)
591  {
592  QMap<QString, QString> translations;
593  translations["ACTOR"] = QObject::tr("Actors");
594  translations["DIRECTOR"] = QObject::tr("Director");
595  translations["PRODUCER"] = QObject::tr("Producer");
596  translations["EXECUTIVE_PRODUCER"] = QObject::tr("Executive Producer");
597  translations["WRITER"] = QObject::tr("Writer");
598  translations["GUEST_STAR"] = QObject::tr("Guest Star");
599  translations["HOST"] = QObject::tr("Host");
600  translations["ADAPTER"] = QObject::tr("Adapter");
601  translations["PRESENTER"] = QObject::tr("Presenter");
602  translations["COMMENTATOR"] = QObject::tr("Commentator");
603  translations["GUEST"] = QObject::tr("Guest");
604 
605  while (query.next())
606  {
607  DTC::CastMember *pCastMember = pCastMemberList->AddNewCastMember();
608 
609  QString role = query.value(0).toString();
610  pCastMember->setRole(role);
611  pCastMember->setTranslatedRole(translations.value(role.toUpper()));
612  /* The people.name column uses utf8_bin collation.
613  * Qt-MySQL drivers use QVariant::ByteArray for string-type
614  * MySQL fields marked with the BINARY attribute (those using a
615  * *_bin collation) and QVariant::String for all others.
616  * Since QVariant::toString() uses QString::fromAscii()
617  * (through QVariant::convert()) when the QVariant's type is
618  * QVariant::ByteArray, we have to use QString::fromUtf8()
619  * explicitly to prevent corrupting characters.
620  * The following code should be changed to use the simpler
621  * toString() approach, as above, if we do a DB update to
622  * coalesce the people.name values that differ only in case and
623  * change the collation to utf8_general_ci, to match the
624  * majority of other columns, or we'll have the same problem in
625  * reverse.
626  */
627  pCastMember->setName(QString::fromUtf8(query.value(1)
628  .toByteArray().constData()));
629  pCastMember->setCharacterName(QString::fromUtf8(query.value(2)
630  .toByteArray().constData()));
631  }
632  }
633 
634  //pCastMemberList->setCount(query.size());
635  //pCastMemberList->setTotalAvailable(query.size());
636 }
637 
639 //
641 
642 void FillCutList(DTC::CutList* pCutList, RecordingInfo* rInfo, int marktype)
643 {
644  frm_dir_map_t markMap;
645  frm_dir_map_t::const_iterator it;
646 
647  if (rInfo && rInfo->GetChanID())
648  {
649  rInfo->QueryCutList(markMap);
650 
651  for (it = markMap.cbegin(); it != markMap.cend(); ++it)
652  {
653  bool isend = (*it) == MARK_CUT_END || (*it) == MARK_COMM_END;
654  if (marktype == 0)
655  {
656  DTC::Cutting *pCutting = pCutList->AddNewCutting();
657  pCutting->setMark(*it);
658  pCutting->setOffset(it.key());
659  }
660  else if (marktype == 1)
661  {
662  uint64_t offset = 0;
663  if (rInfo->QueryKeyFramePosition(&offset, it.key(), isend))
664  {
665  DTC::Cutting *pCutting = pCutList->AddNewCutting();
666  pCutting->setMark(*it);
667  pCutting->setOffset(offset);
668  }
669  }
670  else if (marktype == 2)
671  {
672  uint64_t offset = 0;
673  if (rInfo->QueryKeyFrameDuration(&offset, it.key(), isend))
674  {
675  DTC::Cutting *pCutting = pCutList->AddNewCutting();
676  pCutting->setMark(*it);
677  pCutting->setOffset(offset);
678  }
679  }
680  }
681  }
682 }
683 
685 //
687 
688 void FillCommBreak(DTC::CutList* pCutList, RecordingInfo* rInfo, int marktype)
689 {
690  frm_dir_map_t markMap;
691  frm_dir_map_t::const_iterator it;
692 
693  if (rInfo && rInfo->GetChanID())
694  {
695  rInfo->QueryCommBreakList(markMap);
696 
697  for (it = markMap.cbegin(); it != markMap.cend(); ++it)
698  {
699  bool isend = (*it) == MARK_CUT_END || (*it) == MARK_COMM_END;
700  if (marktype == 0)
701  {
702  DTC::Cutting *pCutting = pCutList->AddNewCutting();
703  pCutting->setMark(*it);
704  pCutting->setOffset(it.key());
705  }
706  else if (marktype == 1)
707  {
708  uint64_t offset = 0;
709  if (rInfo->QueryKeyFramePosition(&offset, it.key(), isend))
710  {
711  DTC::Cutting *pCutting = pCutList->AddNewCutting();
712  pCutting->setMark(*it);
713  pCutting->setOffset(offset);
714  }
715  }
716  else if (marktype == 2)
717  {
718  uint64_t offset = 0;
719  if (rInfo->QueryKeyFrameDuration(&offset, it.key(), isend))
720  {
721  DTC::Cutting *pCutting = pCutList->AddNewCutting();
722  pCutting->setMark(*it);
723  pCutting->setOffset(offset);
724  }
725  }
726  }
727  }
728 }
729 
731 //
733 
734 void FillSeek(DTC::CutList* pCutList, RecordingInfo* rInfo, MarkTypes marktype)
735 {
736  frm_pos_map_t markMap;
737  frm_pos_map_t::const_iterator it;
738 
739  if (rInfo && rInfo->GetChanID())
740  {
741  rInfo->QueryPositionMap(markMap, marktype);
742 
743  for (it = markMap.cbegin(); it != markMap.cend(); ++it)
744  {
745  DTC::Cutting *pCutting = pCutList->AddNewCutting();
746  pCutting->setMark(it.key());
747  pCutting->setOffset(it.value());
748  }
749  }
750 }
751 
752 int CreateRecordingGroup(const QString& groupName)
753 {
754  int groupID = -1;
755  MSqlQuery query(MSqlQuery::InitCon());
756 
757  query.prepare("INSERT INTO recgroups SET recgroup = :NAME, "
758  "displayname = :DISPLAYNAME");
759  query.bindValue(":NAME", groupName);
760  query.bindValue(":DISPLAYNAME", groupName);
761 
762  if (query.exec())
763  groupID = query.lastInsertId().toInt();
764 
765  if (groupID <= 0)
766  LOG(VB_GENERAL, LOG_ERR, QString("Could not create recording group (%1). "
767  "Does it already exist?").arg(groupName));
768 
769  return groupID;
770 }
771 
772 DBCredits * jsonCastToCredits(const QJsonObject &cast)
773 {
774  int priority = 1;
775  auto* credits = new DBCredits;
776 
777  QJsonArray members = cast["CastMembers"].toArray();
778  for (const auto & m : std::as_const(members))
779  {
780  QJsonObject actor = m.toObject();
781  QString name = actor.value("Name").toString("");
782  QString character = actor.value("CharacterName").toString("");
783  QString role = actor.value("Role").toString("");
784 
785  credits->emplace_back(role, name, priority, character);
786  ++priority;
787  }
788 
789  return credits;
790 }
ChannelInfo
Definition: channelinfo.h:31
serviceUtil.h
ChannelGroupItem::m_grpId
uint m_grpId
Definition: channelgroup.h:28
RecordingRule::m_channelid
int m_channelid
callsign?
Definition: recordingrule.h:99
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
RecordingRule::m_autoTranscode
bool m_autoTranscode
Definition: recordingrule.h:132
FillProgramInfo
void FillProgramInfo(DTC::Program *pProgram, ProgramInfo *pInfo, bool bIncChannel, bool bDetails, bool bIncCast)
Definition: serviceUtil.cpp:49
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:214
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:962
FillVideoMetadataInfo
void FillVideoMetadataInfo(DTC::VideoMetadataInfo *pVideoMetadataInfo, const VideoMetadataListManager::VideoMetadataPtr &pMetadata, bool bDetails)
Definition: serviceUtil.cpp:414
ProgramInfo::GetFilesize
virtual uint64_t GetFilesize(void) const
Definition: programinfo.cpp:6425
MARK_COMM_END
@ MARK_COMM_END
Definition: programtypes.h:60
FillRecRuleInfo
void FillRecRuleInfo(DTC::RecRule *pRecRule, RecordingRule *pRule)
Definition: serviceUtil.cpp:279
DTC::CastMemberList::AddNewCastMember
CastMember * AddNewCastMember()
Definition: castMemberList.h:44
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
metadataimagehelper.h
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:3762
RecordingRule::m_category
QString m_category
Definition: recordingrule.h:82
DTC::VideoMetadataInfo::Artwork
QObject Artwork
Definition: videoMetadataInfo.h:67
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
DTC::Program
Definition: programAndChannel.h:145
RecordingRule::m_starttime
QTime m_starttime
Definition: recordingrule.h:91
DTC::VideoMetadataInfo::Id
int Id
Definition: videoMetadataInfo.h:34
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
DTC::GenreList::AddNewGenre
Genre * AddNewGenre()
Definition: genreList.h:53
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:55
RecordingInfo::GetFilesize
uint64_t GetFilesize(void) const override
Definition: recordinginfo.cpp:1755
ProgramInfo::GetRecordingID
uint GetRecordingID(void) const
Definition: programinfo.h:446
FillChannelGroup
void FillChannelGroup(DTC::ChannelGroup *pGroup, const ChannelGroupItem &pGroupItem)
Definition: serviceUtil.cpp:265
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:936
RecordingRule::m_title
QString m_title
Definition: recordingrule.h:77
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:204
DTC::GenreList
Definition: genreList.h:25
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:118
RecordingRule::m_lastDeleted
QDateTime m_lastDeleted
Definition: recordingrule.h:144
RecStatus::Unknown
@ Unknown
Definition: recordingstatus.h:31
RecordingRule
Internal representation of a recording rule, mirrors the record table.
Definition: recordingrule.h:28
FillChannelInfo
bool FillChannelInfo(DTC::ChannelInfo *pChannel, uint nChanID, bool bDetails)
Definition: serviceUtil.cpp:177
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:619
ChannelInfo::m_name
QString m_name
Definition: channelinfo.h:92
MusicMetadata::Track
int Track() const
Definition: musicmetadata.h:199
ContentTypeToString
QString ContentTypeToString(VideoContentType type)
Definition: videoutils.cpp:295
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:4216
MusicMetadata
Definition: musicmetadata.h:80
FillCastMemberList
void FillCastMemberList(DTC::CastMemberList *pCastMemberList, ProgramInfo *pInfo)
Definition: serviceUtil.cpp:563
MusicMetadata::Length
std::chrono::milliseconds Length() const
Definition: musicmetadata.h:205
FillArtworkInfoList
void FillArtworkInfoList(DTC::ArtworkInfoList *pArtworkInfoList, const QString &sInetref, uint nSeason)
Definition: serviceUtil.cpp:340
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
DTC::Program::Recording
QObject Recording
Definition: programAndChannel.h:188
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
ChannelInfo::m_icon
QString m_icon
Definition: channelinfo.h:93
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
DTC::CutList::AddNewCutting
Cutting * AddNewCutting()
Definition: cutList.h:53
DBCredits
std::vector< DBPerson > DBCredits
Definition: programdata.h:73
DTC::Cutting
Definition: cutting.h:23
ProgramInfo::IsRepeat
bool IsRepeat(void) const
Definition: programinfo.h:487
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
ChannelInfo::m_useOnAirGuide
bool m_useOnAirGuide
Definition: channelinfo.h:108
DTC::CastMemberList
Definition: castMemberList.h:16
RecordingRule::m_episode
uint m_episode
Definition: recordingrule.h:95
InputInfo::m_recPriority
int m_recPriority
Definition: inputinfo.h:53
programinfo.h
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
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
DTC::Input
Definition: input.h:24
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
DTC::Program::Channel
QObject Channel
Definition: programAndChannel.h:187
FillCutList
void FillCutList(DTC::CutList *pCutList, RecordingInfo *rInfo, int marktype)
Definition: serviceUtil.cpp:642
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:1705
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:551
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
DTC::VideoMetadataInfo::Genres
QObject Genres
Definition: videoMetadataInfo.h:69
ProgramInfo::GetEpisodeTotal
uint GetEpisodeTotal(void) const
Definition: programinfo.h:368
cutList.h
RecordingRule::m_findtime
QTime m_findtime
Time for timeslot rules.
Definition: recordingrule.h:101
RecordingRule::m_lastRecorded
QDateTime m_lastRecorded
Definition: recordingrule.h:143
RecordingRule::m_autoExpire
bool m_autoExpire
Definition: recordingrule.h:126
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:3464
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
FillSeek
void FillSeek(DTC::CutList *pCutList, RecordingInfo *rInfo, MarkTypes marktype)
Definition: serviceUtil.cpp:734
RecordingRule::m_subtitle
QString m_subtitle
Definition: recordingrule.h:79
ProgramInfo::GetAudioProperties
uint GetAudioProperties(void) const
Definition: programinfo.h:497
DTC::RecordingInfo
Definition: recording.h:25
ProgramInfo::GetPlaybackGroup
QString GetPlaybackGroup(void) const
Definition: programinfo.h:420
RecordingRule::m_findday
int m_findday
Day of the week for once per week etc.
Definition: recordingrule.h:104
RecordingRule::m_filter
unsigned m_filter
Definition: recordingrule.h:115
uint
unsigned int uint
Definition: compat.h:81
ProgramInfo::GetSeriesID
QString GetSeriesID(void) const
Definition: programinfo.h:435
FillGenreList
void FillGenreList(DTC::GenreList *pGenreList, int videoID)
Definition: serviceUtil.cpp:387
DTC::Genre
Definition: genre.h:24
ChannelGroupItem::m_name
QString m_name
Definition: channelgroup.h:29
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:45
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
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
ProgramInfo::GetDuplicateCheckMethod
RecordingDupMethodType GetDuplicateCheckMethod(void) const
What should be compared to determine if two programs are the same?
Definition: programinfo.h:459
channelinfo.h
ProgramInfo::GetInputID
uint GetInputID(void) const
Definition: programinfo.h:463
DTC::ChannelGroup
Definition: channelGroup.h:23
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
DTC::Program::Artwork
QObject Artwork
Definition: programAndChannel.h:189
ChannelInfo::m_serviceId
uint m_serviceId
Definition: channelinfo.h:111
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
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:4198
MusicMetadata::Hostname
QString Hostname(void)
Definition: musicmetadata.h:230
ProgramInfo::GetLastModifiedTime
QDateTime GetLastModifiedTime(void) const
Definition: programinfo.h:429
DTC::CastMember
Definition: castMember.h:23
ProgramInfo::GetSeason
uint GetSeason(void) const
Definition: programinfo.h:366
cardutil.h
DTC::RecRule
Definition: recRule.h:15
RecordingRule::m_dupMethod
RecordingDupMethodType m_dupMethod
Definition: recordingrule.h:113
FillCommBreak
void FillCommBreak(DTC::CutList *pCutList, RecordingInfo *rInfo, int marktype)
Definition: serviceUtil.cpp:688
ProgramInfo::GetCategoryTypeString
QString GetCategoryTypeString(void) const
Returns catType as a string.
Definition: programinfo.cpp:1887
FillMusicMetadataInfo
void FillMusicMetadataInfo(DTC::MusicMetadataInfo *pVideoMetadataInfo, MusicMetadata *pMetadata, bool bDetails)
Definition: serviceUtil.cpp:517
ChannelInfo::Load
bool Load(uint lchanid=-1)
Definition: channelinfo.cpp:131
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:889
MarkTypes
MarkTypes
Definition: programtypes.h:47
MusicMetadata::LastPlay
QDateTime LastPlay() const
Definition: musicmetadata.h:244
DTC::ArtworkInfo
Definition: artworkInfo.h:24
MusicMetadata::Compilation
bool Compilation() const
Definition: musicmetadata.h:252
ChannelInfo::m_sourceId
uint m_sourceId
Definition: channelinfo.h:89
DTC::VideoMetadataInfo
Definition: videoMetadataInfo.h:29
ChannelInfo::m_tvFormat
QString m_tvFormat
Definition: channelinfo.h:105
DTC::ArtworkInfoList::AddNewArtworkInfo
ArtworkInfo * AddNewArtworkInfo()
Definition: artworkInfoList.h:53
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
CreateRecordingGroup
int CreateRecordingGroup(const QString &groupName)
Definition: serviceUtil.cpp:752
ChannelInfo::m_xmltvId
QString m_xmltvId
Definition: channelinfo.h:97
ArtworkMap
QMultiMap< VideoArtworkType, ArtworkInfo > ArtworkMap
Definition: metadataimagehelper.h:31
ProgramInfo::QueryCommBreakList
void QueryCommBreakList(frm_dir_map_t &frames) const
Definition: programinfo.cpp:3550
ChannelInfo::m_videoFilters
QString m_videoFilters
Definition: channelinfo.h:96
DTC::MusicMetadataInfo
Definition: musicMetadataInfo.h:25
MusicMetadata::Rating
int Rating() const
Definition: musicmetadata.h:239
ProgramInfo::GetProgramID
QString GetProgramID(void) const
Definition: programinfo.h:436
ChannelInfo::GetInputIds
QList< uint > GetInputIds() const
Definition: channelinfo.h:67
DTC::ChannelInfo
Definition: programAndChannel.h:30
RecordingRule::m_station
QString m_station
Definition: recordingrule.h:98
ProgramInfo::GetRecordingRuleID
uint GetRecordingRuleID(void) const
Definition: programinfo.h:449
RecordingRule::m_recPriority
int m_recPriority
Definition: recordingrule.h:107
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
InputInfo::m_displayName
QString m_displayName
Definition: inputinfo.h:52
kArtworkCoverart
@ kArtworkCoverart
Definition: metadataimagehelper.h:11
DTC::ArtworkInfoList
Definition: artworkInfoList.h:25
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
jsonCastToCredits
DBCredits * jsonCastToCredits(const QJsonObject &cast)
Definition: serviceUtil.cpp:772
RecordingRule::m_prefInput
int m_prefInput
Definition: recordingrule.h:108
kChannelNotVisible
@ kChannelNotVisible
Definition: channelinfo.h:24
DTC::Program::Cast
QObject Cast
Definition: programAndChannel.h:190
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:838
FillInputInfo
void FillInputInfo(DTC::Input *input, const InputInfo &inputInfo)
Definition: serviceUtil.cpp:546
ProgramInfo::GetSubtitle
QString GetSubtitle(void) const
Definition: programinfo.h:363
ProgramInfo::GetStars
float GetStars(void) const
Definition: programinfo.h:442
DTC::CutList
Definition: cutList.h:25