Automatic Asset Validation
When you have many various assets, some basic sanity checks go a long way!
I was already verifying the existence of assets based on the stream type, but with a script automatically uploading my markers, I needed to have some checks on that data!
Markers
The simplest to check would be Started & Ended markers not matching up - it's the classes are-the-parentheiss balanaced problem, but with partly dynamic substrings instead of individual characters! Next was ensuring these Started/Ended markers were correctly cased - capitalized first letters - and then ensuring there were no blank lines in markers file at all.
Slide-Matching
The most useful validation was ensuring the text for slide-markers actually existed in the slide text, of course I needed to download & parse the slides text first, but this turned out to be only a few lines after discovering the query needed to get the current slide and using jsdom
to parse it.
Not only did this help me discover many of markers being off-by-one, but also eliminated the time I'd manually spend checking the markers!
Chat
Then I decided to ensure that the download chat matched the stream - date was the same, there were no markers after the last chat message, etc.
This did actually catch a few
chat.json
s in the wrong folders!
There's little more that could usefully be validated, though I had add a remaining-days-counter to classes without YouTube reuploads, to ensure I continally check for those uploads.