X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=lib%2FApp%2FMPD%2FFeeder.pm;h=66f3ce179d4a3a1c7589b1bfb337c69f39d5cc10;hb=77d28a4deff0003254af5bd402cdaa4ad5470b30;hp=3808c91f8195b36fc8983999e800d3f655999ce1;hpb=eeea137fa23911f368ae99027e4b0543da213180;p=mpd-feeder.git diff --git a/lib/App/MPD/Feeder.pm b/lib/App/MPD/Feeder.pm index 3808c91..66f3ce1 100644 --- a/lib/App/MPD/Feeder.pm +++ b/lib/App/MPD/Feeder.pm @@ -132,6 +132,8 @@ use constant DEFAULT_CONFIG_FILE => '/etc/mpd-feeder/mpd-feeder.conf'; my $rows = $mpd->send('listallinfo')->get; + $log->trace('got all songs from MPD'); + $db->start_update; try { my $song_count; @@ -142,14 +144,20 @@ use constant DEFAULT_CONFIG_FILE => '/etc/mpd-feeder/mpd-feeder.conf'; $self->db->store_song( $entry->{file}, $entry->{AlbumArtist} // $entry->{Artist}, $entry->{Album} ); + $song_count++; } - $log->info("Updated data about $song_count songs"); + my ($total_songs, $total_artists, $total_albums, + $new_songs, $new_artists, $new_albums + ) = $self->db->finish_update; - $self->db->remove_stale_entries; + $log->info( + "Updated data about $song_count songs (including $new_songs new), " + . "$total_artists artists (including $new_artists new) " - $self->db->finish_update; + . "and $total_albums albums (including $new_albums new)" + ); $db_needs_update = 0; }