entry.pm: use parser functions

This commit is contained in:
Milan
2020-04-09 23:02:19 +02:00
parent 29951c2f63
commit a37974bb5e
2 changed files with 3 additions and 24 deletions

View File

@@ -8,6 +8,7 @@ use Data::Dumper;
use params();
use config();
use entry();
use template();
use studios();
use series();
@@ -78,25 +79,9 @@ sub check_params {
my $checked = {};
my $debug = $params->{debug} || '';
if ( $debug =~ /([a-z\_\,]+)/ ) {
$debug = $1;
}
$checked->{debug} = $debug;
entry::set_numbers( $checked, $params, ['project_id', 'studio_id' ]);
for my $param ( 'project_id', 'studio_id' ) {
if ( ( defined $params->{$param} ) && ( $params->{$param} =~ /^\d+$/ ) ) {
$checked->{$param} = $params->{$param};
}
}
for my $param ('location') {
if ( defined $params->{$param} ) {
$checked->{$param} = $params->{$param};
$checked->{$param} =~ s/^\s+//g;
$checked->{$param} =~ s/\s+$//g;
}
}
entry::set_strings( $checked, $params, [ 'location'] );
return $checked;
}

View File

@@ -164,11 +164,6 @@ sub check_params {
my $template = template::check( $config, $params->{template}, 'series_names.html' );
my $debug = $params->{debug} || '';
if ( $debug =~ /([a-z\_\,]+)/ ) {
$debug = $1;
}
my $search = $params->{q} || $params->{search} || $params->{term} || '';
if ( $search =~ /([a-z0-9A-Z\_\,]+)/ ) {
$search = $1;
@@ -176,7 +171,6 @@ sub check_params {
return {
template => $template,
debug => $debug,
search => $search,
};
}