Log more information when running the 'cleanup db' action

master
François-Xavier Thomas 6 years ago
parent 76e8abd219
commit b753e48632
  1. 9
      airsonic-main/src/main/java/org/airsonic/player/controller/MusicFolderSettingsController.java

@ -26,6 +26,8 @@ import org.airsonic.player.dao.MediaFileDao;
import org.airsonic.player.domain.MusicFolder; import org.airsonic.player.domain.MusicFolder;
import org.airsonic.player.service.MediaScannerService; import org.airsonic.player.service.MediaScannerService;
import org.airsonic.player.service.SettingsService; import org.airsonic.player.service.SettingsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
@ -48,6 +50,8 @@ import java.util.stream.Collectors;
@RequestMapping("/musicFolderSettings") @RequestMapping("/musicFolderSettings")
public class MusicFolderSettingsController { public class MusicFolderSettingsController {
private static final Logger LOG = LoggerFactory.getLogger(MusicFolderSettingsController.class);
@Autowired @Autowired
private SettingsService settingsService; private SettingsService settingsService;
@Autowired @Autowired
@ -93,9 +97,14 @@ public class MusicFolderSettingsController {
private void expunge() { private void expunge() {
LOG.info("Cleaning database...");
LOG.info("Deleting non-present artists...");
artistDao.expunge(); artistDao.expunge();
LOG.info("Deleting non-present albums...");
albumDao.expunge(); albumDao.expunge();
LOG.info("Deleting non-present media files...");
mediaFileDao.expunge(); mediaFileDao.expunge();
LOG.info("Database cleanup complete.");
mediaFileDao.checkpoint(); mediaFileDao.checkpoint();
} }

Loading…
Cancel
Save