diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index c938d4b9..eb84492d 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -630,6 +630,8 @@ public class MediaBindingBean { return getMovieInfo().getGenres(); if (infoObject instanceof Episode) return getSeriesInfo().getGenres(); + if (infoObject instanceof AudioTrack) + return Stream.of(getMusic().getGenre()).filter(Objects::nonNull).collect(toList()); return null; } diff --git a/source/net/filebot/web/AudioTrack.java b/source/net/filebot/web/AudioTrack.java index ea36bcdb..8f3b8ad2 100644 --- a/source/net/filebot/web/AudioTrack.java +++ b/source/net/filebot/web/AudioTrack.java @@ -12,6 +12,7 @@ public class AudioTrack implements Serializable { protected String albumArtist; protected String trackTitle; + protected String genre; protected SimpleDate albumReleaseDate; protected Integer mediumIndex; protected Integer mediumCount; @@ -30,6 +31,7 @@ public class AudioTrack implements Serializable { this.album = other.album; this.albumArtist = other.albumArtist; this.trackTitle = other.trackTitle; + this.genre = other.genre; this.albumReleaseDate = other.albumReleaseDate; this.mediumIndex = other.mediumIndex; this.mediumCount = other.mediumCount; @@ -46,12 +48,13 @@ public class AudioTrack implements Serializable { this.database = database; } - public AudioTrack(String artist, String title, String album, String albumArtist, String trackTitle, SimpleDate albumReleaseDate, Integer mediumIndex, Integer mediumCount, Integer trackIndex, Integer trackCount, String mbid, String database) { + public AudioTrack(String artist, String title, String album, String albumArtist, String trackTitle, String genre, SimpleDate albumReleaseDate, Integer mediumIndex, Integer mediumCount, Integer trackIndex, Integer trackCount, String mbid, String database) { this.artist = artist; this.title = title; this.album = album; this.albumArtist = albumArtist; this.trackTitle = trackTitle; + this.genre = genre; this.albumReleaseDate = albumReleaseDate; this.mediumIndex = mediumIndex; this.mediumCount = mediumCount; @@ -81,6 +84,10 @@ public class AudioTrack implements Serializable { return trackTitle; } + public String getGenre() { + return genre; + } + public SimpleDate getAlbumReleaseDate() { return albumReleaseDate; } diff --git a/source/net/filebot/web/ID3Lookup.java b/source/net/filebot/web/ID3Lookup.java index 09c87557..cdcb67b3 100644 --- a/source/net/filebot/web/ID3Lookup.java +++ b/source/net/filebot/web/ID3Lookup.java @@ -95,6 +95,7 @@ public class ID3Lookup implements MusicIdentificationService { String album = getString(m, "Album"); String albumArtist = getString(m, "Album/Performer"); String trackTitle = getString(m, "Track"); + String genre = getString(m, "Genre"); Integer mediumIndex = null; Integer mediumCount = null; Integer trackIndex = getInteger(m, "Track/Position"); @@ -113,7 +114,7 @@ public class ID3Lookup implements MusicIdentificationService { } } - return new AudioTrack(artist, title, album, albumArtist, trackTitle, albumReleaseDate, mediumIndex, mediumCount, trackIndex, trackCount, mbid, getIdentifier()); + return new AudioTrack(artist, title, album, albumArtist, trackTitle, genre, albumReleaseDate, mediumIndex, mediumCount, trackIndex, trackCount, mbid, getIdentifier()); } public Episode getEpisode(MediaInfo m) {