Changeset 967

Show
Ignore:
Timestamp:
11/01/07 23:45:17 (6 years ago)
Author:
paul
Message:

flag_aus_hdtv: fix multiple for base channels (repeated programs on hd channels)

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/postprocessors/flag_aus_hdtv

    r927 r967  
    1313 
    1414my $progname = "flag_aus_hdtv"; 
    15 my $version = "0.21"; 
     15my $version = "0.22"; 
    1616 
    1717$| = 1; 
     
    5555 
    5656my %stats; 
    57 my $channels, my $opt_channels; 
     57my $channels, my $opt_channels, my %channel_xmlid_to_opt_channel_xmlid; 
    5858my $d; 
    5959my $override_settings = { }; 
     
    265265        } 
    266266 
    267         my ($shortchannels, $shortoptchannels); 
     267        my $shortchannels; 
    268268        while (my ($name, $chanid) = each %$channels) 
    269269        { 
     
    312312 
    313313            push @{$shortchannels->{$name}}, $chanid; 
    314             push @{$shortoptchannels->{$name."HD"}}, $opt_channels->{$oldname."HD"} 
     314            $channel_xmlid_to_opt_channel_xmlid{$chanid} = $opt_channels->{$oldname."HD"} 
    315315                    if defined $opt_channels->{$oldname."HD"}; 
    316316 
     
    322322        } 
    323323        $channels = $shortchannels; 
    324         $opt_channels = $shortoptchannels; 
    325324} 
    326325 
     
    562561        my $this_chan = $prog->{channel}; 
    563562        my $this_title; 
    564         my $hd_chan_base; 
    565563 
    566564        $this_title = $prog->{title}->[0]->[0] 
     
    570568        goto NOMATCH if (!defined $this_chan); 
    571569        goto NOMATCH if (!defined $this_title); 
    572         goto NOMATCH if (!defined $d->{prog}->{$this_chan}); 
    573570 
    574571        # if programme is already marked as HDTV, just skip all of this 
     
    586583                        printf "  matched '$t' to '$this_title' (canonical match)\n" if (!defined $d->{seenprog}->{$this_title}); 
    587584                        $stats{matched_prog}++; 
    588                         $hd_chan_base = $d->{prog}->{$this_chan}->{$t}->{chan}."HD"; 
    589585                        goto MATCH; 
    590586                } 
     
    606602                                printf "  matched '$t' to '$this_title' (hd override)\n" if (!defined $d->{seenprog}->{$this_title}); 
    607603                                $stats{override_matched_prog}++; 
    608                                 $hd_chan_base = $ch."HD"; 
    609604                                goto MATCH; 
    610605                        } 
     
    620615        $prog->{video}->{aspect} = "16:9"; # widescreen 
    621616 
    622         if (!defined $opt_channels->{$hd_chan_base}) { 
     617        if (!defined $channel_xmlid_to_opt_channel_xmlid{$this_chan}) { 
    623618                # no HD variant 
    624619                $prog->{video}->{quality} = "HDTV" unless (defined $opt->{notag}); 
    625  
    626620                $writer->write_programme($prog); 
    627621                $stats{rewrote_prog_as_hdtv_inplace}++; 
    628622        } else { 
    629623                if ($opt->{action} =~ /copy/) { 
     624                        # SD channel 
     625                        delete $prog->{video}->{quality}; 
    630626                        $writer->write_programme($prog); 
    631627                        $stats{rewrote_prog_as_hdtv_inplace}++; 
     
    634630                # populate this programme in HD channel 
    635631                $prog->{video}->{quality} = "HDTV" unless (defined $opt->{notag}); 
    636                 foreach (@{$opt_channels->{$hd_chan_base}}) { 
    637                         $prog->{channel} = $_; 
    638                         $writer->write_programme($prog); 
    639                         $stats{wrote_prog_into_hdtv_channel}++ 
    640                 } 
     632                $prog->{channel} = $channel_xmlid_to_opt_channel_xmlid{$this_chan}; 
     633                $writer->write_programme($prog); 
     634                $stats{wrote_prog_into_hdtv_channel}++ 
    641635        } 
    642636        return; 
  • trunk/status

    r966 r967  
    2020postprocessor   imdb_augment_data   0.35 
    2121postprocessor   tvdb_augment_data   0.11 
    22 postprocessor   flag_aus_hdtv       0.21 
     22postprocessor   flag_aus_hdtv       0.22 
    2323postprocessor   augment_timezone    0.17