From 91f5272f7081ae94a04938d5456718b8636e7743 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 11 Nov 2021 09:25:27 +0000 Subject: [PATCH] proper mpd connection initialization --- bin/mpd-feeder | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; -- 2.39.5