Conversation
README documents that the offline city list "is created automatically during a search" if it doesn't exist, but that mechanism was never actually implemented anywhere in the codebase - new_city.cfg was only ever read, never written. Implemented it: after a successful online search (search_online), append any newly found cities to new_city.cfg, deduped by city id against what's already in the file, in the same "ID/City_Name" format the reader already expects (verified with a write/read round-trip, including a non-ASCII city name). Creates SYSTEM_DIR if needed, mirroring the pattern already used elsewhere (e.g. ForecaSetup.save in plugin.py). The offline list now builds up over time as users search, so City Selection's offline browsing (and search_offline's fallback) actually has something to work with after the fix in #4/#5. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UPpumFb2PP21ATpDwJBYBB
pQu4k3r
added a commit
that referenced
this pull request
Sep 10, 2026
Reported: searching "Lourdes" added all 17 online search results to new_city.cfg, not just the one city actually chosen. #6 appended every result from search_online to the offline list as soon as the search ran, before the user picked anything. Moved the write to the four places a city is actually selected instead (ok/save_favorite1/save_favorite2/save_home), keyed off the exact same get_selected_city() string already used to save favorites - same format as the offline file, so no extra parsing/round-tripping. Still deduped by id so repeated selections don't grow the file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UPpumFb2PP21ATpDwJBYBB
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.
Summary
README documents that the offline city list "is created automatically during a search" if it doesn't exist, but that mechanism was never actually implemented —
new_city.cfgwas only ever read anywhere in the codebase, never written. Confirmed by repo-wide search before implementing.Implements it: after a successful online search (
search_onlineincity_panel.py), any newly found cities are appended tonew_city.cfg, deduped by city id against what's already in the file, in the sameID/City_Nameformat the reader already expects.SYSTEM_DIRif needed, mirroring the pattern already used elsewhere (ForecaSetup.saveinplugin.py).São Paulo), to confirm the_↔space encoding matchesprepare_city_list's reader exactly.With this, the offline city list now actually builds up over time as users search — so City Selection's offline browsing and
search_offline's local fallback (both fixed in #4/#5) have something real to work with after a fresh install.