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 Dec 1, 2020
1 parent 1b490da commit 8b93be8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions calendar/experiments/calendar/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 8b93be8

Please sign in to comment.