diff --git a/endpoint/mh_endpoint.py b/endpoint/mh_endpoint.py index 36a12f01..a0b38e26 100755 --- a/endpoint/mh_endpoint.py +++ b/endpoint/mh_endpoint.py @@ -111,6 +111,9 @@ def do_POST(self): data = base64.b64decode(entry['payload']) timestamp = int.from_bytes(data[0:4], 'big') + 978307200 if (timestamp > startdate): + # Only add datePublished if Apple does not return the key + if not entry.get("datePublished"): + entry["datePublished"] = timestamp newResults[timestamp] = entry sorted_map = OrderedDict(sorted(newResults.items(), reverse=True))