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 params();
use config(); use config();
use entry();
use template(); use template();
use studios(); use studios();
use series(); use series();
@@ -78,25 +79,9 @@ sub check_params {
my $checked = {}; my $checked = {};
my $debug = $params->{debug} || ''; entry::set_numbers( $checked, $params, ['project_id', 'studio_id' ]);
if ( $debug =~ /([a-z\_\,]+)/ ) {
$debug = $1;
}
$checked->{debug} = $debug;
for my $param ( 'project_id', 'studio_id' ) { entry::set_strings( $checked, $params, [ 'location'] );
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;
}
}
return $checked; return $checked;
} }

View File

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