Opened 18 years ago

Closed 18 years ago

#1654 closed patch (fixed)

Auto-expire doesn't handle max episodes when overrides are involved

Reported by: derek@… Owned by: cpinkham
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

I have a recording rule for Blue Jays games with a max episode limit of 1 and 'record new and expire old' set to true. Today's game recorded, but it didn't expire yesterday's game. I traced it down to the fact that yesterday's game had an override added to it so the recordid for that recording didn't match my recording rule and therefore the autoexpirer didn't count the number of episodes properly.

My fix is to include a new column in recorded called parentid, which holds the recordid of the base recording rule and then this column is used by the autoexpirer to count the episodes properly. I have this working and the autoexpirer now properly counts the episodes when I manually set the parentid column for rows in recorded.

What I'm not able to get working properly is automatically setting the parentid column. I'm trying to update it when changes are made to the recorded table, but I'm obviously not quite understanding how changes are made to the recorded table when an override is introduced during an active recording.

I've attached my patch as it stands now, if someone can have a look at what I'm doing wrong and point me in the right direction for setting the parentid then I'd be more than willing to finish up this patch. As it stands, the parentid is always being set to 0 (which is also the column's default value).

Attachments (2)

autoexpire.patch (5.2 KB) - added by derek@… 18 years ago.
fix max episode check in auto-expire; work in progress
autoexpire.final.patch (5.9 KB) - added by derek@… 18 years ago.
autoexpire fix for max episode rules; replaces previous patch

Download all attachments as: .zip

Change History (11)

Changed 18 years ago by derek@…

Attachment: autoexpire.patch added

fix max episode check in auto-expire; work in progress

comment:1 Changed 18 years ago by derek@…

After some tracing of the code, I've got this all working, including the proper setting of the parentid in the recorded table. I'm running the patch now and initial testing looks good - going to test it more thoroughly tomorrow and will post the final patch when verified.

I also included a slightly modified patch for #1658 as that ticket addresses a similar problem with counting recorded episodes. The only mod is to make use of the parentid introduced here to better count episodes properly.

comment:2 Changed 18 years ago by derek@…

Fix attached as 'autoexpire.final.patch'. This patch replaces the first one. This fix adds a new column to recorded called parentid that holds the recordid the recording was based off of in case it's using an override. With this information, the max episode autoexpire rules are properly calculated. The patch from #1658 is also included in this patch, slightly modified to make use of the parentid field created here.

Changed 18 years ago by derek@…

Attachment: autoexpire.final.patch added

autoexpire fix for max episode rules; replaces previous patch

comment:3 Changed 18 years ago by cpinkham

Owner: changed from Isaac Richards to cpinkham

comment:4 Changed 18 years ago by cpinkham

Milestone: 0.21

comment:5 in reply to:  4 Changed 18 years ago by derek@…

Replying to cpinkham:

If it makes any difference, I've been running this patch since I wrote it on my own system (3+ months) with no problems and the desired/expected results. I mention it just in case it gets this patch committed to SVN a little sooner. :-)

comment:6 Changed 18 years ago by cpinkham

Milestone: 0.210.20

I'll check it out. Moving back to 0.20.

comment:7 Changed 18 years ago by cpinkham

Milestone: 0.200.21

I wasn't able to get this in before the feature freeze, moving back to 0.21.

comment:8 Changed 18 years ago by derek@…

Appears this patch may be obsoleted by Bruce's commit [11124]. Thread started on dev list asking for confirmation, but looking at Bruce's changeset, it does seem like this patch would no longer be needed.

comment:9 Changed 18 years ago by bjm

Resolution: fixed
Status: newclosed

Obsoleted by [11124]. Override recording files are now associated with their parentid by storing this recordid value in the 'recorded' table. This was done for other reasons but will resolve this issue as well. This is not retroactive but new override recordings will count for the max episodes of the parent rule.

Note: See TracTickets for help on using tickets.