Skip to content

Commit

Permalink
-d option to force chart download
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Chaloupecky committed Jan 21, 2018
1 parent 0fc639c commit 1e1201b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions load_dtpp_metadata.pl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
say "Supplied airport ID: Only $airportId will be processed!";
}

our $downloadAll = $opt{d};


my $BASE_DIR = shift @ARGV;
Expand Down Expand Up @@ -402,17 +403,22 @@ sub record {
deleteStaleFiles($pdf_name);
++$deletedCount;
}

my $doDownload = 0;
if ( $user_action =~ /A/i ) {
say "Added " . "$dtppDownloadDir" . "$pdf_name";
downloadPlate($pdf_name);
++$addedCount;
$doDownload = 1

}
if ( $user_action =~ /C/i ) {
downloadPlate($pdf_name);
++$changedCount;
$doDownload = 1;
}

if ($doDownload || $downloadAll) {
downloadPlate($pdf_name);
}
#If the pdf doesn't exist locally fetch it
#but don't bother trying to download DELETED charts
if ( !( $pdf_name =~ /DELETED/i )
Expand Down

0 comments on commit 1e1201b

Please sign in to comment.