avoid FS call to get file length

pull/11/head
Zlatin Balevsky 2019-07-11 15:28:25 +01:00
parent 2fba9a74ce
commit 56e9235d7b
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ class PersisterService extends Service {
private def toJson(File f, SharedFile sf) {
def json = [:]
json.file = Base64.encode DataUtil.encodei18nString(f.toString())
json.length = f.length()
json.length = sf.getCachedLength()
InfoHash ih = sf.getInfoHash()
json.infoHash = Base64.encode ih.getRoot()
json.pieceSize = sf.getPieceSize()