Rev3148, Fix big site size calculation
This commit is contained in:
parent
fdd82f7ac4
commit
2b611ae798
2 changed files with 5 additions and 1 deletions
|
@ -10,7 +10,7 @@ class Config(object):
|
||||||
|
|
||||||
def __init__(self, argv):
|
def __init__(self, argv):
|
||||||
self.version = "0.6.0"
|
self.version = "0.6.0"
|
||||||
self.rev = 3146
|
self.rev = 3148
|
||||||
self.argv = argv
|
self.argv = argv
|
||||||
self.action = None
|
self.action = None
|
||||||
self.config_file = "zeronet.conf"
|
self.config_file = "zeronet.conf"
|
||||||
|
|
|
@ -732,6 +732,10 @@ class ContentManager(object):
|
||||||
old_content_size = 0
|
old_content_size = 0
|
||||||
old_content_size_optional = 0
|
old_content_size_optional = 0
|
||||||
|
|
||||||
|
# Reset site site on first content.json
|
||||||
|
if not old_content and inner_path == "content.json":
|
||||||
|
self.site.settings["size"] = 0
|
||||||
|
|
||||||
content_size_optional = sum([file["size"] for file in content.get("files_optional", {}).values() if file["size"] >= 0])
|
content_size_optional = sum([file["size"] for file in content.get("files_optional", {}).values() if file["size"] >= 0])
|
||||||
site_size = self.site.settings["size"] - old_content_size + content_size # Site size without old content plus the new
|
site_size = self.site.settings["size"] - old_content_size + content_size # Site size without old content plus the new
|
||||||
site_size_optional = self.site.settings["size_optional"] - old_content_size_optional + content_size_optional # Site size without old content plus the new
|
site_size_optional = self.site.settings["size_optional"] - old_content_size_optional + content_size_optional # Site size without old content plus the new
|
||||||
|
|
Loading…
Reference in a new issue