0

我正在编写一个插件来从 DroneDeploy 导出/同步数据。

我查看了从 Images.get() 返回的 JSON。有时可以使用“date_creation”字段。有时该字段不存在。此外,在这个字段中,“$date”字段显示了一个基于字符串的日期,我必须假设它是本地日期?该日期的表示是否是上传图像的用户的本地时间?还是已经转换为当前登录用户的时区?

来自 Images.get() API 的图像的截取 JSON 示例:

{
    "name": "camera",
    "drone_session_id": "1495472258_SUPPORTOPENPIPELINE",
    "command": "log",
    "drone_device_id": "1495472258_SUPPORTOPENPIPELINE",
    "date_creation": {
        "$date": "2017:02:09 11:37:46"
    }
}

如何获得该图像上传到 DroneDeploy 的可靠真实 UTC 日期,以便我可以确定如果用户返回并请求进行另一次同步操作时是否应该导出图像?

4

1 回答 1

0

您所引用的图像 exif 信息可能有点不可靠,因为哪个相机捕获了图像。

为了确定您应该同步哪些图像,我建议您查看plans已同步和未同步的图像。

IE

const allPlanIds$ = dronedeployApi.Plans.all().then((plans) => plans.map((plan) => plan.id));
const alreadySyncedPlanIds$ = fetch()... // get these planIds from your server
const planIdsToSync$ = Promise.all(allPlanIds$, alreadySyncedPlanIds$).then(([planIds, syncedPlanIds]) => planIds.filter((planId) => !syncedPlanIds.includes(planId)));
planIdsToSync$.then((planIdsToSync) => console.log(planIdsToSync)) // get images for these planIds
于 2017-06-02T23:46:37.770 回答