diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-03-28 19:57:58 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-03-28 19:57:58 -0700 |
commit | 691b2f792ea5f171a8b50766721b1188edf758cd (patch) | |
tree | 22af7fb3d49b3d4a107b5685c5e59ea6afaeddd9 /src/github/daneren2005 | |
parent | 55c7fddb046658878522a00bf3b0d5bfab22b969 (diff) | |
download | dsub-691b2f792ea5f171a8b50766721b1188edf758cd.tar.gz dsub-691b2f792ea5f171a8b50766721b1188edf758cd.tar.bz2 dsub-691b2f792ea5f171a8b50766721b1188edf758cd.zip |
Fix for when people have non numbers in disc number field
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/domain/MusicDirectory.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/domain/MusicDirectory.java b/src/github/daneren2005/dsub/domain/MusicDirectory.java index f3521252..fefbb682 100644 --- a/src/github/daneren2005/dsub/domain/MusicDirectory.java +++ b/src/github/daneren2005/dsub/domain/MusicDirectory.java @@ -145,7 +145,11 @@ public class MusicDirectory implements Serializable { if(slashIndex > 0) { discNumber = discNumber.substring(0, slashIndex); } - setDiscNumber(Integer.parseInt(discNumber)); + try { + setDiscNumber(Integer.parseInt(discNumber)); + } catch(Exception e) { + Log.w(TAG, "Non numbers in disc field!"); + } String bitrate = metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_BITRATE); setBitRate(Integer.parseInt((bitrate != null) ? bitrate : "0") / 1000); String length = metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION); @@ -160,7 +164,7 @@ public class MusicDirectory implements Serializable { } metadata.release(); } catch(Exception e) { - Log.i(TAG, "Device doesn't properly support MediaMetadataRetreiver"); + Log.i(TAG, "Device doesn't properly support MediaMetadataRetreiver", e); } } |