@@ -117,6 +117,10 @@ PVR_ERROR Timers::GetTimers(kodi::addon::PVRTimersResultSet& results)
117
117
tag.SetEndTime (TIMER_DATE_MIN);
118
118
tag.SetStartAnyTime (true );
119
119
tag.SetEndAnyTime (true );
120
+ if (recordingType == 2 )
121
+ {
122
+ tag.SetTimerType (TIMER_REPEATING_EPG_ALL_EPISODES);
123
+ }
120
124
}
121
125
else
122
126
{
@@ -390,6 +394,7 @@ PVR_ERROR Timers::GetTimerTypes(std::vector<kodi::addon::PVRTimerType>& types)
390
394
static const int MSG_REPEATING_CHILD = 30144 ;
391
395
static const int MSG_REPEATING_KEYWORD = 30145 ;
392
396
static const int MSG_REPEATING_ADVANCED = 30171 ;
397
+ static const int MSG_REPEATING_ALL_EPISODES = 30218 ;
393
398
394
399
static const int MSG_KEEPALL = 30150 ;
395
400
static const int MSG_KEEP1 = 30151 ;
@@ -532,7 +537,7 @@ PVR_ERROR Timers::GetTimerTypes(std::vector<kodi::addon::PVRTimerType>& types)
532
537
types.emplace_back (*t);
533
538
delete t;
534
539
535
- /* Repeating epg based Parent*/
540
+ /* Repeating epg based Parent timeslot */
536
541
t = new TimerType (
537
542
/* Type id. */
538
543
TIMER_REPEATING_EPG,
@@ -545,6 +550,21 @@ PVR_ERROR Timers::GetTimerTypes(std::vector<kodi::addon::PVRTimerType>& types)
545
550
types.emplace_back (*t);
546
551
delete t;
547
552
553
+ /* Repeating epg based all episode*/
554
+ t = new TimerType (
555
+ /* Type id. */
556
+ TIMER_REPEATING_EPG_ALL_EPISODES,
557
+ /* Attributes. */
558
+ TIMER_EPG_ATTRIBS | TIMER_REPEATING_EPG_ATTRIBS & ~(PVR_TIMER_TYPE_SUPPORTS_WEEKDAYS),
559
+ /* Description. */
560
+ GetTimerDescription (MSG_REPEATING_ALL_EPISODES), // "Repeating (All episodes)"
561
+ /* Values definitions for attributes. */
562
+ recordingLimitValues, m_defaultLimit, showTypeValues, m_defaultShowType, recordingGroupValues, 0 );
563
+ types.emplace_back (*t);
564
+ delete t;
565
+
566
+
567
+
548
568
/* Read-only one-shot for timers generated by timerec */
549
569
t = new TimerType (
550
570
/* Type id. */
@@ -669,6 +689,7 @@ PVR_ERROR Timers::AddTimer(const kodi::addon::PVRTimer& timer)
669
689
const std::string encodedName = UriEncode (timer.GetTitle ());
670
690
const std::string encodedKeyword = UriEncode (timer.GetEPGSearchString ());
671
691
const std::string days = GetDayString (timer.GetWeekdays ());
692
+
672
693
const std::string directory = UriEncode (m_settings->m_recordingDirectories [timer.GetRecordingGroup ()]);
673
694
674
695
int epgOid = 0 ;
@@ -689,7 +710,18 @@ PVR_ERROR Timers::AddTimer(const kodi::addon::PVRTimer& timer)
689
710
marginEnd = m_settings->m_defaultPostPadding ;
690
711
}
691
712
692
- switch (timer.GetTimerType ())
713
+ int timerType = timer.GetTimerType ();
714
+ size_t countDays = std::count (days.begin (), days.end (), ' :' );
715
+ if (timerType == TIMER_REPEATING_EPG)
716
+ {
717
+ if (countDays > 1 && countDays < 7 )
718
+ {
719
+ // Backend doesn't support mixed days change to type 2 any episode
720
+ timerType = TIMER_REPEATING_EPG_ALL_EPISODES;
721
+ }
722
+ }
723
+
724
+ switch (timerType)
693
725
{
694
726
case TIMER_ONCE_MANUAL:
695
727
kodi::Log (ADDON_LOG_DEBUG, " TIMER_ONCE_MANUAL" );
@@ -735,7 +767,7 @@ PVR_ERROR Timers::AddTimer(const kodi::addon::PVRTimer& timer)
735
767
if (timer.GetEPGSearchString () == TYPE_7_TITLE)
736
768
{
737
769
kodi::Log (ADDON_LOG_DEBUG, " TIMER_REPEATING_EPG ANY CHANNEL - TYPE 7" );
738
- request = kodi::tools::StringUtils::Format (" recording.recurring.save&type =7&recurring_id=%d&start_time=%d&end_time=%d&keep=%d&pre_padding=%d&post_padding=%d&day_mask=%s&directory_id=%s%s" ,
770
+ request = kodi::tools::StringUtils::Format (" recording.recurring.save&recurring_type =7&recurring_id=%d&start_time=%d&end_time=%d&keep=%d&pre_padding=%d&post_padding=%d&day_mask=%s&directory_id=%s%s" ,
739
771
timer.GetClientIndex (),
740
772
static_cast <int >(timer.GetStartTime ()),
741
773
static_cast <int >(timer.GetEndTime ()),
@@ -769,21 +801,56 @@ PVR_ERROR Timers::AddTimer(const kodi::addon::PVRTimer& timer)
769
801
else
770
802
{
771
803
kodi::Log (ADDON_LOG_DEBUG, " TIMER_REPEATING_EPG" );
772
- // build recurring recording request
773
- request = kodi::tools::StringUtils::Format (" recording.recurring.save&recurring_id=%d&channel_id=%d&event_id=%d&keep=%d&pre_padding=%d&post_padding=%d&day_mask=%s&directory_id=%s&only_new=%s%s" ,
774
- timer.GetClientIndex (),
775
- timer.GetClientChannelUid (),
776
- epgOid,
777
- timer.GetMaxRecordings (),
778
- marginStart,
779
- marginEnd,
780
- days.c_str (),
781
- directory.c_str (),
782
- preventDuplicates,
783
- enabled.c_str ()
804
+ if (countDays == 7 )
805
+ {
806
+ // build recurring type 3 request for a daily request not automatic timeslot
807
+ request = kodi::tools::StringUtils::Format (" recording.recurring.save&recurring_type=3&recurring_id=%d&channel_id=%d&event_id=%d&keep=%d&pre_padding=%d&post_padding=%d&directory_id=%s&only_new=%s%s" ,
808
+ timer.GetClientIndex (),
809
+ timer.GetClientChannelUid (),
810
+ epgOid,
811
+ timer.GetMaxRecordings (),
812
+ marginStart,
813
+ marginEnd,
814
+ directory.c_str (),
815
+ preventDuplicates,
816
+ enabled.c_str ()
817
+ );
818
+ }
819
+ else
820
+ {
821
+ // NextPVR saves DAY, WEEKEND and WEEKDAY as timeslot recordings
822
+ request = kodi::tools::StringUtils::Format (" recording.recurring.save&recurring_id=%d&channel_id=%d&event_id=%d&keep=%d&pre_padding=%d&post_padding=%d&day_mask=%s&directory_id=%s&only_new=%s%s" ,
823
+ timer.GetClientIndex (),
824
+ timer.GetClientChannelUid (),
825
+ epgOid,
826
+ timer.GetMaxRecordings (),
827
+ marginStart,
828
+ marginEnd,
829
+ days.c_str (),
830
+ directory.c_str (),
831
+ preventDuplicates,
832
+ enabled.c_str ()
784
833
);
834
+ }
785
835
}
786
836
break ;
837
+ case TIMER_REPEATING_EPG_ALL_EPISODES:
838
+ // NextPVR doesn't support daymask but pass it anyway.
839
+ kodi::Log (ADDON_LOG_DEBUG, " TIMER_REPEATING_EPG_ALL_EPISODES" );
840
+ // build recurring type 2 request
841
+ request = kodi::tools::StringUtils::Format (" recording.recurring.save&recurring_type=2&recurring_id=%d&channel_id=%d&event_id=%d&keep=%d&pre_padding=%d&post_padding=%d&day_mask=%s&directory_id=%s&only_new=%s%s" ,
842
+ timer.GetClientIndex (),
843
+ timer.GetClientChannelUid (),
844
+ epgOid,
845
+ timer.GetMaxRecordings (),
846
+ marginStart,
847
+ marginEnd,
848
+ days.c_str (),
849
+ directory.c_str (),
850
+ preventDuplicates,
851
+ enabled.c_str ()
852
+ );
853
+ break ;
787
854
788
855
case TIMER_REPEATING_MANUAL:
789
856
kodi::Log (ADDON_LOG_DEBUG, " TIMER_REPEATING_MANUAL" );
0 commit comments