public void onSongAdded(@Observes AddSongEvent addSongEvent) { for (Song song : addSongEvent.getAddedSongs()) { if (!getAllSongs().contains(song)) { allSongs.add(song); if (hasText(song.getGenre())) getGenres().add(song.getGenre()); } } }
private void initGenresCache() { genres = new HashSet<>(); genres.add(""); for (Song song : getAllSongs()) { if (hasText(song.getGenre())) { genres.add(song.getGenre()); } } }