Changeset 86

Show
Ignore:
Timestamp:
12/23/07 00:38:08 (1 year ago)
Author:
chris
Message:

Completes #48: Added a check to make sure the title of the tracks
contains a "-" character. If not, then do not try and parse the track.

Files:

Legend:

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

    r82 r86  
    137137        } 
    138138 
     139        /* If the track does not contain a "-" character, then do not parse it 
     140         * as a various artists track. */ 
     141        if (!track.contains("-")) { 
     142            return false; 
     143        } 
     144 
    139145        /* In addition to other checks, this makes sure the track is not null, 
    140146         * because track will need to be parsed. */ 
  • trunk/src/test/org/lastpod/TrackItemTest.java

    r82 r86  
    147147 
    148148    /** 
     149     * Tests a "Various Artists" track that does not have a dash character. 
     150     */ 
     151    public void testVariousArtistsTrackWithoutDash() { 
     152        TrackItem trackItem = new TrackItem(); 
     153        trackItem.setTrackid(1); 
     154        trackItem.setActive(Boolean.TRUE); 
     155        trackItem.setLength(60); 
     156        trackItem.setArtist("Various Artists"); 
     157        trackItem.setAlbum("Italo Disco Collection - Vol."); 
     158        trackItem.setTrack("Raff / Self control"); 
     159        trackItem.setPlaycount(1); 
     160        trackItem.setLastplayed(1); 
     161        trackItem.setParseVariousArtists(true); 
     162        trackItem.setVariousArtistsStrings(VARIOUS_ARTISTS_STRING); 
     163 
     164        assertFalse(trackItem.isVariousArtistAlbum(true, VARIOUS_ARTISTS_STRING)); 
     165        assertFalse(trackItem.isVariousArtistAlbum(false, VARIOUS_ARTISTS_STRING)); 
     166        assertEquals("Various Artists", trackItem.getArtist()); 
     167        assertEquals("Italo Disco Collection - Vol.", trackItem.getAlbum()); 
     168        assertEquals("Raff / Self control", trackItem.getTrack()); 
     169    } 
     170 
     171    /** 
    149172     * Tests a "Various Artists" __Compilations track. 
    150173     */