Skip to content

Commit

Permalink
Ability to get all metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
NeilRashbrook committed Nov 2, 2020
1 parent 9f3a75c commit b4ff478
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions calendar/api/ext-calendar-utils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ function convertCalendar(extension, calendar) {
// TODO find a better way to define the cache id
props.cacheId = calendar.superCalendar.id + "#cache";
props.capabilities = unwrapCalendar(calendar.superCalendar).capabilities; // TODO needs deep clone?
if (calendar instanceof Ci.calISyncWriteCalendar) {
props.metadata = {
ids: calendar.getAllMetaDataIds(),
values: calendar.getAllMetaDataValues().map(value => {
try {
return JSON.parse(value) ?? {};
} catch (ex) {
return {};
}
}),
};
}
}

return props;
Expand Down

0 comments on commit b4ff478

Please sign in to comment.