Conversation
…ning Reported: opening Select City with no offline new_city.cfg showed "City list file not found" twice, then dropped back to the main plugin screen instead of staying on a usable search panel. Root causes: - onShown fires more than once per screen open in Enigma2, and prepare_city_list() was bound directly to onShown with no guard, so the warning popped up on every firing. - The warning's callback closed the entire CityPanel4 screen (self.close(None)), not just the popup, contradicting its own "use the search" message since the search screen no longer existed by the time the user could act on it. Fixed by guarding the warning to show once per screen instance, and leaving CityPanel4 open afterward (with an empty list) so the user can press RED to search online, per PR #4's Test plan note that this mechanism needed follow-up. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UPpumFb2PP21ATpDwJBYBB
# Conflicts: # usr/lib/enigma2/python/Plugins/Extensions/Foreca1/city_panel.py
pQu4k3r
added a commit
that referenced
this pull request
Sep 10, 2026
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
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
Follow-up to #4. User tested the crash fix and reported: opening Select City with no offline
new_city.cfgshowed "City list file not found" twice, then dropped back to the main plugin screen instead of staying on a usable search panel.Root causes:
onShownfires more than once per screen open in Enigma2, andprepare_city_list()was bound directly toonShownwith no guard, so the warning popped up on every firing.CityPanel4screen (self.close(None)), not just the popup — contradicting its own "use the search" message, since the search screen no longer existed by the time the user could act on it.Fix
self._missing_file_warned).CityPanel4open afterward (with an empty list) instead of closing it, so the user can press RED to open the keyboard and search online — confirmedopen_keyboard/filter_cities/search_online/search_offlineare all self-contained and don't depend on the offline file being present.