From 0da2bfa110e48c2f7c18a8d0ba06ee110cc251cb Mon Sep 17 00:00:00 2001
From: Jan Grewe <jan.grewe@g-node.org>
Date: Fri, 14 Aug 2020 13:39:07 +0200
Subject: [PATCH] [frontend util] fix trial duration estimation

---
 fishbook/frontend/util.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fishbook/frontend/util.py b/fishbook/frontend/util.py
index e9a9f88..b8e2665 100644
--- a/fishbook/frontend/util.py
+++ b/fishbook/frontend/util.py
@@ -207,7 +207,7 @@ class StimSpikesFile:
         for l in lines:
             l = l.strip()
             if "duration:" in l:
-                trial_duration = float(l[1:].strip().split(":")[-3])
+                trial_duration = float(l[1:].strip().split(":")[-1][:-3])
             if "index:" in l:
                 if len(trial_data) > 0:
                     index_map[(index, trial)] = (trial_duration, trial_data)
@@ -226,5 +226,5 @@ class StimSpikesFile:
     def get(self, run_index, trial_index):
         if tuple([run_index, trial_index]) not in self._data_map.keys():
             print("Data not found for run %i and trial %i:" % (run_index, trial_index))
-            return None
+            return None, None
         return self._data_map[(run_index, trial_index)]
\ No newline at end of file