Ticket #11495: mythtv-0.27-serviceapi-dvr-editschedule.patch

File mythtv-0.27-serviceapi-dvr-editschedule.patch, 10.5 KB (added by dev-team@…, 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..4d5de0b 100644
    a b  
    3838class SERVICE_PUBLIC DvrServices : public Service  //, public QScriptable ???
    3939{
    4040    Q_OBJECT
    41     Q_CLASSINFO( "version"    , "1.6" );
     41    Q_CLASSINFO( "version"    , "1.7" );
    4242    Q_CLASSINFO( "RemoveRecordedItem_Method",                   "POST" )
    4343    Q_CLASSINFO( "AddRecordSchedule_Method",                    "POST" )
    4444    Q_CLASSINFO( "RemoveRecordSchedule_Method",                 "POST" )
    4545    Q_CLASSINFO( "EnableRecordSchedule_Method",                 "POST" )
    4646    Q_CLASSINFO( "DisableRecordSchedule_Method",                "POST" )
     47    Q_CLASSINFO( "EditRecordSchedule_Method",                   "POST" )
    4748
    4849    public:
    4950
     
    127128                                                           bool      AutoUserJob4,
    128129                                                           int       Transcoder        ) = 0;
    129130
     131        virtual bool               EditRecordSchedule    ( int       RecordId,
     132                                                           bool      Inactive,
     133                                                           uint      Season,
     134                                                           uint      Episode,
     135                                                           QString   Inetref,
     136                                                           int       FindId,
     137                                                           QString   Type,
     138                                                           QString   SearchType,
     139                                                           int       RecPriority,
     140                                                           uint      PreferredInput,
     141                                                           int       StartOffset,
     142                                                           int       EndOffset,
     143                                                           QString   DupMethod,
     144                                                           QString   DupIn,
     145                                                           uint      Filter,
     146                                                           QString   RecProfile,
     147                                                           QString   RecGroup,
     148                                                           QString   StorageGroup,
     149                                                           QString   PlayGroup,
     150                                                           bool      AutoExpire,
     151                                                           int       MaxEpisodes,
     152                                                           bool      MaxNewest,
     153                                                           bool      AutoCommflag,
     154                                                           bool      AutoTranscode,
     155                                                           bool      AutoMetaLookup,
     156                                                           bool      AutoUserJob1,
     157                                                           bool      AutoUserJob2,
     158                                                           bool      AutoUserJob3,
     159                                                           bool      AutoUserJob4,
     160                                                           int       Transcoder        ) = 0;
     161
    130162        virtual bool               RemoveRecordSchedule  ( uint             RecordId   ) = 0;
    131163
    132164        virtual DTC::RecRuleList*  GetRecordScheduleList ( int              StartIndex,
  • mythtv/programs/mythbackend/services/dvr.cpp

    diff --git a/mythtv/programs/mythbackend/services/dvr.cpp b/mythtv/programs/mythbackend/services/dvr.cpp
    index 25df8b1..dd59f39 100644
    a b  
    601601    return recid;
    602602}
    603603
     604bool Dvr::EditRecordSchedule ( int       nRecordId,
     605                               bool      bInactive,
     606                               uint      nSeason,
     607                               uint      nEpisode,
     608                               QString   sInetref,
     609                               int       nFindId,
     610                               QString   sType,
     611                               QString   sSearchType,
     612                               int       nRecPriority,
     613                               uint      nPreferredInput,
     614                               int       nStartOffset,
     615                               int       nEndOffset,
     616                               QString   sDupMethod,
     617                               QString   sDupIn,
     618                               uint      nFilter,
     619                               QString   sRecProfile,
     620                               QString   sRecGroup,
     621                               QString   sStorageGroup,
     622                               QString   sPlayGroup,
     623                               bool      bAutoExpire,
     624                               int       nMaxEpisodes,
     625                               bool      bMaxNewest,
     626                               bool      bAutoCommflag,
     627                               bool      bAutoTranscode,
     628                               bool      bAutoMetaLookup,
     629                               bool      bAutoUserJob1,
     630                               bool      bAutoUserJob2,
     631                               bool      bAutoUserJob3,
     632                               bool      bAutoUserJob4,
     633                               int       nTranscoder)
     634{
     635    bool bResult = false;
     636
     637    if (nRecordId <= 0 )
     638        throw( QString("Record ID appears invalid."));
     639
     640    RecordingRule pRule;
     641    pRule.m_recordID = nRecordId;
     642    pRule.Load();
     643
     644    if (pRule.IsLoaded())
     645    {
     646        pRule.m_isInactive = bInactive;
     647        if (sType.isEmpty())
     648            sType = "single";
     649
     650        if (sSearchType.isEmpty())
     651            sSearchType = "none";
     652
     653        if (sDupMethod.isEmpty())
     654            sDupMethod = "subtitleanddescription";
     655
     656        if (sDupIn.isEmpty())
     657            sDupIn = "all";
     658
     659        pRule.m_type = recTypeFromString(sType);
     660        pRule.m_searchType = searchTypeFromString(sSearchType);
     661        pRule.m_dupMethod = dupMethodFromString(sDupMethod);
     662        pRule.m_dupIn = dupInFromString(sDupIn);
     663
     664        if (sRecProfile.isEmpty())
     665            sRecProfile = "Default";
     666
     667        if (sRecGroup.isEmpty())
     668            sRecGroup = "Default";
     669
     670        if (sStorageGroup.isEmpty())
     671            sStorageGroup = "Default";
     672
     673        if (sPlayGroup.isEmpty())
     674            sPlayGroup = "Default";
     675
     676        pRule.m_recProfile = sRecProfile;
     677        pRule.m_recGroup = sRecGroup;
     678        pRule.m_storageGroup = sStorageGroup;
     679        pRule.m_playGroup = sPlayGroup;
     680
     681        pRule.m_isInactive = bInactive;
     682
     683        pRule.m_season = nSeason;
     684        pRule.m_episode = nEpisode;
     685        pRule.m_inetref = sInetref;
     686        pRule.m_findid = nFindId;
     687
     688        pRule.m_recPriority = nRecPriority;
     689        pRule.m_prefInput = nPreferredInput;
     690        pRule.m_startOffset = nStartOffset;
     691        pRule.m_endOffset = nEndOffset;
     692        pRule.m_filter = nFilter;
     693
     694        pRule.m_autoExpire = bAutoExpire;
     695        pRule.m_maxEpisodes = nMaxEpisodes;
     696        pRule.m_maxNewest = bMaxNewest;
     697
     698        pRule.m_autoCommFlag = bAutoCommflag;
     699        pRule.m_autoTranscode = bAutoTranscode;
     700        pRule.m_autoMetadataLookup = bAutoMetaLookup;
     701
     702        pRule.m_autoUserJob1 = bAutoUserJob1;
     703        pRule.m_autoUserJob2 = bAutoUserJob2;
     704        pRule.m_autoUserJob3 = bAutoUserJob3;
     705        pRule.m_autoUserJob4 = bAutoUserJob4;
     706
     707        pRule.m_transcoder = nTranscoder;
     708
     709        pRule.Save();
     710        bResult = true;
     711    }
     712    return bResult;
     713}
     714
    604715bool Dvr::RemoveRecordSchedule ( uint nRecordId )
    605716{
    606717    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..40fc1cf 100644
    a b  
    109109                                                bool      AutoUserJob4,
    110110                                                int       Transcoder);
    111111
     112        bool               EditRecordSchedule ( int       RecordId,
     113                                                bool      Inactive,
     114                                                uint      Season,
     115                                                uint      Episode,
     116                                                QString   Inetref,
     117                                                int       FindId,
     118                                                QString   Type,
     119                                                QString   SearchType,
     120                                                int       RecPriority,
     121                                                uint      PreferredInput,
     122                                                int       StartOffset,
     123                                                int       EndOffset,
     124                                                QString   DupMethod,
     125                                                QString   DupIn,
     126                                                uint      Filter,
     127                                                QString   RecProfile,
     128                                                QString   RecGroup,
     129                                                QString   StorageGroup,
     130                                                QString   PlayGroup,
     131                                                bool      AutoExpire,
     132                                                int       MaxEpisodes,
     133                                                bool      MaxNewest,
     134                                                bool      AutoCommflag,
     135                                                bool      AutoTranscode,
     136                                                bool      AutoMetaLookup,
     137                                                bool      AutoUserJob1,
     138                                                bool      AutoUserJob2,
     139                                                bool      AutoUserJob3,
     140                                                bool      AutoUserJob4,
     141                                                int       Transcoder);
     142
    112143        bool              RemoveRecordSchedule ( uint             RecordId   );
    113144
    114145        DTC::RecRuleList* GetRecordScheduleList( int              StartIndex,