Keep sidecar paths in step when a video moves #234
Closed
opened 2026-08-25 08:36:54 +01:00 by naps62-yolo
·
2 comments
No Branch/Tag Specified
main
ui-mobile-first
codex/fix-action-button-reload
translation
qbit-2
docker
bugs
blitz/subtitles
fix/255-provider-reorder
blitz/feedback-3
subtitles/251-icon-vocab
subtitles/237-relocate-subs
fix/248-title-move-creates-root
blitz/feedback-2
issue/227-abandoned-pack-visible
issue/245-backoff-anchor
issue/240-design-coherence
issue/211-waived-rule
issue/232-plainer-words
issue/246-policy-reclassify
issue/244-root-slash-stored
issue/231-settings-rows
issue/241-reclassify-on-root-change
issue/239-failure-window
issue/230-icon-only
issue/243-root-path-edges
issue/238-attention-liveness
issue/229-back-button
issue/236-root-path-move
issue/226-attention-threshold
issue/228-root-move
blitz/size-bands
size-bands/209-runtime-scale
size-bands/210-size-waiver
size-bands/208-runtime-design
blitz/reliability
reliability/155-sqlx-migrations
reliability/176-refresh-on-add
removal-nav/175-removal-controls
removal-nav/174-season-file-removal
removal-nav/172-search-titles
removal-nav/173-homepage-library
removal-nav/171-untrack-clears
removal-nav/170-chip-align
removal-nav/169-design-amendment
feedback/167-deck-autosearch
feedback/165-chip-colour
feedback/166-header-rail
feedback/163-drop-cast
feedback/164-control-geometry
feedback/162-season-ordering
feedback/161-search-episodes
feedback/160-autotrack-seed
feedback/159-design-amend
blitz/rich-metadata
rich/151-grid
rich/148-search-rows
rich/150-series-meta
rich/149-movie-page
rich/147-search-art
rich/156-rating-null
rich/146-meta-api
rich/145-poster-cols
rich/144-trailer
rich/143-meta-detail
rich/142-design-amend
blitz/153-empty-episode-titles
blitz/152-deck-routes
blitz/141-season-vanished-api
blitz/129-series-detail-view
blitz/140-attention-episode-numbers
blitz/137-season-removals
blitz/133-attention-tv-lanes
blitz/139-movie-id-episode-guard
blitz/134-stale-attention-queue
blitz/124-rss-episode-matching
blitz/136-imdb-series-lookup
blitz/132-manual-commands
blitz/128-series-delete-files
blitz/131-status-seasons-input
blitz/138-plural-season-range
blitz/135-pack-name-parse
blitz/122-upstream-removals
blitz/130-add-series-search
blitz/121-series-refresh
blitz/127-unified-search-tv
blitz/123-episode-matching
blitz/126-tv-attention
blitz/119-tracked-rule
blitz/125-season-deck
blitz/120-tvdb-id
blitz/118-season-zero
blitz/117-design-amend
issue/115-avail-search
issue/112-name-truncate
issue/111-score-colors
No results found.
Labels
Clear labels
area/api
area/ci
area/compat
area/core
area/daemon
area/db
area/dl
area/indexer
area/infra
area/meta
area/parse
area/probe
area/subs
area/web
difficulty/easy
difficulty/hard
difficulty/moderate
difficulty/trivial
phase/1-skeleton
phase/2-logic
phase/3-sourcing
phase/4-movies
phase/5-ui
phase/6-tv
phase/7-people
phase/8-compat
phase/9-subtitles
type/bug
type/chore
type/feature
type/test
arr-api
CI and test harness
arr-compat
arr-core
arr-daemon
arr-db
arr-dl
arr-indexer
workspace and tooling
arr-meta
arr-parse
arr-probe
arr-subs crate: providers, extraction, translation, sync
web/
bounded, obvious approach, few files
subtle correctness or cross-cutting
multiple files, judgement, an interface to design
one file, mechanical, no design decisions
workspace, CI, config, database, empty API and SPA
parsing and policy engine, pure, no network
TMDB and Prowlarr, read-only
movies end to end
search, buckets, library views, queues
seasons, episodes, tracking, derived status
owner tags and notifications
Jellyseerr shim
build order: subtitles, DESIGN.md §15
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: yolo/arr#234
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
subtitle_files.pathis the row's identity on disk, and nothing keeps it instep when the video moves. §7.4 renames on import, and a library move rewrites
media_files.path; the sidecar rows keep pointing at the old folder.Consequences, all quiet:
if the folder survives, or orphaned if it does not.
claim_pathand #222's one-sidecar invariant both reason about a path thatno longer exists, so arr can write a second sidecar beside the moved video
while believing the language is already satisfied.
Rewrite
subtitle_files.pathwherevermedia_files.pathis rewritten, in thesame transaction, and move the files with the video. A sidecar lives inside the
§7.4 title folder precisely so that a folder-level move takes it along — the
database is the part that does not follow.
Pre-existing; found while implementing #222 and not caused by it.
Depends on: #186, #195
Investigated before implementing. This issue is blocked: there is currently no code path anywhere in the repo that rewrites an existing
media_files.pathto a different value, so there is no "video move" forsubtitle_files.pathto fall out of step with.Checked:
INSERT/UPDATEtouchingmedia_files(arr-api,arr-daemon,arr-compat). The only path-changing statement is the crash-recovery upsert inrecord_import/record_episode_import(ON CONFLICT (path) DO UPDATE), which only fires when the same path is re-imported after a crash — it never changes the stored path to something new.impl Action for ...registered with the reconcile loop (import, grab, tv_grab, series_refresh, reaper, broken, subtitles, attention, rss). None relocates an already-imported file.PUT /api/roots/{root_id}reconfigures a root'spath(a settings correction) but never touchesmedia_filesrows or moves files.movies::updateacceptsroot_id, and the web UI exposes a root-select dropdown on the movie detail page (web/src/main.ts~2358) that calls it — but the handler only writes themovies.root_idcolumn. It doesn't move the file on disk or rewritemedia_files.path. Changing a movie's root today silently desyncs the file from its new root/audience with no relocation at all.Since nothing moves a video's
media_files.pathyet, there's no transaction to hooksubtitle_files.pathinto, and building a trigger or helper against a caller that doesn't exist would be speculative infrastructure the project's conventions explicitly avoid. The move feature itself needs its own issue: physically relocate the file, rewritemedia_files.path, move the sidecars, and rewritesubtitle_files.path, all together. This issue can be re-scoped to be part of that work (or reopened against it) once the move exists.Branch:
subtitles/234-sidecar-on-move(no code changes — nothing to implement against).just cinot run since nothing changed.Findings
movies::updateacceptsroot_idand the web UI lets an operator change a movie's root/audience from the detail page, but the file is never moved andmedia_files.pathis never rewritten to match the new root. The movie silently ends up tracked under a root/audience its file doesn't physically live under. This is the real gap #234 is downstream of — worth its own issue (implement the actual move: relocate the file, updatemedia_files.path, move sidecars, updatesubtitle_files.path, in one transaction).Closing: the premise of this issue was wrong, and the worker was right to push no code.
I wrote that "§7.4 renames on import and library moves rewrite
media_files.path". The second half is not true — nothing in the codebase relocates an imported file. The reconcile loop's nine actions all leave placement alone, andPUT /api/roots/{id}rewrites a root's path without touching files. So there is no transaction forsubtitle_files.pathto hook into, and adding a helper against a caller that does not exist would be speculative infrastructure.The real gap is upstream and now filed as #235:
PATCH /api/movies/{id}acceptsroot_idand the UI offers a root dropdown, but the handler only writes the column — the file is never moved. Keeping sidecar paths in step is one step of implementing that move, not a separate piece of work, so it belongs in #235 rather than here.Reopen against #235 if the move lands and the sidecar half gets skipped.