[mythtv-users] Channel listings for one channel don't show up in mythweb

Tomi Orava tomimo at ncircle.nullnet.fi
Thu Feb 18 14:44:42 UTC 2021


On 11/12/2020 17:40, Jay Harbeston wrote:
 >
 >
 >>>>>
 >>>>>
 >>>
 >>> I don't think the actual page has ever been mentioned. I'd assume it's:
 >>>
 >>> http://somehostname/mythweb/tv/list <http://somehostname/mythweb/tv/list>
 >>>
 >>> or wherever the mythweb is installed.
 >>>
 >>> See if http://somehostname/mythweb/settings/tv/channels page show the
 >>> channels of interest.
 >>>
 >>> Would expect an empty response from this:
 >>>
 >>> mysql --user=mythtv --password=<from config.xml> --host=localhost --execute="SELECT chanid,channum,callsign,visible FROM channel WHERE
 >>> visible
 >>> NOT IN (0, 1)" mythconverg
 >>>
 >>> Checking because I can't remember when the change to visible's values was made.
 >>>
 >>
 >> I only have one source, and I do not have any ‘zombie’ channels as the other person mentioned later in this thread.
 >>
 >
 >
 > Well it turns out I did have one stray ‘zombie’ channel that I deleted, but it didn’t get removed from the channel table, rather it was
 > marked as deleted as indicted in this thread.  I removed that channel in the channel table, and it now displays correctly.
 >
 > Apologies for all the noise in this thread. :-)


I know this is an old thread, but as I hit this problem myself just now, here is the fix:

diff --git a/modules/tv/classes/Channel.php b/modules/tv/classes/Channel.php
index a4350283..73611112 100644
--- a/modules/tv/classes/Channel.php
+++ b/modules/tv/classes/Channel.php
@@ -54,9 +54,9 @@ class Channel extends MythBase {
              if ($_SESSION['guide_favonly']) {
                  $sql .= ', channelgroup, channelgroupnames WHERE channel.chanid = channelgroup.chanid AND channelgroup.grpid = 
channelgroupnames.grpid AND channelgroupnames.name = \'Favorites\'';
                  if ($filtered)
-                    $sql .= ' AND channel.visible = 1';
+                    $sql .= ' AND channel.visible = 1 AND channel.deleted IS NULL';
              } elseif ($filtered) {
-                $sql .= ' WHERE channel.visible = 1';
+                $sql .= ' WHERE channel.visible = 1 AND channel.deleted IS NULL';
              }
              $sql .= ' GROUP BY channel.channum, channel.callsign';
          // Sort
@@ -82,7 +82,7 @@ class Channel extends MythBase {
                  $sql .= ', channelgroup, channelgroupnames WHERE channel.chanid = channelgroup.chanid AND channelgroup.grpid = 
channelgroupnames.grpid AND channelgroupnames.name = \'Favorites\' AND';
              else
                  $sql .= ' WHERE';
-            $sql .= ' channel.visible = 1';
+            $sql .= ' channel.visible = 1 AND channel.deleted IS NULL';
              $sql .= ' GROUP BY channel.channum, channel.callsign';
          // Sort
              $sql .= ' ORDER BY '

The reason for this change is this commit:

commit 2e26f7f12fce13c155e43ff536b1e09a342e1722
Author: David Engel <dengel at mythtv.org>
Date:   Thu Oct 10 10:29:28 2019 -0500

     Preserve data for deleted channels that are still referenced.

     Don't immediately remove database entries for channels when they are
     deleted.  Instead, mark them as deleted so they are no longer used.
     Change housekeeping to remove the entries for delted channels at a
     later time when they are no longer referenced.

     Fixes #13500

With this commit any deleted channels are simply marked as deleted, instead
of the records being actually deleted. This might confuse MythWeb.

For example:

mysql> select chanid,channum,deleted from channel where deleted IS NOT NULL;
+--------+---------+---------------------+
| chanid | channum | deleted             |
+--------+---------+---------------------+
|  10009 | 9       | 2021-02-16 22:13:53 |
|  10006 | 6       | 2021-02-16 22:13:24 |
|  10014 | 14      | 2021-02-16 22:17:43 |
|  10015 | 15      | 2021-02-16 22:17:43 |
|  10008 | 8       | 2021-02-16 22:17:43 |
|  10001 | 204     | 2021-02-16 22:17:43 |
|  10002 | 202     | 2021-02-16 22:17:43 |
|  10003 | 205     | 2021-02-16 22:17:43 |
|  10004 | 4       | 2021-02-16 22:13:17 |
|  10005 | 215     | 2021-02-16 22:17:43 |
|  10013 | 13      | 2021-02-16 22:17:43 |
|  10011 | 11      | 2021-02-16 22:17:43 |
|  10010 | 10      | 2021-02-16 22:13:57 |
|  10007 | 7       | 2021-02-16 22:14:08 |
|  10020 | 20      | 2021-02-16 22:17:43 |
|  10016 | 16      | 2021-02-16 22:17:43 |
|  10012 | 12      | 2021-02-16 22:17:43 |
|  20105 | 105     | 2021-02-05 16:01:08 |
+--------+---------+---------------------+
18 rows in set (0.00 sec)

All of the above channels are old DVB-T channels that I happened to delete
after switching completely to DBT-T2 cards. Deleting the above records
will of course fix the current issue, but only temporarily.

TomiO.


More information about the mythtv-users mailing list