[mythtv-users] Can't seem to delete channels

f-myth-users at media.mit.edu f-myth-users at media.mit.edu
Thu Jul 29 17:02:12 UTC 2021

    > Date: Thu, 29 Jul 2021 08:37:47 +0100
    > From: David Watkins <watkinshome at gmail.com>

    > Since relatively recently MythTV will hang on to deleted channels as long
    > as long as there are any recordings made from them.

    > They should be marked as 'deleted' in the database.

    > In my experience MythWeb has not been updated to work with this continues
    > to display them and shows strange behaviour if the same channel appears on
    > a different source.

I don't think this is a mythweb problem.  In the frontend right now, I'm
seeing it trying and failing to record two programs simultaneously from
the SD and HD source of a channel I don't get, which I set disabled last
night.  And I see upcoming recordings trying to record simultaneously
from the SD and HD versions of several other channels to which I do
subscribe, yet I disabled all SD channels which had HD equivalents.

I don't have any other sources.  I'm also surprised that my supposedly-
deleted channels appear to still be getting data fetched for them; I was
assuming that the grabber wouldn't bother to fetch, store in sqlite, or
give to the backend to store in mysql, channels that the user wasn't
going to use.

When I imported my old DB, Myth assigned all my old (standard-def, from
cable boxes) channels to source 1, even though they were source 3 on the
old system.  (Source 1 and source 2 on the old system haven't been
available in years because I'd switched cable providers, etc.)  Before
my first run of mfdb under v31, I used the Channel Editor to delete
all those old channels with the "delete all on this source" button
(or whatever it was called), since I wasn't planning to carry over the
recordings from that unit---just the recording schedules---and since all
those old channel numbers were wrong anyway.  -Those- channels are shown
as deleted in the channels table, with the timestamp of when I deleted

My -new- (Ceton) source apparently took up the ball of being source 3
(and I have only one line in videosources, for source 3) and got all my
new channels assigned there.  (Surprising.)  I noticed that yesterday
when I realized that all my new recording files still started with 3.
However, none of the channels I deleted using sdjson-sqlite-select
are marked as deleted in the mysql channels table.

I'm still wondering if there's some connecting link between the two
which I have failed to invoke.  How does tv_grab_zz_sdjson_sqlite tell
Myth which channels are valid?  What causes either one to stop fetching
scheduling data for a channel?

[Is it possible that sdjson-sqlite-select is failing to set some -second-
field in the sqlite database when disabling a channel?  The code sets
the "selected" field in the channels table in sqlite; I'm assuming that's
sufficient unless that database schema has changed since s-s-s was written.]

I'm hoping I don't have to manually use the channel editor to delete
channels one by one; this was what I was trying to avoid by using
sdjson-sqlite-select, since I wrote a couple simple scripts to do all
the heavy lifting of emitting a list of -several hundred- callsigns to
delete which I could then hand to sdjson-sqlite-select.  Now, I -could-
manually set fake "deleted" entries on each such channel in the mysql
channels table--that would be trivial---but I'd rather not, since direct
DB manipulation is, uh, discouraged---precisely because I don't know
what else happens when a channel gets deleted.  And also because it's
cleaner to not have tv_grab_zz_sdjson_sqlite fetch twice as much data
(or more) as it needs to.  (Or do XMLTV grabbers fetch -everything-,
all the time, and it's Myth that determines whether to (a) store in
mysql, and/or (b) to use, the resulting data?)

I'd really appreciate an explanation of what deselecting a channel
in an XML grabber is -supposed- to do (will its data still be fetched?
does it somehow tell mfdb that the channel is to be deleted and/or
otherwise ignored), or whether there are actually supposed to be
two steps here:  (a) delete channel in grabber and (b) -also-
delete same channel in myth, and the two don't talk to each other.

P.S.  Either way, if sdjson-sqlite-select either doesn't work, or
requires another step, someone with write access to the wiki should
update the instructions.  If I figure this out, I'd so so, but I
don't have edit rights on the wiki.

P.P.S.  Second issue:  many of my HD channels appear twice in my channel
map, in two different ranges (like 800's vs 1500's or whatever), and
this seems to have been true for quite a while, so it's not some
short-term shuffle going on.  I -think- either channel number works, but
haven't had time to test that.  I don't know if there's a way of telling
myth to prefer one or the other if it does turn out to matter.  I'm asking
now because we're talking callsign/channel selection anyway and it might
be relevent.

More information about the mythtv-users mailing list