Empty file (GPS.Sport storage backend failure) handling.
authorRoman Bazalevskiy <rvb@rvb.name>
Sat, 12 Aug 2023 16:40:41 +0000 (19:40 +0300)
committerRoman Bazalevskiy <rvb@rvb.name>
Sat, 12 Aug 2023 16:40:41 +0000 (19:40 +0300)
pyrungps/pyrungps_sync.py

index 18c2235c34ac667f1dec830e22980745a9ee2ea6..67362156ea82d66235aeccc78f1dc826017a84fe 100644 (file)
@@ -189,6 +189,10 @@ def sync_db(dbx,username,year,month,dir=".",verbose=False,force=False):
 
         sport = training['sport']
         timestamp = gpx.tracks[0].start_time()
 
         sport = training['sport']
         timestamp = gpx.tracks[0].start_time()
+                
+        if not(timestamp):
+          print("Empty training found, skipping...")
+          continue
         
         print(sport, timestamp)
         
         
         print(sport, timestamp)