+ if ((torrentFile.magnetUri() != null) && (torrentFile.magnetUri().length() > 0)) {
+ stringBuilder.append(" Magnet: ").append(torrentFile.magnetUri()).append("\n");
+ }
+ if ((torrentFile.downloadUri() != null) && (torrentFile.downloadUri().length() > 0)) {
+ stringBuilder.append(" Download: ").append(torrentFile.downloadUri()).append("\n");
+ }
+ }
+ }
+ }
+ /* list all known episodes. */
+ stringBuilder.append(reaction.name()).append(" - All Known Episodes\n\n");
+ ImmutableMap<Integer, Collection<Episode>> episodesBySeason = FluentIterable.from(allEpisodes).index(new Function<Episode, Integer>() {
+
+ @Override
+ public Integer apply(Episode episode) {
+ return episode.season();
+ }
+ }).asMap();
+ for (Entry<Integer, Collection<Episode>> seasonEntry : episodesBySeason.entrySet()) {
+ stringBuilder.append(" Season ").append(seasonEntry.getKey()).append("\n\n");
+ for (Episode episode : Ordering.natural().sortedCopy(seasonEntry.getValue())) {
+ stringBuilder.append(" Episode ").append(episode.episode()).append("\n");
+ for (TorrentFile torrentFile : episode) {
+ stringBuilder.append(" Size: ").append(torrentFile.size());
+ stringBuilder.append(" in ").append(torrentFile.fileCount()).append(" file(s): ");
+ stringBuilder.append(torrentFile.magnetUri());