Skip to content

[script.wetrakr] 1.1.6#2835

Open
wetrakr wants to merge 2 commits into
xbmc:omegafrom
wetrakr:script.wetrakr-1.1.6
Open

[script.wetrakr] 1.1.6#2835
wetrakr wants to merge 2 commits into
xbmc:omegafrom
wetrakr:script.wetrakr-1.1.6

Conversation

@wetrakr
Copy link
Copy Markdown

@wetrakr wetrakr commented May 21, 2026

Update to WeTrakr Scrobbler (script.wetrakr) v1.1.6.

Changes since 1.1.4

v1.1.6

  • Dispatch all scrobble HTTP calls on a daemon thread so Kodi's player callbacks return immediately. Fixes a multi-second UI freeze observed at the "watched" moment on slower devices (reported on Vero 4K+ running OSMC Kodi 21.1).

v1.1.5

  • Fall back to the VideoPlayer.UniqueID infolabel when JSON-RPC uniqueid comes back empty. Enables correct media resolution for items played outside Kodi's local library (Jellyfin for Kodi, Plex Kodi Connect).

The full changelog is also embedded in addon.xml under <news>.

@kodiai
Copy link
Copy Markdown

kodiai Bot commented May 21, 2026

Kodiai Addon Check

✅ No issues found by kodi-addon-checker.

@kodiai
Copy link
Copy Markdown

kodiai Bot commented May 21, 2026

Partial review -- Analyzed 2 of 4 files. Reviewed top 2 files by risk in retry.

Review completed with reduced scope.

@kodiai
Copy link
Copy Markdown

kodiai Bot commented May 21, 2026

Review Details
  • Analyzed progress before timeout: 0/4 changed files

  • Findings captured before timeout: 0 total

  • Retry state: scheduled reduced-scope retry

  • Lines changed: +95 -35

  • Profile: balanced (auto, lines changed: 130)

  • Contributor experience: profile-backed (using linked contributor profile guidance)

  • Review completed: 2026-05-21T18:15:58.758Z

  • Total wall-clock: 6m 18s

  • Phase timings:

    • queue wait: 1ms
    • workspace preparation: 1.3s
    • retrieval/context assembly: 6.3s
    • executor handoff: 2.0s
    • remote runtime: 6m 4s (degraded: remote runtime timed out)
    • publication: 2.2s (degraded: captured before publication completed)
  • Keyword parsing: No keywords detected

Comment on lines +28 to +33
def _dispatch_async(target, *args, **kwargs):
"""Run a callable in a daemon thread; never blocks the caller."""
t = threading.Thread(target=target, args=args, kwargs=kwargs)
t.daemon = True
t.start()
return t
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MAJOR] Background threads lack exception handling. If target raises an exception after the thread starts, it won't be caught by the callback's try-except blocks and won't be logged via Kodi's logging system (player.py:150-152, 198-200, 255-257, 342-349, 351-353, 390).

Only _send_scrobble() (line 427-432) wraps its call with proper error handling via the inner _send() function. All other _dispatch_async() calls risk silent failures that make debugging difficult.

Suggested change
def _dispatch_async(target, *args, **kwargs):
"""Run a callable in a daemon thread; never blocks the caller."""
t = threading.Thread(target=target, args=args, kwargs=kwargs)
t.daemon = True
t.start()
return t
def _dispatch_async(target, *args, **kwargs):
"""Run a callable in a daemon thread; never blocks the caller."""
def _wrapped():
try:
target(*args, **kwargs)
except Exception as e:
xbmc.log("[WeTrakr] Background thread error: {}".format(str(e)), xbmc.LOGERROR)
t = threading.Thread(target=_wrapped)
t.daemon = True
t.start()
return t

Wrap target callable in try/except so unhandled exceptions are piped
through xbmc.log(LOGERROR) instead of dying silently. Addresses the
review comment from kodiai bot on PR xbmc#2835.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@romanvm romanvm added the Approved Approved and is ready to merge label May 22, 2026
@romanvm
Copy link
Copy Markdown

romanvm commented May 22, 2026

LGTM
AI comments are optional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Approved and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants