From c73748b3deb9973d04ecf07a920292342433d5fc Mon Sep 17 00:00:00 2001 From: Kris Anderson <1562427+kris-anderson@users.noreply.github.com> Date: Wed, 4 Nov 2026 14:44:18 -0800 Subject: [PATCH] [The Porn DB Markers] Skip scenes that no longer exist The Scene.Update.Post hook queues a Sync task by scene id. If the scene is deleted before that task runs, find_scene() returns None and processScene crashed with "TypeError: 'NoneType' object is not subscriptable". Return early with a debug log line instead. Bump to 0.4.5. Fixes #813 Co-Authored-By: Claude Opus 5.5 --- plugins/TPDBMarkers/TPDBMarkers.yml | 2 +- plugins/TPDBMarkers/tpdbMarkers.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/TPDBMarkers/TPDBMarkers.yml b/plugins/TPDBMarkers/TPDBMarkers.yml index e0e51d13..aac8013d 100644 --- a/plugins/TPDBMarkers/TPDBMarkers.yml +++ b/plugins/TPDBMarkers/TPDBMarkers.yml @@ -1,6 +1,6 @@ name: The Porn DB Markers description: Sync Markers from The Porn DB aka theporndb.net -version: 0.4.4 +version: 0.4.5 url: https://discourse.stashapp.cc/t/the-porn-db-markers/1335 exec: - python diff --git a/plugins/TPDBMarkers/tpdbMarkers.py b/plugins/TPDBMarkers/tpdbMarkers.py index 3ca347ed..45741330 100644 --- a/plugins/TPDBMarkers/tpdbMarkers.py +++ b/plugins/TPDBMarkers/tpdbMarkers.py @@ -23,6 +23,10 @@ def getTag(name): def processScene(scene): + if scene is None: + # The hook queues a task by scene id; the scene may be deleted before it runs. + log.debug("Scene not found, it may have been deleted; skipping") + return getTag("[TPDBMarker]") for sid in scene["stash_ids"]: if sid["endpoint"] == TPDB_ENDPOINT: