Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tapiriik/services/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class UserExceptionType:
UnknownTZ = "tz_unknown"
System = "system"
Other = "other"
CouldBeExternalSync = "could_be_external_sync"

class UserException:
def __init__(self, type, extra=None, intervention_required=False, clear_group=None):
Expand Down
6 changes: 6 additions & 0 deletions tapiriik/sync/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,13 +501,19 @@ def _getServiceExclusionUserException(self, serviceRecord):

def _determineRecipientServices(self, activity):
recipientServices = []
# We are getting the name of service wich the activity is from
activity_origin_svc_name = next((svc.Service.ID for svc in self._serviceConnections if {svc._id} & activity.ServiceDataCollection.keys()))
for conn in self._serviceConnections:
if not conn.Service.ReceivesActivities:
# Nope.
continue
if conn._id in activity.ServiceDataCollection:
# The activity record is updated earlier for these, blegh.
continue
if activity_origin_svc_name != "decathlon" and conn.Service.ID == "strava":
# We don't want services other than Decathlon to send activties to Strava
activity.Record.MarkAsNotPresentOn(conn, UserException(UserExceptionType.CouldBeExternalSync))
continue
elif hasattr(conn, "SynchronizedActivities") and len([x for x in activity.UIDs if x in conn.SynchronizedActivities]):
continue
elif activity.Type not in conn.Service.SupportedActivities:
Expand Down
3 changes: 2 additions & 1 deletion tapiriik/web/static/js/tapiriik-ng.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ function ActivitiesController($scope, $http) {
"tz_unknown": "The time zone of this activity could not be determined.",
"system": "There was a system error while synchronizing this activity.",
"other": "There was an error while synchronizing this activity or this service does not support upload",
"unknown": "Your guess is as good as mine."
"unknown": "Your guess is as good as mine.",
"could_be_external_sync": "Services with direct synchronisation (ie : Strava and Garmin) are no longer supported as it could provoke duplicates"
};
return explanations[type].replace(/%\(service\)/g, $scope.DisplayNameByService(presc.Service));
};
Expand Down