[Schmitzm-commits] r2370 - trunk/schmitzm-mp3/src/main/java/de/schmitzm/mp3/id3

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Wed Jul 24 14:40:16 CEST 2013


Author: mojays
Date: 2013-07-24 14:40:16 +0200 (Wed, 24 Jul 2013)
New Revision: 2370

Modified:
   trunk/schmitzm-mp3/src/main/java/de/schmitzm/mp3/id3/ID3TagUtil.java
Log:
BugFix: handle year with leading white spaces (in ID3v1)

Modified: trunk/schmitzm-mp3/src/main/java/de/schmitzm/mp3/id3/ID3TagUtil.java
===================================================================
--- trunk/schmitzm-mp3/src/main/java/de/schmitzm/mp3/id3/ID3TagUtil.java	2013-07-24 11:18:16 UTC (rev 2369)
+++ trunk/schmitzm-mp3/src/main/java/de/schmitzm/mp3/id3/ID3TagUtil.java	2013-07-24 12:40:16 UTC (rev 2370)
@@ -836,8 +836,8 @@
     setComment( newTag, tag.getComment() );
     setGenre( newTag, tag.getGenre() == null ? null : tag.getGenre().toString() );
     setTitle( newTag, tag.getTitle() );
-    String yearStr = tag.getYear();
-    setYear(newTag,  StringUtils.isBlank(yearStr) ? null : Integer.parseInt(yearStr) );
+    String yearStr = StringUtils.trimToNull(tag.getYear());
+    setYear(newTag,  yearStr == null ? null : Integer.parseInt(yearStr) );
     int track = (tag instanceof ID3V1_1Tag) ? ((ID3V1_1Tag)tag).getAlbumTrack() : 0;
     setTrackInformation(newTag, track <= 0 ? null : track, totalTracks);
     return newTag;



More information about the Schmitzm-commits mailing list