impress/scripts/remove_unknown_glitch.rb
Emi Matchu 08a64d4987 Remove glitch from items resolved by the new renderer fix
I'll revert this commit in a sec, these are just temporary files I used to audit our assets with the `DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN` glitch, and remove it from the ones I've decided seem functional now.

This commit is intended as a historical record of what we changed in the database and how and why.

```
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | A Grey Day Background | Item 39708 | Asset 39694 | http://impress.openneo.net/swf-assets/39694?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | A Haunting Path Background | Item 78585 | Asset 468669 | http://impress.openneo.net/swf-assets/468669?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | Autumnal Scenescape | Item 80632 | Asset 497773 | http://impress.openneo.net/swf-assets/497773?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | Beautiful Butterfly Foreground | Item 83714 | Asset 558774 | http://impress.openneo.net/swf-assets/558774?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | Food Fight Shower | Item 57781 | Asset 139542 | http://impress.openneo.net/swf-assets/139542?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | Glowing Light Sky Background | Item 54176 | Asset 112686 | http://impress.openneo.net/swf-assets/112686?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | MiniMME11-S1: Approaching Eventide Skirt | Item 65801 | Asset 225267 | http://impress.openneo.net/swf-assets/225267?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | MiniMME11-S1: Approaching Eventide Skirt | Item 65801 | Asset 225277 | http://impress.openneo.net/swf-assets/225277?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | MiniMME11-S1: Approaching Eventide Skirt | Item 65801 | Asset 225805 | http://impress.openneo.net/swf-assets/225805?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | Mutant Containment Suit | Item 81643 | Asset 520525 | http://impress.openneo.net/swf-assets/520525?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | Negg Fountain Background | Item 82391 | Asset 537342 | http://impress.openneo.net/swf-assets/537342?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | Rainbow Fountain Background | Item 36747 | Asset 27886 | http://impress.openneo.net/swf-assets/27886?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | Written Word Shower | Item 51134 | Asset 94213 | http://impress.openneo.net/swf-assets/94213?playing=true
["DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"] -> [] | Starry Glowstone Path Background | Item 74542 | Asset 390340 | http://impress.openneo.net/swf-assets/390340?playing=true
```
2026-01-19 11:14:22 -08:00

53 lines
1.1 KiB
Ruby

# Run with: rails runner scripts/remove_unknown_glitch.rb
ASSET_IDS = [
39694,
468669,
497773,
558774,
139542,
112686,
225267,
225277,
225805,
520525,
537342,
27886,
94213,
390340,
]
GLITCH_TO_REMOVE = "DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN"
ASSET_IDS.each do |asset_id|
asset = SwfAsset.find_by(id: asset_id)
if asset.nil?
puts "Asset #{asset_id}: NOT FOUND"
next
end
before_glitches = asset.known_glitches
unless before_glitches.include?(GLITCH_TO_REMOVE)
puts "Asset #{asset_id}: Does not have #{GLITCH_TO_REMOVE}"
next
end
after_glitches = before_glitches - [GLITCH_TO_REMOVE]
asset.known_glitches = after_glitches
asset.save!
# Get the item via the relationship
item_rel = asset.parent_swf_asset_relationships.find_by(parent_type: "Item")
item = item_rel&.parent
item_name = item&.name || "(no item)"
item_id = item&.id || "(no item)"
url = "http://impress.openneo.net/swf-assets/#{asset_id}?playing=true"
puts "#{before_glitches.inspect} -> #{after_glitches.inspect} | #{item_name} | Item #{item_id} | Asset #{asset_id} | #{url}"
end
puts "\nDone!"