Changeset 98

Show
Ignore:
Timestamp:
04/30/08 22:53:26 (2 years ago)
Author:
chris
Message:

Completes #36/#64:
When manufacturing a track the start time is offset by 31 seconds to
avoid last.fm spamprotection

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/org/lastpod/parser/PlayCountsParser.java

    r80 r98  
    4242 */ 
    4343public class PlayCountsParser implements TrackItemParser { 
     44        /** 
     45         * An offset to prevent spam protection from being triggered by last.fm. 
     46         */ 
     47        public static final long SPAM_PROTECTION_OFFSET = 31; 
     48 
    4449    /** 
    4550     * The location of the iTunes path. 
     
    205210        TrackItem manufacturedTrack = new TrackItem(temptrack); 
    206211        long lastplayed = temptrack.getLastplayed(); 
    207         long newLastPlayed = lastplayed + temptrack.getLength()
     212        long newLastPlayed = lastplayed + temptrack.getLength() - SPAM_PROTECTION_OFFSET
    208213 
    209214        manufacturedTrack.setLastplayed(newLastPlayed);