Commits

Palmer, 2E0EOL committed 7a50136

Merge the paths section into the feeds main configuration

Comments (0)

Files changed (1)

 # Parent 643f61e053c33732b1e4a975fd3dedf3acd2613c
 Break up downloads into categories using paths
 
+diff -r 643f61e053c3 dlpodget
+--- a/dlpodget	Mon Jan 21 23:23:26 2013 +0000
++++ b/dlpodget	Sat Jan 26 16:22:19 2013 +0000
+@@ -177,6 +177,7 @@
+ 		}
+ 	}
+ 	if ( $conf ) {
++		my %reserveSec = map {  $_ => 1 } ( '_main', 'paths' ); # Reserved section names
+ 		my ( @sections, $secC );
+ 		$secC = $conf->GetSections(\@sections);
+ 
+@@ -196,11 +197,20 @@
+ 			}
+ 		}
+ 
++		if ( 'paths' ~~ @sections ) { # Has a paths section?
++			my @secKeys;
++			if ( $conf->GetKeys('paths', \@secKeys) ) {
++				foreach my $pk ( @secKeys ) {
++					$feeds{_main}->{ uc($pk) } = $conf->GetDatum('paths', $pk);
++				}
++			}
++		}
++
+ 		for ( my $secI = 0; $secI < $secC; $secI++ ) {
+ 			my @secKeys;
+ 			my $keyC = $conf->GetKeys($sections[$secI], \@secKeys);
+ 			foreach ( my $keyI = 0; $keyI < $keyC; $keyI++ ) {
+-				next if ( $sections[$secI] eq '_main' ); # Skip reserved section
++				next if ( $reserveSec{$sections[$secI]} ); # Skip reserved sections
+ 				my $v = $conf->GetDatum($sections[$secI], $secKeys[$keyI]);
+ 				$v = ProcessTags(\%feeds, $v);
+ 				printf(
 diff -r 643f61e053c3 dlpodget.rc
 --- a/dlpodget.rc	Mon Jan 21 23:23:26 2013 +0000
-+++ b/dlpodget.rc	Sat Jan 26 15:48:31 2013 +0000
++++ b/dlpodget.rc	Sat Jan 26 16:22:19 2013 +0000
 @@ -16,138 +16,145 @@
  ;   noop      = <1|0>, default 0, set to 1 to disable modification of local files.