The problem is actually here:
https://github.com/xibosignage/xibo-cms/blob/develop/lib/data/media.data.class.php#L831
This line should be:
$this->addModuleFile($folder . DIRECTORY_SEPARATOR . $file, 0, true, $force);
Forcing it to an integer would have hidden this problem, which probably isn’t what you want - so you may want to revert your fix.