Drive-In event ideas: an idea withdrawn for a rule change shows again when re-proposed
The box's third run proposed the Ant-Man double again under rules 4, but its history entry from rules 3 was marked withdrawn, so it was recorded as known and left off the Chair. A re-proposed idea now replaces its withdrawn entry. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -242,11 +242,14 @@ internal object EventIdeaHistory {
|
||||
file.writeText(JSONArray(all.map { if (it.optInt("rules") < EVENT_IDEA_RULES && it.optString("decision") == "proposed") JSONObject(it.toString()).put("decision", "withdrawn: rules changed") else it }).toString())
|
||||
}
|
||||
fun record(file: File, ideas: List<EventIdea>, nowMs: Long) = runCatching {
|
||||
val all = load(file); val known = all.map { it.optString("signature") }.toSet()
|
||||
// An idea withdrawn only because the rules changed, and proposed again under the new ones, is shown again: its old entry goes.
|
||||
val again = ideas.map { it.signature }.toSet()
|
||||
val all = load(file).filterNot { it.optString("signature") in again && it.optString("decision").startsWith("withdrawn") }
|
||||
val known = all.map { it.optString("signature") }.toSet()
|
||||
val added = ideas.filter { it.signature !in known }.map { i ->
|
||||
JSONObject().put("signature", i.signature).put("theme", i.theme).put("source", i.source).put("format", i.format.name).put("evening", i.evening?.toString())
|
||||
.put("films", JSONArray(i.films.map { it.id })).put("titles", JSONArray(i.films.map { it.title })).put("reasons", JSONArray(i.reasons)).put("shownMs", nowMs).put("decision", "proposed").put("rules", EVENT_IDEA_RULES)
|
||||
}
|
||||
if (added.isNotEmpty()) file.writeText(JSONArray(all + added).toString())
|
||||
if (added.isNotEmpty() || all.size != load(file).size) file.writeText(JSONArray(all + added).toString())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user