Fix it being possible to upload arbitrary .mkv files and have them be treated as .webm. This was possible because WebM uses the Matroska container format, and we only checked for the Matroska header, not that the file was actually a WebM. There were only 6 such files in production: * https://danbooru.donmai.us/posts?tags=exif:Matroska:DocType=matroska * https://danbooru.donmai.us/posts/5522036 * https://danbooru.donmai.us/posts/4743498 * https://danbooru.donmai.us/posts/3925427 * https://danbooru.donmai.us/posts/3147897 * https://danbooru.donmai.us/posts/2965862 * https://danbooru.donmai.us/posts/2430436 These videos are playable in Chrome, but not in Firefox, since Firefox doesn't support .mkv files (it supports some, depending on which codecs are used, but not .mkv files in general).
Logical
This directory contains library code used through Danbooru. This includes things like defining API clients, dealing with sources, parsing tag searches, storing and resizing images, and so on.
Many of the files here use the Service Object pattern. Instead of putting complex code in models or controllers, it goes here, in plain old Ruby objects (POROs). This keeps models and controllers simpler, and keeps domain logic isolated and independent from the database and the HTTP request cycle.