XMLTV / xmltv

Utilities to obtain, generate, and post-process TV listings data in XMLTV format
GNU General Public License v2.0
297 stars 94 forks source link

tv_grab_uk_freeview: $p_title can be unasigned creating script error. #231

Closed bmrussell closed 6 months ago

bmrussell commented 6 months ago

Thanks for taking the time to report an issue. Please take a moment to review our open/closed issues above, in case your issue has already been reported.

If you are reporting a new issue, please give your issue a descriptive title and fill out the blanks below, providing as much information as possible.

XMLTV Version?

Installed OS package xmltv-1.3.0-1.fc40.noarch Updated tv_grab_uk_freeview from commit id de77b48

XMLTV Component?

tv_grab_uk_freeview

Perl Version

v5.38.2

Operating System

Fedora 40, kernel 6.8.10-300.fc40.x86_64

What happened?

Error:

Use of uninitialized value $p_title in substitution (s///) at ./tv_grab_uk_freeview line 602.

What did you expect to happen?

No error

Did you see any warnings/errors?

using config filename /home/brian/.xmltv/tv_grab_uk_freeview.conf
getting list of channels: ##################################################
getting listings: #################################Use of uninitialized value $p_title in substitution (s///) at ./tv_grab_uk_freeview line 602.
#################
title element: not writing undefined value for title at /usr/share/perl5/vendor_perl/XMLTV.pm line 2166.
bad data inside programme element, not writing

What steps are needed to reproduce this issue?

./tv_grab_uk_freeview --fast --days 1 --output /tmp/bad.xml

channels5.txt

Please attach your config file below:

channels5.txt attached

Any other information?

Put workaround in local script at line 551:

if (!(defined $p_title)) {
    print STDERR "p_title undefined" if $opt_debug;
    $p_title = 'unknown';
}

Seems OK, but I've never programmed Perl before, so didn't raise a pull request.

honir commented 6 months ago

Thanks for the info.

Programmes with no title appear to be fillers at the end of the schedule (i.e. there's no real data).

We probably don't want these empty placeholders polluting our EPG (with title = "TBA") so let's drop them from the output.

I haven't seen a prog with no title in the middle of a schedule so I don't think there's a downside to this action.

Fixed version committed to github.