MythTV  0.28pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Modules Pages
dvr.cpp
Go to the documentation of this file.
1 // Program Name: dvr.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 <QMap>
27 #include <QRegExp>
28 
29 #include "dvr.h"
30 
31 #include "compat.h"
32 #include "mythversion.h"
33 #include "mythcorecontext.h"
34 #include "mythevent.h"
35 #include "scheduler.h"
36 #include "autoexpire.h"
37 #include "jobqueue.h"
38 #include "encoderlink.h"
39 #include "remoteutil.h"
40 #include "mythdate.h"
41 #include "recordinginfo.h"
42 #include "cardutil.h"
43 #include "inputinfo.h"
44 #include "programtypes.h"
45 #include "recordingtypes.h"
46 
47 #include "serviceUtil.h"
48 #include "mythscheduler.h"
49 #include "storagegroup.h"
50 #include "playgroup.h"
51 #include "recordingprofile.h"
52 
53 #include "scheduler.h"
54 
55 extern QMap<int, EncoderLink *> tvList;
56 extern AutoExpire *expirer;
57 
59 //
61 
63  int nStartIndex,
64  int nCount,
65  const QString &sTitleRegEx,
66  const QString &sRecGroup,
67  const QString &sStorageGroup )
68 {
69  QMap< QString, ProgramInfo* > recMap;
70 
72  recMap = gCoreContext->GetScheduler()->GetRecording();
73 
74  QMap< QString, uint32_t > inUseMap = ProgramInfo::QueryInUseMap();
75  QMap< QString, bool > isJobRunning= ProgramInfo::QueryJobsRunning(JOB_COMMFLAG);
76 
77  ProgramList progList;
78 
79  int desc = 1;
80  if (bDescending)
81  desc = -1;
82 
83  LoadFromRecorded( progList, false, inUseMap, isJobRunning, recMap, desc );
84 
85  QMap< QString, ProgramInfo* >::iterator mit = recMap.begin();
86 
87  for (; mit != recMap.end(); mit = recMap.erase(mit))
88  delete *mit;
89 
90  // ----------------------------------------------------------------------
91  // Build Response
92  // ----------------------------------------------------------------------
93 
94  DTC::ProgramList *pPrograms = new DTC::ProgramList();
95  int nAvailable = 0;
96 
97  int nMax = (nCount > 0) ? nCount : progList.size();
98 
99  nAvailable = 0;
100  nCount = 0;
101 
102  QRegExp rTitleRegEx = QRegExp(sTitleRegEx, Qt::CaseInsensitive);
103 
104  for( unsigned int n = 0; n < progList.size(); n++)
105  {
106  ProgramInfo *pInfo = progList[ n ];
107 
108  if (pInfo->IsDeletePending() ||
109  (!sTitleRegEx.isEmpty() && !pInfo->GetTitle().contains(rTitleRegEx)) ||
110  (!sRecGroup.isEmpty() && sRecGroup != pInfo->GetRecordingGroup()) ||
111  (!sStorageGroup.isEmpty() && sStorageGroup != pInfo->GetStorageGroup()))
112  continue;
113 
114  if ((nAvailable < nStartIndex) ||
115  (nCount >= nMax))
116  {
117  ++nAvailable;
118  continue;
119  }
120 
121  ++nAvailable;
122  ++nCount;
123 
124  DTC::Program *pProgram = pPrograms->AddNewProgram();
125 
126  FillProgramInfo( pProgram, pInfo, true );
127  }
128 
129  // ----------------------------------------------------------------------
130 
131  pPrograms->setStartIndex ( nStartIndex );
132  pPrograms->setCount ( nCount );
133  pPrograms->setTotalAvailable( nAvailable );
134  pPrograms->setAsOf ( MythDate::current() );
135  pPrograms->setVersion ( MYTH_BINARY_VERSION );
136  pPrograms->setProtoVer ( MYTH_PROTO_VERSION );
137 
138  return pPrograms;
139 }
140 
142 //
144 
146  int chanid, const QDateTime &recstarttsRaw)
147 {
148  if ((RecordedId <= 0) &&
149  (chanid <= 0 || !recstarttsRaw.isValid()))
150  throw QString("Recorded ID or Channel ID and StartTime appears invalid.");
151 
152  // TODO Should use RecordingInfo
153  ProgramInfo pi;
154  if (RecordedId > 0)
155  pi = ProgramInfo(RecordedId);
156  else
157  pi = ProgramInfo(chanid, recstarttsRaw.toUTC());
158 
159  DTC::Program *pProgram = new DTC::Program();
160  FillProgramInfo( pProgram, &pi, true );
161 
162  return pProgram;
163 }
164 
166 //
168 
169 bool Dvr::RemoveRecorded(int RecordedId,
170  int chanid, const QDateTime &recstarttsRaw,
171  bool forceDelete, bool allowRerecord)
172 {
173  return DeleteRecording(RecordedId, chanid, recstarttsRaw, forceDelete,
174  allowRerecord);
175 }
176 
177 
178 bool Dvr::DeleteRecording(int RecordedId,
179  int chanid, const QDateTime &recstarttsRaw,
180  bool forceDelete, bool allowRerecord)
181 {
182  if ((RecordedId <= 0) &&
183  (chanid <= 0 || !recstarttsRaw.isValid()))
184  throw QString("Recorded ID or Channel ID and StartTime appears invalid.");
185 
186  // TODO Should use RecordingInfo
187  ProgramInfo pi;
188  if (RecordedId > 0)
189  pi = ProgramInfo(RecordedId);
190  else
191  pi = ProgramInfo(chanid, recstarttsRaw.toUTC());
192 
193  if (pi.GetChanID() && pi.HasPathname())
194  {
195  QString cmd = QString("DELETE_RECORDING %1 %2 %3 %4")
196  .arg(pi.GetChanID())
198  .arg(forceDelete ? "FORCE" : "NO_FORCE")
199  .arg(allowRerecord ? "FORGET" : "NO_FORGET");
200  MythEvent me(cmd);
201 
202  gCoreContext->dispatch(me);
203  return true;
204  }
205 
206  return false;
207 }
208 
210 //
212 
213 bool Dvr::UnDeleteRecording(int RecordedId,
214  int chanid, const QDateTime &recstarttsRaw)
215 {
216  if ((RecordedId <= 0) &&
217  (chanid <= 0 || !recstarttsRaw.isValid()))
218  throw QString("Recorded ID or Channel ID and StartTime appears invalid.");
219 
220  RecordingInfo ri;
221  if (RecordedId > 0)
222  ri = RecordingInfo(RecordedId);
223  else
224  ri = RecordingInfo(chanid, recstarttsRaw.toUTC());
225 
226  if (ri.GetChanID() && ri.HasPathname())
227  {
228  QString cmd = QString("UNDELETE_RECORDING %1 %2")
229  .arg(ri.GetChanID())
231  MythEvent me(cmd);
232 
233  gCoreContext->dispatch(me);
234  return true;
235  }
236 
237  return false;
238 }
239 
241 //
243 
244 bool Dvr::UpdateRecordedWatchedStatus ( int RecordedId,
245  int chanid,
246  const QDateTime &recstarttsRaw,
247  bool watched)
248 {
249  if ((RecordedId <= 0) &&
250  (chanid <= 0 || !recstarttsRaw.isValid()))
251  throw QString("Recorded ID or Channel ID and StartTime appears invalid.");
252 
253  // TODO Should use RecordingInfo
254  ProgramInfo pi;
255  if (RecordedId > 0)
256  pi = ProgramInfo(RecordedId);
257  else
258  pi = ProgramInfo(chanid, recstarttsRaw.toUTC());
259 
260  pi.SaveWatched(watched);
261 
262  return true;
263 }
264 
266 //
268 
270  int nCount )
271 {
272  pginfolist_t infoList;
273 
274  if (expirer)
275  expirer->GetAllExpiring( infoList );
276 
277  // ----------------------------------------------------------------------
278  // Build Response
279  // ----------------------------------------------------------------------
280 
281  DTC::ProgramList *pPrograms = new DTC::ProgramList();
282 
283  nStartIndex = min( nStartIndex, (int)infoList.size() );
284  nCount = (nCount > 0) ? min( nCount, (int)infoList.size() ) : infoList.size();
285  int nEndIndex = min((nStartIndex + nCount), (int)infoList.size() );
286 
287  for( int n = nStartIndex; n < nEndIndex; n++)
288  {
289  ProgramInfo *pInfo = infoList[ n ];
290 
291  if (pInfo != NULL)
292  {
293  DTC::Program *pProgram = pPrograms->AddNewProgram();
294 
295  FillProgramInfo( pProgram, pInfo, true );
296 
297  delete pInfo;
298  }
299  }
300 
301  // ----------------------------------------------------------------------
302 
303  pPrograms->setStartIndex ( nStartIndex );
304  pPrograms->setCount ( nCount );
305  pPrograms->setTotalAvailable( infoList.size() );
306  pPrograms->setAsOf ( MythDate::current() );
307  pPrograms->setVersion ( MYTH_BINARY_VERSION );
308  pPrograms->setProtoVer ( MYTH_PROTO_VERSION );
309 
310  return pPrograms;
311 }
312 
314 //
316 
318 {
319 
320  DTC::EncoderList* pList = new DTC::EncoderList();
321 
322  QList<InputInfo> inputInfoList = CardUtil::GetAllInputInfo();
323  QMap<int, EncoderLink *>::Iterator iter = tvList.begin();
324 
325  for (; iter != tvList.end(); ++iter)
326  {
327  EncoderLink *elink = *iter;
328 
329  if (elink != NULL)
330  {
331  DTC::Encoder *pEncoder = pList->AddNewEncoder();
332 
333  pEncoder->setId ( elink->GetCardID() );
334  pEncoder->setState ( elink->GetState() );
335  pEncoder->setLocal ( elink->IsLocal() );
336  pEncoder->setConnected ( elink->IsConnected() );
337  pEncoder->setSleepStatus ( elink->GetSleepStatus() );
338  // pEncoder->setLowOnFreeSpace( elink->isLowOnFreeSpace());
339 
340  if (pEncoder->Local())
341  pEncoder->setHostName( gCoreContext->GetHostName() );
342  else
343  pEncoder->setHostName( elink->GetHostName() );
344 
345  QList<InputInfo>::iterator it = inputInfoList.begin();
346  for (; it < inputInfoList.end(); ++it)
347  {
348  InputInfo inputInfo = *it;
349  if (inputInfo.cardid == static_cast<uint>(elink->GetCardID()))
350  {
351  DTC::Input *input = pEncoder->AddNewInput();
352  FillInputInfo(input, inputInfo);
353  }
354  }
355 
356  switch ( pEncoder->State() )
357  {
361  {
362  ProgramInfo *pInfo = elink->GetRecording();
363 
364  if (pInfo)
365  {
366  DTC::Program *pProgram = pEncoder->Recording();
367 
368  FillProgramInfo( pProgram, pInfo, true, true );
369 
370  delete pInfo;
371  }
372 
373  break;
374  }
375 
376  default:
377  break;
378  }
379  }
380  }
381  return pList;
382 }
383 
385 //
387 
389 {
390  DTC::InputList *pList = new DTC::InputList();
391 
392  QList<InputInfo> inputInfoList = CardUtil::GetAllInputInfo();
393  QList<InputInfo>::iterator it = inputInfoList.begin();
394  for (; it < inputInfoList.end(); ++it)
395  {
396  InputInfo inputInfo = *it;
397  DTC::Input *input = pList->AddNewInput();
398  FillInputInfo(input, inputInfo);
399  }
400 
401  return pList;
402 }
403 
405 //
407 
408 QStringList Dvr::GetRecGroupList()
409 {
410  MSqlQuery query(MSqlQuery::InitCon());
411  query.prepare("SELECT recgroup FROM recgroups WHERE recgroup <> 'Deleted' "
412  "ORDER BY recgroup");
413 
414  QStringList result;
415  if (!query.exec())
416  {
417  MythDB::DBError("GetRecGroupList", query);
418  return result;
419  }
420 
421  while (query.next())
422  result << query.value(0).toString();
423 
424  return result;
425 }
426 
428 //
430 
432 {
434 }
435 
437 //
439 
441 {
442  return PlayGroup::GetNames();
443 }
444 
446 //
448 
450 {
452 
453  MSqlQuery query(MSqlQuery::InitCon());
454 
455  query.prepare("SELECT filterid, description, newruledefault "
456  "FROM recordfilter ORDER BY filterid");
457 
458  if (query.exec())
459  {
460  while (query.next())
461  {
462  DTC::RecRuleFilter* ruleFilter = filterList->AddNewRecRuleFilter();
463  ruleFilter->setId(query.value(0).toInt());
464  ruleFilter->setDescription(QObject::tr(query.value(1).toString()
465  .toUtf8().constData()));
466  }
467  }
468 
469  return filterList;
470 }
471 
473 //
475 
476 QStringList Dvr::GetTitleList(const QString& RecGroup)
477 {
478  MSqlQuery query(MSqlQuery::InitCon());
479 
480  QString querystr = "SELECT DISTINCT title FROM recorded "
481  "WHERE deletepending = 0";
482 
483  if (!RecGroup.isEmpty())
484  querystr += " AND recgroup = :RECGROUP";
485  else
486  querystr += " AND recgroup != 'Deleted'";
487 
488  querystr += " ORDER BY title";
489 
490  query.prepare(querystr);
491 
492  if (!RecGroup.isEmpty())
493  query.bindValue(":RECGROUP", RecGroup);
494 
495  QStringList result;
496  if (!query.exec())
497  {
498  MythDB::DBError("GetTitleList recorded", query);
499  return result;
500  }
501 
502  while (query.next())
503  result << query.value(0).toString();
504 
505  return result;
506 }
507 
509 //
511 
513 {
514  MSqlQuery query(MSqlQuery::InitCon());
515 
516  QString querystr = QString(
517  "SELECT title, inetref, count(title) as count "
518  " FROM recorded "
519  " WHERE inetref <> '' "
520  " AND deletepending = 0 "
521  " GROUP BY title, inetref "
522  " ORDER BY title");
523 
524  query.prepare(querystr);
525 
526  DTC::TitleInfoList *pTitleInfos = new DTC::TitleInfoList();
527  if (!query.exec())
528  {
529  MythDB::DBError("GetTitleList recorded", query);
530  return pTitleInfos;
531  }
532 
533  while (query.next())
534  {
535  DTC::TitleInfo *pTitleInfo = pTitleInfos->AddNewTitleInfo();
536 
537  pTitleInfo->setTitle(query.value(0).toString());
538  pTitleInfo->setInetref(query.value(1).toString());
539  pTitleInfo->setCount(query.value(2).toInt());
540  }
541 
542  return pTitleInfos;
543 }
544 
546 //
548 
550  int nCount,
551  bool bShowAll,
552  int nRecordId,
553  int nRecStatus )
554 {
555  RecordingList recordingList; // Auto-delete deque
556  RecList tmpList; // Standard deque, objects must be deleted
557 
558  if (nRecordId <= 0)
559  nRecordId = -1;
560 
561  // NOTE: Fetching this information directly from the schedule is
562  // significantly faster than using ProgramInfo::LoadFromScheduler()
563  Scheduler *scheduler = dynamic_cast<Scheduler*>(gCoreContext->GetScheduler());
564  if (scheduler)
565  scheduler->GetAllPending(tmpList, nRecordId);
566 
567  // Sort the upcoming into only those which will record
568  RecList::iterator it = tmpList.begin();
569  for(; it < tmpList.end(); ++it)
570  {
571  if ((nRecStatus != 0) &&
572  ((*it)->GetRecordingStatus() != nRecStatus))
573  {
574  delete *it;
575  *it = NULL;
576  continue;
577  }
578 
579  if (!bShowAll && ((((*it)->GetRecordingStatus() >= RecStatus::Failing) &&
580  ((*it)->GetRecordingStatus() <= RecStatus::WillRecord)) ||
581  ((*it)->GetRecordingStatus() == RecStatus::Conflict)) &&
582  ((*it)->GetRecordingEndTime() > MythDate::current()))
583  {
584  recordingList.push_back(new RecordingInfo(**it));
585  }
586  else if (bShowAll &&
587  ((*it)->GetRecordingEndTime() > MythDate::current()))
588  {
589  recordingList.push_back(new RecordingInfo(**it));
590  }
591 
592  delete *it;
593  *it = NULL;
594  }
595 
596  // ----------------------------------------------------------------------
597  // Build Response
598  // ----------------------------------------------------------------------
599 
600  DTC::ProgramList *pPrograms = new DTC::ProgramList();
601 
602  nStartIndex = min( nStartIndex, (int)recordingList.size() );
603  nCount = (nCount > 0) ? min( nCount, (int)recordingList.size() ) : recordingList.size();
604  int nEndIndex = min((nStartIndex + nCount), (int)recordingList.size() );
605 
606  for( int n = nStartIndex; n < nEndIndex; n++)
607  {
608  ProgramInfo *pInfo = recordingList[ n ];
609 
610  DTC::Program *pProgram = pPrograms->AddNewProgram();
611 
612  FillProgramInfo( pProgram, pInfo, true );
613  }
614 
615  // ----------------------------------------------------------------------
616 
617  pPrograms->setStartIndex ( nStartIndex );
618  pPrograms->setCount ( nCount );
619  pPrograms->setTotalAvailable( recordingList.size() );
620  pPrograms->setAsOf ( MythDate::current() );
621  pPrograms->setVersion ( MYTH_BINARY_VERSION );
622  pPrograms->setProtoVer ( MYTH_PROTO_VERSION );
623 
624  return pPrograms;
625 }
626 
628 //
630 
632  int nCount,
633  int nRecordId )
634 {
635  RecordingList recordingList; // Auto-delete deque
636  RecList tmpList; // Standard deque, objects must be deleted
637 
638  if (nRecordId <= 0)
639  nRecordId = -1;
640 
641  // NOTE: Fetching this information directly from the schedule is
642  // significantly faster than using ProgramInfo::LoadFromScheduler()
643  Scheduler *scheduler = dynamic_cast<Scheduler*>(gCoreContext->GetScheduler());
644  if (scheduler)
645  scheduler->GetAllPending(tmpList, nRecordId);
646 
647  // Sort the upcoming into only those which are conflicts
648  RecList::iterator it = tmpList.begin();
649  for(; it < tmpList.end(); ++it)
650  {
651  if (((*it)->GetRecordingStatus() == RecStatus::Conflict) &&
652  ((*it)->GetRecordingStartTime() >= MythDate::current()))
653  {
654  recordingList.push_back(new RecordingInfo(**it));
655  }
656  delete *it;
657  *it = NULL;
658  }
659 
660  // ----------------------------------------------------------------------
661  // Build Response
662  // ----------------------------------------------------------------------
663 
664  DTC::ProgramList *pPrograms = new DTC::ProgramList();
665 
666  nStartIndex = min( nStartIndex, (int)recordingList.size() );
667  nCount = (nCount > 0) ? min( nCount, (int)recordingList.size() ) : recordingList.size();
668  int nEndIndex = min((nStartIndex + nCount), (int)recordingList.size() );
669 
670  for( int n = nStartIndex; n < nEndIndex; n++)
671  {
672  ProgramInfo *pInfo = recordingList[ n ];
673 
674  DTC::Program *pProgram = pPrograms->AddNewProgram();
675 
676  FillProgramInfo( pProgram, pInfo, true );
677  }
678 
679  // ----------------------------------------------------------------------
680 
681  pPrograms->setStartIndex ( nStartIndex );
682  pPrograms->setCount ( nCount );
683  pPrograms->setTotalAvailable( recordingList.size() );
684  pPrograms->setAsOf ( MythDate::current() );
685  pPrograms->setVersion ( MYTH_BINARY_VERSION );
686  pPrograms->setProtoVer ( MYTH_PROTO_VERSION );
687 
688  return pPrograms;
689 }
690 
692  QString sTitle,
693  QString sSubtitle,
694  QString sDescription,
695  QString sCategory,
696  QDateTime recstarttsRaw,
697  QDateTime recendtsRaw,
698  QString sSeriesId,
699  QString sProgramId,
700  int nChanId,
701  QString sStation,
702  int nFindDay,
703  QTime tFindTime,
704  int nParentId,
705  bool bInactive,
706  uint nSeason,
707  uint nEpisode,
708  QString sInetref,
709  QString sType,
710  QString sSearchType,
711  int nRecPriority,
712  uint nPreferredInput,
713  int nStartOffset,
714  int nEndOffset,
715  QString sDupMethod,
716  QString sDupIn,
717  uint nFilter,
718  QString sRecProfile,
719  QString sRecGroup,
720  QString sStorageGroup,
721  QString sPlayGroup,
722  bool bAutoExpire,
723  int nMaxEpisodes,
724  bool bMaxNewest,
725  bool bAutoCommflag,
726  bool bAutoTranscode,
727  bool bAutoMetaLookup,
728  bool bAutoUserJob1,
729  bool bAutoUserJob2,
730  bool bAutoUserJob3,
731  bool bAutoUserJob4,
732  int nTranscoder)
733 {
734  QDateTime recstartts = recstarttsRaw.toUTC();
735  QDateTime recendts = recendtsRaw.toUTC();
736  RecordingRule rule;
737  rule.LoadTemplate("Default");
738 
739  if (sType.isEmpty())
740  sType = "single";
741 
742  if (sSearchType.isEmpty())
743  sSearchType = "none";
744 
745  if (sDupMethod.isEmpty())
746  sDupMethod = "subtitleanddescription";
747 
748  if (sDupIn.isEmpty())
749  sDupIn = "all";
750 
751  rule.m_title = sTitle;
752  rule.m_subtitle = sSubtitle;
753  rule.m_description = sDescription;
754 
755  rule.m_startdate = recstartts.date();
756  rule.m_starttime = recstartts.time();
757  rule.m_enddate = recendts.date();
758  rule.m_endtime = recendts.time();
759 
760  rule.m_type = recTypeFromString(sType);
761  rule.m_searchType = searchTypeFromString(sSearchType);
762  rule.m_dupMethod = dupMethodFromString(sDupMethod);
763  rule.m_dupIn = dupInFromString(sDupIn);
764 
765  if (sRecProfile.isEmpty())
766  sRecProfile = "Default";
767 
768  if (sRecGroup.isEmpty())
769  sRecGroup = "Default";
770 
771  if (sStorageGroup.isEmpty())
772  sStorageGroup = "Default";
773 
774  if (sPlayGroup.isEmpty())
775  sPlayGroup = "Default";
776 
777  rule.m_category = sCategory;
778  rule.m_seriesid = sSeriesId;
779  rule.m_programid = sProgramId;
780 
781  rule.m_channelid = nChanId;
782  rule.m_station = sStation;
783 
784  rule.m_findday = nFindDay;
785  rule.m_findtime = tFindTime;
786 
787  rule.m_recProfile = sRecProfile;
788  rule.m_recGroupID = RecordingInfo::GetRecgroupID(sRecGroup) > 0 ? RecordingInfo::GetRecgroupID(sRecGroup) :
790  rule.m_storageGroup = sStorageGroup;
791  rule.m_playGroup = sPlayGroup;
792 
793  rule.m_parentRecID = nParentId;
794  rule.m_isInactive = bInactive;
795 
796  rule.m_season = nSeason;
797  rule.m_episode = nEpisode;
798  rule.m_inetref = sInetref;
799 
800  rule.m_recPriority = nRecPriority;
801  rule.m_prefInput = nPreferredInput;
802  rule.m_startOffset = nStartOffset;
803  rule.m_endOffset = nEndOffset;
804  rule.m_filter = nFilter;
805 
806  rule.m_autoExpire = bAutoExpire;
807  rule.m_maxEpisodes = nMaxEpisodes;
808  rule.m_maxNewest = bMaxNewest;
809 
810  rule.m_autoCommFlag = bAutoCommflag;
811  rule.m_autoTranscode = bAutoTranscode;
812  rule.m_autoMetadataLookup = bAutoMetaLookup;
813 
814  rule.m_autoUserJob1 = bAutoUserJob1;
815  rule.m_autoUserJob2 = bAutoUserJob2;
816  rule.m_autoUserJob3 = bAutoUserJob3;
817  rule.m_autoUserJob4 = bAutoUserJob4;
818 
819  rule.m_transcoder = nTranscoder;
820 
821  QString msg;
822  if (!rule.IsValid(msg))
823  throw msg;
824 
825  rule.Save();
826 
827  uint recid = rule.m_recordID;
828 
829  return recid;
830 }
831 
833  QString sTitle,
834  QString sSubtitle,
835  QString sDescription,
836  QString sCategory,
837  QDateTime dStartTimeRaw,
838  QDateTime dEndTimeRaw,
839  QString sSeriesId,
840  QString sProgramId,
841  int nChanId,
842  QString sStation,
843  int nFindDay,
844  QTime tFindTime,
845  bool bInactive,
846  uint nSeason,
847  uint nEpisode,
848  QString sInetref,
849  QString sType,
850  QString sSearchType,
851  int nRecPriority,
852  uint nPreferredInput,
853  int nStartOffset,
854  int nEndOffset,
855  QString sDupMethod,
856  QString sDupIn,
857  uint nFilter,
858  QString sRecProfile,
859  QString sRecGroup,
860  QString sStorageGroup,
861  QString sPlayGroup,
862  bool bAutoExpire,
863  int nMaxEpisodes,
864  bool bMaxNewest,
865  bool bAutoCommflag,
866  bool bAutoTranscode,
867  bool bAutoMetaLookup,
868  bool bAutoUserJob1,
869  bool bAutoUserJob2,
870  bool bAutoUserJob3,
871  bool bAutoUserJob4,
872  int nTranscoder)
873 {
874  if (nRecordId <= 0 )
875  throw QString("Record ID is invalid.");
876 
877  RecordingRule pRule;
878  pRule.m_recordID = nRecordId;
879  pRule.Load();
880 
881  if (!pRule.IsLoaded())
882  throw QString("Record ID does not exist.");
883 
884  QDateTime recstartts = dStartTimeRaw.toUTC();
885  QDateTime recendts = dEndTimeRaw.toUTC();
886 
887  pRule.m_isInactive = bInactive;
888  if (sType.isEmpty())
889  sType = "single";
890 
891  if (sSearchType.isEmpty())
892  sSearchType = "none";
893 
894  if (sDupMethod.isEmpty())
895  sDupMethod = "subtitleanddescription";
896 
897  if (sDupIn.isEmpty())
898  sDupIn = "all";
899 
900  pRule.m_type = recTypeFromString(sType);
901  pRule.m_searchType = searchTypeFromString(sSearchType);
902  pRule.m_dupMethod = dupMethodFromString(sDupMethod);
903  pRule.m_dupIn = dupInFromString(sDupIn);
904 
905  if (sRecProfile.isEmpty())
906  sRecProfile = "Default";
907 
908  if (sRecGroup.isEmpty())
909  sRecGroup = "Default";
910 
911  if (sStorageGroup.isEmpty())
912  sStorageGroup = "Default";
913 
914  if (sPlayGroup.isEmpty())
915  sPlayGroup = "Default";
916 
917  if (!sTitle.isEmpty())
918  pRule.m_title = sTitle;
919 
920  if (!sSubtitle.isEmpty())
921  pRule.m_subtitle = sSubtitle;
922 
923  if(!sDescription.isEmpty())
924  pRule.m_description = sDescription;
925 
926  if (!sCategory.isEmpty())
927  pRule.m_category = sCategory;
928 
929  if (!sSeriesId.isEmpty())
930  pRule.m_seriesid = sSeriesId;
931 
932  if (!sProgramId.isEmpty())
933  pRule.m_programid = sProgramId;
934 
935  if (nChanId)
936  pRule.m_channelid = nChanId;
937  if (!sStation.isEmpty())
938  pRule.m_station = sStation;
939 
940  pRule.m_startdate = recstartts.date();
941  pRule.m_starttime = recstartts.time();
942  pRule.m_enddate = recendts.date();
943  pRule.m_endtime = recendts.time();
944 
945  pRule.m_findday = nFindDay;
946  pRule.m_findtime = tFindTime;
947 
948  pRule.m_recProfile = sRecProfile;
949  pRule.m_recGroupID = RecordingInfo::GetRecgroupID(sRecGroup) > 0 ? RecordingInfo::GetRecgroupID(sRecGroup) :
951  pRule.m_storageGroup = sStorageGroup;
952  pRule.m_playGroup = sPlayGroup;
953 
954  pRule.m_isInactive = bInactive;
955 
956  pRule.m_season = nSeason;
957  pRule.m_episode = nEpisode;
958  pRule.m_inetref = sInetref;
959 
960  pRule.m_recPriority = nRecPriority;
961  pRule.m_prefInput = nPreferredInput;
962  pRule.m_startOffset = nStartOffset;
963  pRule.m_endOffset = nEndOffset;
964  pRule.m_filter = nFilter;
965 
966  pRule.m_autoExpire = bAutoExpire;
967  pRule.m_maxEpisodes = nMaxEpisodes;
968  pRule.m_maxNewest = bMaxNewest;
969 
970  pRule.m_autoCommFlag = bAutoCommflag;
971  pRule.m_autoTranscode = bAutoTranscode;
972  pRule.m_autoMetadataLookup = bAutoMetaLookup;
973 
974  pRule.m_autoUserJob1 = bAutoUserJob1;
975  pRule.m_autoUserJob2 = bAutoUserJob2;
976  pRule.m_autoUserJob3 = bAutoUserJob3;
977  pRule.m_autoUserJob4 = bAutoUserJob4;
978 
979  pRule.m_transcoder = nTranscoder;
980 
981  QString msg;
982  if (!pRule.IsValid(msg))
983  throw msg;
984 
985  bool bResult = pRule.Save();
986 
987  return bResult;
988 }
989 
990 bool Dvr::RemoveRecordSchedule ( uint nRecordId )
991 {
992  bool bResult = false;
993 
994  if (nRecordId <= 0 )
995  throw QString("Record ID does not exist.");
996 
997  RecordingRule pRule;
998  pRule.m_recordID = nRecordId;
999 
1000  bResult = pRule.Delete();
1001 
1002  return bResult;
1003 }
1004 
1005 bool Dvr::AddDontRecordSchedule(int nChanId, const QDateTime &dStartTime,
1006  bool bNeverRecord)
1007 {
1008  bool bResult = true;
1009 
1010  if (nChanId <= 0 || !dStartTime.isValid())
1011  throw QString("Program does not exist.");
1012 
1013  ProgramInfo *pi = LoadProgramFromProgram(nChanId, dStartTime.toUTC());
1014 
1015  if (!pi)
1016  throw QString("Program does not exist.");
1017 
1018  // Why RecordingInfo instead of ProgramInfo? Good question ...
1019  RecordingInfo recInfo = RecordingInfo(*pi);
1020 
1021  delete pi;
1022 
1023  if (bNeverRecord)
1024  {
1025  recInfo.ApplyNeverRecord();
1026  }
1027  else
1029 
1030  return bResult;
1031 }
1032 
1034  int nCount,
1035  const QString &Sort,
1036  bool Descending )
1037 {
1038  Scheduler::SchedSortColumn sortingColumn;
1039  if (Sort.toLower() == "lastrecorded")
1040  sortingColumn = Scheduler::kSortLastRecorded;
1041  else if (Sort.toLower() == "nextrecording")
1042  sortingColumn = Scheduler::kSortNextRecording;
1043  else if (Sort.toLower() == "title")
1044  sortingColumn = Scheduler::kSortTitle;
1045  else if (Sort.toLower() == "priority")
1046  sortingColumn = Scheduler::kSortPriority;
1047  else if (Sort.toLower() == "type")
1048  sortingColumn = Scheduler::kSortType;
1049  else
1050  sortingColumn = Scheduler::kSortTitle;
1051 
1052  RecList recList;
1053  Scheduler::GetAllScheduled(recList, sortingColumn, !Descending);
1054 
1055  // ----------------------------------------------------------------------
1056  // Build Response
1057  // ----------------------------------------------------------------------
1058 
1059  DTC::RecRuleList *pRecRules = new DTC::RecRuleList();
1060 
1061  nStartIndex = min( nStartIndex, (int)recList.size() );
1062  nCount = (nCount > 0) ? min( nCount, (int)recList.size() ) : recList.size();
1063  int nEndIndex = min((nStartIndex + nCount), (int)recList.size() );
1064 
1065  for( int n = nStartIndex; n < nEndIndex; n++)
1066  {
1067  RecordingInfo *info = recList[n];
1068 
1069  if (info != NULL)
1070  {
1071  DTC::RecRule *pRecRule = pRecRules->AddNewRecRule();
1072 
1073  FillRecRuleInfo( pRecRule, info->GetRecordingRule() );
1074  }
1075  }
1076 
1077  // ----------------------------------------------------------------------
1078 
1079  pRecRules->setStartIndex ( nStartIndex );
1080  pRecRules->setCount ( nCount );
1081  pRecRules->setTotalAvailable( recList.size() );
1082  pRecRules->setAsOf ( MythDate::current() );
1083  pRecRules->setVersion ( MYTH_BINARY_VERSION );
1084  pRecRules->setProtoVer ( MYTH_PROTO_VERSION );
1085 
1086  while (!recList.empty())
1087  {
1088  delete recList.back();
1089  recList.pop_back();
1090  }
1091 
1092  return pRecRules;
1093 }
1094 
1096  QString sTemplate,
1097  int nRecordedId,
1098  int nChanId,
1099  QDateTime dStartTimeRaw,
1100  bool bMakeOverride )
1101 {
1102  RecordingRule rule;
1103  QDateTime dStartTime = dStartTimeRaw.toUTC();
1104 
1105  if (nRecordId > 0)
1106  {
1107  rule.m_recordID = nRecordId;
1108  if (!rule.Load())
1109  throw QString("Record ID does not exist.");
1110  }
1111  else if (!sTemplate.isEmpty())
1112  {
1113  if (!rule.LoadTemplate(sTemplate))
1114  throw QString("Template does not exist.");
1115  }
1116  else if (nRecordedId > 0) // Loads from the Recorded/Recorded Program Table
1117  {
1118  // Despite the use of ProgramInfo, this only applies to Recordings.
1119  ProgramInfo recInfo(nRecordedId);
1120  if (!rule.LoadByProgram(&recInfo))
1121  throw QString("Recording does not exist");
1122  }
1123  else if (nChanId > 0 && dStartTime.isValid()) // Loads from Program Table, should NOT be used with recordings
1124  {
1125  // Despite the use of RecordingInfo, this only applies to programs in the
1126  // present or future, not to recordings? Confused yet?
1128  RecordingInfo info(nChanId, dStartTime, false, 0, &status);
1129  if (status != RecordingInfo::kFoundProgram)
1130  throw QString("Program does not exist.");
1131  RecordingRule *pRule = info.GetRecordingRule();
1132  if (bMakeOverride && rule.m_type != kSingleRecord &&
1133  rule.m_type != kOverrideRecord && rule.m_type != kDontRecord)
1134  pRule->MakeOverride();
1135  rule = *pRule;
1136  }
1137  else
1138  {
1139  throw QString("Invalid request.");
1140  }
1141 
1142  DTC::RecRule *pRecRule = new DTC::RecRule();
1143  FillRecRuleInfo( pRecRule, &rule );
1144 
1145  return pRecRule;
1146 }
1147 
1149 {
1150  bool bResult = false;
1151 
1152  if (nRecordId <= 0 )
1153  throw QString("Record ID appears invalid.");
1154 
1155  RecordingRule pRule;
1156  pRule.m_recordID = nRecordId;
1157  pRule.Load();
1158 
1159  if (pRule.IsLoaded())
1160  {
1161  pRule.m_isInactive = false;
1162  bResult = pRule.Save();
1163  }
1164 
1165  return bResult;
1166 }
1167 
1169 {
1170  bool bResult = false;
1171 
1172  if (nRecordId <= 0 )
1173  throw QString("Record ID appears invalid.");
1174 
1175  RecordingRule pRule;
1176  pRule.m_recordID = nRecordId;
1177  pRule.Load();
1178 
1179  if (pRule.IsLoaded())
1180  {
1181  pRule.m_isInactive = true;
1182  bResult = pRule.Save();
1183  }
1184 
1185  return bResult;
1186 }
1187 
1189 {
1190  RecStatus::Type type = static_cast<RecStatus::Type>(RecStatus);
1191  return RecStatus::toString(type);
1192 }
1193 
1194 QString Dvr::RecStatusToDescription(int RecStatus, int recType,
1195  const QDateTime &StartTime)
1196 {
1197  //if (!StartTime.isValid())
1198  // throw QString("StartTime appears invalid.");
1199  RecStatus::Type rsType = static_cast<RecStatus::Type>(RecStatus);
1200  RecordingType recordingType = static_cast<RecordingType>(recType);
1201  return RecStatus::toDescription(rsType, recordingType, StartTime);
1202 }
1203 
1204 QString Dvr::RecTypeToString(QString recType)
1205 {
1206  bool ok;
1207  RecordingType enumType = static_cast<RecordingType>(recType.toInt(&ok, 10));
1208  if (ok)
1209  return toString(enumType);
1210  // RecordingType type = static_cast<RecordingType>(recType);
1211  return toString(recTypeFromString(recType));
1212 }
1213 
1214 QString Dvr::RecTypeToDescription(QString recType)
1215 {
1216  bool ok;
1217  RecordingType enumType = static_cast<RecordingType>(recType.toInt(&ok, 10));
1218  if (ok)
1219  return toDescription(enumType);
1220  // RecordingType type = static_cast<RecordingType>(recType);
1221  return toDescription(recTypeFromString(recType));
1222 }
1223 
1224 QString Dvr::DupInToString(QString DupIn)
1225 {
1226  // RecordingDupInType type= static_cast<RecordingDupInType>(DupIn);
1227  // return toString(type);
1228  return toString(dupInFromString(DupIn));
1229 }
1230 
1231 QString Dvr::DupInToDescription(QString DupIn)
1232 {
1233  // RecordingDupInType type= static_cast<RecordingDupInType>(DupIn);
1234  //return toDescription(type);
1235  return toDescription(dupInFromString(DupIn));
1236 }
1237 
1238 QString Dvr::DupMethodToString(QString DupMethod)
1239 {
1240  // RecordingDupMethodType method = static_cast<RecordingDupMethodType>(DupMethod);
1241  return toString(dupMethodFromString(DupMethod));
1242 }
1243 
1244 QString Dvr::DupMethodToDescription(QString DupMethod)
1245 {
1246  // RecordingDupMethodType method = static_cast<RecordingDupMethodType>(DupMethod);
1247  return toDescription(dupMethodFromString(DupMethod));
1248 }
QString RecStatusToString(int RecStatus)
Definition: dvr.cpp:1188
QString m_subtitle
Definition: recordingrule.h:76
bool DeleteRecording(int RecordedId, int ChanId, const QDateTime &StartTime, bool ForceDelete, bool AllowRerecord)
Definition: dvr.cpp:178
QTime m_findtime
Day of the week for once per week etc.
Definition: recordingrule.h:95
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:785
MythScheduler * GetScheduler(void)
DTC::ProgramList * GetConflictList(int StartIndex, int Count, int RecordId)
Definition: dvr.cpp:631
Program * AddNewProgram()
Definition: programList.h:86
void bindValue(const QString &placeholder, const QVariant &val)
Definition: mythdbcon.cpp:884
AutoExpire * expirer
QString m_programid
Definition: recordingrule.h:88
DTC::RecRuleFilterList * GetRecRuleFilterList()
Definition: dvr.cpp:449
DTC::TitleInfoList * GetTitleInfoList()
Definition: dvr.cpp:512
SchedSortColumn
Definition: scheduler.h:70
ProgramInfo * LoadProgramFromProgram(const uint chanid, const QDateTime &starttime)
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
Definition: tv.h:63
void push_back(T info)
bool UpdateRecordedWatchedStatus(int RecordedId, int ChanId, const QDateTime &StartTime, bool Watched)
Definition: dvr.cpp:244
QString toDescription(RecordingType rectype)
Converts "rectype" into a human readable description.
bool LoadByProgram(const ProgramInfo *proginfo)
void FillProgramInfo(DTC::Program *pProgram, ProgramInfo *pInfo, bool bIncChannel, bool bDetails, bool bIncCast)
Definition: serviceUtil.cpp:43
bool Delete(bool sendSig=true)
bool IsLoaded() const
Definition: recordingrule.h:55
RecSearchType searchTypeFromString(QString type)
QString toString(MarkTypes type)
QStringList GetPlayGroupList()
Definition: dvr.cpp:440
QVariant value(int i) const
Definition: mythdbcon.h:182
bool IsDeletePending(void) const
Definition: programinfo.h:469
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
void FillRecRuleInfo(DTC::RecRule *pRecRule, RecordingRule *pRule)
RecordingRule * GetRecordingRule(void)
Returns the "record" field, creating it if necessary.
TitleInfo * AddNewTitleInfo()
Definition: titleInfoList.h:57
RecordingType recTypeFromString(QString type)
static QString toDescription(Type, RecordingType, const QDateTime &recstartts)
Converts "recstatus" into a long human readable description.
QString m_storageGroup
static QStringList getRecordingsGroups(void)
QString m_station
Definition: recordingrule.h:93
Holds information on a TV Program one might wish to record.
Definition: recordinginfo.h:33
QString DupMethodToDescription(QString DupMethod)
Definition: dvr.cpp:1244
Watching Recording is the state for when we are watching an in progress recording, but the user does not have control over the channel and recorder to use.
Definition: tv.h:80
unsigned int uint
Definition: compat.h:136
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QString DupInToString(QString DupIn)
Definition: dvr.cpp:1224
GLint GLenum GLsizei GLint GLenum GLenum type
AutoDeleteDeque< ProgramInfo * > ProgramList
Definition: programinfo.h:35
RecordingType m_type
Definition: recordingrule.h:99
RecordingDupMethodType m_dupMethod
DTC::RecRuleList * GetRecordScheduleList(int StartIndex, int Count, const QString &Sort, bool Descending)
Definition: dvr.cpp:1033
DTC::ProgramList * GetExpiringList(int StartIndex, int Count)
Definition: dvr.cpp:269
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
Definition: programinfo.h:387
uint cardid
card id associated with input
Definition: inputinfo.h:75
static uint GetRecgroupID(const QString &recGroup)
Temporary helper during transition from string to ID.
size_t size(void) const
QStringList GetRecStorageGroupList()
Definition: dvr.cpp:431
bool Save(bool sendSig=true)
RecordingDupMethodType dupMethodFromString(QString type)
Holds information on recordings and videos.
Definition: programinfo.h:72
void ApplyRecordStateChange(RecordingType newstate, bool save=true)
Sets RecordingType of "record", creating "record" if it does not exist.
bool RemoveRecorded(int RecordedId, int ChanId, const QDateTime &StartTime, bool ForceDelete, bool AllowRerecord)
Definition: dvr.cpp:169
Recording Only is a TVRec only state for when we are recording a program, but there is no one current...
Definition: tv.h:84
This class is used as a container for messages.
Definition: mythevent.h:15
RecRuleFilter * AddNewRecRuleFilter()
static QString toString(Type, uint id)
static void GetAllScheduled(QStringList &strList, SchedSortColumn sortBy=kSortTitle, bool ascending=true)
Returns all scheduled programs serialized into a QStringList.
Definition: scheduler.cpp:1812
static QMap< QString, uint32_t > QueryInUseMap(void)
bool m_autoMetadataLookup
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
int m_findday
callsign?
Definition: recordingrule.h:94
QMap< int, EncoderLink * > tvList
QString m_playGroup
QString DupMethodToString(QString DupMethod)
Definition: dvr.cpp:1238
Input * AddNewInput()
Definition: inputList.h:59
QString m_description
Definition: recordingrule.h:77
QString RecStatusToDescription(int RecStatus, int RecType, const QDateTime &StartTime)
Definition: dvr.cpp:1194
bool GetAllPending(RecList &retList, int recRuleId=0) const
Definition: scheduler.cpp:1718
QString RecTypeToString(QString RecType)
Definition: dvr.cpp:1204
static MSqlQueryInfo InitCon(ConnectionReuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:542
Internal representation of a recording rule, mirrors the record table.
Definition: recordingrule.h:31
static QList< InputInfo > GetAllInputInfo()
Definition: cardutil.cpp:1067
void GetAllExpiring(QStringList &strList)
Gets the full list of programs that can expire in expiration order.
Definition: autoexpire.cpp:841
QString m_seriesid
Definition: recordingrule.h:87
int m_parentRecID
Unique Recording Rule ID.
Definition: recordingrule.h:70
RecordingDupInType m_dupIn
QString RecTypeToDescription(QString RecType)
Definition: dvr.cpp:1214
void dispatch(const MythEvent &event)
QString m_inetref
Definition: recordingrule.h:89
bool AddDontRecordSchedule(int ChanId, const QDateTime &StartTime, bool NeverRecord)
Definition: dvr.cpp:1005
Encoder * AddNewEncoder()
Definition: encoderList.h:59
DTC::ProgramList * GetUpcomingList(int StartIndex, int Count, bool ShowAll, int RecordId, int RecStatus)
Definition: dvr.cpp:549
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:810
RecRule * AddNewRecRule()
Definition: recRuleList.h:72
QString GetRecordingGroup(void) const
Definition: programinfo.h:402
DTC::RecRule * GetRecordSchedule(uint RecordId, QString Template, int nRecordedId, int ChanId, QDateTime StartTime, bool MakeOverride)
Definition: dvr.cpp:1095
bool UnDeleteRecording(int RecordedId, int ChanId, const QDateTime &StartTime)
Definition: dvr.cpp:213
QString m_title
Recording rule is enabled?
Definition: recordingrule.h:75
Used to expire recordings to make space for new recordings.
Definition: autoexpire.h:62
void ApplyNeverRecord(void)
Set this program to never be recorded by inserting 'history' for it into the database with a status o...
QString DupInToDescription(QString DupIn)
Definition: dvr.cpp:1231
DTC::Program * GetRecorded(int RecordedId, int ChanId, const QDateTime &StartTime)
Definition: dvr.cpp:145
static QMap< QString, bool > QueryJobsRunning(int type)
QString m_recProfile
bool HasPathname(void) const
Definition: programinfo.h:343
void SaveWatched(bool watchedFlag)
Set "watched" field in recorded/videometadata to "watchedFlag".
DTC::EncoderList * GetEncoderList()
Definition: dvr.cpp:317
static QStringList GetNames(void)
Definition: playgroup.cpp:173
virtual QMap< QString, ProgramInfo * > GetRecording(void) const =0
bool RemoveRecordSchedule(uint RecordId)
Definition: dvr.cpp:990
bool Load(bool asTemplate=false)
unsigned m_filter
QString GetStorageGroup(void) const
Definition: programinfo.h:405
QString m_category
Definition: recordingrule.h:80
bool LoadFromRecorded(ProgramList &destination, bool possiblyInProgressRecordingsOnly, const QMap< QString, uint32_t > &inUseMap, const QMap< QString, bool > &isJobRunning, const QMap< QString, ProgramInfo * > &recMap, int sort)
bool LoadTemplate(QString category, QString categoryType="Default")
DTC::InputList * GetInputList()
Definition: dvr.cpp:388
DTC::ProgramList * GetRecordedList(bool Descending, int StartIndex, int Count, const QString &TitleRegEx, const QString &RecGroup, const QString &StorageGroup)
Definition: dvr.cpp:62
std::deque< RecordingInfo * > RecList
Definition: mythscheduler.h:10
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:610
vector< ProgramInfo * > pginfolist_t
Definition: autoexpire.h:23
QStringList GetRecGroupList()
Definition: dvr.cpp:408
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:355
RecordingDupInType dupInFromString(QString type)
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:181
void FillInputInfo(DTC::Input *input, InputInfo inputInfo)
bool MakeOverride(void)
bool DisableRecordSchedule(uint RecordId)
Definition: dvr.cpp:1168
QString GetHostName(void)
bool UpdateRecordSchedule(uint RecordId, QString Title, QString Subtitle, QString Description, QString Category, QDateTime StartTime, QDateTime EndTime, QString SeriesId, QString ProgramId, int ChanId, QString Station, int FindDay, QTime FindTime, bool Inactive, uint Season, uint Episode, QString Inetref, QString Type, QString SearchType, int RecPriority, uint PreferredInput, int StartOffset, int EndOffset, QString DupMethod, QString DupIn, uint Filter, QString RecProfile, QString RecGroup, QString StorageGroup, QString PlayGroup, bool AutoExpire, int MaxEpisodes, bool MaxNewest, bool AutoCommflag, bool AutoTranscode, bool AutoMetaLookup, bool AutoUserJob1, bool AutoUserJob2, bool AutoUserJob3, bool AutoUserJob4, int Transcoder)
Definition: dvr.cpp:832
Default UTC.
Definition: mythdate.h:14
bool EnableRecordSchedule(uint RecordId)
Definition: dvr.cpp:1148
QStringList GetTitleList(const QString &RecGroup)
Definition: dvr.cpp:476
QString GetTitle(void) const
Definition: programinfo.h:346
RecSearchType m_searchType
uint AddRecordSchedule(QString Title, QString Subtitle, QString Description, QString Category, QDateTime StartTime, QDateTime EndTime, QString SeriesId, QString ProgramId, int ChanId, QString Station, int FindDay, QTime FindTime, int ParentId, bool Inactive, uint Season, uint Episode, QString Inetref, QString Type, QString SearchType, int RecPriority, uint PreferredInput, int StartOffset, int EndOffset, QString DupMethod, QString DupIn, uint Filter, QString RecProfile, QString RecGroup, QString StorageGroup, QString PlayGroup, bool AutoExpire, int MaxEpisodes, bool MaxNewest, bool AutoCommflag, bool AutoTranscode, bool AutoMetaLookup, bool AutoUserJob1, bool AutoUserJob2, bool AutoUserJob3, bool AutoUserJob4, int Transcoder)
Definition: dvr.cpp:691
bool IsValid(QString &text)