You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(95) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(70) |
Feb
(137) |
Mar
(102) |
Apr
(50) |
May
(62) |
Jun
(6) |
Jul
|
Aug
(12) |
Sep
(146) |
Oct
(108) |
Nov
(49) |
Dec
(84) |
2003 |
Jan
(60) |
Feb
(126) |
Mar
(111) |
Apr
(170) |
May
(162) |
Jun
(87) |
Jul
(88) |
Aug
(51) |
Sep
(50) |
Oct
(24) |
Nov
(95) |
Dec
(62) |
2004 |
Jan
(93) |
Feb
(81) |
Mar
(106) |
Apr
(94) |
May
(109) |
Jun
(8) |
Jul
(22) |
Aug
(15) |
Sep
(82) |
Oct
(26) |
Nov
(44) |
Dec
(28) |
2005 |
Jan
(25) |
Feb
(17) |
Mar
(27) |
Apr
(7) |
May
(25) |
Jun
(22) |
Jul
(21) |
Aug
(22) |
Sep
(11) |
Oct
(15) |
Nov
(20) |
Dec
(42) |
2006 |
Jan
(200) |
Feb
(42) |
Mar
(56) |
Apr
(91) |
May
(37) |
Jun
(54) |
Jul
(33) |
Aug
(15) |
Sep
(26) |
Oct
(30) |
Nov
(71) |
Dec
(102) |
2007 |
Jan
(48) |
Feb
(40) |
Mar
(24) |
Apr
(25) |
May
(7) |
Jun
(14) |
Jul
(35) |
Aug
(32) |
Sep
(28) |
Oct
(55) |
Nov
(57) |
Dec
(14) |
2008 |
Jan
(40) |
Feb
(32) |
Mar
(25) |
Apr
(29) |
May
(16) |
Jun
(49) |
Jul
(26) |
Aug
(31) |
Sep
(7) |
Oct
(16) |
Nov
(11) |
Dec
(13) |
2009 |
Jan
(13) |
Feb
(30) |
Mar
(38) |
Apr
(8) |
May
(23) |
Jun
(19) |
Jul
(24) |
Aug
(46) |
Sep
(65) |
Oct
(30) |
Nov
(28) |
Dec
(37) |
2010 |
Jan
(31) |
Feb
(41) |
Mar
(43) |
Apr
(82) |
May
(39) |
Jun
(40) |
Jul
(31) |
Aug
(46) |
Sep
(104) |
Oct
(55) |
Nov
(67) |
Dec
(32) |
2011 |
Jan
(26) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(17) |
Mar
(32) |
Apr
(34) |
May
(15) |
Jun
(50) |
Jul
(19) |
Aug
(8) |
Sep
(16) |
Oct
(18) |
Nov
(12) |
Dec
(3) |
2013 |
Jan
(7) |
Feb
(11) |
Mar
(11) |
Apr
(13) |
May
(17) |
Jun
(5) |
Jul
(4) |
Aug
(2) |
Sep
(4) |
Oct
(44) |
Nov
(14) |
Dec
(57) |
2014 |
Jan
(42) |
Feb
(11) |
Mar
(13) |
Apr
(33) |
May
(48) |
Jun
(22) |
Jul
(7) |
Aug
(19) |
Sep
(11) |
Oct
(34) |
Nov
(12) |
Dec
(18) |
2015 |
Jan
(17) |
Feb
(17) |
Mar
(15) |
Apr
(23) |
May
(2) |
Jun
(41) |
Jul
(31) |
Aug
(33) |
Sep
(6) |
Oct
(5) |
Nov
(8) |
Dec
(23) |
2016 |
Jan
(9) |
Feb
(6) |
Mar
(26) |
Apr
(2) |
May
(24) |
Jun
(20) |
Jul
(34) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(1) |
2017 |
Jan
(17) |
Feb
(6) |
Mar
(8) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
(4) |
Sep
(14) |
Oct
(1) |
Nov
(8) |
Dec
|
From: Kevin G. <kgr...@us...> - 2016-07-15 01:26:46
|
Update of /cvsroot/xmltv/xmltv/grab/sd_json In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21252 Modified Files: tv_grab_sd_json Log Message: tv_grab_sd_json: Do not add default category of "tvshow" for radio stations. Index: tv_grab_sd_json =================================================================== RCS file: /cvsroot/xmltv/xmltv/grab/sd_json/tv_grab_sd_json,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tv_grab_sd_json 15 Jul 2016 01:25:43 -0000 1.20 --- tv_grab_sd_json 15 Jul 2016 01:26:44 -0000 1.21 *************** *** 1187,1191 **** sub get_program_category { ! my ($details) = @_; my %seen; my @result; --- 1187,1191 ---- sub get_program_category { ! my ($channel, $details) = @_; my %seen; my @result; *************** *** 1215,1218 **** --- 1215,1221 ---- add(\@result, 'sports', \%seen); } + elsif($channel->{'isRadioStation'}) { + add(\@result, 'radio', \%seen); + } else { add(\@result, 'tvshow', \%seen); *************** *** 1441,1445 **** $w->write_programme({ ! 'channel' => sprintf($channel_id_format, $channel), 'start' => $start, 'stop' => $stop, --- 1444,1448 ---- $w->write_programme({ ! 'channel' => sprintf($channel_id_format, $channel->{'stationID'}), 'start' => $start, 'stop' => $stop, *************** *** 1449,1453 **** 'credits' => get_program_credits($details), 'date' => get_program_date($details), ! 'category' => get_program_category($details), # 'keyword' => undef, # 'language' => undef, --- 1452,1456 ---- 'credits' => get_program_credits($details), 'date' => get_program_date($details), ! 'category' => get_program_category($channel, $details), # 'keyword' => undef, # 'language' => undef, *************** *** 1504,1508 **** for my $schedule (values %{$cache_schedules->{$channel}}) { for my $program (@{$schedule->{'programs'}}) { ! write_programme($w, $channel, $program, $cache_programs->{$program->{'programID'}}); } } --- 1507,1511 ---- for my $schedule (values %{$cache_schedules->{$channel}}) { for my $program (@{$schedule->{'programs'}}) { ! write_programme($w, $channel_index{$channel}, $program, $cache_programs->{$program->{'programID'}}); } } |
From: Kevin G. <kgr...@us...> - 2016-07-15 01:25:45
|
Update of /cvsroot/xmltv/xmltv/grab/sd_json In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21167 Modified Files: tv_grab_sd_json Log Message: tv_grab_sd_json: More performance improvements. Profiling showed that date/time handling was still the top item for execution time. By writing our own code to parse airDateTime to a unix time instead of using DateTime epoch function the date/time handling is now relatively insignificant. Setting UNSAFE for XML::Writer also makes a somewhat significant improvement. The top usage of execution time is now XMLTV.pm and XML/Writer.pm. Index: tv_grab_sd_json =================================================================== RCS file: /cvsroot/xmltv/xmltv/grab/sd_json/tv_grab_sd_json,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tv_grab_sd_json 9 Jul 2016 18:03:41 -0000 1.19 --- tv_grab_sd_json 15 Jul 2016 01:25:43 -0000 1.20 *************** *** 83,86 **** --- 83,87 ---- 'encoding' => 'utf-8', 'ENCODING' => 'utf-8', + 'UNSAFE' => 1, ); *************** *** 196,216 **** } ! my $dt_zone_utc = DateTime::TimeZone->new(name => 'UTC'); ! my $dt_zone_local = DateTime::TimeZone->new(name => 'local'); ! sub parse_airdate { ! my @date = ($_[0] =~ /(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)Z/); ! local $Params::Validate::NO_VALIDATION = 1; ! return DateTime->new( ! year => $date[0], ! month => $date[1], ! day => $date[2], ! hour => $date[3], ! minute => $date[4], ! second => $date[5], ! time_zone => $dt_zone_utc, ! ); } # SD-JSON only specifies a date for originalAirDate. Older versions of # mythtv need full date and time even though xmltv only requires date. --- 197,234 ---- } ! # days to add to day of month to get days since Jan 1st ! my @days_norm = ( -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333 ); ! my @days_leap = ( -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 ); ! sub is_leap_year { ! return (!($_[0] % 4) && (($_[0] % 100) || !($_[0] % 400))); } + sub parse_airtime { + use integer; + my ($year, $month, $day, $hour, $min, $sec) = ($_[0] =~ /(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)Z/); + + # determine number of days since Jan 1st of requested year + $month -= 1; + $day += is_leap_year($year) ? $days_leap[$month] : $days_norm[$month]; + + # add number of days (minus leap days) for years since 1970 + $day += ($year - 1970) * 365; + + # add leap days from previous years since year 0 (we already included leap + # day for this year), subtract number of leap days between 0 and 1970 (477) + $year -= 1; + $day += $year / 4 - $year / 100 + $year / 400 - 477; + + return ($day * 86400 + $hour * 3600 + $min * 60 + $sec); + } + + sub format_airtime { + my ($sec, $min, $hour, $day, $month, $year) = gmtime($_[0]); + return sprintf('%04d%02d%02d%02d%02d%02d +0000', $year + 1900, $month + 1, $day, $hour, $min, $sec); + } + + my $dt_zone_local = DateTime::TimeZone->new(name => 'local'); + # SD-JSON only specifies a date for originalAirDate. Older versions of # mythtv need full date and time even though xmltv only requires date. *************** *** 218,227 **** # minimize the chance of an error causing the day to be off by one. sub parse_original_airdate { ! my @date = ($_[0] =~ /(\d+)-(\d+)-(\d+)/); local $Params::Validate::NO_VALIDATION = 1; return DateTime->new( ! year => $date[0], ! month => $date[1], ! day => $date[2], hour => 12, time_zone => $dt_zone_local, --- 236,245 ---- # minimize the chance of an error causing the day to be off by one. sub parse_original_airdate { ! my ($year, $month, $day) = ($_[0] =~ /(\d+)-(\d+)-(\d+)/); local $Params::Validate::NO_VALIDATION = 1; return DateTime->new( ! year => $year, ! month => $month, ! day => $day, hour => 12, time_zone => $dt_zone_local, *************** *** 827,832 **** for my $schedule (values %{$cache_schedules->{$channel}}) { for my $program (@{$schedule->{'programs'}}) { ! my $dt = parse_airdate($program->{'airDateTime'}); ! my $airtime = $dt->epoch(); my $dur = int($program->{'duration'}); --- 845,849 ---- for my $schedule (values %{$cache_schedules->{$channel}}) { for my $program (@{$schedule->{'programs'}}) { ! my $airtime = parse_airtime($program->{'airDateTime'}); my $dur = int($program->{'duration'}); *************** *** 1416,1427 **** my ($w, $channel, $program, $details) = @_; ! my $dt = parse_airdate($program->{'airDateTime'}); ! my $airtime = $dt->epoch(); my $dur = int($program->{'duration'}); if(($airtime + $dur) > $time_start && $airtime < $time_stop) { ! my $start = $dt->strftime('%Y%m%d%H%M%S %z'); ! $dt->add(seconds => $dur); ! my $stop = $dt->strftime('%Y%m%d%H%M%S %z'); $w->write_programme({ --- 1433,1442 ---- my ($w, $channel, $program, $details) = @_; ! my $airtime = parse_airtime($program->{'airDateTime'}); my $dur = int($program->{'duration'}); if(($airtime + $dur) > $time_start && $airtime < $time_stop) { ! my $start = format_airtime($airtime); ! my $stop = format_airtime($airtime + $dur); $w->write_programme({ |
From: Nick M. <kno...@us...> - 2016-07-12 01:52:51
|
Update of /cvsroot/xmltv/xmltv In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27179 Modified Files: MANIFEST Log Message: Add tv_grab_sd_json to MANIFEST Index: MANIFEST =================================================================== RCS file: /cvsroot/xmltv/xmltv/MANIFEST,v retrieving revision 1.201 retrieving revision 1.202 diff -C2 -d -r1.201 -r1.202 *** MANIFEST 12 Jul 2016 01:47:43 -0000 1.201 --- MANIFEST 12 Jul 2016 01:52:48 -0000 1.202 *************** *** 190,193 **** --- 190,194 ---- grab/re/test.conf grab/re/tv_grab_re + grab/sd_json/tv_grab_sd_json grab/se_swedb/.cvsignore grab/se_swedb/test.conf |
From: Nick M. <kno...@us...> - 2016-07-12 01:47:46
|
Update of /cvsroot/xmltv/xmltv In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26883 Modified Files: MANIFEST Log Message: Update MANIFEST for tv_augment test framework Index: MANIFEST =================================================================== RCS file: /cvsroot/xmltv/xmltv/MANIFEST,v retrieving revision 1.200 retrieving revision 1.201 diff -C2 -d -r1.200 -r1.201 *** MANIFEST 23 Aug 2015 03:59:33 -0000 1.200 --- MANIFEST 12 Jul 2016 01:47:43 -0000 1.201 *************** *** 937,940 **** --- 937,1011 ---- t/data/tv_grep_previously_shown_whitespace_xml.expected t/data/tv_grep_previously_shown_x_whatever_xml.expected + t/data-tv_augment/configs/tv_augment_automatic_type_1.xml.conf + t/data-tv_augment/configs/tv_augment_automatic_type_2.xml.conf + t/data-tv_augment/configs/tv_augment_automatic_type_3.xml.conf + t/data-tv_augment/configs/tv_augment_automatic_type_4.xml.conf + t/data-tv_augment/configs/tv_augment_automatic_type_5-1.xml.conf + t/data-tv_augment/configs/tv_augment_automatic_type_5-2.xml.conf + t/data-tv_augment/configs/tv_augment_automatic_type_5-3.xml.conf + t/data-tv_augment/configs/tv_augment_automatic_type_5-4.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_1.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_10.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_11.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_12.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_13.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_14.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_15.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_2.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_3.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_4.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_5.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_6.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_7.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_8.xml.conf + t/data-tv_augment/configs/tv_augment_user_type_9.xml.conf + t/data-tv_augment/rules/test_tv_augment.rules + t/data-tv_augment/tv_augment_automatic_type_1.xml + t/data-tv_augment/tv_augment_automatic_type_1.xml-expected + t/data-tv_augment/tv_augment_automatic_type_2.xml + t/data-tv_augment/tv_augment_automatic_type_2.xml-expected + t/data-tv_augment/tv_augment_automatic_type_3.xml + t/data-tv_augment/tv_augment_automatic_type_3.xml-expected + t/data-tv_augment/tv_augment_automatic_type_4.xml + t/data-tv_augment/tv_augment_automatic_type_4.xml-expected + t/data-tv_augment/tv_augment_automatic_type_5-1.xml + t/data-tv_augment/tv_augment_automatic_type_5-1.xml-expected + t/data-tv_augment/tv_augment_automatic_type_5-2.xml + t/data-tv_augment/tv_augment_automatic_type_5-2.xml-expected + t/data-tv_augment/tv_augment_automatic_type_5-3.xml + t/data-tv_augment/tv_augment_automatic_type_5-3.xml-expected + t/data-tv_augment/tv_augment_automatic_type_5-4.xml + t/data-tv_augment/tv_augment_automatic_type_5-4.xml-expected + t/data-tv_augment/tv_augment_user_type_1.xml + t/data-tv_augment/tv_augment_user_type_1.xml-expected + t/data-tv_augment/tv_augment_user_type_10.xml + t/data-tv_augment/tv_augment_user_type_10.xml-expected + t/data-tv_augment/tv_augment_user_type_11.xml + t/data-tv_augment/tv_augment_user_type_11.xml-expected + t/data-tv_augment/tv_augment_user_type_12.xml + t/data-tv_augment/tv_augment_user_type_12.xml-expected + t/data-tv_augment/tv_augment_user_type_13.xml + t/data-tv_augment/tv_augment_user_type_13.xml-expected + t/data-tv_augment/tv_augment_user_type_14.xml + t/data-tv_augment/tv_augment_user_type_14.xml-expected + t/data-tv_augment/tv_augment_user_type_15.xml + t/data-tv_augment/tv_augment_user_type_15.xml-expected + t/data-tv_augment/tv_augment_user_type_2.xml + t/data-tv_augment/tv_augment_user_type_2.xml-expected + t/data-tv_augment/tv_augment_user_type_3.xml + t/data-tv_augment/tv_augment_user_type_3.xml-expected + t/data-tv_augment/tv_augment_user_type_4.xml + t/data-tv_augment/tv_augment_user_type_4.xml-expected + t/data-tv_augment/tv_augment_user_type_5.xml + t/data-tv_augment/tv_augment_user_type_5.xml-expected + t/data-tv_augment/tv_augment_user_type_6.xml + t/data-tv_augment/tv_augment_user_type_6.xml-expected + t/data-tv_augment/tv_augment_user_type_7.xml + t/data-tv_augment/tv_augment_user_type_7.xml-expected + t/data-tv_augment/tv_augment_user_type_8.xml + t/data-tv_augment/tv_augment_user_type_8.xml-expected + t/data-tv_augment/tv_augment_user_type_9.xml + t/data-tv_augment/tv_augment_user_type_9.xml-expected + t/test_tv_augment.t t/data-tv_imdb/lists/actors.list t/data-tv_imdb/lists/actresses.list |
From: Nick M. <kno...@us...> - 2016-07-12 01:30:10
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26134/lib Modified Files: Augment.pm Log Message: Update tidy_desc_text() * remove empty <desc> before writing There is the potential for rules to remove all existing text from the description field, leaving an empty - but defined - field. Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Augment.pm 12 Jul 2016 01:29:56 -0000 1.19 --- Augment.pm 12 Jul 2016 01:30:08 -0000 1.20 *************** *** 371,374 **** --- 371,375 ---- # Tidy <desc> description text + # Remove <desc> if empty/whitespace sub tidy_desc_text () { my ($self, $prog) = @_; *************** *** 384,387 **** --- 385,399 ---- } } + + # delete desc if now empty + # TODO: needs modifying to properly handle multiple descriptions + if (defined $prog->{'desc'}) { + if ( $prog->{'desc'}[0][0] =~ m/^\s*$/ ) { + splice(@{$prog->{'desc'}},0,1); + if (scalar @{$prog->{'desc'}} == 0) { + delete $prog->{'desc'}; + } + } + } } *************** *** 860,864 **** s{ (?: ! [\s.,:;-]* \(? (?: --- 872,876 ---- s{ (?: ! [\s,:;-]* \(? (?: |
From: Nick M. <kno...@us...> - 2016-07-12 01:29:58
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26071/lib Modified Files: Augment.pm Log Message: Update extract_numbering() * make $lang_words qr case-insensitive Although the overall numbering regex uses the /i flag, the compiled $lang_words regex did not; numbering such as "One" would therefore not match, whilst "one" would. * make regexes multiline (hopefully easier to read/maintain) * remove parentheses hidden in comments * check for trailing part numbering before series/episode * factor out s2e3 matching into separate regex * whitespace changes * clean up test cases Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Augment.pm 12 Jul 2016 01:29:45 -0000 1.18 --- Augment.pm 12 Jul 2016 01:29:56 -0000 1.19 *************** *** 794,1110 **** # 2 params: 1) working program hash 2) type: 'title', 'episode' or 'desc' sub extract_numbering () { ! my ($self, $prog, $field) = @_; ! my %elems = ( 'title' => '_title', 'episode' => '_episode', 'desc' => '_desc', 'description' => '_desc' ); ! my $elem = $elems{$field}; ! my ($s, $stot, $e, $etot, $p, $ptot); ! my $int; ! # TODO: set $lang_words according to 'language_code' option ! # also the 'series', 'season' and 'episode' text in the regexs ! my $lang_words = qr/one|two|three|four|five|six|seven|eight|nine/; ! # ! _d(4,"\t extract_numbering: $field : in : ","<$prog->{$elem}>"); ! # Theoretically it's possible to do this in one regex but it gets too unwieldy when we start catering ! # for "series" at the front as well as the back, and it's not easy to maintain ! # so we'll parse out the values in 4 passes ! # ! # Extract and strip the "series" ! (# check for "Series x/x" format covering following formats: ! # ! # "Series 1" ! # "Series one :" ! # "Series 2/4" ! # "Series 12. ..." ! # "Series 1." ! # "Series 4/7. Part one. ..." ! # "Wheeler Dealers - (Series 1)" ! # "Wheeler Dealers, - (Series 1.)" ! # "Wheeler Dealers (Series 1, Episode 4)" ! # "Wheeler Dealers Series 1, Episode 4." ! # "Series 6, Episode 4/7. Part one. ..." ! # "Series 8. ..." ! # "Series 8/10. ..." ! # ! # Test cases: ! # Series 1 ! # Series one : ! # Series 2/4 ! # Series 12. Abc ! # Series 1. ! # Series 4/7. Part one. Abc ! # Wheeler Dealers - (Series 1) ! # Wheeler Dealers, - (Series 1.) ! # Wheeler Dealers (Series 1, Episode 4) ! # Wheeler Dealers Series 1, Episode 4. ! # Series 6, Episode 4/7. Part one. Abc ! # Series 8. Abc ! # Series 8/10. Abc ! # Wheeler Dealers - (Series 1) ! # Wheeler Dealers (Season 1) ! # Wheeler Dealers Series 1 ! # Wheeler Dealers Series 1, 3 ! ); ! if ( $prog->{$elem} =~ ! s/(?:[\s\.,:;-]*\(?)(?:series|season)\s*(\d+|${lang_words})(?:[\s\/]*(\d+))?[\.,]?\)?[\s\.,:;-]*/ /i ! ) ! { ! _d(4,"\t matched 'series' regex"); ! $int = word_to_digit($1); ! $s = $int if defined $int and $int > 0; ! $stot = $2 if defined $2; ! } ! # Extract and strip the "episode" if number at start of data ! # Note: beware of false positives with e.g. "10, Rillington Place" or "1984" ! (# check for "x/y" format covering following formats: ! # ! # "1/6 - ..." ! # "1/6, ..." ! # "1/6 ..." ! # "1/6. ..." ! # "1/6;" ! # "(1/6)" ! # "[1/6]" ! # ! # Test cases: ! # (the ones tagged "<-- cannot match" cannot be matched to avoid false positives c.f. "10, Rillington Place") ! # 1/6 - Abc ! # 1/6, series 1 - Abc ! # 1, series 1 - Abc <-- cannot match ! # 1/6, series one - Abc ! # 1/6. Abc ! # 1/6; series one ! # 1, series one - Abc <-- cannot match ! # 4/25 Wirral v Alicante, Spain ! # 1/6 - Abc ! # 1/6, Abc ! # 1, Abc <-- cannot match ! # 1/6. Abc ! # 1/6; ! # (1/6) ! # [1/6] ! # 1. ! # 1, ! # 2/25 Female Problems ! # should not match --v ! # 3rd Rock ! # 3 rd Rock ! # 10, Rillington Place ! # 10 Rillington Place ! # 1984 ! # 1984. <-- false positive ! # Episode 1 ! # Episode one ! # Episode 2/4 ! # ! # I'm not convinced we should be matching things like "1." - can we be sure this is an ep number? ! # e.g. should not match --v ! # {Premier League Years~~~1999/00} ! ); ! if ( $prog->{$elem} =~ ! # note we insist on the "/" unless the title is just "number." or "number," ! # this is to avoid false matching on "1984" but even here we will falsely match "1984." ! # ! s/^[\(\[]*(?!(?:19|20)\d\d)(\d+)\s*(?:\/|[\.,]$)(\d*)[\.,]?[\)\]]*\s?(?:[\s\.,:;-]+\s*|\s*$)//i ! ) ! { ! _d(4,"\t matched 'leading episode' regex"); ! $int = word_to_digit($1); ! $e = $int if defined $int and $int > 0; ! $etot = $2 if defined $2; ! } ! # Extract and strip the "episode" if number at end of data ! (# check for "x/y" format covering following formats: ! # ! # "1/6" ! # "1/6." ! # "(1/6)" ! # "[1/6]" ! # "s1e6" ! # "(s1e6)" ! # ! # Test cases: ! # 1/6 ! # 1/6. ! # (1/6) ! # [1/6] ! # s1e6 ! # (s1e6) ! # 1 / 6 ! # ( 1/6 ) ! # In the Mix. 2 / 6 ! # In the Mix. ( 2/6 ). ! # should not match --v ! # £20,000. ! # 20,000 ! # the 24. ! # go 24. ! # 24 ! # 1984 ! # 2015/16 ! # 2015/2016 could theoretically be ok but statistically unlikely ! # (although 2015/3000 could be ok but the likes of Eastenders don't have a 'total' so again this is unlikely) ! ); ! if ( $prog->{$elem} =~ ! s/(?:^|[\s\(\[]+)s?(?!(?:19|20)\d\d)(\d+)\s*[\/e]+\s*(\d+)[\s\.,]?[\)\]]*[\s\.]*$//i ! ) ! { ! _d(4,"\t matched 'trailing episode' regex"); ! $int = word_to_digit($1); ! $e = $int if defined $int and $int > 0; ! $etot = $2 if defined $2; ! } ! # Extract and strip the "episode" ! (# check for "Episode x/x" format covering following formats: ! # ! # "Episode 1" ! # "Episode one :" ! # "Episode 2/4" ! # "Episode 12. ..." ! # "Episode 1." ! # "Episode 4/7. Part one. ..." ! # "Wheeler Dealers - (Episode 1)" ! # "Wheeler Dealers, - (Episode 1.)" ! # "Wheeler Dealers (Series 1, Episode 4)" ! # "Wheeler Dealers Series 1, Episode 4." ! # "Series 6, Episode 4/7. Part one. ..." ! # "Series 8. ..." ! # "Series 8/10. ..." ! # ! # Test cases: ! # Episode one : ! # Episode 2/4 ! # Episode 12. Abc ! # Episode 1. ! # Episode 4/7. Part one. Abc ! # Wheeler Dealers - (Episode 1) ! # Wheeler Dealers, - (Episode 1.) ! # Wheeler Dealers (Series 1, Episode 4) ! # Wheeler Dealers Series 1, Episode 4. ! # Series 6, Episode 4/7. Part one. Abc ! # should not match --v ! # Series 8. Abc ! # Series 8/10. Abc ! # 1/6 - Abc ! # 1/6, series 1 - Abc ! # 1, series 1 - Abc ! # 1/6, series one - Abc ! # 1/6. Abc ! # 1/6; series one ! # 1, series one - Abc ! ); ! if ( $prog->{$elem} =~ ! s/(?:[\s\.,:;-]*\(?)(?:episode)\s*(\d+|${lang_words})(?:[\s\/]*(\d+))?[\.,]?\)?[\s\.,:;-]*/ /i ! ) ! { ! _d(4,"\t matched 'episode' regex"); ! $int = word_to_digit($1); ! $e = $int if defined $int and $int > 0; ! $etot = $2 if defined $2; ! } ! # Extract and strip the "part" ! ( # check for part numbering covering following formats: ! # ! # "Dead Man's Eleven (Part 1)" ! # "Dead Man's Eleven - (Part 1)" ! # "Dead Man's Eleven - (Part 1/2)" ! # "Dead Man's Eleven (Pt 1)" ! # "Dead Man's Eleven - (Pt. 1)" ! # "Dead Man's Eleven - (Pt. 1/2)" ! # "Dead Man's Eleven - Part 1" ! # "Dead Man's Eleven: Part 1" ! # "Dead Man's Eleven; Pt 1" ! # "Dead Man's Eleven, Pt. 1" ! # "Dead Man's Eleven Part 1" ! # "Dead Man's Eleven Pt 1" ! # "Dead Man's Eleven Pt 1/2" ! # "Dead Man's Eleven Pt. 1" ! # "Part 1" ! # "Part 1/3" ! # "Pt 2" ! # "Pt 2/3" ! # "Pt. 3" ! # "Part One" ! # "Pt Two" ! # "Pt. Three" ! # "Part One of Two" ! # "Pt Two / Three" ! # "Pt. Three of Four" ! # "Dead Man's Eleven - Part One" ! # "Dead Man's Eleven: Part One" ! # "Dead Man's Eleven; Pt One" ! # "Dead Man's Eleven, Pt. One" ! # "Dead Man's Eleven Part One" ! # "Dead Man's Eleven Pt One" ! # "Dead Man's Eleven Pt. One" ! # "Dead Man's Eleven (Part One)" ! # "Dead Man's Eleven - (Part One)" ! # "Dead Man's Eleven (Pt One)" ! # "Dead Man's Eleven - (Pt. One)" ! # "Dead Man's Eleven: 1" ! # ! # Test cases: ! # Dead Man's Eleven ! # Dead Man's Eleven: 1 ! # Dead Man's Eleven (Part 1) ! # Dead Man's Eleven - (Part 1) ! # Dead Man's Eleven - (Part 1/2) ! # Dead Man's Eleven (Pt 1) ! # Dead Man's Eleven - (Pt. 1) ! # Dead Man's Eleven - (Pt. 1/2) ! # Dead Man's Eleven - Part 1 ! # Dead Man's Eleven: Part 1 ! # Dead Man's Eleven; Pt 1 ! # Dead Man's Eleven, Pt. 1 ! # Dead Man's Eleven Part 1 ! # Dead Man's Eleven Pt 1 ! # Dead Man's Eleven Pt 1/2 ! # Dead Man's Eleven Pt. 1 ! # Dead Man's Eleven - Part One ! # Dead Man's Eleven: Part One ! # Dead Man's Eleven; Pt One ! # Dead Man's Eleven, Pt. One ! # Dead Man's Eleven Part One ! # Dead Man's Eleven Pt One ! # Dead Man's Eleven Pt. One ! # Dead Man's Eleven (Part One) ! # Dead Man's Eleven - (Part One) ! # Dead Man's Eleven (Pt One) ! # Dead Man's Eleven - (Pt. One) ! # Part One ! # Pt Two ! # Pt. Three ! # Part One of Two ! # Pt Two / Three ! # Pt. Three of Four ! # Part 1 ! # Part 1/3 ! # Pt 2 ! # Pt 2/3 ! # Pt. 3 ! # ! # should not match --v ! # Burnley v Preston North End: 2006/07 ! ); ! if ( $prog->{$elem} =~ ! s/(?:[\s\.,:;-]*\(?(?:part|pt\.?)\s*(?!(?:19|20))(\d+|${lang_words})\s*(?:(?:\/|of)\s*(\d+|${lang_words}))?\)?|:\s*(\d+))[\s\.,:;-]*$/ /i ! ) ! { ! _d(4,"\t matched 'part' regex"); ! $int = word_to_digit($3 || $1); # $3 is in use case "Dead Man's Eleven: 1" ! $p = $int if defined $int and $int > 0; ! $int = word_to_digit($2) if defined $2; ! $ptot = $int if defined $2 && defined $int and $int > 0; ! } --- 794,1169 ---- # 2 params: 1) working program hash 2) type: 'title', 'episode' or 'desc' sub extract_numbering () { ! my ($self, $prog, $field) = @_; ! my %elems = ( 'title' => '_title', 'episode' => '_episode', 'desc' => '_desc', 'description' => '_desc' ); ! my $elem = $elems{$field}; ! my ($s, $stot, $e, $etot, $p, $ptot); ! my $int; ! # TODO: set $lang_words according to 'language_code' option ! # also the 'series', 'season' and 'episode' text in the regexs ! my $lang_words = qr/one|two|three|four|five|six|seven|eight|nine/i; ! # ! _d(4,"\t extract_numbering: $field : in : ","<$prog->{$elem}>"); ! # Theoretically it's possible to do this in one regex but it gets too unwieldy when we start catering ! # for "series" at the front as well as the back, and it's not easy to maintain ! # so we'll parse out the values in separate passes ! # First, remove any part numbering from the *end* of the element ! # Should match --v ! # Dead Man's Eleven ! # Dead Man's Eleven: 1 ! # Dead Man's Eleven (Part 1) ! # Dead Man's Eleven - (Part 1) ! # Dead Man's Eleven - (Part 1/2) ! # Dead Man's Eleven (Pt 1) ! # Dead Man's Eleven - (Pt. 1) ! # Dead Man's Eleven - (Pt. 1/2) ! # Dead Man's Eleven - Part 1 ! # Dead Man's Eleven: Part 1 ! # Dead Man's Eleven; Pt 1 ! # Dead Man's Eleven, Pt. 1 ! # Dead Man's Eleven Part 1 ! # Dead Man's Eleven Pt 1 ! # Dead Man's Eleven Pt 1/2 ! # Dead Man's Eleven Pt. 1 ! # Dead Man's Eleven - Part One ! # Dead Man's Eleven: Part One ! # Dead Man's Eleven; Pt One ! # Dead Man's Eleven, Pt. One ! # Dead Man's Eleven Part One ! # Dead Man's Eleven Pt One ! # Dead Man's Eleven Pt. One ! # Dead Man's Eleven (Part One) ! # Dead Man's Eleven - (Part One) ! # Dead Man's Eleven (Pt One) ! # Dead Man's Eleven - (Pt. One) ! # Part One ! # Pt Two ! # Pt. Three ! # Part One of Two ! # Pt Two / Three ! # Pt. Three of Four ! # Part 1 ! # Part 1/3 ! # Pt 2 ! # Pt 2/3 ! # Pt. 3 ! # ! # Should not match --v ! # Burnley v Preston North End: 2006/07 ! if ( $prog->{$elem} =~ ! s{ ! (?: ! [\s.,:;-]* ! \(? ! (?: ! part|pt\.? ! ) ! \s* ! (?! (?:19|20)\d\d ) (\d+ | ${lang_words}) # $1 ! \s* ! (?: ! (?: ! /|of ! ) ! \s* ! (\d+ | ${lang_words}) # $2 ! )? ! \)? ! | ! : ! \s* ! (\d+) # $3 ! ) ! [\s.,:;-]* ! $ ! } ! { }ix ! ) ! { ! _d(4,"\t matched 'part' regex"); ! $int = word_to_digit($3 || $1); # $3 is in use case "Dead Man's Eleven: 1" ! $p = $int if defined $int and $int > 0; ! $int = word_to_digit($2) if defined $2; ! $ptot = $int if defined $2 && defined $int and $int > 0; ! } + # Next, extract and strip "series x/y" + # + # Should match --v + # Series 1 + # Series one : + # Series 2/4 + # Series 12. Abc + # Series 1. + # Wheeler Dealers - (Series 1) + # Wheeler Dealers, - (Series 1.) + # Wheeler Dealers (Series 1, Episode 4) + # Wheeler Dealers Series 1, Episode 4. + # Series 8. Abc + # Series 8/10. Abc + # Wheeler Dealers - (Series 1) + # Wheeler Dealers (Season 1) + # Wheeler Dealers Series 1 + # Wheeler Dealers Series 1, 3 + # + # Does not match --v + # Series 4/7. Part one. Abc + # Series 6, Episode 4/7. Part one. Abc ! if ( $prog->{$elem} =~ ! s{ ! (?: ! [\s.,:;-]* ! \(? ! ) ! (?: ! series|season ! ) ! \s* ! ( \d+ | ${lang_words} ) # $1 ! (?: ! [\s/]* ! ( \d+ ) # $2 ! )? ! [.,]? ! \)? ! [\s\.,:;-]* ! } ! { }ix ! ) ! { ! _d(4,"\t matched 'series' regex"); ! $int = word_to_digit($1); ! $s = $int if defined $int and $int > 0; ! $stot = $2 if defined $2; ! } + # Extract and strip the "episode" + # + # i) check for "Episode x/x" format covering following formats: + # + # Should match --v + # Episode one : + # Episode 2/4 + # Episode 12. Abc + # Episode 1. + # Wheeler Dealers - (Episode 1) + # Wheeler Dealers, - (Episode 1.) + # Wheeler Dealers (Series 1, Episode 4) + # Wheeler Dealers Series 1, Episode 4. + # + # Should not match --v + # Series 8. Abc + # Series 8/10. Abc + # 1/6 - Abc + # 1/6, series 1 - Abc + # 1, series 1 - Abc + # 1/6, series one - Abc + # 1/6. Abc + # 1/6; series one + # 1, series one - Abc + # + # Does not match --v + # Episode 4/7. Part one. Abc + # Series 6, Episode 4/7. Part one. Abc ! if ( $prog->{$elem} =~ ! s{ ! (?: ! [\s.,:;-]* ! \(? ! ) ! (?: ! episode ! ) ! \s* ! (\d+ | ${lang_words}) # $1 ! (?: ! [\s/]* ! (\d+) # $2 ! )? ! [.,]? ! \)? ! [\s.,:;-]* ! } ! { }ix ! ) ! { ! _d(4,"\t matched 'episode' regex"); ! $int = word_to_digit($1); ! $e = $int if defined $int and $int > 0; ! $etot = $2 if defined $2; ! } ! ! # Extract and strip the episode "x/y" if number at start of data ! # ! # Note: beware of false positives with e.g. "10, Rillington Place" or "1984". ! # Those entries below tagged "<-- cannot match" are not matched to avoid ! # false positives c.f. "10, Rillington Place") ! # ! # I'm not convinced we should be matching things like "1." - can we be sure ! # this is an ep number? ! # ! # Should match --v ! # 1/6 - Abc ! # 1/6, series 1 - Abc ! # 1/6, series one - Abc ! # 1/6. Abc ! # 1/6; series one ! # 4/25 Wirral v Alicante, Spain ! # 1/6 - Abc ! # 1/6, Abc ! # 1/6. Abc ! # 1/6; ! # (1/6) ! # [1/6] ! # 1. ! # 1, ! # 2/25 Female Problems ! # ! # Should not match --v ! # 1, series 1 - Abc <-- cannot match ! # 1, series one - Abc <-- cannot match ! # 1, Abc <-- cannot match ! # 3rd Rock ! # 3 rd Rock ! # 10, Rillington Place ! # 10 Rillington Place ! # 1984 ! # 1984. <-- false positive ! # Episode 1 ! # Episode one ! # Episode 2/4 ! # {Premier League Years~~~1999/00} ! ! elsif ( $prog->{$elem} =~ ! ! # note we insist on the "/" unless the title is just "number." or "number," ! # this is to avoid false matching on "1984" but even here we will falsely match "1984." ! # ! s{ ! ^ ! [([]* ! (?! (?:19|20)\d\d ) (\d+) # $1 ! \s* ! (?: ! / ! \s* ! | ! [.,] ! $ ! ) ! (\d*) # $2 ! [.,]? ! [)\]]* ! \s? ! (?: ! [\s.,:;-]+ ! \s* ! | ! \s* ! $ ! ) ! } ! {}ix ! ) ! { ! _d(4,"\t matched 'leading episode' regex"); ! $int = word_to_digit($1); ! $e = $int if defined $int and $int > 0; ! $etot = $2 if defined $2; ! } ! ! # Extract and strip the episode "x/y" if number at end of data ! # ! # Should match --v ! # 1/6 ! # 1/6. ! # (1/6) ! # [1/6] ! # 1 / 6 ! # ( 1/6 ) ! # In the Mix. 2 / 6 ! # In the Mix. ( 2/6 ). ! # ! # Should not match --v ! # £20,000. ! # 20,000 ! # the 24. ! # go 24. ! # 24 ! # 1984 ! # 2015/16 ! # 2015/2016 (could theoretically be ok but statistically unlikely) ! # 2015/3000 (could be ok but the likes of Eastenders don't have a 'total' so again this is unlikely) ! ! elsif ( $prog->{$elem} =~ ! s{ ! (?: ! ^ ! | ! [\s(\[]+ ! ) ! (?! (?:19|20)\d\d ) (\d+) # $1 ! \s* ! \/ ! \s* ! (\d+) # $2 ! [\s.,]? ! [)\]]* ! [\s.]* ! $ ! } ! {}ix ! ) ! { ! _d(4,"\t matched 'trailing episode' regex"); ! $int = word_to_digit($1); ! $e = $int if defined $int and $int > 0; ! $etot = $2 if defined $2; ! } ! ! # Extract and strip the series/episode "sXeY" at end of data ! # ! # Should match --v ! # e6 ! # [E6] ! # s1e6 ! # (s1e6) ! # In the Mix. S1E6 ! # In the Mix. ( S1E6 ). ! ! elsif ( $prog->{$elem} =~ ! s{ ! (?: ! ^ ! | ! [\s([]+ ! ) ! s? ! (\d+)? # $1 ! \s* ! e ! \s* ! (\d+) # $2 ! [\s.,]? ! [)\]]* ! [\s.]* ! $ ! } ! {}ix ! ) ! { ! _d(4,"\t matched 'trailing series/episode' regex"); ! $s = $1 if defined $1 and $1 > 0; ! $e = $2 if defined $2 and $2 > 0; ! } |
From: Nick M. <kno...@us...> - 2016-07-12 01:29:47
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26045/lib Modified Files: Augment.pm Log Message: Update process_translate_genres() * correct documentation to match example rule Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Augment.pm 12 Jul 2016 01:29:32 -0000 1.17 --- Augment.pm 12 Jul 2016 01:29:45 -0000 1.18 *************** *** 2355,2359 **** rule: 14|Soccer~Football in : "Leeds v Arsenal" category "Soccer" ! out: "Leeds v Arsenal" category "Soccer" rule: 14|Adventure/War~Action Adventure~War --- 2355,2359 ---- rule: 14|Soccer~Football in : "Leeds v Arsenal" category "Soccer" ! out: "Leeds v Arsenal" category "Football" rule: 14|Adventure/War~Action Adventure~War |
From: Nick M. <kno...@us...> - 2016-07-12 01:29:35
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26012/lib Modified Files: Augment.pm Log Message: Update process_subtitle_remove_text() * Update sub-title match regex to: i) remove unneeded quoting in character class ii) match removal text to very end of sub-title (no trailing chars) * Upper-case first letter of new sub-title after text has been removed Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Augment.pm 12 Jul 2016 01:29:21 -0000 1.16 --- Augment.pm 12 Jul 2016 01:29:32 -0000 1.17 *************** *** 2002,2007 **** if ($prog->{'_title'} eq $key) { ! if ( $prog->{'_episode'} =~ s/^\Q$value\E[\s\.,:;-]*//i ! || $prog->{'_episode'} =~ s/[\s\.,:;-]*\Q$value\E[\s\.]*$//i ) { l(sprintf("\t Removed text '%s' from subtitle. New subtitle is '%s' (#%s.%s)", --- 2002,2009 ---- if ($prog->{'_title'} eq $key) { ! if ( $prog->{'_episode'} =~ s/^\Q$value\E\s*[.,:;-]?\s*//i ! || $prog->{'_episode'} =~ s/\s*[.,:;-]?\s*\Q$value\E$//i ) { ! ! $prog->{'_episode'} = ucfirst($prog->{'_episode'}); l(sprintf("\t Removed text '%s' from subtitle. New subtitle is '%s' (#%s.%s)", |
From: Nick M. <kno...@us...> - 2016-07-12 01:29:23
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25987/lib Modified Files: Augment.pm Log Message: Update process_replacement_film_genres() * avoid unnecessary defined-ness check The defined-ness of $prog->{'_genres'} is already checked in the enclosing block Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Augment.pm 12 Jul 2016 01:29:10 -0000 1.15 --- Augment.pm 12 Jul 2016 01:29:21 -0000 1.16 *************** *** 2300,2315 **** my $old = ''; ! if (defined $prog->{'_genres'}) { ! foreach my $genre (@{ $prog->{'_genres'} }) { ! $old .= $genre->[0] . ','; ! # is it a film? ! if ( $genre->[0] =~ m/films?/i ) { ! $isfilm = 1; ! } ! } ! chop $old; ! } if (!$isfilm) { --- 2300,2313 ---- my $old = ''; ! foreach my $genre (@{ $prog->{'_genres'} }) { ! $old .= $genre->[0] . ','; ! # is it a film? ! if ( $genre->[0] =~ m/films?/i ) { ! $isfilm = 1; ! } ! } ! chop $old; if (!$isfilm) { |
From: Nick M. <kno...@us...> - 2016-07-12 01:29:12
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25959/lib Modified Files: Augment.pm Log Message: Update process_demoted_titles() * make separator and surrounding whitespace optional Prior to this change, if a programme's sub-title element did not contain optional whitespace and a separator character after the title text to be promoted, the rule would not apply. Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Augment.pm 12 Jul 2016 01:28:58 -0000 1.14 --- Augment.pm 12 Jul 2016 01:29:10 -0000 1.15 *************** *** 1426,1430 **** if ($prog->{'_title'} eq $key) { ! if ( $prog->{'_episode'} =~ s/^\Q$value\E\s*[\.,:;-]\s*//i ) { $prog->{'_title'} = $value; --- 1426,1430 ---- if ($prog->{'_title'} eq $key) { ! if ( $prog->{'_episode'} =~ s/^\Q$value\E(?:\s*[.,:;-]\s*)?//i ) { $prog->{'_title'} = $value; |
From: Nick M. <kno...@us...> - 2016-07-12 01:29:00
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25910/lib Modified Files: Augment.pm Log Message: Update process_replacement_genres() * quote all metacharacters (regular + wildcard rule strings) We need to ensure that titles in user #6 rules have all metacharacters escaped before being used to match against a programme title. For non-wildcard matches we can simply quote the whole title string. For wildcard matches we quotemeta($key) and then un-escape the regex placeholder chars (%%), before substituting them with the wildcard regex chars (.*?) Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Augment.pm 12 Jul 2016 01:28:46 -0000 1.13 --- Augment.pm 12 Jul 2016 01:28:58 -0000 1.14 *************** *** 2205,2211 **** _d(4,"\t $line, $key, $value"); ! my $_key = $self->replace_wild($key); ! if ($prog->{'_title'} =~ m/\Q$_key\E/i ) { #_d(4,dd(4,$prog->{'_genres'})); --- 2205,2212 ---- _d(4,"\t $line, $key, $value"); ! my $qr_key = $self->replace_wild($key); ! _d(5,"\t $line, $qr_key, $value"); ! if ($prog->{'_title'} =~ $qr_key ) { #_d(4,dd(4,$prog->{'_genres'})); *************** *** 3556,3562 **** my ($self, $key) = @_; if ($key =~ m/%%/) { ! $key =~ s/%%/\.\*\?/g } ! return "^$key\$"; } --- 3557,3568 ---- my ($self, $key) = @_; if ($key =~ m/%%/) { ! $key = quotemeta($key); ! $key =~ s/\\%\\%/%%/g; ! $key =~ s/%%/\.\*\?/g; ! return qr/^$key$/; } ! else { ! return qr/^\Q$key\E$/; ! } } |
From: Nick M. <kno...@us...> - 2016-07-12 01:28:49
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25885/lib Modified Files: Augment.pm Log Message: Update process_mixed_subtitle_title() * update title filter regex to match documented separators * update documentation Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Augment.pm 12 Jul 2016 01:28:35 -0000 1.12 --- Augment.pm 12 Jul 2016 01:28:46 -0000 1.13 *************** *** 1745,1749 **** # # Some programme titles contain both the episode and title data, ! # separated by a colon ($episode:$title) or a hyphen ($episode - $title). # Here we reassign the episode to the $episode element, leaving only the # programme's title in the $title element --- 1745,1751 ---- # # Some programme titles contain both the episode and title data, ! # separated by a colon ($episode:$title), semicolon ($episode; $title) or a ! # hyphen ($episode - $title). ! # # Here we reassign the episode to the $episode element, leaving only the # programme's title in the $title element *************** *** 1764,1768 **** if (!defined $self->{'rules'}->{$ruletype}) { return 0; } ! if ( defined $prog->{'_title'} && $prog->{'_title'} =~ m/:|-/ ) { # can't use the index for this one since we don't know what the incoming title begins with --- 1766,1770 ---- if (!defined $self->{'rules'}->{$ruletype}) { return 0; } ! if ( defined $prog->{'_title'} && $prog->{'_title'} =~ m/[:;-]/ ) { # can't use the index for this one since we don't know what the incoming title begins with |
From: Nick M. <kno...@us...> - 2016-07-12 01:28:37
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25857/lib Modified Files: Augment.pm Log Message: Update process_mixed_title_subtitle() * update title filter regex to match documented separators * update documentation Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Augment.pm 12 Jul 2016 01:28:23 -0000 1.11 --- Augment.pm 12 Jul 2016 01:28:35 -0000 1.12 *************** *** 1649,1653 **** # # Some programme titles contain both the title and episode data, ! # separated by a colon ($title:$episode) or a hyphen ($title - $episode). # Here we reassign the episode to the $episode element, leaving only the # programme's title in the $title element --- 1649,1655 ---- # # Some programme titles contain both the title and episode data, ! # separated by a colon ($title:$episode), semicolon ($title; $episode) ! # or a hyphen ($title - $episode). ! # # Here we reassign the episode to the $episode element, leaving only the # programme's title in the $title element *************** *** 1668,1672 **** if (!defined $self->{'rules'}->{$ruletype}) { return 0; } ! if ( defined $prog->{'_title'} && $prog->{'_title'} =~ m/:|-/ ) { my $idx = lc(substr $prog->{'_title'}, 0, 2); --- 1670,1674 ---- if (!defined $self->{'rules'}->{$ruletype}) { return 0; } ! if ( defined $prog->{'_title'} && $prog->{'_title'} =~ m/[:;-]/ ) { my $idx = lc(substr $prog->{'_title'}, 0, 2); |
From: Nick M. <kno...@us...> - 2016-07-12 01:28:25
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25827/lib Modified Files: Augment.pm Log Message: Update process_non_title_info() * update title filter regex to match documented separators * remove unnecessary escaping in separator character class Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Augment.pm 12 Jul 2016 01:28:11 -0000 1.10 --- Augment.pm 12 Jul 2016 01:28:23 -0000 1.11 *************** *** 1356,1360 **** if (!defined $self->{'rules'}->{$ruletype}) { return 0; } ! if ( defined $prog->{'_title'} && $prog->{'_title'} =~ m/:/ ) { my $idx = lc(substr $prog->{'_title'}, 0, 2); --- 1356,1360 ---- if (!defined $self->{'rules'}->{$ruletype}) { return 0; } ! if ( defined $prog->{'_title'} && $prog->{'_title'} =~ m/[:;-]/ ) { my $idx = lc(substr $prog->{'_title'}, 0, 2); *************** *** 1365,1369 **** _d(4,"\t $line, $key, $value"); ! if ( $prog->{'_title'} =~ s/^\Q$key\E\s*[\:;-]\s*//i ) { l(sprintf("\t Removed '%s' from title. New title '%s' (#%s.%s)", $key, $prog->{'_title'}, $ruletype, $line)); --- 1365,1369 ---- _d(4,"\t $line, $key, $value"); ! if ( $prog->{'_title'} =~ s/^\Q$key\E\s*[:;-]\s*//i ) { l(sprintf("\t Removed '%s' from title. New title '%s' (#%s.%s)", $key, $prog->{'_title'}, $ruletype, $line)); |
From: Nick M. <kno...@us...> - 2016-07-12 01:28:13
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25798/lib Modified Files: Augment.pm Log Message: Add add_missing_language_codes() * add lang attr to title, sub-title and desc if missing after augmentation Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Augment.pm 12 Jul 2016 01:27:59 -0000 1.9 --- Augment.pm 12 Jul 2016 01:28:11 -0000 1.10 *************** *** 302,305 **** --- 302,308 ---- $self->tidy_desc_text($prog); + # Add missing language codes to <title>, <sub-title> and <desc> elements + $self->add_missing_language_codes($prog); + l("\t Post-processing title/episode: {" . $prog->{'title'}[0][0] . '~~~' . (defined $prog->{'sub-title'} ? $prog->{'sub-title'}[0][0] : '') . "}" ); *************** *** 384,387 **** --- 387,412 ---- + # Add missing language codes to <title>, <sub-title> and <desc> elements + sub add_missing_language_codes () { + _d(3,self()); + my ($self, $prog) = @_; + + my @elems = ('title', 'sub-title', 'desc'); + foreach my $elem (@elems) { + if (defined $prog->{$elem}) { + dd(3,$prog->{$elem}); + for (my $i=0; $i < scalar @{$prog->{$elem}}; $i++) { + + # add language code if missing (leave existing codes alone) + # my $v = $prog->{$elem}[$i][0]; + # $prog->{$elem}[$i] = [ $v, $self->{'language_code'} ]; + push @{$prog->{$elem}[$i]}, $self->{'language_code'} + if (scalar @{$prog->{$elem}[$i]} == 1); + } + } + } + } + + =item B<remove_duplicated_new_title_in_ep> |
From: Nick M. <kno...@us...> - 2016-07-12 01:28:01
|
Update of /cvsroot/xmltv/xmltv/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25750/lib Modified Files: Augment.pm Log Message: Update remove_duplicated_title_in_ep() * look for undefined regex capture before setting <sub-title> Index: Augment.pm =================================================================== RCS file: /cvsroot/xmltv/xmltv/lib/Augment.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Augment.pm 12 Jul 2016 01:20:09 -0000 1.8 --- Augment.pm 12 Jul 2016 01:27:59 -0000 1.9 *************** *** 522,526 **** || $tmp_episode =~ m/^\Q$tmp_title\E\s+\((.+)\)$/i || $tmp_episode =~ m/^\Q$tmp_title\E\s*$/i ) { ! $prog->{'sub-title'}[0][0] = $1; l(sprintf("\t Removing title text from beginning of episode field (#%s)", $ruletype)); $self->add_to_audit ($me, $key, { '_title'=>$tmp_title, '_episode'=>$tmp_episode }) --- 522,526 ---- || $tmp_episode =~ m/^\Q$tmp_title\E\s+\((.+)\)$/i || $tmp_episode =~ m/^\Q$tmp_title\E\s*$/i ) { ! $prog->{'sub-title'}[0][0] = defined $1 ? $1 : ''; l(sprintf("\t Removing title text from beginning of episode field (#%s)", $ruletype)); $self->add_to_audit ($me, $key, { '_title'=>$tmp_title, '_episode'=>$tmp_episode }) |
From: Nick M. <kno...@us...> - 2016-07-12 01:27:48
|
Update of /cvsroot/xmltv/xmltv/t In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25694/t Added Files: test_tv_augment.t Log Message: Add tv_augment testing framework --- NEW FILE: test_tv_augment.t --- #!/usr/bin/perl # # Run tv_augment against various input files and check the generated output # is as expected. # # This framework (borrowed from test_tv_imdb.t) tests each type of automatic # and user rule for tv_augment (lib/Augment.pm) by comparing the output # generated from input data against the expected output for each rule type. # # -- Nick Morrott, kno...@gm..., 2016-07-07 # $Id: test_tv_augment.t,v 1.1 2016/07/12 01:27:46 knowledgejunkie Exp $ # use warnings; use strict; use Getopt::Long; use Cwd; use File::Temp qw(tempdir); use File::Copy; use XMLTV::Usage <<END $0: test suite for tv_augment usage: $0 [--tests-dir DIR] [--cmds-dir DIR] [--verbose] END ; my $tests_dir = 't/data-tv_augment'; # where to find input XML files die "no directory $tests_dir" if not -d $tests_dir; my $cmds_dir = 'blib/script'; # directory tv_augment lives in die "no directory $cmds_dir" if not -d $cmds_dir; my $verbose = 0; GetOptions('tests-dir=s' => \$tests_dir, 'cmds-dir=s' => \$cmds_dir, 'verbose' => \$verbose) or usage(0); usage(0) if @ARGV; my $tmpDir = tempdir(CLEANUP => 1); # my $tmpDir = tempdir(CLEANUP => 0); my @inputs = <$tests_dir/*.xml>; @inputs = sort (@inputs); die "no test cases (*.xml) found in $tests_dir" if not @inputs; my $numtests = scalar @inputs; print "1..$numtests\n"; my $n = 0; INPUT: foreach my $input (@inputs) { ++$n; use File::Basename; my $input_basename = File::Basename::basename($input); my $output="$tmpDir/".$input_basename."-output"; my $cmd="$cmds_dir/tv_augment --rule $tests_dir/rules/test_tv_augment.rules --config $tests_dir/configs/$input_basename.conf --input $input --output $output --nostats 2>&1"; # my $cmd="perl -I blib/lib $cmds_dir/tv_augment --rule $tests_dir/rules/test_tv_augment.rules --config $tests_dir/configs/$input_basename.conf --input $input --output $output --log $tmpDir/$input_basename.log --debug 5 >$tmpDir/$input_basename.debug 2>&1"; my $r = system($cmd); # Check command return status. if ($r) { my ($status, $sig, $core) = ($? >> 8, $? & 127, $? & 128); if ($sig) { die "$cmd killed by signal $sig, aborting"; } warn "$cmd failed: $status, $sig, $core\n"; print "not ok $n\n"; next INPUT; } open(FD, "$input-expected") || die "$input-expected:$!"; open(OD, "$output") || die "$output:$!"; my $line = 0; my $failed = 0; INPUT: while(<FD>) { my $in=$_; $line++; # ignore single line XML comments in "expected" data next INPUT if ($in =~ m/\s*<!--/); my $out=<OD>; chomp($in); chomp($out); if ( $in ne $out ) { warn "$input ($line) failed to match expected ('$in' != '$out')\n"; $failed = 1; last INPUT; } } close(FD); close(OD); if ($failed) { print "not ok $n\n"; } else { print "ok $n\n"; } } |
From: Nick M. <kno...@us...> - 2016-07-12 01:27:46
|
Update of /cvsroot/xmltv/xmltv/t/data-tv_augment/rules In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25694/t/data-tv_augment/rules Added Files: test_tv_augment.rules Log Message: Add tv_augment testing framework --- NEW FILE: test_tv_augment.rules --- # # Sample "rules" file for use with tv_augment # # $Id: test_tv_augment.rules,v 1.1 2016/07/12 01:27:44 knowledgejunkie Exp $ # # ############################################################################### # # This file contains the rules used by XMLTV::Augment. # # The objective is to fix errors and inconsistencies in the incoming data from # a grabber, and to enhance the programme xml where certain data are missing. # # For example: # Some programme entries in the listings data may contain subtitle/episode # information in the title field, others may contain the programme title # and subtitle reversed, and yet more may contain 'episode' information that # should be in the episode-num field. # # Rules are divided into a number of 'types' according to what they do. # Individual types (rule sets) can be switched off in the augmentation config # file. # # Matching is usually (but not exclusively) done by comparing the incoming # <title> against the title specified in the rule below. # # A 'rule' definition consists of the rule 'type' separated rom the rule # content by a pipe character ('|'). The rule content has a variable (but fixed # for any given rule type) number of fields separated by tilde characters ('~') # # The action taken depends on the rule type: # # 1) non_title_info # The content is text that is to be removed from any programme titles where # this text occurs at the beginning of the <title> element followed by # any of : ; or , # e.g. # 1|Action Heroes Season # "Action Heroes Season: Rambo" --> "Rambo" # # 2) mixed_title_subtitle # The content is the desired title of a programme when the incoming title # contains both the programme's title *and* episode separated by : ; or - # ($title:$episode). We reassign the episode information to the <episode> # element, leaving only the programme title in the <title> element. # e.g. # 2|Blackadder II # "Blackadder II: Potato / " --> "Blackadder II / Potato" # # 3) mixed_subtitle_title # The content is the desired title of a programme when the incoming title # contains both the programme's episode *and* title separated by : ; or - # ($episode:$title). We reassign the episode information to the <episode> # element, leaving only the programme title in the <title> element. # e.g. # 3|Storyville # "Kings of Pastry: Storyville / " --> "Storyville / Kings of Pastry" # # 4) reversed_title_subtitle # The content is the desired title of a programme which is listed as the # programme's episode (i.e. the title and episode details have been # reversed). We therefore reverse the <title> and <episode> elements. # e.g. # 4|Storyville # "Kings of Pastry / Storyville" --> "Storyville / Kings of Pastry" # # 5) replacement_titles # The content contains two programme titles, separated by a # tilde (~). The first title is replaced by the second in the listings # output. # This is useful to fix inconsistent naming (e.g. "Law and Order" vs. # "Law & Order") or inconsistent grammar ("xxxx's" vs. "xxxxs'") # e.g. # 5|A Time Team Special~Time Team # "A Time Team Special / Doncaster" --> "Time Team / Doncaster" # # 6) replacement_genres # The content contains a programme title and a programme category(-ies) # (genres), separated by tilde (~). Categories can be assigned to # uncategorised programmes (which can be seen in the stats log). # (Note that *all* categories are replaced for the title.) # e.g. # 6|Antiques Roadshow~Entertainment~Arts~Shopping # "Antiques Roadshow / " category "Reality" --> # "Antiques Roadshow / " category "Entertainment" + "Arts" + "Shopping" # # 7) replacement_episodes # The content contains a programme title, an old episode value and a new # episode value, separated by tildes (~). # e.g. # 7|Time Team~Time Team Special: Doncaster~Doncaster # "Time Team / Time Team Special: Doncaster" --> "Time Team / Doncaster" # # 8) replacement_titles_episodes # The content contains an old programme title, an old episode value, a new # programme title and a new episode value. The old and new titles MUST be # given, the episode fields can be left empty but the field itself must be # present. # e.g. # 8|Top Gear USA Special~Detroit~Top Gear~USA Special # "Top Gear USA Special / Detroit" --> "Top Gear / USA Special" # # 8|Top Gear USA Special~~Top Gear~USA Special # "Top Gear USA Special / " --> "Top Gear / USA Special" # # 9) replacement_ep_from_desc # The content contains a programme title, a new episode value to update, # and a description (or at least the start of it) to match against. When # title matches incoming data and the incoming description startswith the # text given then the episode value will be replaced. # e.g. # 9|Heroes of Comedy~The Goons~The series celebrating great British # comics pays tribute to the Goons. # "Heroes of Comedy / " desc> = "The series celebrating great British # comics pays tribute to the Goons." # --> "Heroes of Comedy / The Goons" # Should be used with care; e.g. # "Heroes of Comedy / Spike Milligan" desc> = "The series celebrating # great British comics pays tribute to the Goons." # would *also* become # "Heroes of Comedy / The Goons" # this may not be what you want! # # 10) replacement_titles_desc # The content contains an old programme title, an old episode value, a new # programme title, a new episode value and the episode description (or at # least the start of it) to match against. # The old and new titles and description MUST be given, the episode fields # can be left empty but the field itself must be present. # This is useful to fix episodes where the series is unknown but can be # pre-determined from the programme's description. # e.g. # 10|Which Doctor~~Gunsmoke~Which Doctor~Festus and Doc go fishing, but # are captured by a family that is feuding with the Haggens. # "Which Doctor / " desc> = "Festus and Doc go fishing, but are captured # by a family that is feuding with the Haggens. [...]" # --> "Gunsmoke / Which Doctor" # # 11) demoted_titles # The content contains a programme 'brand' and a new title to be extracted # from subtitle field and promoted to programme title, replacing the brand # title. # In other words, if title matches, and sub-title starts with text then # remove the matching text from sub-title and move it into the title. # Any text after 'separator' (any of .,:;-) in the sub-title is preserved. # e.g. # 11|Blackadder~Blackadder II # "Blackadder / Blackadder II: Potato" --> "Blackadder II / Potato" # # 12) replacement_film_genres # The content contains a film title and a category (genre) or categories, # separated by a tilde (~). # If title matches the rule's text and the prog has category "Film" or # "Films", then use the replacement category(-ies) supplied. # Use case: some film-related programmes are incorrectly flagged as films # and should to be re-assigned to a more suitable category. # (Note ALL categories are replaced, not just "Film") # e.g. # 12|The Hobbit Special~Entertainment~Interview # "The Hobbit Special / " category "Film" + "Drama" --> # "The Hobbit Special / " category "Entertainment" + "Interview" # # 13) subtitle_remove_text # The content contains a programme title and arbitrary text to # be removed from the start/end of the programme's subtitle. If the text to # be removed precedes or follows a "separator" (any of .,:;-), the # separator is removed also. # e.g. # 13|Time Team~A Time Team Special # "Time Team / Doncaster : A Time Team Special" --> # "Time Team / Doncaster" # # 14) process_replacement_genres # The content contains a category (genre) value followed by replacement # category(-ies) separated by a tilde (~). # Use case: useful if your PVR doesn't understand some of the category # values in the incoming data; you can translate them to another value. # e.g. # 14|Adventure/War~Action Adventure~War # "The Guns of Navarone" category "Adventure/War" --> # "The Guns of Navarone" category "Action Adventure" + "War" # # 15) process_add_genres_to_channel # The content contains a channel id followed by replacement # category(-ies) separated by a tilde (~). # Use case: this can add a category if data from your supplier is always # missing; e.g. add "News" to a news channel, or "Music" to a music # vid channel. # e.g. # 15|travelchannel.co.uk~Travel # "World's Greatest Motorcycle Rides" category "Motoring" --> # "World's Greatest Motorcycle Rides" category "Motoring" + "Travel" # 15|cnbc.com~News~Business # "Investing in India" category "" --> # "Investing in India" category "News" + "Business" # You should be very careful with this one as it will add the category you # specify to EVERY programme broadcast on that channel. This may not be what # you always want (e.g. Teleshopping isn't really "music" even if it is on MTV!) # # ############################################################################### # # Some sample rules follow; obviously you should delete these and replace with # your own! # 1|Action Heroes Season 1|Python Night 1|Western Season 2|Blackadder II 2|Comic Relief 2|Old Grey Whistle Test 3|Blackadder II 3|Comic Relief 3|Old Grey Whistle Test 3|Storyville 4|Storyville 4|Timewatch 5|A Time Team Special~Time Team 5|Cheaper By the Dozen~Cheaper by the Dozen 5|Later - with Jools Holland~Later... with Jools Holland 6|Antiques Roadshow~Entertainment~Arts~Shopping 6|Deal or No Deal~Game show 6|Later%%... with Jools Holland~Music 6|M*A*S*H%%~Sitcom 6|Men Behaving Badly~Sitcom 6|Mr. Robot~Drama 6|Springwatch 20%%~Nature 7|Time Team~Time Team Special: Doncaster~Doncaster 8|Blackadder~Blackadder Back and Forth~Blackadder: Back and Forth~ 8|Top Gear USA Special~Detroit~Top Gear~USA Special 8|Top Gear USA Special~~Top Gear~USA Special 9|Heroes of Comedy~The Goons~The series celebrating great British comics pays tribute to the Goons. 10|Which Doctor~~Gunsmoke~Which Doctor~Festus and Doc go fishing, but are captured by a family that is feuding with the Haggens. 10|Which Doctor~Which Doctor~Gunsmoke~Which Doctor~Festus and Doc go fishing, but are captured by a family that is feuding with the Haggens. 11|Blackadder~Blackadder II 11|Formula One~Live Formula One 11|Man on Earth~Man on Earth with Tony Robinson 12|Hell on Wheels~Drama 12|The Hobbit Special~Entertainment~Interview 13|Time Team~A Time Team Special 13|World's Busiest~World's Busiest 14|Adventure/War~Action Adventure~War 14|NFL~American Football 14|Soccer~Football 15|smashhits.net~Music 15|travelchannel.co.uk~Travel # # (the sample rules shown here are in sorted order but that is not necessary # in your live file) ############################################################################### |
From: Nick M. <kno...@us...> - 2016-07-12 01:20:49
|
Update of /cvsroot/xmltv/xmltv/t/data-tv_augment/configs In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24655/t/data-tv_augment/configs Log Message: Directory /cvsroot/xmltv/xmltv/t/data-tv_augment/configs added to the repository |
From: Nick M. <kno...@us...> - 2016-07-12 01:20:41
|
Update of /cvsroot/xmltv/xmltv/t/data-tv_augment/rules In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24632/t/data-tv_augment/rules Log Message: Directory /cvsroot/xmltv/xmltv/t/data-tv_augment/rules added to the repository |
From: Nick M. <kno...@us...> - 2016-07-12 01:20:31
|
Update of /cvsroot/xmltv/xmltv/t/data-tv_augment In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24617/t/data-tv_augment Log Message: Directory /cvsroot/xmltv/xmltv/t/data-tv_augment added to the repository |
From: Nick M. <kno...@us...> - 2016-07-12 01:20:12
|
Update of /cvsroot/xmltv/xmltv/filter/augment In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24582/filter/augment Modified Files: augment.conf Log Message: Rename rule #A6 to #A5.4 Even if enabled in the config file, rule #A6 is only active when #A5 is enabled to allow checking of programme numbering. It therefore seems appropriate to make rule #A6 a "sub-rule" of #A5. Index: augment.conf =================================================================== RCS file: /cvsroot/xmltv/xmltv/filter/augment/augment.conf,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** augment.conf 27 Jun 2016 23:55:38 -0000 1.3 --- augment.conf 12 Jul 2016 01:20:09 -0000 1.4 *************** *** 77,81 **** extract_numbering_from_desc = 1 ! # Rule #A6 - If no <sub-title> then make one from "part" numbers. make_episode_from_part_numbers = 1 --- 77,82 ---- extract_numbering_from_desc = 1 ! # Rule #A5.4 - If no <sub-title> then make one from "part" numbers. ! # (requires #A5 enabled) make_episode_from_part_numbers = 1 |
From: Kevin G. <kgr...@us...> - 2016-07-09 18:03:43
|
Update of /cvsroot/xmltv/xmltv In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12177 Modified Files: Makefile.PL Log Message: tv_grab_sd_json: Improve efficiency of date/time handling. After profiling the code using NYTProf I found that the DateTime parsing and comparisons were the top usage of execution time. Adding my own parsing functions and converting everything to seconds from epoch for comparisons makes a huge difference in performance. Excluding network delays (or when everything is already in the cache) the execution time is now about cut in half. DateTime usage is actually still the number one item in the profiler output so there may still be room for improvement here but dates and times are hard to get right with all the timezone, DST, leap, etc. issues. Index: Makefile.PL =================================================================== RCS file: /cvsroot/xmltv/xmltv/Makefile.PL,v retrieving revision 1.457 retrieving revision 1.458 diff -C2 -d -r1.457 -r1.458 *** Makefile.PL 29 Jun 2016 00:00:00 -0000 1.457 --- Makefile.PL 9 Jul 2016 18:03:41 -0000 1.458 *************** *** 900,904 **** blurb => '$$ Grabber for schedulesDirect.org SD-JSON service (many countries)', exes => [ 'grab/sd_json/tv_grab_sd_json' ], ! prereqs => { 'DateTime::Format::DateParse' => 0, 'Digest::SHA' => 0, 'JSON' => 0, --- 900,904 ---- blurb => '$$ Grabber for schedulesDirect.org SD-JSON service (many countries)', exes => [ 'grab/sd_json/tv_grab_sd_json' ], ! prereqs => { 'DateTime' => 0, 'Digest::SHA' => 0, 'JSON' => 0, |
From: Kevin G. <kgr...@us...> - 2016-07-08 23:03:50
|
Update of /cvsroot/xmltv/xmltv/grab/sd_json In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22128 Modified Files: tv_grab_sd_json Log Message: tv_grab_sd_json: Fix issue with removing a deleted lineup from your account. When your account had a deleted lineup the list of lineups was not shown correctly and you could not remove the deleted lineup. Index: tv_grab_sd_json =================================================================== RCS file: /cvsroot/xmltv/xmltv/grab/sd_json/tv_grab_sd_json,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tv_grab_sd_json 8 Jul 2016 23:02:17 -0000 1.17 --- tv_grab_sd_json 8 Jul 2016 23:03:48 -0000 1.18 *************** *** 307,316 **** sub sd_json_add_lineup { my ($lineup) = @_; ! return sd_json_request('put', $lineup); } sub sd_json_delete_lineup { my ($lineup) = @_; ! return sd_json_request('delete', $lineup); } --- 307,316 ---- sub sd_json_add_lineup { my ($lineup) = @_; ! return sd_json_request('put', "lineups/$lineup"); } sub sd_json_delete_lineup { my ($lineup) = @_; ! return sd_json_request('delete', "lineups/$lineup"); } *************** *** 376,382 **** my $transport = $lineup->{'transport'} // 'unknown'; my $name = $lineup->{'name'} // 'unknown'; ! my ($id) = $lineup->{'uri'} =~ m{.*/(.*)}; ! if($transport eq 'QAM') { return "$id | $transport"; } --- 376,385 ---- my $transport = $lineup->{'transport'} // 'unknown'; my $name = $lineup->{'name'} // 'unknown'; ! my $id = $lineup->{'lineup'} // 'unknown'; ! if($lineup->{'isDeleted'}) { ! return "$id | $name"; ! } ! elsif($transport eq 'QAM') { return "$id | $transport"; } *************** *** 512,520 **** my $country = uc(ask('Lineup ID or Country (ISO-3166-1 alpha 3 such as USA or CAN):')); if(length($country) > 3) { ! sd_json_add_lineup("lineups/$country"); } else { my $count = 0; ! my @uri; if(ask_search_by_transmitter($country)) { --- 515,523 ---- my $country = uc(ask('Lineup ID or Country (ISO-3166-1 alpha 3 such as USA or CAN):')); if(length($country) > 3) { ! sd_json_add_lineup("$country"); } else { my $count = 0; ! my @lineups; if(ask_search_by_transmitter($country)) { *************** *** 525,529 **** $count++; my $lineup = $transmitters->{$transmitter}; ! push(@uri, "lineups/$lineup"); say("$count. $lineup | $transmitter"); } --- 528,532 ---- $count++; my $lineup = $transmitters->{$transmitter}; ! push(@lineups, $lineup); say("$count. $lineup | $transmitter"); } *************** *** 537,542 **** for my $lineup (@{$headend->{'lineups'}}) { $count++; ! push(@uri, $lineup->{'uri'}); ! my ($id) = $lineup->{'uri'} =~ m{.*/(.*)}; say("$count. $id | $lineup->{'name'} | $headend->{'location'} | $headend->{'transport'}"); } --- 540,545 ---- for my $lineup (@{$headend->{'lineups'}}) { $count++; ! my $id = $lineup->{'lineup'}; ! push(@lineups, $id); say("$count. $id | $lineup->{'name'} | $headend->{'location'} | $headend->{'transport'}"); } *************** *** 546,550 **** my $add = ask_choice('Add lineup (0 = none):', 0, (0 .. $count)); if($add) { ! sd_json_add_lineup($uri[$add - 1]); } } --- 549,553 ---- my $add = ask_choice('Add lineup (0 = none):', 0, (0 .. $count)); if($add) { ! sd_json_add_lineup($lineups[$add - 1]); } } *************** *** 553,557 **** my $delete = ask_choice('Delete lineup (0 = none):', 0, (0 .. $count)); if($delete) { ! sd_json_delete_lineup($lineups->[$delete - 1]->{'uri'}); } } --- 556,560 ---- my $delete = ask_choice('Delete lineup (0 = none):', 0, (0 .. $count)); if($delete) { ! sd_json_delete_lineup($lineups->[$delete - 1]->{'lineup'}); } } *************** *** 601,605 **** }); for my $lineup (@{$lineups}) { ! my ($id) = $lineup->{'uri'} =~ m{.*/(.*)}; $w->write_option({ value => $id, --- 604,608 ---- }); for my $lineup (@{$lineups}) { ! my $id = $lineup->{'lineup'}; $w->write_option({ value => $id, |
From: Kevin G. <kgr...@us...> - 2016-07-08 23:02:19
|
Update of /cvsroot/xmltv/xmltv/grab/sd_json In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22019 Modified Files: tv_grab_sd_json Log Message: tv_grab_sd_json: Allow search by transmitter for more than GBR. It turns out I was mistaken that only GBR is supported for transmitter search. I now parse the available countries from the response to the /available API. Index: tv_grab_sd_json =================================================================== RCS file: /cvsroot/xmltv/xmltv/grab/sd_json/tv_grab_sd_json,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tv_grab_sd_json 8 Jul 2016 21:05:47 -0000 1.16 --- tv_grab_sd_json 8 Jul 2016 23:02:17 -0000 1.17 *************** *** 276,279 **** --- 276,294 ---- } + sub sd_json_get_available { + my ($type) = @_; + my $result = sd_json_request('get', 'available'); + + if($type) { + for my $entry (@{$result}) { + if($entry->{'type'} eq $type) { + return $entry; + } + } + } + + return $result; + } + sub sd_json_get_lineups { return sd_json_request('get', 'lineups'); *************** *** 371,378 **** } sub ask_search_by_transmitter { my ($country) = @_; ! if($country eq 'GBR') { my @options; push(@options, 'transmitter'); --- 386,402 ---- } + my %transmitter_countries; + sub ask_search_by_transmitter { my ($country) = @_; ! if(!%transmitter_countries) { ! my $available = sd_json_get_available('DVB-T'); ! for ($available->{'description'} =~ /[A-Z]{3}/g) { ! $transmitter_countries{$_} = undef; ! } ! } ! ! if(exists $transmitter_countries{$country}) { my @options; push(@options, 'transmitter'); |