mirror of
https://github.com/dedicatedcode/reitti.git
synced 2026-01-09 01:17:57 -05:00
630 android timeline export never imports (#652)
This commit is contained in:
@@ -49,10 +49,9 @@ test.describe('Date Picker Tests', () => {
|
||||
test('should load correct date when in a different timezone at start of day', async ({page}) => {
|
||||
await page.clock.setFixedTime(new Date('2017-02-02T00:30:00'));
|
||||
|
||||
const responsePromise = page.waitForResponse('**/timeline/content/range?startDate=2017-12-20&endDate=2017-12-20&timezone=Europe%2FBerlin');
|
||||
|
||||
await page.getByText('Wed20Dec').click()
|
||||
await expect(page.locator('div').filter({ hasText: 'Wed20Dec' }).nth(2)).toContainClass('selected');
|
||||
const responsePromise = page.waitForResponse('**/timeline/content/range?startDate=2017-12-20&endDate=2017-12-20&timezone=Europe%2FBerlin');
|
||||
const response = await responsePromise;
|
||||
expect(response.status()).toBe(200);
|
||||
|
||||
|
||||
@@ -189,7 +189,12 @@ public class RawLocationPointJdbcService {
|
||||
}
|
||||
|
||||
public Optional<RawLocationPoint> findLatest(User user) {
|
||||
return findLatest(user, Instant.EPOCH);
|
||||
String sql = "SELECT rlp.id, rlp.accuracy_meters, rlp.elevation_meters, rlp.timestamp, rlp.user_id, ST_AsText(rlp.geom) as geom, rlp.processed, rlp.synthetic, rlp.ignored, rlp.invalid, rlp.version " +
|
||||
"FROM raw_location_points rlp " +
|
||||
"WHERE rlp.user_id = ? AND rlp.invalid = false " +
|
||||
"ORDER BY rlp.timestamp DESC LIMIT 1";
|
||||
List<RawLocationPoint> results = jdbcTemplate.query(sql, rawLocationPointRowMapper, user.getId());
|
||||
return results.isEmpty() ? Optional.empty() : Optional.of(results.getFirst());
|
||||
}
|
||||
|
||||
public List<ClusteredPoint> findClusteredPointsInTimeRangeForUser(
|
||||
|
||||
@@ -57,7 +57,7 @@ public class VisitDetectionPreviewService {
|
||||
Timestamp start = Timestamp.from(date.minus(config.getVisitMerging().getSearchDurationInHours() * 2, ChronoUnit.HOURS));
|
||||
Timestamp end = Timestamp.from(date.plus(1, ChronoUnit.DAYS).plus(config.getVisitMerging().getSearchDurationInHours() * 2, ChronoUnit.HOURS));
|
||||
this.jdbcTemplate.update("INSERT INTO preview_raw_location_points(accuracy_meters, timestamp, user_id, elevation_meters, geom, processed, version, ignored, synthetic, preview_id, preview_created_at) " +
|
||||
"SELECT accuracy_meters, timestamp, user_id, elevation_meters, geom, false, version, ignored, synthetic, ?, ? FROM raw_location_points WHERE timestamp > ? AND timestamp <= ? AND user_id = ?",
|
||||
"SELECT accuracy_meters, timestamp, user_id, elevation_meters, geom, false, version, ignored, synthetic, ?, ? FROM raw_location_points WHERE timestamp > ? AND timestamp <= ? AND user_id = ? AND invalid = false",
|
||||
previewId,
|
||||
Timestamp.valueOf(now),
|
||||
start,
|
||||
|
||||
@@ -40,6 +40,7 @@ public class GeoJsonImporter {
|
||||
|
||||
try {
|
||||
stateHolder.importStarted();
|
||||
logger.info("Importing GeoJSON file for user {}", user.getUsername());
|
||||
JsonNode rootNode = objectMapper.readTree(inputStream);
|
||||
|
||||
// Check if it's a valid GeoJSON
|
||||
|
||||
@@ -42,6 +42,7 @@ public class GoogleAndroidTimelineImporter extends BaseGoogleTimelineImporter {
|
||||
AtomicInteger processedCount = new AtomicInteger(0);
|
||||
|
||||
try {
|
||||
logger.info("Importing Google Timeline Android file for user {}", user.getUsername());
|
||||
this.stateHolder.importStarted();
|
||||
JsonFactory factory = objectMapper.getFactory();
|
||||
JsonParser parser = factory.createParser(inputStream);
|
||||
|
||||
@@ -40,6 +40,7 @@ public class GoogleIOSTimelineImporter extends BaseGoogleTimelineImporter {
|
||||
AtomicInteger processedCount = new AtomicInteger(0);
|
||||
|
||||
try {
|
||||
logger.info("Importing Google Timeline IOS file for user {}", user.getUsername());
|
||||
stateHolder.importStarted();
|
||||
JsonFactory factory = objectMapper.getFactory();
|
||||
JsonParser parser = factory.createParser(inputStream);
|
||||
|
||||
@@ -40,7 +40,8 @@ public class GoogleRecordsImporter {
|
||||
|
||||
try {
|
||||
stateHolder.importStarted();
|
||||
// Use Jackson's streaming API to process the file
|
||||
logger.info("Importing Google Records file for user {}", user.getUsername());
|
||||
|
||||
JsonFactory factory = objectMapper.getFactory();
|
||||
JsonParser parser = factory.createParser(inputStream);
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ public class GpxImporter {
|
||||
|
||||
try {
|
||||
stateHolder.importStarted();
|
||||
logger.info("Importing GPX file for user {}", user.getUsername());
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
Document document = builder.parse(inputStream);
|
||||
|
||||
Reference in New Issue
Block a user