Changeset 974
- Timestamp:
- 12/04/07 05:23:12 (6 years ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
postprocessors/flag_aus_hdtv (modified) (10 diffs)
-
status (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/postprocessors/flag_aus_hdtv
r973 r974 13 13 14 14 my $progname = "flag_aus_hdtv"; 15 my $version = "0.2 3";15 my $version = "0.24"; 16 16 17 17 $| = 1; … … 70 70 my %stats; 71 71 my $channels, my $reverse_channels, my $detailed_reverse_channels, my $opt_channels, my %channel_xmlid_to_opt_channel_xmlid; 72 my $d, my $ o, my $hd;72 my $d, my $ar, my $sd, my $hd; 73 73 my $override_settings = { }; 74 74 my %amp = ( nbsp => ' ', qw{ amp & lt < gt > apos ' quot " } ); … … 286 286 287 287 foreach my $hdchannel (keys %$hd_to_sds) { 288 if ( exists$channels->{$hdchannel}) {288 if (defined $channels->{$hdchannel}) { 289 289 foreach my $sdchannel (@{$hd_to_sds->{$hdchannel}}) { 290 if ( exists$channels->{$sdchannel}) {290 if (defined $channels->{$sdchannel}) { 291 291 # there can be only one SD channel for the 7HD channel 292 292 $channel_xmlid_to_opt_channel_xmlid{$channels->{$sdchannel}} = 293 $channels->{$hdchannel};293 $channels->{$hdchannel}; 294 294 print " '$hdchannel' with xmlid '$channels->{$hdchannel}'" . 295 295 " populated with programs provided by " . … … 354 354 355 355 if (defined $opt_channels->{$oldname."HD"}) { 356 if ( exists$channel_xmlid_to_opt_channel_xmlid{$chanid}) {356 if (defined $channel_xmlid_to_opt_channel_xmlid{$chanid}) { 357 357 print " - Skipping '${oldname}HD' treated as '${name}HD' with xmlid '" . 358 358 $opt_channels->{$oldname."HD"} . "' " . … … 629 629 #print "process later high definition channel programmes - $this_title - $reverse_channels->{$this_chan}\n"; 630 630 $prog->{video}->{quality} = "HDTV" unless (defined $opt->{notag}); 631 $ o->{$reverse_channels->{$this_chan}}->{Shepherd::Common::parse_xmltv_date($prog->{start})} = $prog;631 $ar->{$reverse_channels->{$this_chan}}->{Shepherd::Common::parse_xmltv_date($prog->{start})} = $prog; 632 632 return; 633 } 634 635 # keep a copy of standard definition related to high definition channel programmes for program removal later 636 if (defined $channel_xmlid_to_opt_channel_xmlid{$this_chan} && 637 defined $detailed_reverse_channels->{$channel_xmlid_to_opt_channel_xmlid{$this_chan}}) { 638 $sd->{$detailed_reverse_channels->{$channel_xmlid_to_opt_channel_xmlid{$this_chan}}}-> 639 {Shepherd::Common::parse_xmltv_date($prog->{start})} = $prog; 633 640 } 634 641 … … 697 704 sub write_hd # currently doesn't fill any gaps between programs 698 705 { 706 # remove from argument channel identical (time, title, sub-title) programs found on sd channel 707 foreach my $hdchannel (keys %$ar) { 708 #print "removal for hdchannel $hdchannel\n"; 709 710 my @aprogs = sort {$a <=> $b} keys %{$ar->{$hdchannel}}; 711 my $aprog = $ar->{$hdchannel}->{shift @aprogs}; 712 713 my @progs = sort {$a <=> $b} keys %{$sd->{$hdchannel}}; 714 my $prog = $sd->{$hdchannel}->{shift @progs}; 715 last if !defined $prog; 716 my $start = Shepherd::Common::parse_xmltv_date($prog->{start}); 717 my $stop = Shepherd::Common::parse_xmltv_date($prog->{stop}); 718 #print "found programs\n"; 719 720 while (defined $aprog) { 721 my $astart = Shepherd::Common::parse_xmltv_date($aprog->{start}); 722 my $astop = Shepherd::Common::parse_xmltv_date($aprog->{stop}); 723 724 # skip any sd programs before this argument programs time 725 while (defined $prog && $start < $astart) { 726 #print "skip prog\n"; 727 $prog = $sd->{$hdchannel}->{shift @progs}; 728 last if !defined $prog; 729 $start = Shepherd::Common::parse_xmltv_date($prog->{start}); 730 $stop = Shepherd::Common::parse_xmltv_date($prog->{stop}); 731 } 732 last if !defined $prog; 733 734 if ($astart == $start && $astop == $stop && 735 (!defined $aprog->{title} || !defined $prog->{title} || 736 $aprog->{title}->[0]->[0] eq $prog->{title}->[0]->[0]) && 737 (!defined $aprog->{'sub-title'} || !defined $prog->{'sub-title'} || 738 $aprog->{'sub-title'}->[0]->[0] eq $prog->{'sub-title'}->[0]->[0])) { 739 #print "delete aprog\n"; 740 delete $ar->{$hdchannel}->{$astart}; 741 } 742 743 $aprog = $ar->{$hdchannel}->{shift @aprogs}; 744 } 745 } 746 699 747 foreach my $xmlid (keys %$hd) { 700 748 #print "processing channel xmlid $xmlid\n"; 701 749 702 my ($argument, @a rguments, $aprog);750 my ($argument, @aprogs, $aprog); 703 751 704 752 # if an argument channel exists, sort the programs ready for inserting … … 708 756 709 757 print " channel '"; 710 if ( exists$detailed_reverse_channels->{$channel_xmlid_to_opt_channel_xmlid{$xmlid}}) {758 if (defined $detailed_reverse_channels->{$channel_xmlid_to_opt_channel_xmlid{$xmlid}}) { 711 759 print $detailed_reverse_channels->{$channel_xmlid_to_opt_channel_xmlid{$xmlid}}; 712 760 } else { … … 716 764 " augmented with programs from channel '$argument'\n"; 717 765 718 if (defined $ o->{$argument}) {719 @a rguments = sort {$a <=> $b} keys %{$o->{$argument}};720 $aprog = $ o->{$argument}->{shift @arguments};766 if (defined $ar->{$argument}) { 767 @aprogs = sort {$a <=> $b} keys %{$ar->{$argument}}; 768 $aprog = $ar->{$argument}->{shift @aprogs}; 721 769 } 722 770 #print "first argument program at $aprog->{start}\n"; … … 744 792 } 745 793 746 $aprog = $ o->{$argument}->{shift @arguments};794 $aprog = $ar->{$argument}->{shift @aprogs}; 747 795 } 748 796 … … 761 809 #print "wrote left over argument program $aprog->{title}->[0]->[0]\n"; 762 810 763 $aprog = $ o->{$argument}->{shift @arguments};811 $aprog = $ar->{$argument}->{shift @aprogs}; 764 812 } 765 813 } -
trunk/status
r973 r974 19 19 postprocessor imdb_augment_data 0.35 20 20 postprocessor tvdb_augment_data 0.11 21 postprocessor flag_aus_hdtv 0.2 321 postprocessor flag_aus_hdtv 0.24 22 22 postprocessor augment_timezone 0.17
