Xilu013 Sfx Hydrate
src.xil_pipeline.XILU013_sfx_hydrate
XILU013 — SFX Source Hydration.
Reads sfx_source and sfx_overrides pipe-hint fields from a parsed script
JSON and writes the corresponding source / volume_percentage /
play_duration values into the SFX config — without requiring a full re-parse.
This is the standalone counterpart to the automatic backfill that runs at the
end of xil parse when the SFX config already exists. Use it after adding
pipe-hints to an existing script and re-parsing, or to apply hints from a
xil regen --sfx output without touching the original parsed JSON.
Usage:
xil sfx-hydrate --episode S04E04
xil sfx-hydrate --episode S04E04 --parsed parsed/the413/parsed_the413_S04E04.json
xil sfx-hydrate --episode S04E04 --sfx configs/the413/sfx_S04E04.json
xil sfx-hydrate --episode S04E04 --dry-run
hydrate_sfx_config
Apply pipe-hint fields from parsed to the SFX config at sfx_path.
Covers both halves of the hint grammar: a source filename is written when
the cue has none, while attribute hints (play_volume_pct=…,
play_duration_pct=…) overwrite
whatever the config holds, since the script is authoritative for those.
With force, a differing source is replaced too — the only way to correct
a cue whose source is a "NEW STEM NEEDED: …" placeholder or a stale path.
A replacement is skipped when the hint's file does not resolve on disk, which
protects bare SFX/<file> sources that work today from being repointed at a
slug-form path that has nothing behind it.
Parameters:
-
parsed(dict) –Parsed script dict (output of XILP001).
-
sfx_path(str) –Path to the SFX config JSON to update in-place.
-
dry_run(bool, default:False) –When True, report changes without writing.
-
force(bool, default:False) –Replace a differing
sourcerather than only filling missing ones.
Returns:
-
int–Number of entries that would be (or were) updated.
Source code in src/xil_pipeline/XILU013_sfx_hydrate.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
get_parser
Return the argument parser for xil-sfx-hydrate.
Source code in src/xil_pipeline/XILU013_sfx_hydrate.py
main
CLI entry point for SFX config source-field hydration.