mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
Bugfix: always update track meta data.
This commit is contained in:
@@ -39,27 +39,21 @@ public class TrackUtils {
|
||||
}
|
||||
|
||||
public static void updateTrack(Context context, Track track, String name, String activityTypeLocalized, ActivityType activityType, String description, ContentProviderUtils contentProviderUtils) {
|
||||
boolean update = false;
|
||||
if (name != null) {
|
||||
track.setName(name);
|
||||
update = true;
|
||||
}
|
||||
if (activityTypeLocalized != null) {
|
||||
track.setActivityTypeLocalized(activityTypeLocalized);
|
||||
update = true;
|
||||
}
|
||||
if (activityType != null) {
|
||||
track.setActivityType(activityType);
|
||||
} else if (activityTypeLocalized != null) {
|
||||
track.setActivityType(ActivityType.findByLocalizedString(context, activityTypeLocalized)
|
||||
);
|
||||
track.setActivityType(ActivityType.findByLocalizedString(context, activityTypeLocalized));
|
||||
}
|
||||
if (description != null) {
|
||||
track.setDescription(description);
|
||||
update = true;
|
||||
}
|
||||
if (update) {
|
||||
contentProviderUtils.updateTrack(track);
|
||||
}
|
||||
|
||||
contentProviderUtils.updateTrack(track);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user