return secondsBetween(prev.getStartTime(), next).getSeconds() < allowedDiff;
}
protected void scrobbleTracks() throws ApplicationException {
scrobbleFailedTracks();
Scrobble head;
for (LastFmUser lastFmUser : userScrobbles.keySet()) {
ConcurrentLinkedDeque<Scrobble> deque = userScrobbles.get(lastFmUser);
while ((head = deque.peekFirst()) != null && !tooClose(head, new DateTime())) {
playCountDao.addPlayCount(head.getLastFmUser(), head.getTrack());
WSResponse wsResponse = scrobbleClient.scrobble(head);
if (!wsResponse.wasCallSuccessful()) {
LOG.warn("scrobbling " + head + " failed! Add for re-sending.");
LOG.debug("Scrobble response: " + wsResponse);
failedScrobbles.add(head);