mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-24 08:14:32 +00:00
First attempt at converting "sig" to "activity" for v3
This commit is contained in:
@@ -57,11 +57,11 @@ class SOTA(HTTPSpotProvider):
|
||||
# Seen SOTA spots with no frequency!
|
||||
mode=Mode.from_name(source_spot["mode"].upper()),
|
||||
comment=source_spot["comments"],
|
||||
sig=ActivityName.SOTA,
|
||||
sig_refs=[
|
||||
activity=ActivityName.SOTA,
|
||||
activity_refs=[
|
||||
ActivityRef(
|
||||
id=source_spot["summitCode"],
|
||||
sig=ActivityName.SOTA,
|
||||
activity=ActivityName.SOTA,
|
||||
name=source_spot["summitName"],
|
||||
latitude=source_spot["latitude"],
|
||||
longitude=source_spot["longitude"],
|
||||
@@ -92,10 +92,10 @@ class SOTA(HTTPSpotProvider):
|
||||
id_token = credentials.get("id_token", "")
|
||||
if not access_token or not id_token:
|
||||
raise ValueError("SOTA API tokens are required. Please log into SOTA in order to spot to it.")
|
||||
sig_ref = spot.sig_refs[0].id if spot.sig_refs else ""
|
||||
if sig_ref:
|
||||
ref_id = spot.activity_refs[0].id if spot.activity_refs else ""
|
||||
if ref_id:
|
||||
# Split reference into association and summit codes
|
||||
ref_split = sig_ref.split("/")
|
||||
ref_split = ref_id.split("/")
|
||||
|
||||
# Figure out a valid mode. Borrowed this from PoLo :)
|
||||
# https://github.com/ham2k/app-polo/blob/main/src/extensions/activities/sota/SOTAPostSelfSpot.js
|
||||
|
||||
Reference in New Issue
Block a user