Skip to content

Fix invalid xbmcgui.LOGERROR in Radarr/Sonarr error paths - #17

Merged
Addonniss merged 1 commit into
Addonniss:mainfrom
Pihaar:fix-logerror-constant
Aug 9, 2026
Merged

Fix invalid xbmcgui.LOGERROR in Radarr/Sonarr error paths#17
Addonniss merged 1 commit into
Addonniss:mainfrom
Pihaar:fix-logerror-constant

Conversation

@Pihaar

@Pihaar Pihaar commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The error-logging calls in the main Radarr and Sonarr flows pass
xbmcgui.LOGERROR, which does not exist. The Kodi log-level constants
live in the xbmc module, not xbmcgui.

common.log() forwards the level to xbmc.log(), so evaluating
xbmcgui.LOGERROR at the call site raises
AttributeError: module 'xbmcgui' has no attribute 'LOGERROR'. This
happens on every failure path (failed lookup, add, command, or an
exception): instead of the intended error message the user gets a
script error, and the surrounding except then calls
log(..., xbmcgui.LOGERROR) again, raising a second uncaught
AttributeError. The happy path is unaffected.

The helper/test functions already use the correct xbmc.LOGERROR
(for example radarr.py:28, 45, 51), so this is an inconsistency.

Fix: use xbmc.LOGERROR at the affected sites. xbmc is already
imported in both files, so no other change is needed.

Affected lines:

  • resources/lib/radarr.py: 117, 130, 147, 182, 186
  • resources/lib/sonarr.py: 263, 299, 321, 375, 382

Verified on Kodi 22: xbmcgui.LOGERROR raises AttributeError,
xbmc.LOGERROR is 3, and calling the addon's
common.log(msg, xbmc.LOGERROR) works.

@Addonniss
Addonniss merged commit 1803fd6 into Addonniss:main Aug 9, 2026
@Pihaar
Pihaar deleted the fix-logerror-constant branch August 9, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants