diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-11-19 21:03:40 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-11-19 21:03:40 +0100 |
| commit | f6b7fe33ee7c08761f3403ca77b7530dbb2763df (patch) | |
| tree | f48621ad79fc9d60a03e8d774da0839b6b6df09f /src/storage/image-manager/root.zig | |
| parent | 25228df6d13b5e8541672c4cdd84e200ff56a4c4 (diff) | |
backend: fix no data error for exif
Diffstat (limited to 'src/storage/image-manager/root.zig')
| -rw-r--r-- | src/storage/image-manager/root.zig | 14 |
1 files changed, 6 insertions, 8 deletions
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( |