Skip to content

Commit

Permalink
Add some more SQL logging for the works query.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelherger committed Sep 9, 2024
1 parent af7714b commit f6ef66f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Slim/Control/Queries.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4751,9 +4751,13 @@ sub worksQuery {
my $composerCount = $cache->{$cacheKey};
if ( !$composerCount ) {
my $total_sth = $dbh->prepare_cached( qq{
SELECT COUNT(1) FROM ( $ccSql ) AS t1
SELECT COUNT(1) FROM ( $ccSql ) AS t1
} );

if ( main::DEBUGLOG && $sqllog->is_debug ) {
$sqllog->debug( "Composer count query: SELECT COUNT(1) FROM ( $ccSql ) AS t1 / " . Data::Dump::dump($p) );
}

$total_sth->execute( @{$p} );
($composerCount) = $total_sth->fetchrow_array();
$total_sth->finish;
Expand All @@ -4776,6 +4780,10 @@ sub worksQuery {
SELECT COUNT(1) FROM ( $cSql ) AS t1
} );

if ( main::DEBUGLOG && $sqllog->is_debug ) {
$sqllog->debug( "Works totals query: SELECT COUNT(1) FROM ( $cSql ) AS t1 / " . Data::Dump::dump($p) );
}

$total_sth->execute( @{$p} );
($count) = $total_sth->fetchrow_array();
$total_sth->finish;
Expand Down Expand Up @@ -4812,7 +4820,7 @@ sub worksQuery {

my ($valid, $start, $end) = $request->normalize(scalar($index), scalar($quantity), $count);

if ($valid) {
if ($valid && $tags ne 'CC') {

my $loopname = 'works_loop';
my $chunkCount = 0;
Expand Down

0 comments on commit f6ef66f

Please sign in to comment.