remove GPX if it's already in the database, too
This commit is contained in:
parent
2c19532e1b
commit
841fac5634
1
main.py
1
main.py
@ -74,6 +74,7 @@ def process_gpx_files(tx: Connection):
|
||||
print(f'Processing {filename}')
|
||||
if list(db.execute(text('select exists(select from training where owner = :owner and filename = :filename)'),
|
||||
dict(owner=owner, filename=filename,),),)[0][0]:
|
||||
os.remove(filepath)
|
||||
continue
|
||||
with open(filepath) as f:
|
||||
gpx_file = gpxpy.parse(f)
|
||||
|
Loading…
x
Reference in New Issue
Block a user