X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Freactor%2Fstates%2FTorrentState.java;h=9e9659d585e0ffd5ad13aac52d6877ea958cc81f;hb=96c6a320ec7e97a3330a629628b7d8c4560cf9ab;hp=0855195226f98d5f9153ee92761e02a6a72f6dc9;hpb=0ba26b2221c274bd6a1a099e30dec8cfd773db0c;p=rhynodge.git diff --git a/src/main/java/net/pterodactylus/reactor/states/TorrentState.java b/src/main/java/net/pterodactylus/reactor/states/TorrentState.java index 0855195..9e9659d 100644 --- a/src/main/java/net/pterodactylus/reactor/states/TorrentState.java +++ b/src/main/java/net/pterodactylus/reactor/states/TorrentState.java @@ -99,6 +99,15 @@ public class TorrentState extends AbstractState implements Iterable /** The download URI of the file. */ private final String downloadUri; + /** The number of files in this torrent. */ + private final int fileCount; + + /** The number of seeds connected to this torrent. */ + private final int seedCount; + + /** The number of leechers connected to this torrent. */ + private final int leechCount; + /** * Creates a new torrent file. * @@ -110,12 +119,21 @@ public class TorrentState extends AbstractState implements Iterable * The magnet URI of the file * @param downloadUri * The download URI of the file + * @param fileCount + * The number of files + * @param seedCount + * The number of connected seeds + * @param leechCount + * The number of connected leechers */ - public TorrentFile(String name, String size, String magnetUri, String downloadUri) { + public TorrentFile(String name, String size, String magnetUri, String downloadUri, int fileCount, int seedCount, int leechCount) { this.name = name; this.size = size; this.magnetUri = magnetUri; this.downloadUri = downloadUri; + this.fileCount = fileCount; + this.seedCount = seedCount; + this.leechCount = leechCount; } // @@ -159,6 +177,33 @@ public class TorrentState extends AbstractState implements Iterable return downloadUri; } + /** + * Returns the number of files in this torrent. + * + * @return The number of files in this torrent + */ + public int fileCount() { + return fileCount; + } + + /** + * Returns the number of seeds connected to this torrent. + * + * @return The number of connected seeds + */ + public int seedCount() { + return seedCount; + } + + /** + * Returns the number of leechers connected to this torrent. + * + * @return The number of connected leechers + */ + public int leechCount() { + return leechCount; + } + // // PRIVATE METHODS //