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  #ifndef _WIN32 // Needs fixing for Windows
208  pChannel->setExtendedVisible(toRawString(channelInfo.m_visible));
209  #endif
210 
211  pChannel->setSerializeDetails( bDetails );
212 
213  if (bDetails)
214  {
215  pChannel->setMplexId(channelInfo.m_mplexId);
216  pChannel->setServiceId(channelInfo.m_serviceId);
217  pChannel->setATSCMajorChan(channelInfo.m_atscMajorChan);
218  pChannel->setATSCMinorChan(channelInfo.m_atscMinorChan);
219  pChannel->setFormat(channelInfo.m_tvFormat);
220  pChannel->setFineTune(channelInfo.m_fineTune);
221  pChannel->setFrequencyId(channelInfo.m_freqId);
222  pChannel->setChanFilters(channelInfo.m_videoFilters);
223  pChannel->setSourceId(channelInfo.m_sourceId);
224  pChannel->setCommFree(channelInfo.m_commMethod == -2);
225  pChannel->setUseEIT(channelInfo.m_useOnAirGuide);
226  pChannel->setXMLTVID(channelInfo.m_xmltvId);
227  pChannel->setDefaultAuth(channelInfo.m_defaultAuthority);
228  pChannel->setServiceType(channelInfo.m_serviceType);
229 
230  QList<uint> groupIds = channelInfo.GetGroupIds();
231  QString sGroupIds;
232  for (int x = 0; x < groupIds.size(); x++)
233  {
234  if (x > 0)
235  sGroupIds += ",";
236 
237  sGroupIds += QString::number(groupIds.at(x));
238  }
239  pChannel->setChannelGroups(sGroupIds);
240 
241  QList<uint> inputIds = channelInfo.GetInputIds();
242  QString sInputIds;
243  for (int x = 0; x < inputIds.size(); x++)
244  {
245  if (x > 0)
246  sInputIds += ",";
247 
248  sInputIds += QString::number(inputIds.at(x));
249  }
250  pChannel->setInputs(sInputIds);
251  }
252 
253  return true;
254 }
255 
257 //
259 
260 void FillChannelGroup(DTC::ChannelGroup* pGroup, const ChannelGroupItem& pGroupItem)
261 {
262  if (!pGroup)
263  return;
264 
265  pGroup->setGroupId(pGroupItem.m_grpId);
266  pGroup->setName(pGroupItem.m_name);
267  pGroup->setPassword(""); // Not currently supported
268 }
269 
271 //
273 
275  RecordingRule *pRule )
276 {
277  if ((pRecRule == nullptr) || (pRule == nullptr))
278  return;
279 
280  pRecRule->setId ( pRule->m_recordID );
281  pRecRule->setParentId ( pRule->m_parentRecID );
282  pRecRule->setInactive ( pRule->m_isInactive );
283  pRecRule->setTitle ( pRule->m_title );
284  pRecRule->setSubTitle ( pRule->m_subtitle );
285  pRecRule->setDescription ( pRule->m_description );
286  pRecRule->setSeason ( pRule->m_season );
287  pRecRule->setEpisode ( pRule->m_episode );
288  pRecRule->setCategory ( pRule->m_category );
289  pRecRule->setStartTime ( QDateTime(pRule->m_startdate,
290  pRule->m_starttime, Qt::UTC));
291  pRecRule->setEndTime ( QDateTime(pRule->m_enddate,
292  pRule->m_endtime, Qt::UTC));
293  pRecRule->setSeriesId ( pRule->m_seriesid );
294  pRecRule->setProgramId ( pRule->m_programid );
295  pRecRule->setInetref ( pRule->m_inetref );
296  pRecRule->setChanId ( pRule->m_channelid );
297  pRecRule->setCallSign ( pRule->m_station );
298  pRecRule->setFindDay ( pRule->m_findday );
299  pRecRule->setFindTime ( pRule->m_findtime );
300  pRecRule->setType ( toRawString(pRule->m_type) );
301  pRecRule->setSearchType ( toRawString(pRule->m_searchType));
302  pRecRule->setRecPriority ( pRule->m_recPriority );
303  pRecRule->setPreferredInput ( pRule->m_prefInput );
304  pRecRule->setStartOffset ( pRule->m_startOffset );
305  pRecRule->setEndOffset ( pRule->m_endOffset );
306  pRecRule->setDupMethod ( toRawString(pRule->m_dupMethod) );
307  pRecRule->setDupIn ( toRawString(pRule->m_dupIn) );
308  pRecRule->setNewEpisOnly ( newEpifromDupIn(pRule->m_dupIn) );
309  pRecRule->setFilter ( pRule->m_filter );
310  pRecRule->setRecProfile ( pRule->m_recProfile );
311  pRecRule->setRecGroup ( RecordingInfo::GetRecgroupString(pRule->m_recGroupID) );
312  pRecRule->setStorageGroup ( pRule->m_storageGroup );
313  pRecRule->setPlayGroup ( pRule->m_playGroup );
314  pRecRule->setAutoExpire ( pRule->m_autoExpire );
315  pRecRule->setMaxEpisodes ( pRule->m_maxEpisodes );
316  pRecRule->setMaxNewest ( pRule->m_maxNewest );
317  pRecRule->setAutoCommflag ( pRule->m_autoCommFlag );
318  pRecRule->setAutoTranscode ( pRule->m_autoTranscode );
319  pRecRule->setAutoMetaLookup ( pRule->m_autoMetadataLookup );
320  pRecRule->setAutoUserJob1 ( pRule->m_autoUserJob1 );
321  pRecRule->setAutoUserJob2 ( pRule->m_autoUserJob2 );
322  pRecRule->setAutoUserJob3 ( pRule->m_autoUserJob3 );
323  pRecRule->setAutoUserJob4 ( pRule->m_autoUserJob4 );
324  pRecRule->setTranscoder ( pRule->m_transcoder );
325  pRecRule->setNextRecording ( pRule->m_nextRecording );
326  pRecRule->setLastRecorded ( pRule->m_lastRecorded );
327  pRecRule->setLastDeleted ( pRule->m_lastDeleted );
328  pRecRule->setAverageDelay ( pRule->m_averageDelay );
329 }
330 
332 //
334 
336  const QString &sInetref,
337  uint nSeason )
338 {
339  ArtworkMap map = GetArtwork(sInetref, nSeason);
340  for (auto i = map.cbegin(); i != map.cend(); ++i)
341  {
342  DTC::ArtworkInfo *pArtInfo = pArtworkInfoList->AddNewArtworkInfo();
343  pArtInfo->setFileName(i.value().url);
344  switch (i.key())
345  {
346  case kArtworkFanart:
347  pArtInfo->setStorageGroup("Fanart");
348  pArtInfo->setType("fanart");
349  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
350  "&FileName=%2")
351  .arg("Fanart",
352  QString(QUrl::toPercentEncoding(
353  QUrl(i.value().url).path()))));
354  break;
355  case kArtworkBanner:
356  pArtInfo->setStorageGroup("Banners");
357  pArtInfo->setType("banner");
358  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
359  "&FileName=%2")
360  .arg("Banners",
361  QString(QUrl::toPercentEncoding(
362  QUrl(i.value().url).path()))));
363  break;
364  case kArtworkCoverart:
365  default:
366  pArtInfo->setStorageGroup("Coverart");
367  pArtInfo->setType("coverart");
368  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
369  "&FileName=%2")
370  .arg("Coverart",
371  QString(QUrl::toPercentEncoding(
372  QUrl(i.value().url).path()))));
373  break;
374  }
375  }
376 }
377 
379 //
381 
382 void FillGenreList(DTC::GenreList* pGenreList, int videoID)
383 {
384  if (!pGenreList)
385  return;
386 
387  MSqlQuery query(MSqlQuery::InitCon());
388  query.prepare("SELECT genre from videogenre "
389  "LEFT JOIN videometadatagenre ON videometadatagenre.idgenre = videogenre.intid "
390  "WHERE idvideo = :ID "
391  "ORDER BY genre;");
392  query.bindValue(":ID", videoID);
393 
394  if (query.exec() && query.size() > 0)
395  {
396  while (query.next())
397  {
398  DTC::Genre *pGenre = pGenreList->AddNewGenre();
399  QString genre = query.value(0).toString();
400  pGenre->setName(genre);
401  }
402  }
403 }
404 
406 //
408 
410  DTC::VideoMetadataInfo *pVideoMetadataInfo,
412  bool bDetails)
413 {
414  pVideoMetadataInfo->setId(pMetadata->GetID());
415  pVideoMetadataInfo->setTitle(pMetadata->GetTitle());
416  pVideoMetadataInfo->setSubTitle(pMetadata->GetSubtitle());
417  pVideoMetadataInfo->setTagline(pMetadata->GetTagline());
418  pVideoMetadataInfo->setDirector(pMetadata->GetDirector());
419  pVideoMetadataInfo->setStudio(pMetadata->GetStudio());
420  pVideoMetadataInfo->setDescription(pMetadata->GetPlot());
421  pVideoMetadataInfo->setCertification(pMetadata->GetRating());
422  pVideoMetadataInfo->setInetref(pMetadata->GetInetRef());
423  pVideoMetadataInfo->setCollectionref(pMetadata->GetCollectionRef());
424  pVideoMetadataInfo->setHomePage(pMetadata->GetHomepage());
425  pVideoMetadataInfo->setReleaseDate(
426  QDateTime(pMetadata->GetReleaseDate(),
427  QTime(0,0),Qt::LocalTime).toUTC());
428  pVideoMetadataInfo->setAddDate(
429  QDateTime(pMetadata->GetInsertdate(),
430  QTime(0,0),Qt::LocalTime).toUTC());
431  pVideoMetadataInfo->setUserRating(pMetadata->GetUserRating());
432  pVideoMetadataInfo->setChildID(pMetadata->GetChildID());
433  pVideoMetadataInfo->setLength(pMetadata->GetLength().count());
434  pVideoMetadataInfo->setPlayCount(pMetadata->GetPlayCount());
435  pVideoMetadataInfo->setSeason(pMetadata->GetSeason());
436  pVideoMetadataInfo->setEpisode(pMetadata->GetEpisode());
437  pVideoMetadataInfo->setParentalLevel(pMetadata->GetShowLevel());
438  pVideoMetadataInfo->setVisible(pMetadata->GetBrowse());
439  pVideoMetadataInfo->setWatched(pMetadata->GetWatched());
440  pVideoMetadataInfo->setProcessed(pMetadata->GetProcessed());
441  pVideoMetadataInfo->setContentType(ContentTypeToString(
442  pMetadata->GetContentType()));
443  pVideoMetadataInfo->setFileName(pMetadata->GetFilename());
444  pVideoMetadataInfo->setHash(pMetadata->GetHash());
445  pVideoMetadataInfo->setHostName(pMetadata->GetHost());
446  pVideoMetadataInfo->setCoverart(pMetadata->GetCoverFile());
447  pVideoMetadataInfo->setFanart(pMetadata->GetFanart());
448  pVideoMetadataInfo->setBanner(pMetadata->GetBanner());
449  pVideoMetadataInfo->setScreenshot(pMetadata->GetScreenshot());
450  pVideoMetadataInfo->setTrailer(pMetadata->GetTrailer());
451  pVideoMetadataInfo->setSerializeArtwork( true );
452 
453  if (bDetails)
454  {
455  if (!pMetadata->GetFanart().isEmpty())
456  {
457  DTC::ArtworkInfo *pArtInfo =
458  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
459  pArtInfo->setStorageGroup("Fanart");
460  pArtInfo->setType("fanart");
461  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
462  "&FileName=%2")
463  .arg("Fanart",
464  QString(
465  QUrl::toPercentEncoding(pMetadata->GetFanart()))));
466  }
467  if (!pMetadata->GetCoverFile().isEmpty())
468  {
469  DTC::ArtworkInfo *pArtInfo =
470  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
471  pArtInfo->setStorageGroup("Coverart");
472  pArtInfo->setType("coverart");
473  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
474  "&FileName=%2")
475  .arg("Coverart",
476  QString(
477  QUrl::toPercentEncoding(pMetadata->GetCoverFile()))));
478  }
479  if (!pMetadata->GetBanner().isEmpty())
480  {
481  DTC::ArtworkInfo *pArtInfo =
482  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
483  pArtInfo->setStorageGroup("Banners");
484  pArtInfo->setType("banner");
485  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
486  "&FileName=%2")
487  .arg("Banners",
488  QString(
489  QUrl::toPercentEncoding(pMetadata->GetBanner()))));
490  }
491  if (!pMetadata->GetScreenshot().isEmpty())
492  {
493  DTC::ArtworkInfo *pArtInfo =
494  pVideoMetadataInfo->Artwork()->AddNewArtworkInfo();
495  pArtInfo->setStorageGroup("Screenshots");
496  pArtInfo->setType("screenshot");
497  pArtInfo->setURL(QString("/Content/GetImageFile?StorageGroup=%1"
498  "&FileName=%2")
499  .arg("Screenshots",
500  QString(
501  QUrl::toPercentEncoding(pMetadata->GetScreenshot()))));
502  }
503  }
504 
505  FillGenreList(pVideoMetadataInfo->Genres(), pVideoMetadataInfo->Id());
506 }
507 
509 //
511 
513  MusicMetadata *pMetadata, bool bDetails)
514 {
515  pVideoMetadataInfo->setId(pMetadata->ID());
516  pVideoMetadataInfo->setArtist(pMetadata->Artist());
517  pVideoMetadataInfo->setCompilationArtist(pMetadata->CompilationArtist());
518  pVideoMetadataInfo->setAlbum(pMetadata->Album());
519  pVideoMetadataInfo->setTitle(pMetadata->Title());
520  pVideoMetadataInfo->setTrackNo(pMetadata->Track());
521  pVideoMetadataInfo->setGenre(pMetadata->Genre());
522  pVideoMetadataInfo->setYear(pMetadata->Year());
523  pVideoMetadataInfo->setPlayCount(pMetadata->PlayCount());
524  pVideoMetadataInfo->setLength(pMetadata->Length().count());
525  pVideoMetadataInfo->setRating(pMetadata->Rating());
526  pVideoMetadataInfo->setFileName(pMetadata->Filename());
527  pVideoMetadataInfo->setHostName(pMetadata->Hostname());
528  pVideoMetadataInfo->setLastPlayed(pMetadata->LastPlay());
529  pVideoMetadataInfo->setCompilation(pMetadata->Compilation());
530 
531  if (bDetails)
532  {
533  //TODO add coverart here
534  }
535 }
536 
538 //
540 
541 void FillInputInfo(DTC::Input* input, const InputInfo& inputInfo)
542 {
543  input->setId(inputInfo.m_inputId);
544  input->setInputName(inputInfo.m_name);
545  input->setCardId(inputInfo.m_inputId);
546  input->setSourceId(inputInfo.m_sourceId);
547  input->setDisplayName(inputInfo.m_displayName);
548  input->setLiveTVOrder(inputInfo.m_liveTvOrder);
549  input->setScheduleOrder(inputInfo.m_scheduleOrder);
550  input->setRecPriority(inputInfo.m_recPriority);
551  input->setQuickTune(inputInfo.m_quickTune);
552 }
553 
555 //
557 
559  ProgramInfo* pInfo)
560 {
561  if (!pCastMemberList || !pInfo)
562  return;
563 
564  MSqlQuery query(MSqlQuery::InitCon());
565 
566  QString table;
567  if (pInfo->GetFilesize() > 0) // FIXME: This shouldn't be the way to determine what is or isn't a recording!
568  table = "recordedcredits";
569  else
570  table = "credits";
571 
572  query.prepare(QString("SELECT role, people.name, roles.name FROM %1"
573  " AS credits"
574  " LEFT JOIN people ON"
575  " credits.person = people.person"
576  " LEFT JOIN roles ON"
577  " credits.roleid = roles.roleid"
578  " WHERE credits.chanid = :CHANID"
579  " AND credits.starttime = :STARTTIME"
580  " ORDER BY role, priority;").arg(table));
581 
582  query.bindValue(":CHANID", pInfo->GetChanID());
583  query.bindValue(":STARTTIME", pInfo->GetScheduledStartTime());
584 
585  if (query.exec() && query.size() > 0)
586  {
587  QMap<QString, QString> translations;
588  translations["ACTOR"] = QObject::tr("Actors");
589  translations["DIRECTOR"] = QObject::tr("Director");
590  translations["PRODUCER"] = QObject::tr("Producer");
591  translations["EXECUTIVE_PRODUCER"] = QObject::tr("Executive Producer");
592  translations["WRITER"] = QObject::tr("Writer");
593  translations["GUEST_STAR"] = QObject::tr("Guest Star");
594  translations["HOST"] = QObject::tr("Host");
595  translations["ADAPTER"] = QObject::tr("Adapter");
596  translations["PRESENTER"] = QObject::tr("Presenter");
597  translations["COMMENTATOR"] = QObject::tr("Commentator");
598  translations["GUEST"] = QObject::tr("Guest");
599 
600  while (query.next())
601  {
602  DTC::CastMember *pCastMember = pCastMemberList->AddNewCastMember();
603 
604  QString role = query.value(0).toString();
605  pCastMember->setRole(role);
606  pCastMember->setTranslatedRole(translations.value(role.toUpper()));
607  /* The people.name column uses utf8_bin collation.
608  * Qt-MySQL drivers use QVariant::ByteArray for string-type
609  * MySQL fields marked with the BINARY attribute (those using a
610  * *_bin collation) and QVariant::String for all others.
611  * Since QVariant::toString() uses QString::fromAscii()
612  * (through QVariant::convert()) when the QVariant's type is
613  * QVariant::ByteArray, we have to use QString::fromUtf8()
614  * explicitly to prevent corrupting characters.
615  * The following code should be changed to use the simpler
616  * toString() approach, as above, if we do a DB update to
617  * coalesce the people.name values that differ only in case and
618  * change the collation to utf8_general_ci, to match the
619  * majority of other columns, or we'll have the same problem in
620  * reverse.
621  */
622  pCastMember->setName(QString::fromUtf8(query.value(1)
623  .toByteArray().constData()));
624  pCastMember->setCharacterName(QString::fromUtf8(query.value(2)
625  .toByteArray().constData()));
626  }
627  }
628 
629  //pCastMemberList->setCount(query.size());
630  //pCastMemberList->setTotalAvailable(query.size());
631 }
632 
634 //
636 
637 void FillCutList(DTC::CutList* pCutList, RecordingInfo* rInfo, int marktype)
638 {
639  frm_dir_map_t markMap;
640  frm_dir_map_t::const_iterator it;
641 
642  if (rInfo && rInfo->GetChanID())
643  {
644  rInfo->QueryCutList(markMap);
645 
646  for (it = markMap.cbegin(); it != markMap.cend(); ++it)
647  {
648  bool isend = (*it) == MARK_CUT_END || (*it) == MARK_COMM_END;
649  if (marktype == 0)
650  {
651  DTC::Cutting *pCutting = pCutList->AddNewCutting();
652  pCutting->setMark(*it);
653  pCutting->setOffset(it.key());
654  }
655  else if (marktype == 1)
656  {
657  uint64_t offset = 0;
658  if (rInfo->QueryKeyFramePosition(&offset, it.key(), isend))
659  {
660  DTC::Cutting *pCutting = pCutList->AddNewCutting();
661  pCutting->setMark(*it);
662  pCutting->setOffset(offset);
663  }
664  }
665  else if (marktype == 2)
666  {
667  uint64_t offset = 0;
668  if (rInfo->QueryKeyFrameDuration(&offset, it.key(), isend))
669  {
670  DTC::Cutting *pCutting = pCutList->AddNewCutting();
671  pCutting->setMark(*it);
672  pCutting->setOffset(offset);
673  }
674  }
675  }
676  }
677 }
678 
680 //
682 
683 void FillCommBreak(DTC::CutList* pCutList, RecordingInfo* rInfo, int marktype)
684 {
685  frm_dir_map_t markMap;
686  frm_dir_map_t::const_iterator it;
687 
688  if (rInfo && rInfo->GetChanID())
689  {
690  rInfo->QueryCommBreakList(markMap);
691 
692  for (it = markMap.cbegin(); it != markMap.cend(); ++it)
693  {
694  bool isend = (*it) == MARK_CUT_END || (*it) == MARK_COMM_END;
695  if (marktype == 0)
696  {
697  DTC::Cutting *pCutting = pCutList->AddNewCutting();
698  pCutting->setMark(*it);
699  pCutting->setOffset(it.key());
700  }
701  else if (marktype == 1)
702  {
703  uint64_t offset = 0;
704  if (rInfo->QueryKeyFramePosition(&offset, it.key(), isend))
705  {
706  DTC::Cutting *pCutting = pCutList->AddNewCutting();
707  pCutting->setMark(*it);
708  pCutting->setOffset(offset);
709  }
710  }
711  else if (marktype == 2)
712  {
713  uint64_t offset = 0;
714  if (rInfo->QueryKeyFrameDuration(&offset, it.key(), isend))
715  {
716  DTC::Cutting *pCutting = pCutList->AddNewCutting();
717  pCutting->setMark(*it);
718  pCutting->setOffset(offset);
719  }
720  }
721  }
722  }
723 }
724 
726 //
728 
729 void FillSeek(DTC::CutList* pCutList, RecordingInfo* rInfo, MarkTypes marktype)
730 {
731  frm_pos_map_t markMap;
732  frm_pos_map_t::const_iterator it;
733 
734  if (rInfo && rInfo->GetChanID())
735  {
736  rInfo->QueryPositionMap(markMap, marktype);
737 
738  for (it = markMap.cbegin(); it != markMap.cend(); ++it)
739  {
740  DTC::Cutting *pCutting = pCutList->AddNewCutting();
741  pCutting->setMark(it.key());
742  pCutting->setOffset(it.value());
743  }
744  }
745 }
746 
747 int CreateRecordingGroup(const QString& groupName)
748 {
749  int groupID = -1;
750  MSqlQuery query(MSqlQuery::InitCon());
751 
752  query.prepare("INSERT INTO recgroups SET recgroup = :NAME, "
753  "displayname = :DISPLAYNAME");
754  query.bindValue(":NAME", groupName);
755  query.bindValue(":DISPLAYNAME", groupName);
756 
757  if (query.exec())
758  groupID = query.lastInsertId().toInt();
759 
760  if (groupID <= 0)
761  LOG(VB_GENERAL, LOG_ERR, QString("Could not create recording group (%1). "
762  "Does it already exist?").arg(groupName));
763 
764  return groupID;
765 }
766 
767 DBCredits * jsonCastToCredits(const QJsonObject &cast)
768 {
769  int priority = 1;
770  auto* credits = new DBCredits;
771 
772  QJsonArray members = cast["CastMembers"].toArray();
773  for (const auto & m : members)
774  {
775  QJsonObject actor = m.toObject();
776  QString name = actor.value("Name").toString("");
777  QString character = actor.value("CharacterName").toString("");
778  QString role = actor.value("Role").toString("");
779 
780  credits->push_back(DBPerson(role, name, priority, character));
781  ++priority;
782  }
783 
784  return credits;
785 }
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:409
ProgramInfo::GetFilesize
virtual uint64_t GetFilesize(void) const
Definition: programinfo.cpp:6283
MARK_COMM_END
@ MARK_COMM_END
Definition: programtypes.h:61
FillRecRuleInfo
void FillRecRuleInfo(DTC::RecRule *pRecRule, RecordingRule *pRule)
Definition: serviceUtil.cpp:274
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:1708
ProgramInfo::GetRecordingID
uint GetRecordingID(void) const
Definition: programinfo.h:445
FillChannelGroup
void FillChannelGroup(DTC::ChannelGroup *pGroup, const ChannelGroupItem &pGroupItem)
Definition: serviceUtil.cpp:260
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:558
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:335
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:492
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:637
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:1658
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:729
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:144
ProgramInfo::GetSeriesID
QString GetSeriesID(void) const
Definition: programinfo.h:434
FillGenreList
void FillGenreList(DTC::GenreList *pGenreList, int videoID)
Definition: serviceUtil.cpp:382
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:683
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:512
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:747
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:767
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:541
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