diff --git a/lib/SLUB/LZA/TA/Command/report.pm b/lib/SLUB/LZA/TA/Command/report.pm index fbc8d05743ce75132ff967104450aed88e0e85c6..0a5d93ba0f1d6c7b9c148a871e969da5fb2fd6cf 100644 --- a/lib/SLUB/LZA/TA/Command/report.pm +++ b/lib/SLUB/LZA/TA/Command/report.pm @@ -271,9 +271,8 @@ PAINLESS return $aips_response; } -sub get_ldp_projects { ## no critic (CognitiveComplexity::ProhibitExcessCognitiveComplexity) - my ($self, $opt, $args) = @_; - my $query = SLUB::LZA::TA::Archivematica::Elasticsearch::PrepareQuery::prepare_ldpprojects_query(@_); +sub get_ldp_projects ($self, $opt, $args) { ## no critic (CognitiveComplexity::ProhibitExcessCognitiveComplexity) + my $query = SLUB::LZA::TA::Archivematica::Elasticsearch::PrepareQuery::prepare_ldpprojects_query($self, $opt, $args); my $response = SLUB::LZA::TA::Archivematica::Elasticsearch::query_elasticsearch( $SLUB::LZA::TA::config{elasticsearch_protocol}, $SLUB::LZA::TA::config{elasticsearch_host}, @@ -303,8 +302,7 @@ sub get_ldp_projects { ## no critic (CognitiveComplexity::ProhibitExcessCognitiv return @ret; } -sub get_filestypes_by_aips { - my ($self, $opt, $args) = @_; +sub get_filestypes_by_aips($self, $opt, $args) { my $aips_query = SLUB::LZA::TA::Archivematica::Elasticsearch::PrepareQuery::prepare_aip_query($opt); $aips_query->{"_source"} = { "includes" => 'uuid' @@ -464,14 +462,13 @@ sub set_ldpflavour_results_for_filetype($self, $opt, $args, $results_ref, $newha return 1; } -sub execute { - my ($self, $opt, $args) = @_; +sub execute($self, $opt, $args) { my %results; $results{date} = sprintf("%04u-%02u-%02u", Today()); $results{package} = __PACKAGE__; $results{from} = $opt->{creationdate_epochs}->{from_string}; $results{to} = $opt->{creationdate_epochs}->{to_string}; - my @ldp_projects = ($opt->{with_ldp}) ? get_ldp_projects(@_) : (); + my @ldp_projects = ($opt->{with_ldp}) ? get_ldp_projects($self, $opt, $args) : (); foreach my $aip_state (AIPSTATE) { my %newhash = %{$opt}; filtered_set_for_aipstate($aip_state, \%newhash); diff --git a/lib/SLUB/LZA/TA/Command/search.pm b/lib/SLUB/LZA/TA/Command/search.pm index 1bea1819257c679ce097a42172f8fc02f30f78a2..c4cb38a4bfbe19ea9952a4c7b7824004894104be 100644 --- a/lib/SLUB/LZA/TA/Command/search.pm +++ b/lib/SLUB/LZA/TA/Command/search.pm @@ -174,11 +174,10 @@ sub validate_args($self, $opt, $args) { ## no critic qw(CognitiveComplexity::Pro } -sub find_aips_by_file_pronom_id { - my ($self, $opt, $args) = @_; +sub find_aips_by_file_pronom_id($self, $opt, $args) { # index aipfiles needed # find all AIPs where pronom-id like XXX - my $files_query = SLUB::LZA::TA::Archivematica::Elasticsearch::PrepareQuery::prepare_files_query(@_); + my $files_query = SLUB::LZA::TA::Archivematica::Elasticsearch::PrepareQuery::prepare_files_query($self, $opt, $args); my $files_response = SLUB::LZA::TA::Archivematica::Elasticsearch::query_elasticsearch( $SLUB::LZA::TA::config{elasticsearch_protocol}, $SLUB::LZA::TA::config{elasticsearch_host}, @@ -198,15 +197,14 @@ sub find_aips_by_file_pronom_id { return keys %aips; } -sub execute { - my ($self, $opt, $args) = @_; +sub execute($self, $opt, $args) { my $aips_query; my $aips_response; #p($opt); if (exists $opt->{format} and $opt->{format} eq 'pronom_id') { $aips_query = SLUB::LZA::TA::Archivematica::Elasticsearch::PrepareQuery::prepare_aip_query($opt); # replace AIP query with all match - my @aips = find_aips_by_file_pronom_id(@_); + my @aips = find_aips_by_file_pronom_id($self, $opt, $args); $aips_query->{query}->{bool}->{must}->{terms}->{uuid} = \@aips; } else { # only index aips needed