feat(providers): Add QWeather weather provider, ip.sb location provider and QWeather GeoAPI city search - #151
Merged
Conversation
…er and QWeather GeoAPI city search
# Conflicts: # src/preferences/generalPage.ts # src/providers/provider.ts
Owner
|
I like the idea and the implementation. There are a couple of changes I am going to make before I directly merge this PR into development; mainly an attribution issue and the fact that the weather provider is directly tied to the location search provider. You should see it merged soon, thank you! |
Owner
|
Could you (on this repo):
If there's no issues I'll merge to development soon! Thank you! |
Contributor
Author
|
I've tested the
No issues found on my end. Thanks for the quick turnaround! |
Owner
|
Thank you! It was a large feature commit so as you can tell I made a couple changes, and I really appreciate this PR and your feedback! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the feature requested in #150. Adds providers that work better for users in China, with no refactoring of existing code and no new dependencies.
New weather provider: QWeather
src/providers/qweather.ts(index 3), registered increateProvider.X-QW-Api-Keyrequest header; since QWeather API hosts are per-user (*.qweatherapi.com), a newapi-hostssetting (a{ss}, mirroringapi-keys) stores the host.code != "200") are surfaced as errors.New location provider: ip.sb
MyLocationProvider.IpSb(enum 5) inmyLocation.ts; free, no API key needed.config.getMyLocationProvider()which silently resetDisable(3) andIpapi(4) to ipinfo.City search auto-switch
Preferences UI
Supporting changes
LibSoup.fetchJsongained an optionalheadersparameter (backward compatible).config.ts:getApiHosts()/onApiHostsChanged()mirroring the existing api-keys accessors.weather-providerenum +qweather(3),my-loc-providerenum +ip.sb(5), newapi-hostskey.Notes
./debug.sh);tscclean, schema compiles withglib-compile-schemas --strict.