X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Freactor%2Ftriggers%2FNewEpisodeTrigger.java;h=04b6956ef4227981ed04aab74ab7e4ea17e7100f;hb=a6e8911302a7482787136ef41d1fdb0448d81c1f;hp=4504d60a939bb9e7c12da5a3b432b8f1f34ca7c3;hpb=482012f067ad5ae74c3fcf365398d73dc87e997f;p=rhynodge.git diff --git a/src/main/java/net/pterodactylus/reactor/triggers/NewEpisodeTrigger.java b/src/main/java/net/pterodactylus/reactor/triggers/NewEpisodeTrigger.java index 4504d60..04b6956 100644 --- a/src/main/java/net/pterodactylus/reactor/triggers/NewEpisodeTrigger.java +++ b/src/main/java/net/pterodactylus/reactor/triggers/NewEpisodeTrigger.java @@ -152,8 +152,12 @@ public class NewEpisodeTrigger implements Trigger { stringBuilder.append("- ").append(episode.identifier()).append("\n"); for (TorrentFile torrentFile : episode) { stringBuilder.append(" - ").append(torrentFile.name()).append(", ").append(torrentFile.size()).append("\n"); - stringBuilder.append(" Magnet: ").append(torrentFile.magnetUri()).append("\n"); - stringBuilder.append(" Download: ").append(torrentFile.downloadUri()).append("\n"); + 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"); + } } } } @@ -163,8 +167,12 @@ public class NewEpisodeTrigger implements Trigger { stringBuilder.append("- ").append(episode.identifier()).append("\n"); for (TorrentFile torrentFile : episode) { stringBuilder.append(" - ").append(torrentFile.name()).append(", ").append(torrentFile.size()).append("\n"); - stringBuilder.append(" Magnet: ").append(torrentFile.magnetUri()).append("\n"); - stringBuilder.append(" Download: ").append(torrentFile.downloadUri()).append("\n"); + 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"); + } } } } @@ -199,8 +207,14 @@ public class NewEpisodeTrigger implements Trigger { htmlBuilder.append("").append(torrentFile.fileCount()).append(" file(s), "); htmlBuilder.append("").append(torrentFile.seedCount()).append(" seed(s), "); htmlBuilder.append("").append(torrentFile.leechCount()).append(" leecher(s)\n"); - htmlBuilder.append("
Magnet "); - htmlBuilder.append("Download
\n"); + htmlBuilder.append("
"); + if ((torrentFile.magnetUri() != null) && (torrentFile.magnetUri().length() > 0)) { + htmlBuilder.append("Magnet "); + } + if ((torrentFile.downloadUri() != null) && (torrentFile.downloadUri().length() > 0)) { + htmlBuilder.append("Download"); + } + htmlBuilder.append("
\n"); } htmlBuilder.append("\n"); } @@ -219,8 +233,14 @@ public class NewEpisodeTrigger implements Trigger { htmlBuilder.append("").append(torrentFile.fileCount()).append(" file(s), "); htmlBuilder.append("").append(torrentFile.seedCount()).append(" seed(s), "); htmlBuilder.append("").append(torrentFile.leechCount()).append(" leecher(s)\n"); - htmlBuilder.append("
Magnet "); - htmlBuilder.append("Download
\n"); + htmlBuilder.append("
"); + if ((torrentFile.magnetUri() != null) && (torrentFile.magnetUri().length() > 0)) { + htmlBuilder.append("Magnet "); + } + if ((torrentFile.downloadUri() != null) && (torrentFile.downloadUri().length() > 0)) { + htmlBuilder.append("Download"); + } + htmlBuilder.append("
\n"); } htmlBuilder.append("\n"); }