|
|
@ -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(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|