Opened 14 years ago
Closed 14 years ago
#3242 closed defect (fixed)
Scheduler fails to record programs that match multiple recording rules, depending on which rule is matched first.
Reported by: | anonymous | Owned by: | Isaac Richards |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | 0.20 |
Severity: | medium | Keywords: | schedule multiple match rules |
Cc: | Ticket locked: | no |
Description
If a particular program would be recorded under more than one recording rule (in my case a custom rule), it appears that whichever rule is found to match first determines wether the episode will be recorded, rather than all the rules being checked to see if it can be recorded as it should.
As an example, if there is one recording rule to record any program in the "Comedy" genre with an episode limit of 5, and a second rule to record a particular show title that is also happens to be in the "Comedy" genre, if the first rule has already reached its limit of 5 episodes, the recording is marked as "T" and is not allocated to and recorded under the second rule even if that rule has not reached its episode limit or has no limit set.
I have dug in and found a semi-reasonable workaround for this bug. In scheduler.cpp's comp_overlap() function, add the following two lines somewhere before the final line (I tested it immediately before the final line, but it might be better to be higher in the list, like after the title or chanid test):
if (a->recpriority != b->recpriority)
This gives a preference in the PruneOverlaps? function to allocate potential recordings to higher priority recording rules first. A better solution would be to key off of whether the rule is actually able to record programs, as this workaround still doesn't handle some possible cases very well, but the necessary info for a better fix doesn't appear to be currently available in the ProgramInfo? struct. So this seemed like the best solution without requiring fairly extensive changes.
Tested, and works ok here as long as the overlapping rules are given different priorities, and as long as it is ok that the lower priority rule will never be able to record a show that matches the higher priority rule.