refactor(llamaswap): drop initImageFilename — one caller left, and it was a rename of imageFilename
The 2/4 finding is right: after writeImagePart started passing an explicit filename stem, initImageFilename had no caller in video.go, and its "conditioning frame" doc no longer described its one remaining user (lipsync.go's avatar image). A one-line wrapper that survives only to be misdescribed is not indirection worth keeping. lipsync now calls imageFilename(mime, "frame") directly, and imageFilename's doc lists the real bases — including WHY the video keyframes need distinct ones: a backend that stages uploads by filename would otherwise have the second overwrite the first. Not taken: consolidating the first/last-frame rationale to a single canonical site. The copies address different readers — the wire encoding (provider), the contract's undetectable-support caveat (videogen), and the mode table (README) — and last round's finding was a doc pointing at a note that did not exist. Trading duplication for cross-references is what produced that. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01PLjgrxvHjm1sJgUu9zBPH9
This commit is contained in:
@@ -207,10 +207,12 @@ func parseSwapReport(header string) []imagegen.SwappedFace {
|
||||
// imageFilename picks a multipart filename for an image part. The shim reads
|
||||
// bytes, not names, but a plausible extension keeps server-side sniffing and
|
||||
// request logs honest. base distinguishes the parts of a multi-file form
|
||||
// ("target"/"source") so a log line says which one was malformed.
|
||||
// ("target"/"source", "frame"/"frame_last") so a log line says which one was
|
||||
// malformed — and, for the video keyframes, so a backend that stages uploads
|
||||
// by filename cannot have the second overwrite the first.
|
||||
//
|
||||
// initImageFilename (video.go) is this function with base fixed to "frame"
|
||||
// and delegates here — two copies of one extension table is how they drift.
|
||||
// Every caller routes through here: two copies of one extension table is how
|
||||
// they drift.
|
||||
func imageFilename(mimeType, base string) string {
|
||||
if base == "" {
|
||||
base = "image"
|
||||
|
||||
Reference in New Issue
Block a user