Skip to content

Commit d0777c2

Browse files
oliv3rclaude
andcommitted
Fixed: Return early and navigate back when mainlist login fails
When a channel's main list requires login and log_on() fails (e.g. user cancels device auth), return None from process_folder_list instead of an empty list. FolderAction detects the None sentinel and calls endOfDirectory(handle, False), causing Kodi to navigate back to the channel overview. A brief login-error notification is shown (matching the sub-item login failure pattern at line 500-508). Previously the login failure was silently ignored, leaving the user on an empty folder. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
1 parent 0c4178c commit d0777c2

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

resources/lib/actions/folderaction.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ def execute(self):
6363
watcher = StopWatch("Plugin process_folder_list With Items", Logger.instance())
6464
media_items = self.__favorites
6565

66+
if media_items is None:
67+
Logger.warning("process_folder_list returned None, navigating back")
68+
xbmcplugin.endOfDirectory(self.handle, False)
69+
return
70+
6671
if len(media_items) == 0:
6772
Logger.warning("process_folder_list returned %s items", len(media_items))
6873
ok = self.__show_empty_information(media_items, favs=self.__favorites is not None)

resources/lib/chn_class.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ def process_folder_list(self, parent_item: Optional[MediaItem] = None) -> List[M
201201
if [p for p in data_parsers if p.LogOnRequired]:
202202
Logger.info("One or more dataparsers require logging in.")
203203
self.loggedOn = self.log_on()
204+
if not self.loggedOn:
205+
Logger.warning("Could not log on for: %s", self)
206+
title = LanguageHelper.get_localized_string(LanguageHelper.LoginErrorTitle)
207+
text = LanguageHelper.get_localized_string(LanguageHelper.LoginErrorText)
208+
XbmcWrapper.show_notification(
209+
title, text, display_time=2000,
210+
notification_type=XbmcWrapper.Error,
211+
logger=Logger.instance())
212+
return None
204213

205214
# now set the headers here and not earlier in case they might have been update by the logon
206215
if parent_item is not None and parent_item.HttpHeaders:

0 commit comments

Comments
 (0)