diff --git a/libresonic-main/src/main/java/org/libresonic/player/dao/AbstractDao.java b/libresonic-main/src/main/java/org/libresonic/player/dao/AbstractDao.java index 3c703991..89464eea 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/dao/AbstractDao.java +++ b/libresonic-main/src/main/java/org/libresonic/player/dao/AbstractDao.java @@ -19,7 +19,8 @@ */ package org.libresonic.player.dao; -import org.libresonic.player.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; @@ -35,7 +36,7 @@ import java.util.concurrent.TimeUnit; * @author Sindre Mehus */ public class AbstractDao { - private static final Logger LOG = Logger.getLogger(AbstractDao.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractDao.class); private DaoHelper daoHelper; @@ -79,7 +80,9 @@ public class AbstractDao { protected int update(String sql, Object... args) { long t = System.nanoTime(); + LOG.trace("Executing query: [{}]", sql); int result = getJdbcTemplate().update(sql, args); + LOG.trace("Updated {} rows", result); log(sql, t); return result; } diff --git a/libresonic-main/src/main/java/org/libresonic/player/service/MediaScannerService.java b/libresonic-main/src/main/java/org/libresonic/player/service/MediaScannerService.java index e32c958b..39c8dc39 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/service/MediaScannerService.java +++ b/libresonic-main/src/main/java/org/libresonic/player/service/MediaScannerService.java @@ -20,6 +20,7 @@ package org.libresonic.player.service; import org.apache.commons.lang.ObjectUtils; +import org.apache.commons.lang3.time.DateUtils; import org.libresonic.player.Logger; import org.libresonic.player.dao.AlbumDao; import org.libresonic.player.dao.ArtistDao; @@ -152,7 +153,7 @@ public class MediaScannerService { LOG.info("Starting to scan media library."); try { - Date lastScanned = new Date(); + Date lastScanned = DateUtils.truncate(new Date(), Calendar.SECOND); // Maps from artist name to album count. Map albumCount = new HashMap();