You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(scanner): leave files without video out of movie and series libraries - #4117
Closes#2861
Related issue: N/A
Validation tasks: none
Other clients: Apple N/A (shows what the catalog holds); Android N/A (same); Roku N/A (same)
A movie, series or mixed library picks its files by extension, so an audio-only file, such as a soundtrack saved as .mkv, was added as a movie, or as a fake extra part or edition of a real one. Native clients could not play it, and the server probed it again on every scan and every playback decision. This change leaves such files out of the library and removes the titles already created for them.
The loop came from the probe repair checks, which read "audio, no video, not an audiobook or podcast" as an unfinished probe. The playback planner refuses the same row with source_metadata_incomplete.
This replaces #2881, which was closed after review. That review found the remedy right and the implementation incomplete; the points it raised are covered under Approach.
Approach
The rule. A file is left out when two probes agree it has no video stream. The second reads much further into the file (up to 120 seconds or 100 MB), because MPEG transport and program streams and FLV announce a stream only when its first packet arrives. With the scanner's normal arguments, ffprobe reports audio only for a transport stream whose video starts 20 seconds in. When the second probe finds video, the row is written from it. A probe that fails, times out or is rejected decides nothing. The rule applies to every container.
The verdict is stored, in a new scanner_no_video_files table, by path with the file's size, modification time and OSHash. It holds only while the file still has that size and modification time, so replacing or touching the file has it judged again.
Later scans drop the path first. It takes no part in root or group inference and is neither hashed nor probed; the cost is one stat. A failed probe therefore cannot bring the file back.
A row already written is marked missing and leaves the library the way a removed file's does: membership reconcile, the removal grace and the trash sweep are unchanged. The scan counts it under Missing, so the library-changed event is published. The verdict is written before the row is marked, and the mark is fenced to the size and modification time the scan read.
Renames. Relink still runs before any probe. It refuses a row whose stored probe or verdict shows no video, so the file is probed at its new path. If that probe returns nothing and the library holds a verdict for the same OSHash, size and modification time, the file waits for a later scan instead of being cataloged unprobed. A hash match alone never excludes a file.
Single-file scans reconcile only the retired row's own title. There is no library-wide sweep.
Counters.ScanResult.NoVideo, a no_video field in the scan progress log, and the no_video status on streamapp_scanner_files_total. The name avoids Skipped, which the autoscan API uses for an overlapping scan. No /api/v2 field is added.
Why a table and not a column on media_files: the verdict has to outlive the removal grace, or the per-scan probe returns. On the row, that makes every retired row a permanent tombstone that the trash sweep, Upsert, the relink writes and every reader of missing_since would have to work around.
docs/architecture/missing-files.md gains a "Files without video" section.
Nothing on disk is deleted, moved or renamed.
Validation
Reproduced on a dev sandbox built from origin/main: seven audio-only files across .mkv, .mp4, .ts, .mpg, .flv and .ogv were cataloged as movies, one as part 2 of a multipart movie, and an unchanged rescan probed all seven again.
On a sandbox built from this head: the first scan retired all seven rows and their titles left the library; unchanged rescans probed nothing; a video file replaced by audio was retired; an audio file replaced by video came back; a new audio-only file and a renamed excluded file got no row; a late-starting transport stream was cataloged with its video; a single-file scan of an excluded file changed nothing. The server log named each excluded file once.
Two database tests through ScanFolder and ScanFile fail on the base because the audio-only files stay cataloged, and pass here. Disabling each of four parts of the fix in turn makes one of them fail.
Gate: build, gofmt, go mod tidy -diff, vet, make lint-changed, router lint, migration checks, and the OpenAPI, contract, fixture and local-path checks pass. On a Linux builder, route inventory, the scanner, backup and ingest packages, and the scanner's database pins and contracts pass.
Not run or not clean: the web checks (no web change; the workstation has no pnpm). make test-db-pins reported 44 skips, all backup and command tests that need pg_dump, which the builder lacks. make test-go failed two real-FFmpeg tests in internal/mediasample and internal/playback, packages this change does not touch; I did not rerun them on the base. On macOS three scanner tests fail on non-UTF-8 and case-only file names; two fail the same way on the base, and I did not get a clean base run of the third.
Web app: the library page on a sandbox built from origin/main lists nine titles, seven of them audio-only files; rebuilt from this head and scanned once, it lists the two films with video. Captured at desktop and phone width.
The two review fixes in c5aed923 have no test of their own: one needs two interleaved scans and the other an injected database failure. The reviewer reproduced both against a database before the fix; I did not rerun those reproductions after it.
The playback refusal was confirmed from source, not by starting a session.
Migration: adds one table. Nothing existing is rewritten.
A real video judged as having none. The second probe reads up to 120 seconds or 100 MB; video that starts later than that in a transport stream, program stream or FLV would be left out. Touching the file has it judged again. Such a file is also unplayable on native clients today.
Titles disappear on the first scan after upgrade. Audio-only files already in a movie or series library leave it, with a server warning naming each file. The rows are deleted after the removal grace, as for a removed file.
An undecided file still loops. When the second probe fails or times out, the file is cataloged as before and probed again on the next scan, now with the deeper probe as well.
The first scan that finds such a file has already used its path for root and group inference; the next complete scan prunes what that left.
Verdict rows are removed only with their library. A stale one costs a stat per scan.
Not covered: audio-only extras (trailers and the like) are still cataloged. They do not loop.
Adversarial review: Before any code, gpt-6.1-sol attacked the plan and claude-opus-5-5 cut it. The attack led to the second probe, path-keyed verdicts with no inheritance through OSHash, the fenced retirement, the relink filter, and dropping known paths before inference. The cut led to the missing-row ordering, the backup table classification, and no verdict cleanup beyond the library cascade. A simplify pass ran before verification. A multi-agent code review at high then led to writing the row from the deeper probe, recording the verdict before retiring the row, counting a retirement under Missing, the CI test list entries, and the architecture doc section. The background adversarial review (gpt-6.1-sol, reviewed 13793f096) and Kody both found that the bulk retirement of rows at known paths was not fenced and that a single-file scan never retried a failed reconcile; both are fixed in c5aed923.
Exclude files without video from movie and series library scans
Files with no video stream are now left out of the catalog in movie, series, and mixed libraries, with the verdict persisted in a new scanner_no_video_files table created by 20261113185811_record_no_video_files.sql
An initial no-video probe is confirmed by a deeper ffprobe run (120s analysis, 100 MB probe size) before exclusion. Known no-video paths are skipped on later scans without reprobing.
New files whose probe fails are still excluded when their hash, size, and modification time match a stored verdict. Existing catalog rows for excluded files are marked missing, and moved-file relinking skips no-video candidates.
ScanResult gains a NoVideo count, scan metrics and progress reporting include a no_video status, and the table is classified as server state in backups.
Risk: rolling back the migration drops the scanner_no_video_files table and all stored verdicts; check backup/tables.go and no_video.go if backup or restore behavior depends on the table list.
…ries
A movie, series or mixed library picks files by extension, so an audio-only
file (a soundtrack saved as .mkv, an audio-only transport stream) was
cataloged as a movie. The probe repair checks never settled on such a row, so
every scan and every playback decision probed it again, and native clients
could not play it.
The scanner now leaves such a file out. A probe that lists no video stream is
confirmed by a second one that reads further into the file; the verdict is
stored by path, size and modification time in scanner_no_video_files, and a
row already written for the file is marked missing, so it leaves the library
like a removed file's. Later scans drop the path before inference, hashing and
probing. Moved-file relink still runs before any probe and refuses a row whose
stored probe or verdict shows no video. Nothing on disk is touched.
Closes#2861
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).
The scanner now confirms and records files without video in movie and video libraries. It excludes matching files from later scan processing, retires existing catalog rows, and includes no-video outcomes in scan results and progress.
Changes: No-video file scanning
Layer / File(s)
Summary
Verdict storage and probe confirmation migrations/sql/20261113185811_record_no_video_files.sql, internal/scanner/no_video.go, internal/scanner/probe.go
The migration and repository methods store and query no-video verdicts. When an initial successful probe finds no video in a video library, the scanner can run a deeper probe before recording the verdict and retiring an existing row.
Scan exclusion and catalog reconciliation internal/scanner/scanner.go, internal/scanner/scan_batches.go, internal/scanner/file_relink.go, internal/scanner/no_video_db_test.go
Scans filter paths with matching verdicts before normal processing and exclude no-video candidates from moved-file relinking. The scanner reconciles retired rows, memberships, and queues. Database tests cover directory and single-file scans.
Scan results, progress counts, metrics, and backup table classification include the new verdict handling. The architecture documentation describes the scan behavior and renamed-file cases. The database-contract list includes the new tests.
sequenceDiagram
participant Scanner
participant ffprobe
participant FileRepository
Scanner->>ffprobe: Probe file and confirm no-video result
Scanner->>FileRepository: RecordNoVideoFile
Scanner->>FileRepository: RetireNoVideoFile when an existing row matches
Loading
Suggested reviewers:blurbery, rhainland
Merge Risk: Low · previous review c5aed
The change keeps files without video out of movie and series libraries, and no functional defect was confirmed. One architecture doc misstates how a probe rejection is retried, so correct it before merge. A narrow rename edge case for files whose deep probe failed was noted but not confirmed as a defect worth blocking on.
Security architecture risk: Minimal · up to c5aed
The inspected changes preserve existing library-path restrictions and require successful confirmation before storing an exclusion. Catalog retirement is guarded against concurrent row changes, and interrupted work can recover on later scans. No introduced security or failure-containment defect was established.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — Media content and probe output now influence durable catalog suppression and retirement of the selected path's catalog row. Verdict lookups are scoped to the selected folder, and retirement is fenced to a specific row snapshot. The exclusion handler does not write or delete the media file itself.
Trust Boundaries and Controls
observed — The changed ScanFile branch runs after the existing lexical library-root check and folder-state check. It does not introduce another input endpoint or remove those controls. Its no-video reconciliation uses the selected folder and affected path rather than initiating an unrestricted catalog sweep.
Resilience and Maintainability Implications
observed — Main batch verdict-read failures stop that processing path. A verdict-filter failure during ordinary moved-file detection instead uses the pre-existing best-effort fallback to fresh-file probing; it does not relink the unchecked candidate. Failed confirmation creates no persistent exclusion, and single-file reconciliation can be repeated after retirement.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(scanner): leave files without video out of movie and series libraries" matches the main change. The changeset adds no-video verdicts, excludes audio-only files from movie and series sca…
Linked Issues check
Issue #2861 has one direct coding objective group. The summary shows these behaviors for movie and series libraries:
1. Skip files whose probe finds no video. The scanner records a verdict only after…
Out of Scope Changes check
The changed files support the no-video exclusion objective:
- migrations/sql/20261113185811_record_no_video_files.sql: the verdict table. - internal/scanner/no_video.go and no_video_db_test.go:…
Description check
The description is specific and on-topic. It names the problem (audio-only files with video-like extensions cataloged as movies and probed on every scan), the two-probe rule, the scanner_no_video_file…
Full details: Title check
Explanation
The title "fix(scanner): leave files without video out of movie and series libraries" matches the main change. The changeset adds no-video verdicts, excludes audio-only files from movie and series scans, and retires existing rows. The title is specific and uses a conventional commit prefix.
Full details: Linked Issues check
Explanation
Issue #2861 has one direct coding objective group. The summary shows these behaviors for movie and series libraries:
Skip files whose probe finds no video. The scanner records a verdict only after a second, deeper probe also finds no video (internal/scanner/no_video.go). Later scans drop verdict paths before grouping and probing. Covered by TestScanLeavesOutFilesWithoutVideoDB.
Log the exclusion. The PR states the server log names each excluded file once. The scan progress log gains a no_video count.
Remove existing catalog rows as for a removed file. RetireNoVideoFile marks the row missing only while path, size and modification time still match. Membership reconcile, removal grace and trash sweep are unchanged. Covered by TestScanFileRetiresFileWithoutVideoDB and the directory-scan test.
Stop repeated probing. Unchanged verdict paths are not probed on later scans, which addresses the re-probe loop in the issue.
The issue names TestScanSkipsVideoLibraryFilesWithoutVideoDB as a focused test. The added test names differ. This is a suggestion in the issue, not a requirement, so it does not fail the assessment. The objectives text reports that test as passing on the branch. I did not inspect the test file to confirm that name.
No unmet coding requirement is identified from the summary and the cited code.
Full details: Out of Scope Changes check
Explanation
The changed files support the no-video exclusion objective:
migrations/sql/20261113185811_record_no_video_files.sql: the verdict table.
internal/scanner/no_video.go and no_video_db_test.go: verdict logic, retirement and tests.
internal/scanner/scanner.go, scan_batches.go, file_relink.go: applying verdicts in scans, single-file scans and rename handling.
internal/scanner/probe.go: inputOptions for the deeper probe.
internal/scanner/types.go, internal/libraryingest/executor.go, internal/scanner/metrics.go: the NoVideo count, progress reporting and metric label.
internal/backup/tables.go: classifies the new table.
scripts/ci/db-contracts.txt: lists the new tests.
docs/architecture/missing-files.md: documents the behavior.
Each change serves the verdict feature, its counters, its persistence or its documentation. The new table is covered by backup classification, as the new state requires. No change to playback, /api/v2, web code or unrelated library modes is shown.
The PR states audio-only extras are not covered. The change does not extend to them, so it adds no out-of-scope behavior.
Full details: Description check
Explanation
The description is specific and on-topic. It names the problem (audio-only files with video-like extensions cataloged as movies and probed on every scan), the two-probe rule, the scanner_no_video_files table, the NoVideo counter, the relink and single-file behavior, the validation steps, and the risks. Each part matches the changeset in the raw summary and the linked objectives.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Resolved: the supplied before-and-after library captures at desktop and phone widths, with builds identified, now cover the original visible-change evidence request.
Original request
Evidence: This changes which titles appear in library browsing, so it needs visible-change evidence even though the implementation is server-side. Please add before-and-after captures of the same test library showing the excluded entries disappearing and valid video entries remaining, at desktop and phone-width web viewports, with the build or commit identified. Backend validation alone does not show that screen-level result.
Silo-Server/silo-server#4117 replaces #2881: it leaves out a file with no
video in any supported format, and checks the file again when it changes.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Two verified findings: F1 (P1) and F2 (P2). These match the two findings Kody posted during this review; the inline comments add independent database reproductions.
Verification used a disposable PostgreSQL 17 database migrated through this head and scratch tests loaded with a Go overlay. Both database tests added by this PR passed. The two adversarial checks failed on the replacement-generation fence and retry behavior described inline.
Validated features:#1231 C1–C3, Server, validated build 1804 · cc851494: no behavior change for the recorded video-import, debounce, and source-plugin fixtures. Intake and debouncing are unchanged, and video probes bypass no-video confirmation. #197 and #1250 record no passed server scan cases. The project board was unavailable to this token; these classifications use the issue records and source tracing, not new human validation.
AI disclosure: Reviewed with the Codex harness in T3 Code, model gpt-6.1-sol; GitHub CLI and external Go test fixtures.
A scan retiring a row still present at a path with a no-video verdict matched
on the path alone, so a row another scan wrote for a replaced file could be
marked missing. Each row is now read before its file is checked and retired
only while it is still the row that was read.
A single-file scan of a file already left out also reconciles the title of the
row at its path again, so a reconcile that failed after the row was marked is
retried.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
…hanged
Main gained another "error" literal in this file, which put the reshaped
argument line over the lint's repeated-string limit.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.
Reviewing changes in Silo
Include the related issue, expected behavior, and validation steps in the PR description.
For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
Follow this repository's AGENTS.md and CONTRIBUTING.md.
Request another review with @kody start-review in a PR comment.
React with 👍 or 👎 to give feedback on individual suggestions.
Review settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 4 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
Preserve optional store capabilities through production wrappers
Detach mandatory cleanup from request cancellation and bound its lifetime
Preserve durable media identity and share identity-evidence precedence
Bound decoder throughput trades and share direct-play eligibility
* docs: say movie and TV libraries leave out files with no video
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* docs: say files with no video are left out in every format
Silo-Server/silo-server#4117 replaces #2881: it leaves out a file with no
video in any supported format, and checks the file again when it changes.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
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
bugSomething isn't workinggoPull requests that update go codeimpact: usabilityCore flow broken or severely blockedpriority: P2Limited scope, workaround exists, or polishsize/XL500–999 added + deleted lines (all files); change volume, not priority.
1 participant
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.
Problem
Closes #2861
Related issue: N/A
Validation tasks: none
Other clients: Apple N/A (shows what the catalog holds); Android N/A (same); Roku N/A (same)
A movie, series or mixed library picks its files by extension, so an audio-only file, such as a soundtrack saved as
.mkv, was added as a movie, or as a fake extra part or edition of a real one. Native clients could not play it, and the server probed it again on every scan and every playback decision. This change leaves such files out of the library and removes the titles already created for them.The loop came from the probe repair checks, which read "audio, no video, not an audiobook or podcast" as an unfinished probe. The playback planner refuses the same row with
source_metadata_incomplete.This replaces #2881, which was closed after review. That review found the remedy right and the implementation incomplete; the points it raised are covered under Approach.
Approach
scanner_no_video_filestable, by path with the file's size, modification time and OSHash. It holds only while the file still has that size and modification time, so replacing or touching the file has it judged again.Missing, so the library-changed event is published. The verdict is written before the row is marked, and the mark is fenced to the size and modification time the scan read.ScanResult.NoVideo, ano_videofield in the scan progress log, and theno_videostatus onstreamapp_scanner_files_total. The name avoidsSkipped, which the autoscan API uses for an overlapping scan. No/api/v2field is added.Why a table and not a column on
media_files: the verdict has to outlive the removal grace, or the per-scan probe returns. On the row, that makes every retired row a permanent tombstone that the trash sweep,Upsert, the relink writes and every reader ofmissing_sincewould have to work around.docs/architecture/missing-files.mdgains a "Files without video" section.Nothing on disk is deleted, moved or renamed.
Validation
origin/main: seven audio-only files across.mkv,.mp4,.ts,.mpg,.flvand.ogvwere cataloged as movies, one as part 2 of a multipart movie, and an unchanged rescan probed all seven again.ScanFolderandScanFilefail on the base because the audio-only files stay cataloged, and pass here. Disabling each of four parts of the fix in turn makes one of them fail.go mod tidy -diff, vet,make lint-changed, router lint, migration checks, and the OpenAPI, contract, fixture and local-path checks pass. On a Linux builder, route inventory, the scanner, backup and ingest packages, and the scanner's database pins and contracts pass.make test-db-pinsreported 44 skips, all backup and command tests that needpg_dump, which the builder lacks.make test-gofailed two real-FFmpeg tests ininternal/mediasampleandinternal/playback, packages this change does not touch; I did not rerun them on the base. On macOS three scanner tests fail on non-UTF-8 and case-only file names; two fail the same way on the base, and I did not get a clean base run of the third.origin/mainlists nine titles, seven of them audio-only files; rebuilt from this head and scanned once, it lists the two films with video. Captured at desktop and phone width.c5aed923have no test of their own: one needs two interleaved scans and the other an injected database failure. The reviewer reproduced both against a database before the fix; I did not rerun those reproductions after it.Evidence: https://evidence.siloserver.org/r/silo-server/issue-2861/
Risks
NoVideocount is in logs and metrics only. Listing these files for admins fits feat(scanner): list the files scans skip because of their type #1921 once it lands.Checklist
Follow-ups
AI Disclosure
highthen led to writing the row from the deeper probe, recording the verdict before retiring the row, counting a retirement underMissing, the CI test list entries, and the architecture doc section. The background adversarial review (gpt-6.1-sol, reviewed13793f096) and Kody both found that the bulk retirement of rows at known paths was not fenced and that a single-file scan never retried a failed reconcile; both are fixed inc5aed923.🤖 Generated with Claude Code
Note
Exclude files without video from movie and series library scans
scanner_no_video_filestable created by 20261113185811_record_no_video_files.sqlScanResultgains aNoVideocount, scan metrics and progress reporting include ano_videostatus, and the table is classified as server state in backups.scanner_no_video_filestable and all stored verdicts; check backup/tables.go and no_video.go if backup or restore behavior depends on the table list.Macroscope summarized 4c3e17b.