From 7c6d525e11f4c624f21de3a2473b734c2bdd7a31 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 12 Nov 2021 09:37:25 +0000 Subject: [PATCH] fix DB interaction from commands after DB split-out --- lib/App/MPD/Feeder.pm | 2 +- lib/App/MPD/Feeder/Command.pm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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"); } -- 2.39.5