From f6b7fe33ee7c08761f3403ca77b7530dbb2763df Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 19 Nov 2025 21:03:40 +0100 Subject: backend: fix no data error for exif --- src/storage/image-manager/root.zig | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/storage/image-manager/root.zig') diff --git a/src/storage/image-manager/root.zig b/src/storage/image-manager/root.zig index 7fa1607..4188b88 100644 --- a/src/storage/image-manager/root.zig +++ b/src/storage/image-manager/root.zig @@ -60,24 +60,22 @@ pub fn add(self: *Self, allocator: std.mem.Allocator, image: Image) !void { var current = self.timestamp_order.first; - if (current == null) { - const timestamp = try allocator.create(Timestamp); - timestamp.index = self.items.items.len - 1; - self.timestamp_order.append(×tamp.node); - return; - } - while (current) |c| { const index = @as(*Timestamp, @fieldParentPtr("node", c)).index; if (image.timestamp orelse 0 > self.items.items[index].timestamp orelse 0) { const timestamp = try allocator.create(Timestamp); timestamp.index = self.items.items.len - 1; self.timestamp_order.insertBefore(c, ×tamp.node); - break; + return; } current = c.next; } + + const timestamp = try allocator.create(Timestamp); + timestamp.index = self.items.items.len - 1; + self.timestamp_order.append(×tamp.node); + return; } pub fn save( -- cgit v1.2.3-70-g09d2