From: Damyan Ivanov Date: Thu, 11 Nov 2021 09:25:27 +0000 (+0000) Subject: proper mpd connection initialization X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=91f5272f7081ae94a04938d5456718b8636e7743;p=mpd-feeder.git proper mpd connection initialization --- diff --git a/bin/mpd-feeder b/bin/mpd-feeder index 7c796c7..f0ed182 100755 --- a/bin/mpd-feeder +++ b/bin/mpd-feeder @@ -150,11 +150,11 @@ use Net::Async::MPD; $opt->parse_command_line; unless ($opt->dump_config) { - $mpd = Net::Async::MPD->new( - host => $opt->mpd_host, - port => $opt->mpd_port, - auto_connect => 1, - ); + my %conn = ( auto_connect => 1 ); + $conn{host} = $opt->mpd_host if $opt->mpd_host; + $conn{port} = $opt->mpd_port if $opt->mpd_port; + + $mpd = Net::Async::MPD->new(%conn); $self->connect_db; $self->update_db unless $self->opt->skip_db_update;