mirror of https://github.com/zlatinb/muwire
cache InfoHash instnance in SharedFile
parent
26561a1b5b
commit
759136cff3
|
@ -20,6 +20,7 @@ public class SharedFile {
|
|||
|
||||
private final File file;
|
||||
private final byte[] root;
|
||||
private final InfoHash rootInfoHash;
|
||||
private final int pieceSize;
|
||||
|
||||
private final String cachedPath;
|
||||
|
@ -37,6 +38,7 @@ public class SharedFile {
|
|||
public SharedFile(File file, byte[] root, int pieceSize) throws IOException {
|
||||
this.file = file;
|
||||
this.root = root;
|
||||
this.rootInfoHash = new InfoHash(root);
|
||||
this.pieceSize = pieceSize;
|
||||
this.cachedPath = file.getAbsolutePath();
|
||||
this.cachedLength = file.length();
|
||||
|
@ -64,6 +66,8 @@ public class SharedFile {
|
|||
return root;
|
||||
}
|
||||
|
||||
public InfoHash getRootInfoHash() {return rootInfoHash;}
|
||||
|
||||
public int getPieceSize() {
|
||||
return pieceSize;
|
||||
}
|
||||
|
|
|
@ -361,7 +361,7 @@ class MainFrameView {
|
|||
closureColumn(header : trans("COMMENTS"), preferredWidth : 50, type : Boolean, read : {it.getComment() != null})
|
||||
closureColumn(header : trans("CERTIFIED"), preferredWidth : 50, type : Boolean, read : {
|
||||
Core core = application.context.get("core")
|
||||
core.certificateManager.hasLocalCertificate(new InfoHash(it.getRoot()))
|
||||
core.certificateManager.hasLocalCertificate(it.getRootInfoHash())
|
||||
})
|
||||
closureColumn(header : trans("PUBLISHED"), preferredWidth : 50, type : Boolean, read : {row -> row.isPublished()})
|
||||
closureColumn(header : trans("SEARCH_HITS"), preferredWidth: 50, type : Integer, read : {it.getHits()})
|
||||
|
|
Loading…
Reference in New Issue