Possible fix for #319

Signed-off-by: Andrew DeMaria <lostonamountain@gmail.com>
master
Andrew DeMaria 8 years ago
parent 835bbbc0a5
commit e47928d26a
No known key found for this signature in database
GPG Key ID: 0A3F5E91F8364EDF
  1. 7
      libresonic-main/src/main/java/org/libresonic/player/dao/AbstractDao.java
  2. 3
      libresonic-main/src/main/java/org/libresonic/player/service/MediaScannerService.java

@ -19,7 +19,8 @@
*/ */
package org.libresonic.player.dao; 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.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
@ -35,7 +36,7 @@ import java.util.concurrent.TimeUnit;
* @author Sindre Mehus * @author Sindre Mehus
*/ */
public class AbstractDao { public class AbstractDao {
private static final Logger LOG = Logger.getLogger(AbstractDao.class); private static final Logger LOG = LoggerFactory.getLogger(AbstractDao.class);
private DaoHelper daoHelper; private DaoHelper daoHelper;
@ -79,7 +80,9 @@ public class AbstractDao {
protected int update(String sql, Object... args) { protected int update(String sql, Object... args) {
long t = System.nanoTime(); long t = System.nanoTime();
LOG.trace("Executing query: [{}]", sql);
int result = getJdbcTemplate().update(sql, args); int result = getJdbcTemplate().update(sql, args);
LOG.trace("Updated {} rows", result);
log(sql, t); log(sql, t);
return result; return result;
} }

@ -20,6 +20,7 @@
package org.libresonic.player.service; package org.libresonic.player.service;
import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.libresonic.player.Logger; import org.libresonic.player.Logger;
import org.libresonic.player.dao.AlbumDao; import org.libresonic.player.dao.AlbumDao;
import org.libresonic.player.dao.ArtistDao; import org.libresonic.player.dao.ArtistDao;
@ -152,7 +153,7 @@ public class MediaScannerService {
LOG.info("Starting to scan media library."); LOG.info("Starting to scan media library.");
try { try {
Date lastScanned = new Date(); Date lastScanned = DateUtils.truncate(new Date(), Calendar.SECOND);
// Maps from artist name to album count. // Maps from artist name to album count.
Map<String, Integer> albumCount = new HashMap<String, Integer>(); Map<String, Integer> albumCount = new HashMap<String, Integer>();

Loading…
Cancel
Save