},
)
);
+
+ $mpd->loop->add(
+ IO::Async::Signal->new(
+ name => 'USR1',
+ on_receipt => sub {
+ $log->debug("SIGUSR1 received. Dumping configuration to STDERR");
+ my $old = select \*STDERR;
+ try {
+ $opt->dump;
+ }
+ finally {
+ select $old;
+ }
+ },
+ )
+ );
}
method connect_db {
foreach my $entry (@$rows) {
next unless exists $entry->{file};
$self->db_store_song( $entry->{file},
- $entry->{Artist}, $entry->{Album} );
+ $entry->{AlbumArtist}, $entry->{Album} );
$song_count++;
}
sub {
my $present = scalar @{ $_[0] };
- $log->notice("Playlist contains $present songs");
+ $log->notice( "Playlist contains $present songs. Wanted: "
+ . $opt->target_queue_length );
if ( $present < $opt->target_queue_length ) {
$self->queue_songs(
$opt->target_queue_length - $present, $callback );