relax file name matching for downloaded fit files
Seems like Garmin has changed the naming scheme of `.fit` files within the zip download when getting the original activity.
The scheme used to be `{activity_id}.fit.` but has been changed to `{activity_id}_ACTIVITY.fit`. This commit relaxes the name comparison.
			
			
This commit is contained in:
		
							parent
							
								
									ec0b8e651d
								
							
						
					
					
						commit
						9072333a3c
					
				@ -335,7 +335,7 @@ class GarminClient(object):
 | 
				
			|||||||
        zip_file = zipfile.ZipFile(BytesIO(response.content), mode="r")
 | 
					        zip_file = zipfile.ZipFile(BytesIO(response.content), mode="r")
 | 
				
			||||||
        for path in zip_file.namelist():
 | 
					        for path in zip_file.namelist():
 | 
				
			||||||
            fn, ext = os.path.splitext(path)
 | 
					            fn, ext = os.path.splitext(path)
 | 
				
			||||||
            if fn == str(activity_id):
 | 
					            if fn.startswith(str(activity_id)):
 | 
				
			||||||
                return ext[1:], zip_file.open(path).read()
 | 
					                return ext[1:], zip_file.open(path).read()
 | 
				
			||||||
        return None, None
 | 
					        return None, None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user