xmltv/grab/sd_json tv_grab_sd_json,1.11,1.12

Kevin Groeneveld <[email protected]> Sat, 11 Jun 2016 17:53:36 +0000
Newsgroups gmane.comp.tv.xmltv.cvs
Message-ID <[email protected]>
Update of /cvsroot/xmltv/xmltv/grab/sd_json
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10687

Modified Files:
	tv_grab_sd_json 
Log Message:
tv_grab_sd_json: Add test for invalid channels in configuration.
  
This prevents "Use of uninitialized value in sprintf" warnings and prevents
invalid channels from being included in the XML output.


Index: tv_grab_sd_json
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/sd_json/tv_grab_sd_json,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** tv_grab_sd_json	9 Jun 2016 00:39:05 -0000	1.11
--- tv_grab_sd_json	11 Jun 2016 17:53:34 -0000	1.12
***************
*** 765,769 ****
  	my $limit = DateTime->now()->subtract(days => 10)->epoch();
  
! 	print STDERR "Removing old cache entires...\n" unless $quiet;
  
  	while(my ($key, $hash) = each %{$cache}) {
--- 765,769 ----
  	my $limit = DateTime->now()->subtract(days => 10)->epoch();
  
! 	print STDERR "Removing old cache entries...\n" unless $quiet;
  
  	while(my ($key, $hash) = each %{$cache}) {
***************
*** 810,815 ****
  }
  
! sub cache_index {
! 	print STDERR "Indexing data...\n" unless $quiet;
  
  	# create index
--- 810,815 ----
  }
  
! sub cache_index_channels {
! 	print STDERR "Indexing channels...\n" unless $quiet;
  
  	# create index
***************
*** 869,873 ****
  	}
  	else {
! 		my @list = uniq(@{$conf->{'channel'}});
  		return \@list;
  	}
--- 869,883 ----
  	}
  	else {
! 		my @list;
! 
! 		for my $channel (uniq(@{$conf->{'channel'}})) {
! 			if(exists $channel_index{$channel}) {
! 				push(@list, $channel);
! 			}
! 			else {
! 				print STDERR "Channel ID $channel in the current configuration is not found in any enabled lineup.\n" unless $quiet;
! 			}
! 		}
! 
  		return \@list;
  	}
***************
*** 1358,1361 ****
--- 1368,1372 ----
  	sd_json_init($conf);
  	cache_update_lineups();
+ 	cache_index_channels();
  	$channels = get_channel_list($conf);
  
***************
*** 1367,1371 ****
  	cache_drop_old();
  	cache_save();
- 	cache_index();
  
  	print STDERR "Writing output...\n" unless $quiet;
--- 1378,1381 ----


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e