# HG changeset patch # User Kim Alvefur # Date 1490975391 -7200 # Node ID 5a9d491cc714967a188b1f2cae318ad9b0cff142 # Parent 05e201468f2768dc67bef1411660b468c1efeff2 mod_storage_internal: Add the dates method diff -r 05e201468f27 -r 5a9d491cc714 plugins/mod_storage_internal.lua --- a/plugins/mod_storage_internal.lua Fri Mar 31 17:48:50 2017 +0200 +++ b/plugins/mod_storage_internal.lua Fri Mar 31 17:49:51 2017 +0200 @@ -120,6 +120,12 @@ end, count; end +function archive:dates(username) + local items, err = datamanager.list_load(username, host, self.store); + if not items then return items, err; end + return array(items):pluck("when"):map(datetime.date):unique(); +end + function archive:delete(username, query) if not query or next(query) == nil then return datamanager.list_store(username, host, self.store, nil);