Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced ActivityType is now non-localized (i.e., English) value #1717

Merged
merged 7 commits into from
Oct 10, 2023

Conversation

dennisguse
Copy link
Member

GPXs <type> doesn't specify if it should contain localized or non-localized (i.e., English) content, but most applications use the non-localized approach.
OpenTracks was doing the former and actually didn't store a non-localized activity type at all, but rather just the information about the icon.

What has been done:

  1. Introduced Track.activityType in addition to Track.activityTypeLocalized
  2. Removed ActivityIcon as the icon identifier is superseeded by ActivityType
  3. Implemented database migration to determine TracksColumn.ActivityType (first using activityTypeLocalized and then icon (sadly it cannot be perfect)
  4. KML now export and import activityType and activityTypeLocalized
  5. KML does not export/import icon anymore
  6. GPX now export <type> as activityType while the import should be able to handle activityType OR activityTypeLocalized (BREAKING CHANGE)

As usual there are likely some edgy edge cases.

PS/ KML parsing using SAX is just horrible.

@dennisguse dennisguse added the enhancement New feature or request label Oct 3, 2023
@dennisguse
Copy link
Member Author

@pstorch I am in need for another sanity check.
This PR does a data migration and I hope, I didn't introduce some unexpected features....
I am interfering the newly introduced ActivityType from the stored icon values (sadly a 1 to many mapping) or from the stored (localized or manually entered) activity type.

@pstorch
Copy link
Member

pstorch commented Oct 9, 2023

I did a quick test. Upgrade existing tracks worked. Export and Import with the same language worked. Export and Import from different languages resulted in UNKNOWN track types (I guess as expected).

@dennisguse
Copy link
Member Author

@pstorch Sounds good.
And yes, the localized lookup only works if the imported file has the same language as OpenTracks.
Did you see any issues with the db migration?

@pstorch
Copy link
Member

pstorch commented Oct 10, 2023

Did you see any issues with the db migration?

No obvious issues.

@dennisguse
Copy link
Member Author

@pstorch release and merge it is.
And making a backup from my nightly :D

@dennisguse dennisguse merged commit 65b5339 into main Oct 10, 2023
3 of 5 checks passed
@dennisguse dennisguse deleted the type#1608 branch October 10, 2023 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants