laravel by default automatically serializes models in a custom way when inserted into a job queue and fetches the model from the database again when the job is ran. We would rather not have these extra queries, so we can't pass in models, or data that is already serialized (as laravel will try to deserailize our serialization too and fail), so we opted for arrays, and filling in the properties into a new model again once the job is handled.
The `SerializesModels` trait fetches a new copy of the record from the database, causing 4 more queries than we thought we were using. This change reduces the query time in the ProcessAnnounce job by 55%.
We only cache it if it exists, so let's not query it every single time it doesn't exist.
We don't remove it from the hourly run command yet so that currently existing freeleeches can be deleted.
Many users often remove the announce url from uploaded torrents (since other tracker codebases are known to log urls of uploaded torrents to breach user accounts on other sites). This unfortunately causes the mime detection to sometimes (not all the time) fail preventing the user from uploading. Now that we're validating by file extension, it should still prevent the case of users accidentally uploading an unrelated file which was the main issue to be solved.
Mark peers for deletion via this column so that they can be mass deleted later. This allows for combining peer inserts, updates and deletions into a single bulk peer upsert queue. Otherwise, when a user stops and starts a torrent before the bulk peer updates are collected in the queue, the peer may be deleted immediately after it gets inserted.
If a valid imdb is entered into quick search, return movies/tv matching it. If only a number is entered into quick search, return movies/tv with matching tmdb. If wanting to override these shortcuts, add a space to the end of the search.
Bbcode is always sanitized first before being saved, which causes html entities. However, when content is edited again, the html entities aren't decoded before the user edits them, which causes the user to remove the html entities before updating the content. This commit now decodes the html back to text and will resanitize again upon save.
With almost 1000 distributors, it's a nightmare trying to add a new distributor and having to change its position. All the distributors are ordered alphabetically anyways so just order based on the `name` field instead.