X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Frhynodge%2Ftriggers%2FNewTorrentTrigger.java;h=7b28fee851d9a16ba0487f1452b2e50fc8aedf39;hb=af25c8e67815ae6882eff47dba7a00e2f9234471;hp=872349e06b32f13427b07c94d28a97727b5a996b;hpb=f43798b2b09447fadb82b6019029b5e6fa609ba2;p=rhynodge.git diff --git a/src/main/java/net/pterodactylus/rhynodge/triggers/NewTorrentTrigger.java b/src/main/java/net/pterodactylus/rhynodge/triggers/NewTorrentTrigger.java index 872349e..7b28fee 100644 --- a/src/main/java/net/pterodactylus/rhynodge/triggers/NewTorrentTrigger.java +++ b/src/main/java/net/pterodactylus/rhynodge/triggers/NewTorrentTrigger.java @@ -33,6 +33,7 @@ import net.pterodactylus.rhynodge.states.TorrentState.TorrentFile; import org.apache.commons.lang3.StringEscapeUtils; import com.google.common.collect.Lists; +import com.google.common.collect.Ordering; import com.google.common.collect.Sets; /** @@ -54,7 +55,7 @@ public class NewTorrentTrigger implements Trigger { // /** - * {@inheritDocs} + * {@inheritDoc} */ @Override public State mergeStates(State previousState, State currentState) { @@ -95,7 +96,7 @@ public class NewTorrentTrigger implements Trigger { } // - // STATIC METHODS + // PRIVATE METHODS // /** @@ -131,24 +132,63 @@ public class NewTorrentTrigger implements Trigger { * @return The generated HTML */ private String getHtmlTextList(Reaction reaction) { - StringBuilder htmlText = new StringBuilder(); - htmlText.append("
\n"); - htmlText.append("Filename | "); + htmlBuilder.append("Size | "); + htmlBuilder.append("File(s) | "); + htmlBuilder.append("Seeds | "); + htmlBuilder.append("Leechers | "); + htmlBuilder.append("Magnet | "); + htmlBuilder.append("Download | "); + htmlBuilder.append("
---|---|---|---|---|---|---|
").append(StringEscapeUtils.escapeHtml4(torrentFile.name())).append(" | "); + htmlBuilder.append("").append(StringEscapeUtils.escapeHtml4(torrentFile.size())).append(" | "); + htmlBuilder.append("").append(torrentFile.fileCount()).append(" | "); + htmlBuilder.append("").append(torrentFile.seedCount()).append(" | "); + htmlBuilder.append("").append(torrentFile.leechCount()).append(" | "); + htmlBuilder.append("Link | "); + htmlBuilder.append("Link | "); + htmlBuilder.append("