forked from upstream-mirrors/OpenTracks
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) {
|
public static void updateTrack(Context context, Track track, String name, String activityTypeLocalized, ActivityType activityType, String description, ContentProviderUtils contentProviderUtils) {
|
||||||
boolean update = false;
|
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
track.setName(name);
|
track.setName(name);
|
||||||
update = true;
|
|
||||||
}
|
}
|
||||||
if (activityTypeLocalized != null) {
|
if (activityTypeLocalized != null) {
|
||||||
track.setActivityTypeLocalized(activityTypeLocalized);
|
track.setActivityTypeLocalized(activityTypeLocalized);
|
||||||
update = true;
|
|
||||||
}
|
}
|
||||||
if (activityType != null) {
|
if (activityType != null) {
|
||||||
track.setActivityType(activityType);
|
track.setActivityType(activityType);
|
||||||
} else if (activityTypeLocalized != null) {
|
} else if (activityTypeLocalized != null) {
|
||||||
track.setActivityType(ActivityType.findByLocalizedString(context, activityTypeLocalized)
|
track.setActivityType(ActivityType.findByLocalizedString(context, activityTypeLocalized));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (description != null) {
|
if (description != null) {
|
||||||
track.setDescription(description);
|
track.setDescription(description);
|
||||||
update = true;
|
|
||||||
}
|
|
||||||
if (update) {
|
|
||||||
contentProviderUtils.updateTrack(track);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contentProviderUtils.updateTrack(track);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user