Changeset 89
- Timestamp:
- 12/29/07 10:28:00 (11 months ago)
- Files:
-
- trunk/src/main/org/lastpod/ModelImpl.java (modified) (2 diffs)
- trunk/src/main/org/lastpod/UI.java (modified) (1 diff)
- trunk/src/main/org/lastpod/action/DeletePlayCounts.java (modified) (4 diffs)
- trunk/src/main/org/lastpod/parser/ItunesStatsParser.java (added)
- trunk/src/main/org/lastpod/util/ItunesStatsFilter.java (added)
- trunk/src/test/iTunesStats (added)
- trunk/src/test/org/lastpod/parser/ItunesStatsParserTest.java (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/org/lastpod/ModelImpl.java
r85 r89 20 20 21 21 import org.lastpod.parser.ItunesDbParser; 22 import org.lastpod.parser.ItunesStatsParser; 22 23 import org.lastpod.parser.PlayCountsParser; 23 24 import org.lastpod.parser.TrackItemParser; 25 26 import org.lastpod.util.ItunesStatsFilter; 24 27 import org.lastpod.util.MiscUtilities; 28 29 import java.io.File; 25 30 26 31 import java.util.ArrayList; … … 95 100 ItunesDbParser itunesDbParser = 96 101 new ItunesDbParser(iTunesPath, parseVariousArtists, splitVariousArtistStrings); 97 PlayCountsParser playCountsParser = new PlayCountsParser(iTunesPath, parseMultiPlayTracks); 102 103 /* Defaults to the parser for non-shuffle iPods. */ 104 TrackItemParser playCountsParser = new PlayCountsParser(iTunesPath, parseMultiPlayTracks); 105 106 /* Checks for the "iTunesStats" file. If it exists, switch to the iPod 107 * shuffle parser. */ 108 File file = new File(iTunesPath); 109 File[] itunesStatsFiles = file.listFiles(new ItunesStatsFilter()); 110 111 if ((itunesStatsFiles != null) && (itunesStatsFiles.length != 0)) { 112 playCountsParser = new ItunesStatsParser(iTunesPath, parseMultiPlayTracks); 113 } 114 98 115 DbReader reader = new DbReader(itunesDbParser, playCountsParser); 99 116 trunk/src/main/org/lastpod/UI.java
r83 r89 113 113 */ 114 114 public UI(Model model) { 115 frame = new JFrame("LastPod (v0. 8)");115 frame = new JFrame("LastPod (v0.9)"); 116 116 117 117 submitStatus = new JLabel(); trunk/src/main/org/lastpod/action/DeletePlayCounts.java
r71 r89 21 21 import org.lastpod.Model; 22 22 import org.lastpod.UI; 23 24 import org.lastpod.util.ItunesStatsFilter; 23 25 24 26 import java.awt.event.ActionEvent; … … 54 56 55 57 /** 58 * Stores the file location of the "Play Counts" or "iTunesStats" file. 59 * (For non-shuffle iPods there is a "Play Counts" file, for shuffle 60 * iPods the "iTunesStats" file is used.) 61 */ 62 private File playCountsFile; 63 64 /** 56 65 * Constructs this action. 57 66 * @param userInterface The application's user interface. … … 69 78 putValue(SHORT_DESCRIPTION, desc); 70 79 putValue(MNEMONIC_KEY, new Integer(mnemonic)); 80 81 /* Setup Playcounts file; based on either iPod shuffle or non-shuffle. 82 */ 83 Preferences fPrefs = Preferences.userRoot().node("ws/afterglo/audioPod"); 84 String iTunesPath = fPrefs.get("iTunes Path", "default"); 85 86 if (!iTunesPath.endsWith(File.separator)) { 87 iTunesPath += File.separator; 88 } 89 90 /* Defaults the file for non-shuffle iPods. */ 91 playCountsFile = new File(iTunesPath + "Play Counts"); 92 93 /* Checks for the "iTunesStats" file. If it exists, switch to the iPod 94 * shuffle file. */ 95 File file = new File(iTunesPath); 96 File[] itunesStatsFiles = file.listFiles(new ItunesStatsFilter()); 97 98 if ((itunesStatsFiles != null) && (itunesStatsFiles.length != 0)) { 99 playCountsFile = new File(iTunesPath + "iTunesStats"); 100 putValue(SHORT_DESCRIPTION, "Removes the iTunesStats file from the iPod shuffle."); 101 } 71 102 } 72 103 … … 98 129 } 99 130 100 FileplayCountsFile = new File(iTunesPath + "Play Counts");131 playCountsFile = new File(iTunesPath + "Play Counts"); 101 132 102 133 boolean succuss = false;
