geo-activity-playground 1.7.0__py3-none-any.whl → 1.7.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ import zoneinfo
7
7
  from typing import Optional
8
8
 
9
9
  import pandas as pd
10
+ import sqlalchemy
10
11
  from stravalib import Client
11
12
  from stravalib.exc import Fault
12
13
  from stravalib.exc import ObjectNotFound
@@ -121,8 +122,21 @@ def try_import_strava(
121
122
  and strava_activity.start_date is not None
122
123
  and str(strava_activity.start_date) > strava_end
123
124
  ):
125
+ logger.info(f"Reached {strava_end}, stopping.")
124
126
  break
125
127
 
128
+ if (
129
+ existing_activity := DB.session.scalar(
130
+ sqlalchemy.select(Activity).where(
131
+ Activity.upstream_id == strava_activity.id
132
+ )
133
+ )
134
+ ) is not None:
135
+ logger.info(
136
+ f"Strava activity {strava_activity.id} already exists in database as {existing_activity.id}, skipping."
137
+ )
138
+ continue
139
+
126
140
  cache_file = (
127
141
  pathlib.Path("Cache")
128
142
  / "Strava Activity Metadata"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geo-activity-playground
3
- Version: 1.7.0
3
+ Version: 1.7.1
4
4
  Summary: Analysis of geo data activities like rides, runs or hikes.
5
5
  License: MIT
6
6
  Author: Martin Ueding
@@ -55,7 +55,7 @@ geo_activity_playground/importers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
55
55
  geo_activity_playground/importers/activity_parsers.py,sha256=NAK_Fv_zy75WuNa1bgYgzjc7Dnsj1oVah6DW0faLCG4,11403
56
56
  geo_activity_playground/importers/csv_parser.py,sha256=O1pP5GLhWhnWcy2Lsrr9g17Zspuibpt-GtZ3ZS5eZF4,2143
57
57
  geo_activity_playground/importers/directory.py,sha256=sHcLIi0DOPEATt4wiE_vp00h89fO940wUQyJZUzzpnw,3978
58
- geo_activity_playground/importers/strava_api.py,sha256=0lUmC6u829vJpaIs7plQq4mOPgc7yQI65vN9qhAEqVs,9015
58
+ geo_activity_playground/importers/strava_api.py,sha256=RBKjeFJlDMqVBamr47y9wfO1w-0reE8turYe7aDxLWI,9556
59
59
  geo_activity_playground/importers/strava_checkout.py,sha256=joJI_uic9fYtu7E5Odh6GUq_LyiLqQ72Ucy_Mbjr-X0,9289
60
60
  geo_activity_playground/importers/test_csv_parser.py,sha256=nOTVTdlzIY0TDcbWp7xNyNaIO6Mkeu55hVziVl22QE4,1092
61
61
  geo_activity_playground/importers/test_directory.py,sha256=_fn_-y98ZyElbG0BRxAmGFdtGobUShPU86SdEOpuv-A,691
@@ -175,8 +175,8 @@ geo_activity_playground/webui/templates/summary/vega-chart.html.j2,sha256=mw8Hti
175
175
  geo_activity_playground/webui/templates/time_zone_fixer/index.html.j2,sha256=s9r6BJMXmd7kLSyjkvH4xLi6e01S5bpGRcMgMMJyCAE,1760
176
176
  geo_activity_playground/webui/templates/upload/index.html.j2,sha256=I1Ix8tDS3YBdi-HdaNfjkzYXVVCjfUTe5PFTnap1ydc,775
177
177
  geo_activity_playground/webui/templates/upload/reload.html.j2,sha256=YZWX5eDeNyqKJdQAywDBcU8DZBm22rRBbZqFjrFrCvQ,556
178
- geo_activity_playground-1.7.0.dist-info/LICENSE,sha256=4RpAwKO8bPkfXH2lnpeUW0eLkNWglyG4lbrLDU_MOwY,1070
179
- geo_activity_playground-1.7.0.dist-info/METADATA,sha256=HCy1RVSW8KTPYzUWo9XW5ozzP9HV87ueYQO3Aq6mXjY,1937
180
- geo_activity_playground-1.7.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
181
- geo_activity_playground-1.7.0.dist-info/entry_points.txt,sha256=pbNlLI6IIZIp7nPYCfAtiSiz2oxJSCl7DODD6SPkLKk,81
182
- geo_activity_playground-1.7.0.dist-info/RECORD,,
178
+ geo_activity_playground-1.7.1.dist-info/LICENSE,sha256=4RpAwKO8bPkfXH2lnpeUW0eLkNWglyG4lbrLDU_MOwY,1070
179
+ geo_activity_playground-1.7.1.dist-info/METADATA,sha256=E1l3BDgqU0h1zQ76RHprb-V_op5neSQHdQm4y1W1KLw,1937
180
+ geo_activity_playground-1.7.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
181
+ geo_activity_playground-1.7.1.dist-info/entry_points.txt,sha256=pbNlLI6IIZIp7nPYCfAtiSiz2oxJSCl7DODD6SPkLKk,81
182
+ geo_activity_playground-1.7.1.dist-info/RECORD,,