Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guide duplicates channels - differing programs are listed in each entry #238

Open
SingingDwarf opened this issue Oct 21, 2013 · 13 comments
Open
Assignees
Milestone

Comments

@SingingDwarf
Copy link

Connecting to 0.27 backend running 1.20.3 client.

The Guide shows each channel duplicated - the program data displayed in each differs slightly. The first occurrence of the channel appears to show all listings correctly, whereas the second instance of the channel appears to omit some of the shows.
screenshot_2013-10-21-11-02-56
screenshot_2013-10-21-11-03-30

The channels have the same channel number, callsign, name and xmltvids - but differing chanids.

The source data - i.e. the Listings within MythWeb/MythTV show each channel listed only once.

I have two sources, both with duplicate channels

(NB I am in the UK, running both a standard and a HD source - hence the duplication of channels on each source)

@billmeek
Copy link
Contributor

@SingingDwarf, that's helpful. This may be close to the problem I have. Let's
start with 2 questions.

  1. Do you build MythTV from source? If so, I've got a one line patch that works for me.
  2. Are all your channels marked Visible? (Especially those that show up as duplicates.)

You could just look at the MythTV GUI or mythweb/settings/tv/channels or:

SELECT chanid,channum,xmltvid,visible FROM channel ORDER BY chanid;

Whatever is easiest for you. If you do the sql, please put it in your pastebin of choice
and put a link to it here.

@SingingDwarf
Copy link
Author

  1. No - I get the mythbuntu packages I'm afraid. I would be happy to have a go at building from source on a spare machine (I've never done it before), but it may be a couple of days before I get a chance.

  2. Not all the channels are marked as visible - those which are not are not displayed at all. The duplicated channels are all visible. http://pastebin.com/tNKrvj7u

@billmeek
Copy link
Contributor

Thanks, the patch I'm using wouldn't help.

Next step, looking at the data actually passed from MythTV to MAF. Please run
this (you may need to adjust the command, or use curl if you prefer.)

wget -4 \
    --header='Accept: application/json' \
    --output-document=/tmp/JsonData \
    yourMasterBackend:6544/Guide/GetProgramGuide?StartTime=2013-10-22T06:00:00\&EndTime=2013-10-22T09:00:00\&Details=false

This will be one very long line. We have tools to parse it. Please
pastebin /tmp/JsonData for this one too.

Just to document research, there was a MythTV commit in 0.28-pre Saturday
that changes the SQL right where I had my "AND visible > 0" 'fix'. Need to test
the new version.

http://code.mythtv.org/cgit/mythtv/commit/?id=7c8e274

@ghost ghost assigned dmfrey Oct 21, 2013
@SingingDwarf
Copy link
Author

I hope this helps http://pastebin.com/BN6Mt0nE

The above paste has been removed by pastebin.com. I have a copy
saved on my host. (@billmeek)

@billmeek
Copy link
Contributor

@SingingDwarf, thanks.

This is related to #189.

I cleared my MAF DB.

I changed my MythTV settings for channel 143 to try to duplicate the problem.

Tested before and after applying the 0.28-pre fix in the link above. I still have
two channel 143s. N.B. the duplicate 143s were in the guide BEFORE I pressed
the Refresh icon (at that point, no channel had any programs.) In my case, one
of my 143s had programs, the other has none (in @SingingDwarf's case, one
is good and one has some other data.)

SELECT chan_id,chan_num,xmltv_id,channel_name,callsign,master_hostname FROM channel WHERE chan_num=143;
2143        143         12852       Turner Classic Movies  TCM         mc0
3143        143         12852       Turner Classic Movies  TCM         mc0

@dmfrey, I'd suggest that MAF should only populate 1 instance of any
channel. That could be chan_num+xmltv_id channel before the Guide
is refreshed. If that can be done, this should be retested.

I'd also suggest the the existing channel sort be kept. That
way, channels with different numbers AND different sources will still be
grouped together (the old issue of grouping Over-the-Air channels
together.)

@dmfrey
Copy link
Contributor

