pytrainer/pytrainer — pull request #10 by spaceyjase (2012-09-09 09:16:53+00:00)
Title: Avoiding duplicate uploads / existing status

Hi again :)

Thought I'd tidy this up to avoid duplicate uploads. Strava accepts pretty much any upload but if it already exists then it still returns success but creates a 'Duplicate record' in the user's training tab. That's fine, doesn't really corrupt user data or anything but makes the whole thing a bit silly from pytrainer.

I added a simple little file store that keeps upload IDs and checks 'em first. If found, pytrainer will show the user it already exists and then not upload the record. If it has been processed by Strava, it will open the system's web browser using the activity URL.

I also moved use of the progress dialog into the 'get_web_data' method so it always shows when getting web resources, like getting the user's token.

Hope that helps!

Jason