return (ext.equalsIgnoreCase("mp4") || ext.equalsIgnoreCase("m4a"));
}
@Override
protected void copySpecificTagFields(Tag tag, Track track) {
Mp4Tag mp4Tag = (Mp4Tag) tag;
TrackData trackData = track.getTrackData();
Mp4TrackField trackField = (Mp4TrackField) mp4Tag.getFirstField(Mp4FieldKey.TRACK);
if (trackField != null) {
if (trackField.getTrackNo() != null) {
trackData.addTrack(trackField.getTrackNo().intValue());
}
if (trackField.getTrackTotal() != null) {
trackData.addTrackTotal(trackField.getTrackTotal().intValue());
}
}
Mp4DiscNoField discField = (Mp4DiscNoField) mp4Tag.getFirstField(Mp4FieldKey.DISCNUMBER);
if (discField != null) {
if (discField.getDiscNo() != null) {
trackData.addDisc(discField.getDiscNo().intValue());
}
if (discField.getDiscTotal() != null) {
trackData.addDiscTotal(discField.getDiscTotal().intValue());
}
}
List<TagField> genreFields = new ArrayList<TagField>();
genreFields.addAll(mp4Tag.get(Mp4FieldKey.GENRE_CUSTOM));
genreFields.addAll(mp4Tag.get(Mp4FieldKey.GENRE_ITUNES));
for (TagField genreField : genreFields) {
trackData.addGenre(genreField.toString());
}
}