about summary refs log tree commit diff stats
path: root/internal/index/index_meta.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/index/index_meta.go')
-rw-r--r--internal/index/index_meta.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/index/index_meta.go b/internal/index/index_meta.go
index 635965a..0ff835b 100644
--- a/internal/index/index_meta.go
+++ b/internal/index/index_meta.go
@@ -118,3 +118,14 @@ func (i *Meta) SetSourceMeta(source string, meta *SourceMeta) {
 	}
 	i.data.Sources[source] = meta
 }
+
+func (i *Meta) LastUpdated() time.Time {
+	var last time.Time
+	for _, sourceMeta := range i.data.Sources {
+		if sourceMeta.Updated.After(last) {
+			last = sourceMeta.Updated
+		}
+	}
+
+	return last
+}