From 2006163f82fd59fbee67e454354fbb9ff500b3c6 Mon Sep 17 00:00:00 2001
From: vermaas <vermaas@astron.nl>
Date: Fri, 13 Jan 2023 11:34:46 +0100
Subject: [PATCH] make plot file unique based on checksum instead of name
 (because summary.logs appear multiple times)

---
 atdb/taskdatabase/services/algorithms.py            | 4 +++-
 atdb/taskdatabase/templates/taskdatabase/index.html | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/atdb/taskdatabase/services/algorithms.py b/atdb/taskdatabase/services/algorithms.py
index b0362838..8d1f75c0 100644
--- a/atdb/taskdatabase/services/algorithms.py
+++ b/atdb/taskdatabase/services/algorithms.py
@@ -727,7 +727,9 @@ def construct_inspectionplots(task,source='task_id'):
 
             for plot in plots:
                 basename = plot['basename']
-                plot_file = basename + str(plot['size'])
+                checksum = plot['checksum']
+                #plot_file = basename + str(plot['size'])
+                plot_file = checksum
 
                 # only add unique files
                 if not plot_file in plot_files:
diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html
index 904772e6..c93d0814 100644
--- a/atdb/taskdatabase/templates/taskdatabase/index.html
+++ b/atdb/taskdatabase/templates/taskdatabase/index.html
@@ -34,7 +34,7 @@
         {% include 'taskdatabase/pagination.html' %}
        </div>
     </div>
-    <p class="footer"> Version 13 Januari 2022 - 8:00
+    <p class="footer"> Version 13 Januari 2022 - 11:00
 
 </div>
 
-- 
GitLab