Discover scenes from StashDB that you don’t have locally. View missing scenes for performers and studios, with optional Whisparr integration for automated downloading and cleanup.
Discover scenes from StashDB that you don’t have in your local library. Browse missing scenes for performers and studios, with optional Whisparr integration for automated downloading and cleanup.
Loving the plugin, but sometimes it seems to return inaccurate numbers. For example, visiting the Exploited College Girls studio on StashDB shows 1,173 scenes, but clicking the “Missing Scenes” button in Stash only shows 394 scenes. Am I missing something?
Thanks for reporting this @slinky and @Cadey! I was able to reproduce and fix the issue.
Root cause: The plugin was using StashDB’s TRENDING sort when querying studio scenes. It turns out TRENDING only returns scenes that have trending data (fingerprints, recent activity), which excludes older scenes. For Exploited College Girls, TRENDING returned ~396 scenes while the actual count is 1,173.
Fix: Changed the studio query to use DATE sort instead, which returns all scenes. Also increased the pagination limit from 1,000 to 5,000 scenes to support larger studios/performers.The fix is now live.
Pushed an update today because I kept getting 504 errors, and I believe that was due to it trying to fetch everything for the entity from StashDB. I made some changes that should make it much snappier and avoid those errors. Please let me know if this introduces other problems!
runPluginOperation throws “Invalid JSON input: Invalid \escape” error when running missingScenes plugin on latest Stash version
Body
Environment
Stash Version: latest (≥ v0.25.0, confirmed with v0.30+ for tag support)
Plugin Version: missingScenes (latest available version)
OS: [Please fill in your OS, e.g., Windows 11 / Ubuntu 22.04 / macOS Ventura]
Problem Summary
When attempting to run the plugin via the GraphQL mutation on the latest Stash release, the operation fails immediately with a JSON parsing error. The error specifically flags an invalid escape sequence at a precise position in the JSON input, which prevents the plugin from executing its core functionality (querying StashDB for missing scenes, integrating with Whisparr, etc.).missingScenesrunPluginOperation
Fully configure Stash with a valid Stash-box endpoint (StashDB) and linked performers/studios/tags.
Install the missingScenes plugin and configure optional settings (Whisparr URL, API key, scan path) as per the plugin’s README.
Navigate to a linked performer/studio/tag detail page in Stash.
Click the “Missing Scenes” button to trigger the for the plugin.runPluginOperation
Observe the error popup with the invalid JSON / invalid \escape message.
Root Cause Analysis (Observed)
Strict JSON Parsing in Latest Stash: The latest Stash version enforces strict compliance with RFC 8259 JSON specification, with zero tolerance for invalid escape sequences. Older Stash versions had more lenient JSON parsing and did not throw this error for the same plugin configuration.
Invalid Escape Sequences in Plugin’s JSON Output: The missingScenes plugin generates or loads JSON data that contains illegal escape characters (primarily where the sequence is not a valid JSON escape) and unescaped backslashes (e.g., Windows file paths like where / are misinterpreted as invalid escapes).\escape\eC:\data\unsorted\d\u
Manual JSON String Concatenation: The plugin appears to manually construct JSON strings in its source code (instead of using native JSON serialization utilities) , leading to unescaped special characters and invalid escape sequences that fail strict parsing.
Expected Behavior
The runPluginOperation应该能成功解析插件的 JSON 输入而不触发 escape seq
missingScenes 插件应该会按预期加载并显示 StashDB 中缺失场景列表。
可选的 Whisparr 集成功能(添加到 Whisparr,自动清理)应该
附加N
即使清除了Stash的CAC账户,这个错误依然存在cache/, folders) and the plugin’s tmp/__pycache__ directory.
Thanks for the great report! I’ll look into this. I don’t think I’ve been experiencing this issue myself, but will all of these details, I bet I can figure it out!
Thanks for your plugin, just started to use it and it seems really useful.
Small request, do you think on the grid list, when selecting “favorite tags” the tag(s) that made the scene match could be displayed ?
Would be really nice QoL to assess them at a glance.
The “Building local stash_id cache” message means the plugin is scanning your local library to figure out which StashDB scenes you already have. This step can take a while depending on your library size — it
pages through all scenes linked to StashDB at 100 per page.
A few questions to help narrow it down:
How many scenes are in your library? (Check the Scenes page — the count in the top right)
Which page did you click Missing Scenes from — a performer, studio, or tag page?
Is there anything after that log line? If you wait a minute or two, does another log message appear (like “Cache built: X scenes…”)?
What Stash version are you running?
For the stash-box config — the plugin reads your endpoints directly from Stash’s settings (Settings > Metadata Providers), so as long as you have StashDB configured there with an API key, you’re good. No need
to configure anything in the plugin settings for that.
If it is just taking a long time, that’s something I want to improve — the plugin should give better progress feedback during that cache step instead of going silent
while finding missing scenes, the code correctly identifies that i have 66 scenes missing however it loads, more than 66 in multiples of 50, in this case 100.
also, it would be helpful if the number of missing scenes to be loaded can be a user set variable. as for my case, for loading the next 50 scenes it again starts building local stash_id cache, which take time to build.