Repository navigation
Fix token expiry, Swagger CSRF, detector false positives, stuck pending files (2.10.9) - #92
Merged
Merged
Conversation
POST /api/tokens received expires_in_days as a string from the settings form and raised TypeError in timedelta. The endpoint now coerces digit strings and returns 400 for values that are not positive integers. The API docs page had no CSRF token, so Swagger Try-it-out writes were rejected. The page now carries the token and the request interceptor sends X-CSRFToken on same-origin writes.
Freeze corroboration took the expected packet rate from the container's avg_frame_rate, which Matroska reports as 1000/1 when it cannot compute one, so a static end card with a steady 23.976 fps packet stream was reported as 98% absent. The rate now comes from the cadence measured around the window; the header value is only a fallback. The -c copy validation pass never decodes, so a 'no frame!' line there comes from stream probing. Blu-ray remuxes that start with a lone PPS sample yield one such line on a clean file and were marked corrupted. Up to NO_FRAME_PROBE_NOTICE_MAX of these are benign on a clean exit.
Since 2.9.3 chunk workers claim run members and only discovery created them, so a pending-type run had nothing to chunk and force-scan-pending finalized every run with zero files. The orchestrator now seeds members from the pending inventory. A member whose file is gone is recorded as error with 'File not found' and file_exists false; a completed observation keeps its status and only loses the presence flag. Orphan cleanup asked the folder directly above a vanished media folder, which is gone too when a whole podcast or show is removed, so those rows were held as a possible outage. The guard now walks up to the nearest present directory and asks the library there.
A deleted file and an offline mount read the same. The claim path now writes the missing state only when the containing scan root passes its mount baseline and the nearest present directory under it holds entries; otherwise the member is unavailable and the inventory row keeps its state. The cleanup guard's ancestor walk stops at the scan root so evidence always comes from the same library.
Interlaced DVD rips encoded with duplicate frames dropped carry a container rate of 29.97 fps while frames arrive at a mix of 33 ms and 67 ms steps, so Stage 1 warned that 7 to 15 percent of frames were missing on files where every packet decodes and nothing is absent. When the decode confirms the deficit and decoded frames equal packets, Stage 1 now probes the packet timeline. No gap over one second and a missing tail that explains at most a quarter of the deficit means a variable frame rate note. A hole, a truncated tail, a decoder that loses packets, or a probe timeout still warns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
2.10.6: token expiry 500 and Swagger CSRF
Creating an API token with an expiration returned HTTP 500, and every write request from the Swagger Try-it-out page failed with "The CSRF token is missing". Production logs show three
TypeError: unsupported type for timedelta days component: strtracebacks on POST /api/tokens and the CSRF rejection on a POST with referer /api-docs.What changed
POST /api/tokenscoercesexpires_in_daysfrom the string the settings form sends and returns HTTP 400 for values that are not positive integers. A missing JSON body no longer raises.X-CSRFTokenon same-origin writes. Bearer requests are unaffected.openapi.yamldocumentsexpires_in_dayswithminimum: 1.Verification
python -m pytest tests/ -q: 877 passed, 56 skipped. The one error,test_scan_cancellation_race, needsPIXELPROBE_TEST_POSTGRES_URIand errors the same way onmain.python -m pytest tests/ -m postgresagainst a throwaway PostgreSQL 18 container: 54 passed, 1 skipped.npm ci && npm run build, app import startup check against PostgreSQL, anddocker compose config -qall pass.2.10.6 release
ttlequals0/pixelprobe:2.10.6pushed after CI and CodeQL passed. Trivy: 0 HIGH, 0 CRITICAL, 556 MEDIUM (all Ubuntu 26.04 base packages, no fixes available, same as 2.10.5)./api/versionreports 2.10.6.POST /api/tokenswith"expires_in_days": "1"returns 201 withexpires_atset,"abc"returns 400. The shipped docs bundle contains theX-CSRFTokeninterceptor.latestis unchanged.2.10.7: two detector false positives
Checked against the five files flagged in production:
avg_frame_rateis 1000/1, so the detector expected 11303 packets and saw 273Fixes:
avg_frame_rate, which Matroska reports as 1000/1 when it cannot compute one. Against the real files, Respect no longer corroborates and Bunnylovr still reports missing content.no frame!andmissing picture in access unitcan only come from stream probing. Up toNO_FRAME_PROBE_NOTICE_MAX(default 4) such lines are benign on a clean exit; more still mark the file corrupted. The real 30 Minutes file now passes that stage as healthy.no frame!, non-zero exit).Full suite: 882 passed, 56 skipped, same PostgreSQL-environment error as before.
2.10.7 release
ttlequals0/pixelprobe:2.10.7pushed after CI and CodeQL passed. Trivy: 0 HIGH, 0 CRITICAL, 556 MEDIUM, unchanged from 2.10.6./api/versionreports 2.10.7.latestis unchanged.2.10.8: stuck pending files
17 inventory rows stayed pending after every force-scan-pending run. Their podcast folders had been deleted from the share, and two defects kept them stuck:
POST /api/force-scan-pendingqueued a run that logged "no files to scan" and finished with zero files. Since 2.9.3 chunk workers claim run members, and only directory discovery created them; a pending-type run skips discovery, so there was nothing to chunk. The run now seeds members from the pending inventory. A member whose file is gone is recorded aserrorwith "File not found" andfile_existsfalse, once its scan root passes the mount baseline and the nearest present directory under it still holds entries; an offline library leaves the row unchanged. A row with a completed observation keeps it and only loses its presence flag.Tests: the orchestrator test reproduces the production result (
COMPLETED, 0 files) before the fix; seeding, vanished-file claims, the deleted-subtree guard, and the unmounted-library hold are covered.2.10.8 release
ttlequals0/pixelprobe:2.10.8pushed after CI and CodeQL passed. Trivy: 0 HIGH, 0 CRITICAL, 556 MEDIUM, unchanged./api/versionreports 2.10.8.POST /api/force-scan-pendingqueued 17 files; pending count reached 0 within 10 seconds and the rows readerror, "File not found",file_existsfalse.latestis unchanged.2.10.9: frame-count warnings on VFR DVD rips
41 of the 46 warning rows were Twilight Zone (1985) DVD rips flagged "Frame count differs from container metadata" by 7 to 15%. Two episodes checked in full: packets equal decoded frames, no decode errors, and the largest gap between consecutive frames is 0.067 s. The source is interlaced and was encoded with duplicate frames dropped, so the container's 29.97 fps overstates the frame count. Nothing is missing.
Stage 1 now probes the packet timeline when the decode confirms the deficit and decoded frames equal packets. If no gap exceeds 1 s and the missing tail accounts for at most a quarter of the deficit, the deficit is recorded as a variable frame rate note. A hole, a truncated tail, a decoder that loses packets, or a probe timeout keeps the warning. Against the real S03E25 file the result is the note and no warning.
The other five warnings hold up: Green Room has a 60 s Lionsgate anti-copy card mid-film, Portlandia S02E10 opens with 60 s of color bars and 89 s of silence, The Sound of Music and South Park S10E05 are genuine long holds (entr'acte card, static shot), and Beautiful Girls was replaced after its scan and clears on rescan.
2.10.9 release
ttlequals0/pixelprobe:2.10.9pushed after CI and CodeQL passed. Trivy: 0 HIGH, 0 CRITICAL, 556 MEDIUM, unchanged./api/versionreports 2.10.9.latestis unchanged.