Deleting records from channel table

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
bklein
Junior
Posts: 24
Joined: Sat Sep 19, 2020 6:09 am
Australia

Deleting records from channel table

Post by bklein » Fri Oct 16, 2020 9:21 pm

I have multiple duplicate channels and sources in my channel table. I have updated all the redundant channels to be not visible, but would like to clean things further by deleting the redundant channel records. I see that if you delete a channel in MythTV backend that the date and time are inserted into the channel table - but subsequently the records are deleted from the table. Is this because a routine runs to insert channel information into prior recorded shows before the record is deleted? What would be the best way to delete the redundant records without breaking anything? Would it be to update them with the current date and time in the deleted field? Also, I have 55 channels where the channum is empty. Is it safe to say that no recordings would ever have been made on these channel records and that they can safely be deleted from the table?

User avatar
kmdewaal
Developer
Posts: 142
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: Deleting records from channel table

Post by kmdewaal » Sat Oct 17, 2020 7:26 am

I would start with deleting unused video sources. All channels associated with these video sources are then also deleted. And yes, deletion of a channel means that date&time are entered in the deleted field and this means the channel record will be deleted when there is no recording anymore from that channel. This is done automatically.
It is recommended to do everything with mythtv-setup including deletion of video sources and of channels as this keeps the database consistent.
N.B. Do NOT click the button "delete all video sources" because that WILL delete all video sources and all channels for real in v31 (fixed in master).

bklein
Junior
Posts: 24
Joined: Sat Sep 19, 2020 6:09 am
Australia

Re: Deleting records from channel table

Post by bklein » Sat Oct 17, 2020 11:51 am

Great. Thanks. So deleting unused sources individually will write the date and time to all those source's channels - and delete the channel records from the database when there are no more recordings from that channel?

User avatar
kmdewaal
Developer
Posts: 142
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: Deleting records from channel table

Post by kmdewaal » Sat Oct 17, 2020 3:58 pm

Yes

bklein
Junior
Posts: 24
Joined: Sat Sep 19, 2020 6:09 am
Australia

Re: Deleting records from channel table

Post by bklein » Sat Oct 17, 2020 9:43 pm

Thanks

Post Reply