Opened 3 months ago

Last modified 7 weeks ago

#13473 assigned Patch - Feature

Get RecGroupIDs from the DB instead of hard-coding them in an enum

Reported by: mdabbs Owned by: Peter Bennett
Priority: minor Milestone: needs_triage
Component: MythTV - General Version: v30-fixes
Severity: medium Keywords: RecGroupID
Cc: Ticket locked: no

Description

This patch adds a method to retrieve the RecGroupID from the database instead of assuming that the enumerated values match the auto-increments from the DB.

For DBs that have auto-increments of something other than 1, this will provide the correct ID as it was assigned by the DB.

Attachments (1)

mythtv-fixes-30-recording-groups.patch (6.4 KB) - added by mdabbs 3 months ago.
Patch to provide ability to get RecGroupIDs form the DB instead of the enumeration

Download all attachments as: .zip

Change History (9)

Changed 3 months ago by mdabbs

Patch to provide ability to get RecGroupIDs form the DB instead of the enumeration

comment:1 Changed 3 months ago by Peter Bennett

Owner: set to Peter Bennett
Status: newassigned

comment:2 Changed 3 months ago by Peter Bennett

Before I can do anything about implementing this I need the name and email address of author of the code change to use in the github commit. I have the email address, but I do not know your name.

comment:3 Changed 3 months ago by mdabbs

Author name: Mike Dabbs

comment:4 Changed 3 months ago by Peter Bennett

My feelings on this

  • It likely affects very few users.
  • The proposed change adds database accesses.
  • It is possible that some users have decided to update the database and change the name of their default group to something else. The proposed change would clobber them.

I recommend a simple change rather in dbcheck.cpp to insert the special groups with the correct ids in the first place, regardless to the auto increment value. This should have been done at the start and this problem would never have happened.

For those who already have the wrong values, run this:

update recgroups set recgroupid = 1 where recgroup = 'Default';
update recorded set recgroupid = 1 where recgroup = 'Default';

Repeat for the other two special group names.

comment:5 Changed 2 months ago by Peter Bennett <pbennett@…>

In da558ca5f/mythtv:

dbcheck: Enforce correct recgroupids for special recording groups

If the mysql server is set up with auto_increment_increment=2 or
some value other than 1, the wrong values were set for the special
recording groups.

This only fixes it for new database setups or upgrades from schema
id 1320.

Refs #13473

comment:6 Changed 7 weeks ago by Peter Bennett <pbennett@…>

In 5cde0578d8/mythtv:

dbcheck: Enforce correct recgroupids for special recording groups

If the mysql server is set up with auto_increment_increment=2 or
some value other than 1, the wrong values were set for the special
recording groups.

This only fixes it for new database setups or upgrades from schema
id 1320.

Refs #13473

(cherry picked from commit da558ca5f531b8074155946b96c82ef4fe0ddefa)

comment:7 Changed 7 weeks ago by Peter Bennett <pbennett@…>

In 7668cc59ab/mythtv:

dbcheck: Enforce correct recgroupids for special recording groups

If the mysql server is set up with auto_increment_increment=2 or
some value other than 1, the wrong values were set for the special
recording groups.

This only fixes it for new database setups or upgrades from schema
id 1320.

Refs #13473

(cherry picked from commit da558ca5f531b8074155946b96c82ef4fe0ddefa)

comment:8 Changed 7 weeks ago by Peter Bennett <pbennett@…>

In bf8956a98/mythtv:

dbcheck: Enforce correct recgroupids for special recording groups

If the mysql server is set up with auto_increment_increment=2 or
some value other than 1, the wrong values were set for the special
recording groups.

This only fixes it for new database setups or upgrades from schema
id 1320.

Refs #13473

(cherry picked from commit da558ca5f531b8074155946b96c82ef4fe0ddefa)

Note: See TracTickets for help on using tickets.