Attribute sidecar-only copies correctly and fix the remaining-time estimate - #210
Merged
Brandon-Haney merged 3 commits intoSep 3, 2026
Merged
Conversation
Sidecars fold into their parent video's row, but the parent was indexed from the current run only. A video already on cache needs no copy, so runs that touched only its artwork produced several unattributed rows: four "...-poster.jpg" lines with nothing naming the film. sibling_map covers every video with siblings, not just the ones a run touched, so the parent is known either way. Orphaned sidecars now gather under a header carrying that filename, in the completion banner and the Recent Activity feed alike. The header has no size, because the video did not move and a size there would say it did. A lone sidecar is left flat: its own filename already names the film, so a header would add a row without adding anything to read.
The sidecar group header names the video so its artwork can be attributed, but the video itself did not move. It was still rendering the sidecars' own action badge, so a green CACHED sat beside a .mkv filename and read as though the video had been copied — a clearer claim than the loose rows it replaced, and a wrong one. FileActivity carries sidecars_only through load, save and serialize, defaulting False so existing entries are unaffected. Both surfaces render a neutral tag for those rows: EXTRAS in the completion banner, "Extras only" in Recent Activity, each explaining in its tooltip that the video was already in place.
Copy time is bytes/rate plus a fixed cost per file: open, size verify, chown, tracker write. The estimate modelled only the first, so a queue that ends in artwork and NFOs read as nearly free. On a 199-file run it reported 9m 38s left when 11m 27s remained, because the 43 completed files averaged ~4 GB and the 156 still queued averaged ~0.75 GB. _estimate_remaining_seconds() splits the two. The best sustained rate seen is bulk throughput with per-file costs largely excluded; whatever elapsed time that cannot explain is attributed to the files completed so far. Both are measured from the run in progress, so a slow array or a competing mover is reflected without a tuning constant. Sampled over 2s windows, since shorter ones are scheduling noise that would inflate the peak and hide the per-file term. The banner also led with the file count while its bar and ETA were byte-based. At the moment above that read "43/199 files" beside a correct "9m left", which is a fifth against three fifths and makes the estimate look impossible. Bytes lead when byte progress is available; the file count moves alongside elapsed.
StudioNirin
approved these changes
Sep 3, 2026
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.
Three fixes to what the completion banner and Recent Activity report.
Name the film when only its artwork was copied
Sidecars fold into their parent video's row, but the parent was indexed from the current run only. A video already on cache needs no copy, so a run that touched only its artwork produced unattributed rows: four
...-poster.jpglines with nothing naming the film. The sibling map now covers every video with siblings rather than only the ones a run touched, so orphaned sidecars gather under a header carrying the video's filename in both surfaces. The header shows no size, because the video did not move and a size there would say it did. A lone sidecar stays flat, since its own filename already names the film.Say when only a title's extras moved
That new header names the video, but it was still rendering the sidecars' own action badge, so a green CACHED sat beside a
.mkvfilename and read as though the video had been copied.FileActivitynow carriessidecars_onlythrough load, save and serialize, defaulting False so existing entries are unaffected. Both surfaces render a neutral tag instead: EXTRAS in the banner, "Extras only" in Recent Activity, each explaining in its tooltip that the video was already in place.Price files as well as bytes in the remaining-time estimate
Copy time is bytes/rate plus a fixed per-file cost: open, size verify, chown, tracker write. The estimate modelled only the first, so a queue ending in artwork and NFOs read as nearly free. On a 199-file run it reported 9m 38s left when 11m 27s remained, because the 43 completed files averaged ~4 GB and the 156 still queued averaged ~0.75 GB.
_estimate_remaining_seconds()now splits the two. The best sustained rate seen is bulk throughput with per-file costs largely excluded, and whatever elapsed time that cannot explain is attributed to the files completed so far. Both are measured from the run in progress, so a slow array or a competing mover is reflected without a tuning constant. Sampled over 2s windows, since shorter ones are scheduling noise that would inflate the peak and hide the per-file term.The banner also led with the file count while its bar and ETA were byte-based. At the moment above that read "43/199 files" beside a correct "9m left", which is a fifth against three fifths and makes the estimate look impossible. Bytes lead when byte progress is available, and the file count moves alongside elapsed.
How to test
.mkv.Covered by
tests/test_orphan_sidecar_grouping.pyandtests/test_operation_eta.py.