Changeset 80

Show
Ignore:
Timestamp:
07/06/07 14:36:53 (3 years ago)
Author:
chris
Message:

Completes trac ticket #26:
Multiple play doesn't work all the time.

I only originally tested a scenario where I listened to a song two times.
Once you listen three or more times, it generates the play timestamp
incorrectly, which triggers the spam detection.

This problem is now fixed.

Files:

Legend:

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

    r79 r80  
    182182 
    183183                    for (long j = 0; j < numberToManufacture; j++) { 
    184                         recentPlays.add(manufactureTrack(temptrack)); 
     184                        temptrack = manufactureTrack(temptrack); 
     185                        recentPlays.add(temptrack); 
    185186                    } 
    186187                } 
  • trunk/src/test/org/lastpod/DbReaderTest.java

    r79 r80  
    7272        assertEquals("Legend", track.getAlbum()); 
    7373        assertEquals("No Woman, No Cry (live)", track.getTrack()); 
    74         assertEquals(2, track.getPlaycount()); 
     74        assertEquals(3, track.getPlaycount()); 
    7575        assertEquals(1181489924, track.getLastplayed()); 
    7676    } 
     
    9494        } 
    9595 
    96         assertTrue(recentlyPlayed.size() == 16); 
     96        assertTrue(recentlyPlayed.size() == 17); 
    9797 
    9898        TrackItem track = (TrackItem) recentlyPlayed.get(14); 
     
    113113        assertEquals(1, track.getPlaycount()); 
    114114        assertEquals(1181490351, track.getLastplayed()); 
     115 
     116        track = (TrackItem) recentlyPlayed.get(16); 
     117        assertEquals(20598, track.getTrackid()); 
     118        assertEquals(427, track.getLength()); 
     119        assertEquals("Bob Marley & The Wailers", track.getArtist()); 
     120        assertEquals("Legend", track.getAlbum()); 
     121        assertEquals("No Woman, No Cry (live)", track.getTrack()); 
     122        assertEquals(1, track.getPlaycount()); 
     123        assertEquals(1181490778, track.getLastplayed()); 
    115124    } 
    116125}