Changeset 819
- Timestamp:
- 06/29/07 04:56:01 (6 years ago)
- Files:
-
- 2 modified
-
reconcilers/reconciler_mk2 (modified) (8 diffs)
-
status (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
reconcilers/reconciler_mk2
r808 r819 40 40 # 41 41 # other features: 42 # - will automatically split titles with "title: subtitle" into "title" and43 # "subtitle" (controlled via $reclogic{min_title_for_colon_title_split})44 42 # - will try to match "same titles" (including fuzzy title matching) for 45 43 # duplicate programmes within 10 minutes (or whatever … … 95 93 96 94 my $progname = "reconciler_mk2"; 97 my $version = "0.2 8";95 my $version = "0.29"; 98 96 99 97 use LWP::UserAgent; … … 136 134 $reclogic{always_add_new_channels} = 0; # don't 137 135 138 # when we have a title with a ": " in the middle but no subtitle, split139 # the title into "title: subtitle" provided title & subtitle are each at least140 # 5 characters long141 $reclogic{min_title_for_colon_title_split} = 5;142 143 136 # don't accept programmes that last for longer than 8 hours. 144 137 $reclogic{max_programme_length} = (8 * 60 * 60); # 8 hours 138 $reclogic{max_programme_length_sky_racing} = (12 * 60 * 60); # 12 hours 145 139 146 140 # store a preferred title only if we have at least 1 alternative … … 1043 1037 (strftime "%a%e%b%H%M", localtime($t2)), ($t2 - $t1), $source)) if ($t1 && $t2); 1044 1038 1045 if ((($t2 - $t1) > $reclogic{max_programme_length}) && ($prog_title !~ /close/i)) { 1039 # limit programme length for any not called 'close' but a longer length of 'SkyRacing' 1040 if ((($t2 - $t1) > $reclogic{max_programme_length}) && ($prog_title !~ /\bclose\b/i) && 1041 (($in->{channels}->{$prog_chan}->{pref_desc} ne 'SkyRacing') || 1042 (($t2 - $t1) > $reclogic{max_programme_length_sky_racing}))) { 1046 1043 &log($reclogic{warn_on_invalid_time_in_prog}, 1047 1044 (sprintf "WARNING: programme '%s' on channel '%s' from %s had a programme duration (%d) that exceeded max_programme_length (%d): start '%s' stop '%s'; ignored.", … … 1057 1054 $prog->{grabber_num} = ($in->{num_datafiles}-1); 1058 1055 my $prog_key = sprintf "%d:%d",$t1,$t2; 1059 1060 # if there is a ": " in title and no subtitle, split title into "title: subtitle"1061 # provided each of title/subtitle will be at least $reclogic{min_title_for_colon_title_split}1062 # characters1063 if (!defined $prog_subtitle) {1064 my ($title1,$title2) = split(/: /,$prog_title,2);1065 1066 if (($title1) && ($title2) &&1067 (length($title1) >= $reclogic{min_title_for_colon_title_split}) &&1068 (length($title2) >= $reclogic{min_title_for_colon_title_split})) {1069 &log($reclogic{debug_subtitle_derived_from_title},1070 (sprintf "split title \"%s\" into title \"%s\" subtitle \"%s\" since over min_title_for_colon_title_split (%d)",1071 $prog_title, $title1, $title2, $reclogic{min_title_for_colon_title_split}));1072 $stats{derived_subtitle_from_title}++;1073 1074 $prog_title = $title1;1075 $prog->{title}->[0]->[0] = $title1;1076 1077 $prog_subtitle = $title2;1078 $prog->{'sub-title'}->[0]->[0] = $title2;1079 $prog->{'sub-title'}->[0]->[1] = $prog->{'title'}->[0]->[1];1080 }1081 1082 }1083 1056 1084 1057 # check to see if this grabber has supplied a programme with this start/stop on this … … 1520 1493 my $lang = $entry->[1]; 1521 1494 $lang = "BLANK" if (!$lang); 1522 $lang_added{$lang} = $val;1495 push(@{$lang_added{$lang}}, $val); 1523 1496 $num_added++; 1524 1497 } … … 1543 1516 # 'premiere' - don't pass it on but instead set premiere field. 1544 1517 # 'en' - (as in language: en) - just strip 1518 # duplicate - just strip 1545 1519 if ($field eq 'category') { 1546 1520 if ($val eq "premiere") { … … 1551 1525 &log($reclogic{debug_add_logic}," - stripped 'en' category"); 1552 1526 next; 1527 } elsif (defined $lang_added{$lang} && grep($_ eq $val, @{$lang_added{$lang}})) { 1528 &log($reclogic{debug_add_logic}," - stripped duplicate category"); 1529 next; 1553 1530 } 1554 1531 } 1555 1532 1556 if (($field eq 'category') || ($field eq 'country')) {1557 # don't add duplicates1558 my $found;1559 foreach my $num (0 .. ($num_added-1)) {1560 if (($newprog->{$field}->[$num]->[0] eq $val) and1561 ((not $newprog->{$field}->[$num]->[1] and ($lang eq "BLANK")) or1562 ($newprog->{$field}->[$num]->[1] eq $lang))) {1563 $found = 1;1564 last;1565 }1566 }1567 next if ($found);1568 }1569 1570 1533 if ((!defined $lang_added{$lang}) || ($field eq 'category') || ($field eq 'country')) { 1571 $lang_added{$lang} = $val;1534 push(@{$lang_added{$lang}}, $val); 1572 1535 1573 1536 $newprog->{$field}->[$num_added]->[0] = $val; -
status
r818 r819 14 14 grabber southerncross_website 0.12 15 15 grabber ten_website 1.01 16 reconciler reconciler_mk2 0.2 816 reconciler reconciler_mk2 0.29 17 17 postprocessor imdb_augment_data 0.21 18 18 postprocessor tvdb_augment_data 0.04