dmfrey commented Nov 5, 2013

This issue is going to require a bit of refactor on the program guide and channel tables in the db. Let's move this to v1.30.0 as it is not a show stopper. Also, work will be done in that release to give record schedule capabilities, so it fits with that release.

We should just mark it as a known issue in the release notes.

@SiliconFiend
Copy link

Doesn't this just need a GROUP BY channum,callsign to make the channel list unique? I see the current GuideChannelFragment is creating a CursorLoader with SELECT DISTINCT but that will still have duplicates because the chanid is different for different sources. Unfortunately CursorLoader doesn't accept a GROUP BY argument so it might need a workaround. I found one here: http://stackoverflow.com/questions/10580883/group-by-with-cursorloader?rq=1 but I'm not sure where that implementation would go.

@billmeek I do build MythTV from source (Gentoo, 0.27-fixes), could you provide the one-line patch? Thanks.

@dmfrey
Copy link
Contributor

dmfrey commented Dec 22, 2013

It doesn't seem to be that straight forward when dealing with the android
ContentProvider.

I do have some thoughts on how to handle this, but it will take some
playing around to get it just right
On Dec 22, 2013 3:01 PM, "Karl Newman" notifications@github.com wrote:

Doesn't this just need a GROUP BY channum,callsign to make the channel
list unique? I see the current GuideChannelFragment is creating a
CursorLoader with SELECT DISTINCT but that will still have duplicates
because the chanid is different for different sources. Unfortunately
CursorLoader doesn't accept a GROUP BY argument so it might need a
workaround. I found one here:
http://stackoverflow.com/questions/10580883/group-by-with-cursorloader?rq=1but I'm not sure where that implementation would go.

@billmeek https://github.com/billmeek I do build MythTV from source
(Gentoo, 0.27-fixes), could you provide the one-line patch? Thanks.


Reply to this email directly or view it on GitHubhttps://github.com//issues/238#issuecomment-31094601
.

@billmeek
Copy link
Contributor

@SiliconFiend, stuartm has been using the Services API for the new Webfrontend
in MythTV. He agreed to add my one-liner in 0.28-pre. Only, it's much better than
mine. Here's the commit:

code.mythtv.org/trac/changeset/56508e1

@SiliconFiend
Copy link

That patch didn't apply cleanly to 0.27-fixes due to the other changes which had been made to head (in guide.cpp) and I worked for a while to put together a string of patches which would make it clean, but in the end I just modified the patch context lines to apply the relevant change. However, after recompiling with that patch, it didn't seem to fix it at all, but judging by the content of the patch it seems to affect only visible channels anyway, not the GROUP BY clause (which it already had!). Perhaps I need to clear out the local database (is there a procedure for that?)

@billmeek
Copy link
Contributor

I just go into Settings->Applications->MythTV Android Frontend and then Force stop,
Clear cache and Clear data.

Just FYI, I do still have 2 instances of CBS-HD, one for OTA and one for Cable, e.g.
channum 2_1 and 601.

Same for all other OTAs with matching Cable stations. They both appear in the
MythTV Program Guide, so I assume that's normal.

@SiliconFiend
Copy link

I was afraid that's how I had to clear the database. The backend scan doesn't work at all for me (MAF doesn't find the frontend on the same machine, either). Anyway, I still have the same symptoms--two channels shown in the guide with data only on the first instance of the channel. My two sources are for two different cable boxes. One is a full addressable CableCard box with all the subscribed channels, and the other is a DTA with a subset of the subscribed channels (no premiums, etc.). The overlapping channels have identical channel numbers, callsigns, XMLTVIDs, etc. In MythFrontend and MythWeb they are shown as a single channel, which is what I'd expect.

@billmeek
Copy link
Contributor

Thanks for those details.

If MAF isn't able to automatically see your FE/BE, please see:
https://github.com/MythTV-Clients/MythTV-Android-Frontend/wiki/MythTV-Configuration-Suggestions
(the: What are the requirements for MythTV for Android and Zeroconf? section.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants