fix bug with items with %20 in movie clip URL

"Beautiful Green Painting Background" wasn't loading! https://impress-2020.openneo.net/items/75594

```Error building movie clips Error: Expected JS movie library http://images.neopets.com/cp/items/data/000/000/491/491273_31368b3745/491273_2_HTML5%20Canvas.js to contain a constructor named _491273_2_HTML5%20Canvas, but it did not: ssMetadata,Bitmap3,Bitmap5,CachedTexturedBitmap_4183,CachedTexturedBitmap_4184,CachedTexturedBitmap_4185,CachedTexturedBitmap_4186,CachedTexturedBitmap_4187,Symbol20,Symbol8,Symbol4,Symbol7,Symbol2,Symbol1,Symbol9,Symbol2copy,Symbol2_1,_491273_2_HTML5Canvas,properties,Stage```

We already had code to strip out spaces, but not encoded spaces like %20. Now, we decode the URL first, so that space-stripping will work even if it was encoded.
This commit is contained in:
Emi Matchu 2020-10-28 00:29:32 -07:00
parent 15f10c615b
commit de974a365b

View file

@ -264,7 +264,7 @@ export async function loadMovieLibrary(librarySrc) {
export function buildMovieClip(library, libraryUrl) {
let constructorName;
try {
const fileName = libraryUrl.split("/").pop();
const fileName = decodeURI(libraryUrl).split("/").pop();
const fileNameWithoutExtension = fileName.split(".")[0];
constructorName = fileNameWithoutExtension.replace(/[ -]/g, "");
if (constructorName.match(/^[0-9]/)) {