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