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