We need a task we can run that will
The command is bundle exec rake After:replace_dewplayer_embeds
Post a work using the old embed code, then after the staging deploy, run the rake and make sure the work is updated.
Post a work using the old embed code after the staging deploy. The work should automatically be updated as well.
That there will be an announcement that should go up before the task runs.
Once the conversion is done on production, let Systems know so they can remove the Dewplayer files. We also need to remove the files from the repo (AO3-6097).
Of the chapters that couldn’t be updated:
At least one used an outright invalid flashvars format (flashvars="mp3=audioUrl=http://example.com/podfic.mp3"). I’ll ignore those.
Several failed because of leading spaces in the URL (flashvars="mp3= http://example.com/podfic.mp3"). It’s easy enough to fix these.
When I ran it this time, the output at the end said:
The remaining one used the invalid flashvars, so that’s good.
But I’m slightly confused/concerned about the rest? There were only 24 chapters that couldn’t be updated last time, but 39 is significantly more than 24. Did we really post 15 more chapters with Dewplayer works in the last 4 days?
Hm, no, they’re all from 2012/2013.
It looks like it might’ve included some works it couldn’t update due to incorrect flashvars attributes in that list of 39 updated chapters. I’ll provide more info in the testing channel.
If we can’t convert a chapter because of bad flashvars format, the sanitizer doesn’t actually raise exceptions, just leaves the chapter content untouched. The chapter would be counted under “Updated”.
Looking at updated_at is also misleading, because in those cases the chapter will still be updated (we set the content_sanitizer_version column to -1 to force a sanitizer rerun, which will set it back to 1, bumping the timestamp twice in the process).
The rake task needs better error handling and better detection of whether conversion happens or not.
And all of those have messed up flashvars, so I do believe we are done!
This task was run on 2021-01-23 and finished in ~1h. Final output:
Chapters that could not be converted had:
Flashvars but with wrong parameter names (“MP3“ in uppercase, “audioUrl“)
Flashvars but with no parameter names (flashvars=http://…, flashvars=mp3https://...)
Flashvars with the right parameter name (mp3) but bad values (empty URLs, placeholder URLs like “[MP3 URL]“ and “Coming soon“, and bad URLs like “[http…“)
We did fix most of them. Let’s leave the rest to work creators.