From: Damyan Ivanov Date: Fri, 12 Nov 2021 09:37:25 +0000 (+0000) Subject: fix DB interaction from commands after DB split-out X-Git-Url: https://git.ktnx.net/?p=mpd-feeder.git;a=commitdiff_plain;h=7c6d525e11f4c624f21de3a2473b734c2bdd7a31 fix DB interaction from commands after DB split-out --- diff --git a/lib/App/MPD/Feeder.pm b/lib/App/MPD/Feeder.pm index 9cb1a25..2381689 100644 --- a/lib/App/MPD/Feeder.pm +++ b/lib/App/MPD/Feeder.pm @@ -21,7 +21,7 @@ class App::MPD::Feeder { has $cfg_file :reader; has $opt :reader; has $db :reader; - has $db_needs_update = 1; + has $db_needs_update :writer = 1; has $mpd :reader; use constant DEFAULT_CONFIG_FILE => '/etc/mpd-feeder/mpd-feeder.conf'; diff --git a/lib/App/MPD/Feeder/Command.pm b/lib/App/MPD/Feeder/Command.pm index 37b8ee1..5c94a75 100644 --- a/lib/App/MPD/Feeder/Command.pm +++ b/lib/App/MPD/Feeder/Command.pm @@ -24,7 +24,7 @@ isa App::MPD::Feeder { die "Missing command arguments\n" unless @args; $self->set_db_needs_update(0); for my $artist (@args) { - if ( $self->db_add_unwanted_artist($artist) ) { + if ( $self->db->add_unwanted_artist($artist) ) { $log->info( "Artist '$artist' added to the unwanted list\n"); } @@ -41,7 +41,7 @@ isa App::MPD::Feeder { die "Missing command arguments\n" unless @args; $self->set_db_needs_update(0); for my $artist (@args) { - if ( $self->db_del_unwanted_artist($artist) ) { + if ( $self->db->del_unwanted_artist($artist) ) { $log->info( "Artist '$artist' deleted from the unwanted list\n"); }