Exemple #1
0
 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());
     }
   }
 }
Exemple #2
0
 private void initGenresCache() {
   genres = new HashSet<>();
   genres.add("");
   for (Song song : getAllSongs()) {
     if (hasText(song.getGenre())) {
       genres.add(song.getGenre());
     }
   }
 }