Ticket #11495: mythtv-0.27-serviceapi-dvr-editschedule.3.patch
File mythtv-0.27-serviceapi-dvr-editschedule.3.patch, 19.6 KB (added by , 11 years ago) |
---|
-
mythtv/libs/libmythservicecontracts/services/dvrServices.h
diff --git a/mythtv/libs/libmythservicecontracts/services/dvrServices.h b/mythtv/libs/libmythservicecontracts/services/dvrServices.h index d680375..5a8f4b7 100644
a b 38 38 class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ??? 39 39 { 40 40 Q_OBJECT 41 Q_CLASSINFO( "version" , "1. 6" );41 Q_CLASSINFO( "version" , "1.7" ); 42 42 Q_CLASSINFO( "RemoveRecordedItem_Method", "POST" ) 43 43 Q_CLASSINFO( "AddRecordSchedule_Method", "POST" ) 44 44 Q_CLASSINFO( "RemoveRecordSchedule_Method", "POST" ) 45 45 Q_CLASSINFO( "EnableRecordSchedule_Method", "POST" ) 46 46 Q_CLASSINFO( "DisableRecordSchedule_Method", "POST" ) 47 Q_CLASSINFO( "UpdateRecordSchedule_Method", "POST" ) 47 48 48 49 public: 49 50 … … 94 95 95 96 // Recording Rules 96 97 97 virtual int AddRecordSchedule ( int ChanId, 98 virtual int AddRecordSchedule ( QString Title, 99 QString Subtitle, 100 QString Description, 101 QString Category, 98 102 QDateTime StartTime, 103 QDateTime EndTime, 104 QString SeriesId, 105 QString ProgramId, 106 int ChanId, 107 QString Station, 108 int FindDay, 109 QTime FindTime, 99 110 int ParentId, 100 111 bool Inactive, 101 112 uint Season, 102 113 uint Episode, 103 114 QString Inetref, 104 int FindId, 115 QString Type, 116 QString SearchType, 117 int RecPriority, 118 uint PreferredInput, 119 int StartOffset, 120 int EndOffset, 121 QString DupMethod, 122 QString DupIn, 123 uint Filter, 124 QString RecProfile, 125 QString RecGroup, 126 QString StorageGroup, 127 QString PlayGroup, 128 bool AutoExpire, 129 int MaxEpisodes, 130 bool MaxNewest, 131 bool AutoCommflag, 132 bool AutoTranscode, 133 bool AutoMetaLookup, 134 bool AutoUserJob1, 135 bool AutoUserJob2, 136 bool AutoUserJob3, 137 bool AutoUserJob4, 138 int Transcoder ) = 0; 139 140 virtual bool UpdateRecordSchedule ( int RecordId, 141 QString Title, 142 QString Subtitle, 143 QString Description, 144 QString Category, 145 QDateTime StartTime, 146 QDateTime EndTime, 147 QString SeriesId, 148 QString ProgramId, 149 int ChanId, 150 QString Station, 151 int FindDay, 152 QTime FindTime, 153 bool Inactive, 154 uint Season, 155 uint Episode, 156 QString Inetref, 105 157 QString Type, 106 158 QString SearchType, 107 159 int RecPriority, -
mythtv/programs/mythbackend/services/dvr.cpp
diff --git a/mythtv/programs/mythbackend/services/dvr.cpp b/mythtv/programs/mythbackend/services/dvr.cpp index 25df8b1..77ad332 100644
a b 492 492 return pPrograms; 493 493 } 494 494 495 int Dvr::AddRecordSchedule ( int chanid, 495 int Dvr::AddRecordSchedule ( 496 QString sTitle, 497 QString sSubtitle, 498 QString sDescription, 499 QString sCategory, 496 500 QDateTime recstarttsRaw, 501 QDateTime recendtsRaw, 502 QString sSeriesId, 503 QString sProgramId, 504 int nChanId, 505 QString sStation, 506 int nFindDay, 507 QTime tFindTime, 497 508 int nParentId, 498 509 bool bInactive, 499 510 uint nSeason, 500 511 uint nEpisode, 501 512 QString sInetref, 502 int nFindId,503 513 QString sType, 504 514 QString sSearchType, 505 515 int nRecPriority, … … 526 536 int nTranscoder) 527 537 { 528 538 QDateTime recstartts = recstarttsRaw.toUTC(); 529 RecordingInfo info(chanid, recstartts, false); 539 QDateTime recendts = recendtsRaw.toUTC(); 540 RecordingInfo info(nChanId, recstartts, false); 530 541 RecordingRule *rule = info.GetRecordingRule(); 531 542 // ^ rule is owned by info and deleted when it leaves scope 532 543 … … 542 553 if (sDupIn.isEmpty()) 543 554 sDupIn = "all"; 544 555 545 rule->m_title = info.GetTitle(); 556 if (sTitle.isEmpty()) 557 rule->m_title = info.GetTitle(); 558 else 559 rule->m_title = sTitle; 560 561 if (sSubtitle.isEmpty()) 562 rule->m_subtitle = info.GetSubtitle(); 563 else 564 rule->m_subtitle = sSubtitle; 565 566 if(sDescription.isEmpty()) 567 rule->m_description = info.GetDescription(); 568 else 569 rule->m_description = sDescription; 570 546 571 rule->m_type = recTypeFromString(sType); 547 572 rule->m_searchType = searchTypeFromString(sSearchType); 548 573 rule->m_dupMethod = dupMethodFromString(sDupMethod); … … 560 585 if (sPlayGroup.isEmpty()) 561 586 sPlayGroup = "Default"; 562 587 588 if (sCategory.isEmpty()) 589 rule->m_category = info.GetCategory(); 590 else 591 rule->m_category = sCategory; 592 593 if (sSeriesId.isEmpty()) 594 rule->m_seriesid = info.GetSeriesID(); 595 else 596 rule->m_seriesid = sSeriesId; 597 598 if (sProgramId.isEmpty()) 599 rule->m_programid = info.GetProgramID(); 600 else 601 rule->m_programid = sProgramId; 602 603 if (!sStation.isEmpty()) 604 rule->m_station = sStation; 605 606 rule->m_findday = nFindDay; 607 rule->m_findtime = tFindTime; 608 563 609 rule->m_recProfile = sRecProfile; 564 610 rule->m_recGroup = sRecGroup; 565 611 rule->m_storageGroup = sStorageGroup; … … 571 617 rule->m_season = nSeason; 572 618 rule->m_episode = nEpisode; 573 619 rule->m_inetref = sInetref; 574 rule->m_findid = nFindId;575 620 576 621 rule->m_recPriority = nRecPriority; 577 622 rule->m_prefInput = nPreferredInput; … … 601 646 return recid; 602 647 } 603 648 649 bool Dvr::UpdateRecordSchedule ( int nRecordId, 650 QString sTitle, 651 QString sSubtitle, 652 QString sDescription, 653 QString sCategory, 654 QDateTime dStartTimeRaw, 655 QDateTime dEndTimeRaw, 656 QString sSeriesId, 657 QString sProgramId, 658 int nChanId, 659 QString sStation, 660 int nFindDay, 661 QTime tFindTime, 662 bool bInactive, 663 uint nSeason, 664 uint nEpisode, 665 QString sInetref, 666 QString sType, 667 QString sSearchType, 668 int nRecPriority, 669 uint nPreferredInput, 670 int nStartOffset, 671 int nEndOffset, 672 QString sDupMethod, 673 QString sDupIn, 674 uint nFilter, 675 QString sRecProfile, 676 QString sRecGroup, 677 QString sStorageGroup, 678 QString sPlayGroup, 679 bool bAutoExpire, 680 int nMaxEpisodes, 681 bool bMaxNewest, 682 bool bAutoCommflag, 683 bool bAutoTranscode, 684 bool bAutoMetaLookup, 685 bool bAutoUserJob1, 686 bool bAutoUserJob2, 687 bool bAutoUserJob3, 688 bool bAutoUserJob4, 689 int nTranscoder) 690 { 691 bool bResult = false; 692 693 if (nRecordId <= 0 ) 694 throw( QString("Record ID appears invalid.")); 695 696 RecordingRule pRule; 697 pRule.m_recordID = nRecordId; 698 pRule.Load(); 699 700 if (pRule.IsLoaded()) 701 { 702 QDateTime recstartts = dStartTimeRaw.toUTC(); 703 QDateTime recendts = dEndTimeRaw.toUTC(); 704 705 pRule.m_isInactive = bInactive; 706 if (sType.isEmpty()) 707 sType = "single"; 708 709 if (sSearchType.isEmpty()) 710 sSearchType = "none"; 711 712 if (sDupMethod.isEmpty()) 713 sDupMethod = "subtitleanddescription"; 714 715 if (sDupIn.isEmpty()) 716 sDupIn = "all"; 717 718 pRule.m_type = recTypeFromString(sType); 719 pRule.m_searchType = searchTypeFromString(sSearchType); 720 pRule.m_dupMethod = dupMethodFromString(sDupMethod); 721 pRule.m_dupIn = dupInFromString(sDupIn); 722 723 if (sRecProfile.isEmpty()) 724 sRecProfile = "Default"; 725 726 if (sRecGroup.isEmpty()) 727 sRecGroup = "Default"; 728 729 if (sStorageGroup.isEmpty()) 730 sStorageGroup = "Default"; 731 732 if (sPlayGroup.isEmpty()) 733 sPlayGroup = "Default"; 734 735 736 if (!sTitle.isEmpty()) 737 pRule.m_title = sTitle; 738 739 if (!sSubtitle.isEmpty()) 740 pRule.m_subtitle = sSubtitle; 741 742 if(!sDescription.isEmpty()) 743 pRule.m_description = sDescription; 744 745 746 if (!sCategory.isEmpty()) 747 pRule.m_category = sCategory; 748 749 if (!sSeriesId.isEmpty()) 750 pRule.m_seriesid = sSeriesId; 751 752 if (!sProgramId.isEmpty()) 753 pRule.m_programid = sProgramId; 754 755 if (!sStation.isEmpty()) 756 pRule.m_station = sStation; 757 758 pRule.m_startdate = recstartts.date(); 759 pRule.m_starttime = recstartts.time(); 760 761 pRule.m_enddate = recendts.date(); 762 pRule.m_endtime = recendts.time(); 763 764 pRule.m_findday = nFindDay; 765 pRule.m_findtime = tFindTime; 766 767 pRule.m_recProfile = sRecProfile; 768 pRule.m_recGroup = sRecGroup; 769 pRule.m_storageGroup = sStorageGroup; 770 pRule.m_playGroup = sPlayGroup; 771 772 pRule.m_isInactive = bInactive; 773 774 pRule.m_season = nSeason; 775 pRule.m_episode = nEpisode; 776 pRule.m_inetref = sInetref; 777 778 pRule.m_recPriority = nRecPriority; 779 pRule.m_prefInput = nPreferredInput; 780 pRule.m_startOffset = nStartOffset; 781 pRule.m_endOffset = nEndOffset; 782 pRule.m_filter = nFilter; 783 784 pRule.m_autoExpire = bAutoExpire; 785 pRule.m_maxEpisodes = nMaxEpisodes; 786 pRule.m_maxNewest = bMaxNewest; 787 788 pRule.m_autoCommFlag = bAutoCommflag; 789 pRule.m_autoTranscode = bAutoTranscode; 790 pRule.m_autoMetadataLookup = bAutoMetaLookup; 791 792 pRule.m_autoUserJob1 = bAutoUserJob1; 793 pRule.m_autoUserJob2 = bAutoUserJob2; 794 pRule.m_autoUserJob3 = bAutoUserJob3; 795 pRule.m_autoUserJob4 = bAutoUserJob4; 796 797 pRule.m_transcoder = nTranscoder; 798 799 pRule.Save(); 800 bResult = true; 801 } 802 return bResult; 803 } 804 604 805 bool Dvr::RemoveRecordSchedule ( uint nRecordId ) 605 806 { 606 807 bool bResult = false; -
mythtv/programs/mythbackend/services/dvr.h
diff --git a/mythtv/programs/mythbackend/services/dvr.h b/mythtv/programs/mythbackend/services/dvr.h index 9e23e75..600e5bc 100644
a b 76 76 77 77 // Recording Rules 78 78 79 int AddRecordSchedule ( int ChanId, 79 int AddRecordSchedule ( QString Title, 80 QString Subtitle, 81 QString Description, 82 QString Category, 80 83 QDateTime StartTime, 84 QDateTime EndTime, 85 QString SeriesId, 86 QString ProgramId, 87 int ChanId, 88 QString Station, 89 int FindDay, 90 QTime FindTime, 81 91 int ParentId, 82 92 bool Inactive, 83 93 uint Season, 84 94 uint Episode, 85 95 QString Inetref, 86 int FindId,87 96 QString Type, 88 97 QString SearchType, 89 98 int RecPriority, … … 109 118 bool AutoUserJob4, 110 119 int Transcoder); 111 120 121 bool UpdateRecordSchedule ( int RecordId, 122 QString Title, 123 QString Subtitle, 124 QString Description, 125 QString Category, 126 QDateTime StartTime, 127 QDateTime EndTime, 128 QString SeriesId, 129 QString ProgramId, 130 int ChanId, 131 QString Station, 132 int FindDay, 133 QTime FindTime, 134 bool Inactive, 135 uint Season, 136 uint Episode, 137 QString Inetref, 138 QString Type, 139 QString SearchType, 140 int RecPriority, 141 uint PreferredInput, 142 int StartOffset, 143 int EndOffset, 144 QString DupMethod, 145 QString DupIn, 146 uint Filter, 147 QString RecProfile, 148 QString RecGroup, 149 QString StorageGroup, 150 QString PlayGroup, 151 bool AutoExpire, 152 int MaxEpisodes, 153 bool MaxNewest, 154 bool AutoCommflag, 155 bool AutoTranscode, 156 bool AutoMetaLookup, 157 bool AutoUserJob1, 158 bool AutoUserJob2, 159 bool AutoUserJob3, 160 bool AutoUserJob4, 161 int Transcoder); 162 112 163 bool RemoveRecordSchedule ( uint RecordId ); 113 164 114 165 DTC::RecRuleList* GetRecordScheduleList( int StartIndex,