Open thoughtgap opened 5 years ago
At first only a hint that there is duplicate data makes sense.
Approach for finding out the overlapping time spans: https://derickbailey.com/2015/09/07/check-for-date-range-overlap-with-javascript-arrays-sorting-and-reducing/
Even regular non-overlapping json files will contain duplicate timelineItems: timelineItems which cross midnight will be contained (identically) in both the current and the previous day's JSON file.
These are absolutely identical, down to the itemID, so they should be easy to filter out.
Right now it's in the user's responsibility to avoid duplicate data. The script reads duplicate data without questioning.
E.g. if a monthly export for 02.2019 and a daily export 2019-02-01.json are read, the data is queried and returned twice.