Don't create empty piecefield for every optional file
This commit is contained in:
parent
b322b750c2
commit
046877599e
1 changed files with 4 additions and 1 deletions
|
@ -48,7 +48,10 @@ class UiWebsocketPlugin(object):
|
|||
return False
|
||||
|
||||
sha512 = file_info["sha512"]
|
||||
piecefield = site.storage.piecefields[sha512].tostring()
|
||||
if sha512 in site.storage.piecefields:
|
||||
piecefield = site.storage.piecefields[sha512].tostring()
|
||||
else:
|
||||
piecefield = None
|
||||
|
||||
if piecefield:
|
||||
row["pieces"] = len(piecefield)
|
||||
|
|
Loading…
Reference in a new issue