]> git.ktnx.net Git - mpd-feeder.git/commitdiff
fix DB interaction from commands after DB split-out
authorDamyan Ivanov <dmn@debian.org>
Fri, 12 Nov 2021 09:37:25 +0000 (09:37 +0000)
committerDamyan Ivanov <dmn@debian.org>
Fri, 12 Nov 2021 09:37:25 +0000 (09:37 +0000)
lib/App/MPD/Feeder.pm
lib/App/MPD/Feeder/Command.pm

index 9cb1a2543f901751839e563a15ba0802f50dde8c..2381689a20d4f6dd555b3c1e517562809568a555 100644 (file)
@@ -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';
index 37b8ee18747887dc258dbd1a2e962de530bdac56..5c94a756ceef25e26375a6adb9f2a98405147f94 100644 (file)
@@ -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");
                 }