I use tv_grab_zz_sdjson_sqlite. I notice there are about four duplicate channels. mythfilldatabase.log shows they are skipped as 'Unknown xmltv channel identifier.'
Any idea how this could happen? Is the data coming duplicated from SchedulesDirect, or could it be "old channel" info that didn't get cleaned up? Is there a way to reinitialize the sqlite db without "breaking" it?
It's not causing a real problem, but I have some channel scans to do soon (new channel on-the-air but not in SD data yet, and several subchannels changed networks) so I might as well fix this if possible, while I'm at it.
Duplicate channels in sqlite db, best way to fix?
Moderator: Forum Moderators
Re: Duplicate channels in sqlite db, best way to fix?
It sounds like you have some channels selected in sqlite that are not in your MythTV database. You can deselect them with sqlite.
Locate the sqlite database, it will be called SchedulesDirect.DB or similar, in your .xmltv directory or possibly somewhere in the .mythtv directory.
sqlite3 SchedulesDirect.DB
select * from channels;
In the channel table, set selected to 0 for those you do not want. Example:
update channels set selected = 0
where channum+0 >= 300 and channum+0 <= 336;
Note: I use the "+0" syntax to force a numeric check, otherwise it may regard channel 31 as being between 300 and 336.
Locate the sqlite database, it will be called SchedulesDirect.DB or similar, in your .xmltv directory or possibly somewhere in the .mythtv directory.
sqlite3 SchedulesDirect.DB
select * from channels;
In the channel table, set selected to 0 for those you do not want. Example:
update channels set selected = 0
where channum+0 >= 300 and channum+0 <= 336;
Note: I use the "+0" syntax to force a numeric check, otherwise it may regard channel 31 as being between 300 and 336.
Re: Duplicate channels in sqlite db, best way to fix?
When I say duplicate, I don't just mean "same network," I mean actual duplicates in sqlite SchedulesDirect.DB with the same channum, atscMajor, atscMinor, uhfVhf, but different station (id.) I know how to deselect them but I don't know how it happened and want to know how to clean up the sd database.
Re: Duplicate channels in sqlite db, best way to fix?
Well, the duplicates are from SD itself. I just set up a new database as a test (different directory and config, so it's "clean") and the duplicates are there. In fact besides the duplicate channel numbers, it also has some pre-repack channels with the old channel numbers. So I guess it doesn't cause any harm.