X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=lib%2FApp%2FMPD%2FFeeder.pm;h=7da421a6433bbcc0a8f805cc8d103306200c7c0a;hb=0135556249d5b1a2296dbb3a46eaba31fa9230a0;hp=ed5d27658da5a27a6a9d2a88b9ca5b4372f059c8;hpb=a10f5386816a7468337d033c7a6956d720b62108;p=mpd-feeder.git diff --git a/lib/App/MPD/Feeder.pm b/lib/App/MPD/Feeder.pm index ed5d276..7da421a 100644 --- a/lib/App/MPD/Feeder.pm +++ b/lib/App/MPD/Feeder.pm @@ -237,14 +237,22 @@ use constant DEFAULT_CONFIG_FILE => '/etc/mpd-feeder/mpd-feeder.conf'; sub { my $result = shift; - if ( $result->{changed} eq 'database' ) { + undef $idler; + + my $changed = $result->{changed} // ''; + + if ( $changed eq 'database' ) { $db_needs_update = 1; $self->prepare_to_wait_idle; } - elsif ( $result->{changed} eq 'playlist' ) { + elsif ( $changed eq 'playlist' ) { $self->queue_songs( undef, sub { $self->prepare_to_wait_idle } ); } + elsif ( $changed eq '' ) { + $log->debug("got no changes from idle"); + $self->prepare_to_wait_idle; + } else { use JSON; $log->warn(