Skip to content

Commit

Permalink
fix post-scan warning
Browse files Browse the repository at this point in the history
  • Loading branch information
AF-1 committed Jan 13, 2025
1 parent 69d1b69 commit 25c2cad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 6 additions & 11 deletions DynamicPlaylistCreator/ConfigManager/ParameterHandler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ use Time::Local;

__PACKAGE__->mk_accessor(rw => qw(parameterPrefix criticalErrorCallback));

my $newUnicodeHandling = 0;

my $log = logger('plugin.dynamicplaylistcreator');
my $cache = Slim::Utils::Cache->new();
my $prefs = preferences('plugin.dynamicplaylistcreator');
Expand All @@ -48,9 +46,6 @@ sub new {
my $self = $class->SUPER::new();
$self->parameterPrefix($parameters->{'parameterPrefix'});
$self->criticalErrorCallback($parameters->{'criticalErrorCallback'});
if (UNIVERSAL::can("Slim::Utils::Unicode", "hasEDD")) {
$newUnicodeHandling = 1;
}
return $self;
}

Expand Down Expand Up @@ -423,20 +418,20 @@ sub getSQLTemplateData {
my $dbh = Slim::Schema->dbh;

for my $sql (split(/[;]/, $sqlstatements)) {
main::DEBUGLOG && $log->is_debug && $log->debug("sql = ".Data::Dump::dump($sql));
main::DEBUGLOG && $log->is_debug && $log->debug('sql = '.Data::Dump::dump($sql));
eval {
$sql =~ s/^\s+//g;
$sql =~ s/\s+$//g;
next if !$sql;
my $sth = $dbh->prepare($sql);
main::DEBUGLOG && $log->is_debug && $log->debug("Executing: $sql");
main::DEBUGLOG && $log->is_debug && $log->debug('Executing: '.Data::Dump::dump($sql));
$sth->execute() or do {
$log->error("Error executing: $sql");
$log->error('Error executing: '.Data::Dump::dump($sql));
$sql = undef;
};

if ($sql =~ /^SELECT+/oi) {
main::DEBUGLOG && $log->is_debug && $log->debug("Executing and collecting: $sql");
if ($sql && $sql =~ /^SELECT+/oi) {
main::DEBUGLOG && $log->is_debug && $log->debug('Executing and collecting: '.Data::Dump::dump($sql));
my $id;
my $name;
my $value;
Expand All @@ -445,7 +440,7 @@ sub getSQLTemplateData {
$sth->bind_col(3, \$value);

while($sth->fetch()) {
if ($newUnicodeHandling) {
if (UNIVERSAL::can("Slim::Utils::Unicode", "hasEDD")) {
my %item = (
'id' => Slim::Utils::Unicode::utf8decode($id, 'utf8'),
'name' => Slim::Utils::Unicode::utf8decode($name, 'utf8'),
Expand Down
2 changes: 1 addition & 1 deletion DynamicPlaylistCreator/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>af82aa22-566e-5266-919e-9d90b5c0a5f2</id>
<name>PLUGIN_DYNAMICPLAYLISTCREATOR</name>
<module>Plugins::DynamicPlaylistCreator::Plugin</module>
<version>1.6.8</version>
<version>1.6.9</version>
<description>PLUGIN_DYNAMICPLAYLISTCREATOR_DESC</description>
<creator>AF</creator>
<optionsURL>plugins/DynamicPlaylistCreator/settings/settings.html</optionsURL>
Expand Down

0 comments on commit 25c2cad

Please sign in to comment.