Parse /2016-03-10/ and /2016/ patterns
This commit is contained in:
parent
ff2b8170a5
commit
558ccee1f3
|
@ -49,16 +49,22 @@ public class ID3Lookup implements MusicIdentificationService {
|
||||||
String album = getString(mediaInfo, "Album");
|
String album = getString(mediaInfo, "Album");
|
||||||
String albumArtist = getString(mediaInfo, "Album/Performer");
|
String albumArtist = getString(mediaInfo, "Album/Performer");
|
||||||
String trackTitle = getString(mediaInfo, "Track");
|
String trackTitle = getString(mediaInfo, "Track");
|
||||||
SimpleDate albumReleaseDate = null;
|
|
||||||
Integer mediumIndex = null;
|
Integer mediumIndex = null;
|
||||||
Integer mediumCount = null;
|
Integer mediumCount = null;
|
||||||
Integer trackIndex = getInteger(mediaInfo, "Track/Position");
|
Integer trackIndex = getInteger(mediaInfo, "Track/Position");
|
||||||
Integer trackCount = getInteger(mediaInfo, "Track/Position_Total");
|
Integer trackCount = getInteger(mediaInfo, "Track/Position_Total");
|
||||||
String mbid = null;
|
String mbid = null;
|
||||||
|
|
||||||
Integer year = getInteger(mediaInfo, "Recorded_Date");
|
// try to parse 2016-03-10
|
||||||
if (year != null) {
|
String dateString = getString(mediaInfo, "Recorded_Date");
|
||||||
albumReleaseDate = new SimpleDate(year, 1, 1);
|
SimpleDate albumReleaseDate = SimpleDate.parse(dateString);
|
||||||
|
|
||||||
|
// try to parse 2016
|
||||||
|
if (albumReleaseDate == null) {
|
||||||
|
Integer year = matchInteger(dateString);
|
||||||
|
if (year != null) {
|
||||||
|
albumReleaseDate = new SimpleDate(year, 1, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info.put(f, new AudioTrack(artist, title, album, albumArtist, trackTitle, albumReleaseDate, mediumIndex, mediumCount, trackIndex, trackCount, mbid));
|
info.put(f, new AudioTrack(artist, title, album, albumArtist, trackTitle, albumReleaseDate, mediumIndex, mediumCount, trackIndex, trackCount, mbid));
|
||||||
|
|
Loading…
Reference in New Issue