1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-02 08:25:02 -04:00

Parse /2016-03-10/ and /2016/ patterns

This commit is contained in:
Reinhard Pointner 2016-03-10 12:15:07 +00:00
parent ff2b8170a5
commit 558ccee1f3

View File

@ -49,16 +49,22 @@ public class ID3Lookup implements MusicIdentificationService {
String album = getString(mediaInfo, "Album");
String albumArtist = getString(mediaInfo, "Album/Performer");
String trackTitle = getString(mediaInfo, "Track");
SimpleDate albumReleaseDate = null;
Integer mediumIndex = null;
Integer mediumCount = null;
Integer trackIndex = getInteger(mediaInfo, "Track/Position");
Integer trackCount = getInteger(mediaInfo, "Track/Position_Total");
String mbid = null;
Integer year = getInteger(mediaInfo, "Recorded_Date");
if (year != null) {
albumReleaseDate = new SimpleDate(year, 1, 1);
// try to parse 2016-03-10
String dateString = getString(mediaInfo, "Recorded_Date");
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));