Commits

Palmer, 2E0EOL committed 5be67c4

Better handling of no valid streams -- since the _main section confuses us

  • Participants
  • Parent commits e6c92e2
  • Branches develop

Comments (0)

Files changed (1)

 	my %feeds = ( );
 	my %opts = ( );
 	my $confSeen = 0;
-	my $streamsEnabledCount = 0;
+	my ( $streamsEnabledCount, $streamsDefinedCount ) = ( 0, 0 );
 	my @confFiles = (
 		'dlpodget.rc',
 		"$ENV{HOME}/.dlpodget.rc"
 
 	foreach my $feedName ( keys(%feeds) ) {
 		my $feed = $feeds{$feedName};
+		$streamsDefinedCount++ if ( $feed->{rss} );
 		next if ( !$feed->{enable} );
 		next if ( !$feed->{download} );
 		@entries = ReadStream(\%feeds, $feed->{rss}, $feedName);
 			DownloadStream(\%feeds, $entry, $feedName);
 		}
 	}
-	unless ( scalar(keys(%feeds))-1 ) { # (Ignoring _main)
+	unless ( $streamsDefinedCount ) {
 		print "No valid streams defined.\n";
 		return 1;
 	}