From d4bbb936b6552535c08018e37e5e964b06bbe867 Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Mon, 9 Nov 2020 01:39:46 +0100 Subject: [PATCH] Count preview image sizes in insight data --- .../src/main/scala/docspell/store/queries/QCollective.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/store/src/main/scala/docspell/store/queries/QCollective.scala b/modules/store/src/main/scala/docspell/store/queries/QCollective.scala index dbdcb9e4..a1d162af 100644 --- a/modules/store/src/main/scala/docspell/store/queries/QCollective.scala +++ b/modules/store/src/main/scala/docspell/store/queries/QCollective.scala @@ -61,6 +61,9 @@ object QCollective { select a.file_id,m.length from attachment_source a inner join filemeta m on m.id = a.file_id where a.id in (select aid from attachs) union distinct + select p.file_id,m.length from attachment_preview p + inner join filemeta m on m.id = p.file_id where p.id in (select aid from attachs) + union distinct select a.file_id,m.length from attachment_archive a inner join filemeta m on m.id = a.file_id where a.id in (select aid from attachs) ) as t""".query[Option[Long]].unique