equal
deleted
inserted
replaced
216 |
216 |
217 function archive:summary(username, query) |
217 function archive:summary(username, query) |
218 local iter, err = self:find(username, query) |
218 local iter, err = self:find(username, query) |
219 if not iter then return iter, err; end |
219 if not iter then return iter, err; end |
220 local counts = {}; |
220 local counts = {}; |
|
221 local earliest = {}; |
221 local latest = {}; |
222 local latest = {}; |
222 for _, _, when, with in iter do |
223 for _, _, when, with in iter do |
223 counts[with] = (counts[with] or 0) + 1; |
224 counts[with] = (counts[with] or 0) + 1; |
|
225 if earliest[with] == nil then |
|
226 earliest[with] = when; |
|
227 end |
224 latest[with] = when; |
228 latest[with] = when; |
225 end |
229 end |
226 return { |
230 return { |
227 counts = counts; |
231 counts = counts; |
|
232 earliest = earliest; |
228 latest = latest; |
233 latest = latest; |
229 }; |
234 }; |
230 end |
235 end |
231 |
236 |
232 function archive:users() |
237 function archive:users() |