summaryrefslogtreecommitdiffstats
path: root/application/service
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-05-21 18:40:22 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-05-21 18:43:13 +0200
commit7fccbf5fd1919a9c8ae14d2f39a55de8eee64de5 (patch)
treed6d7f7926de7330a0d6df8e0f4736c90d4cd6ad1 /application/service
parent4dbd81cbdea371b98c1195bfb46d4ec60a4dd82c (diff)
Calc correct total size for history with duplicate hashes
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/service')
-rw-r--r--application/service/files.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/application/service/files.php b/application/service/files.php
index ef1de2911..5e0dd140b 100644
--- a/application/service/files.php
+++ b/application/service/files.php
@@ -30,10 +30,11 @@ class files {
$total_size = $CI->db->query("
SELECT coalesce(sum(filesize), 0) sum
FROM (
- SELECT DISTINCT hash, filesize
+ SELECT DISTINCT `".$CI->db->dbprefix."file_storage`.id, filesize
FROM `".$CI->db->dbprefix."file_storage`
JOIN `".$CI->db->dbprefix."files` ON `".$CI->db->dbprefix."file_storage`.id = `".$CI->db->dbprefix."files`.file_storage_id
WHERE user = ?
+
) sub
", array($user))->row_array();