]> git.ktnx.net Git - mpd-feeder.git/blobdiff - lib/App/MPD/Feeder.pm
more log priority adjustments
[mpd-feeder.git] / lib / App / MPD / Feeder.pm
index 36bf29d0fd3c643be97397741ca672e3c6dc3455..b6c82033a2f11cfe9cdde3208aa092f35dae8f60 100644 (file)
@@ -5,7 +5,6 @@ class App::MPD::Feeder;
 
 use App::MPD::Feeder::DB;
 use App::MPD::Feeder::Options;
-use App::MPD::Feeder::WorkQueue;
 use DBD::Pg;
 use DBI;
 use Getopt::Long;
@@ -182,7 +181,7 @@ method update_db( $force = undef ) {
             $new_songs,   $new_artists,   $new_albums
         ) = $self->db->finish_update;
 
-        $log->info(
+        $log->notice(
             "Updated data about $song_count songs (including $new_songs new), "
                 . "$total_artists artists (including $new_artists new) "
 
@@ -206,12 +205,13 @@ method queue_songs( $num = undef ) {
         my $present = $mpd->send('playlist')->get // [];
         $present = scalar(@$present);
 
-        $log->notice( "Playlist contains $present songs. Wanted: "
-                . $opt->target_queue_length );
         if ( $present < $opt->target_queue_length ) {
+            $log->notice( "Playlist contains $present songs. Wanted: "
+                    . $opt->target_queue_length );
             $self->queue_songs( $opt->target_queue_length - $present );
         }
         else {
+            $log->info("Playlist contains $present songs");
             $playlist_needs_filling = 0;
         }
 
@@ -231,7 +231,7 @@ method queue_songs( $num = undef ) {
         );
     }
 
-    $log->info("About to add $num songs to the playlist");
+    $log->debug("About to add $num songs to the playlist");
 
     my @paths;
     for my $song (@list) {
@@ -240,7 +240,7 @@ method queue_songs( $num = undef ) {
         push @paths, $path;
     }
 
-    $log->debug( "Adding " . join( ', ', map {"«$_»"} @paths ) );
+    $log->notice( "Adding " . join( ', ', map {"«$_»"} @paths ) );
 
     # MPD needs raw bytes
     utf8::encode($_) for @paths;
@@ -260,7 +260,7 @@ method queue_songs( $num = undef ) {
 }
 
 method reexec {
-    $log->notice("disconnecting and re-starting");
+    $log->info("disconnecting and re-starting");
     $db->disconnect;
     undef $mpd;