diff options
author | Aleksey Lim <alsroot@sugarlabs.org> | 2013-11-23 07:34:46 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@sugarlabs.org> | 2013-11-23 08:01:44 (GMT) |
commit | 2ad853ad16d3dce4dacf1313f67e168b0d8213d0 (patch) | |
tree | 89b49a8e0d4d6a4d427f7666b0af1086c369409d /sugar_network/node/stats_node.py | |
parent | a181951a95ea19225807aa7c716347192c8af1ee (diff) |
Process artifact node stats not for screenshots
Diffstat (limited to 'sugar_network/node/stats_node.py')
-rw-r--r-- | sugar_network/node/stats_node.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sugar_network/node/stats_node.py b/sugar_network/node/stats_node.py index fbb22fa..8a91994 100644 --- a/sugar_network/node/stats_node.py +++ b/sugar_network/node/stats_node.py @@ -316,10 +316,16 @@ class _ArtifactStats(_ResourceStats): self['downloaded'] = 0 def log(self, request): - _ResourceStats.log(self, request) - - if request.method == 'GET': - if request.prop == 'data': + if request.method == 'POST': + if request.content.get('type') != 'preview': + self['total'] += 1 + elif request.method == 'DELETE': + existing = self._volume[self.RESOURCE].get(request.guid) + if existing['type'] != 'preview': + self['total'] -= 1 + elif request.method == 'GET' and request.prop == 'data': + existing = self._volume[self.RESOURCE].get(request.guid) + if existing['type'] != 'preview': self.inc(request.guid, 'downloads') self['downloaded'] += 1 |