opencaching / okapi

A common API for all National Opencaching.XX sites
22 stars 19 forks source link

New cache types #452

Closed andrixnet closed 5 years ago

andrixnet commented 7 years ago

There will be new cache types according to https://github.com/opencaching/opencaching-pl/issues/860

How should these be coordinated with OKAPI?

Also, how would changes as suggested here https://github.com/opencaching/opencaching-pl/issues/860#issuecomment-278650636 affect OKAPI?

wrygiel commented 7 years ago

Internally OKAPI recognizes cache types by their IDs, not names. Externally it exposes names, which generally shouldn't change (especially the "primary ones"). So, we need a unique name-ID mapping. One that won't clash with the existing one:

            # Primary types (documented, cannot change)
            'Traditional' => 2, 'Multi' => 3, 'Quiz' => 7, 'Virtual' => 4,
            'Event' => 6,
            # Additional types (may get changed)
            'Other' => 1, 'Webcam' => 5,
            'Moving' => 8, 'Podcast' => 9, 'Own' => 10,

This means, that OCUS might be required to rewrite their cache type IDs, if any of these newly added ones have an ID which is <= 10.

andrixnet commented 7 years ago

There are conflicting IDs. All IDs are documented here : https://wiki.opencaching.eu/index.php/Cache_types A proposed non-overlapping ID assignment is described in column F

Second, does OKAPI expose type 7 (Quiz) in such way that apps like c:geo handle it as the same or different type then geocaching.com's Mystery type?

wrygiel commented 7 years ago

There are conflicting IDs. All IDs are documented here : https://wiki.opencaching.eu/index.php/Cache_types A proposed non-overlapping ID assignment is described in column F

Once you come to an agreement then, these new IDs would need to be changed in OKAPI code.

Second, does OKAPI expose type 7 (Quiz) in such way that apps like c:geo handle it as the same or different type then geocaching.com's Mystery type?

I don't know how c:geo handles geocaching.com caches. (I myself don't use either c:geo, nor geocaching.com.)

What I can tell you is that OKAPI exposes quizes as Quiz cache type in services/caches/geocache method. Also Quiz is currently mapped to Unknown Cache in GPX files. I am not sure how groundspeak maps its Mystery caches to GPX currently, but OKAPI tries to be consistent with groundspeak in this matter (this has become difficult as groundspeak GPX files are now not available for regular users).

wrygiel commented 7 years ago

https://wiki.opencaching.eu/index.php/Cache_types

BTW - note, that you don't need to resolve duplicates with OCDE, because OCDE is not (currently?) planning to switch to OCPL code. OKAPI stores both mappings separately (one for OCPL-codebase and one for OCDE).

following5 commented 5 years ago

After old OC.UK shut down, there is only the conflicting ID 9 left within all OCPL-based sites. See PR #1752 for resolving that.

Between OCDE and OCPL branches, conflicts can only arize in data that is exported by the rarely used old "XML interface". That's the only interface that exposes the internal type IDs. We need not to care about that; it's up the the developers to remap those IDs.

So there is technically no problem with adding the special OC.US types.

following5 commented 5 years ago

But currently there are no efforts to add more types to the OCPL code. It has rather been suggested to map the OCUS types to common types. So there is nothing to do for OKAPI developers now.