MythTV / mythtv

The official MythTV repository
https://www.mythtv.org
GNU General Public License v2.0
704 stars 345 forks source link

Allow IPTV m3u channel importing to insert channels with decimals, such as "2.1" or "23.11" #860

Closed amessina closed 7 months ago

amessina commented 7 months ago

Is your feature request related to a problem? Please describe. When importing lineup.m3u from a HDHomeRun device, the channel-number field includes channels such as channel-number"2.1". These channels are then created in the database channel table with an integer in the channum column. This makes matching SchedulesDirect lineups difficult (tv_grab_zz_sdjson_sqlite), as channum does not match the <number> output by tv_grab_zz_sdjson_sqlite.

I think this may be because https://github.com/MythTV/mythtv/blob/8bb0dcd869a6f0213f649612cec9527edfbef36e/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp#L537 casts int channel_number = channum.toInt (&ok); though I can't be sure.

See lineup.m3u.txt

Describe the solution you'd like I'd like to see the channum column contain the channel-number output from the m3u file.

Describe alternatives you've considered I run UPDATE channel SET channum=LEFT(callsign,LOCATE(' ',callsign) - 1); before running

tv_grab_zz_sdjson_sqlite --quiet --get-lineup --config-file /etc/mythtv/OTA.xmltv | MythUtil-Channel-XMLTV-getLineup --videosource-id 1 --update --refresh-icons --include-extra-icons

to get SchedulesDirect data to match properly.

kmdewaal commented 7 months ago

Yes, I see the problem. This feature was developed and tested with a European HDHomeRun and there the channel numbers are just integers... I think that copying the channel number as a string might just work for both Europe and US. I will have a look at it.

kmdewaal commented 7 months ago

The fix has been tested on a European HDHomeRun and with the lineup.m3u file attached to this ticket but not yet wth a real USA HDHomeRun. The plan is to backport this fix to v34 in a few days when there are no problems reported.

amessina commented 7 months ago

Thanks for such a quick fix!