From 431ac2c0a0681c0bf843edbe02fb569bff06dc90 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 19 Feb 2013 20:22:48 +0100 Subject: [PATCH] Whitespace fix. --- .../rhynodge/triggers/NewEpisodeTrigger.java | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/main/java/net/pterodactylus/rhynodge/triggers/NewEpisodeTrigger.java b/src/main/java/net/pterodactylus/rhynodge/triggers/NewEpisodeTrigger.java index d17f463..f13e210 100644 --- a/src/main/java/net/pterodactylus/rhynodge/triggers/NewEpisodeTrigger.java +++ b/src/main/java/net/pterodactylus/rhynodge/triggers/NewEpisodeTrigger.java @@ -212,6 +212,52 @@ public class NewEpisodeTrigger implements Trigger { private String generateHtmlText(Reaction reaction) { StringBuilder htmlBuilder = new StringBuilder(); htmlBuilder.append("\n"); + /* show all known episodes. */ + htmlBuilder.append("\n\n"); + htmlBuilder.append("\n"); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append("\n"); + htmlBuilder.append("\n"); + htmlBuilder.append("\n"); + Episode lastEpisode = null; + for (Entry> seasonEntry : FluentIterable.from(Ordering.natural().reverse().sortedCopy(allEpisodes)).index(Episode.BY_SEASON).asMap().entrySet()) { + for (Episode episode : seasonEntry.getValue()) { + for (TorrentFile torrentFile : episode) { + if (newEpisodes.contains(episode)) { + htmlBuilder.append(""); + } else if (newTorrentFiles.contains(torrentFile)) { + htmlBuilder.append(""); + } else { + htmlBuilder.append(""); + } + if ((lastEpisode == null) || !lastEpisode.equals(episode)) { + htmlBuilder.append(""); + } else { + htmlBuilder.append(""); + } + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append(""); + htmlBuilder.append("\n"); + lastEpisode = episode; + } + } + } + htmlBuilder.append("\n"); + htmlBuilder.append("
All Known Episodes
SeasonEpisodeFilenameSizeFile(s)SeedsLeechersMagnetDownload
").append(episode.season()).append("").append(episode.episode()).append("").append(StringEscapeUtils.escapeHtml4(torrentFile.name())).append("").append(StringEscapeUtils.escapeHtml4(torrentFile.size())).append("").append(torrentFile.fileCount()).append("").append(torrentFile.seedCount()).append("").append(torrentFile.leechCount()).append("LinkLink
\n"); htmlBuilder.append("\n"); return htmlBuilder.toString(); } -- 2.7.4