Mediascanner crashes if it runs into something it doesnt have access to
Looks like mediascanner doesnt handle accessing files gracefully, if it runs into a file that it doesnt have access to and fails to read it will die thus breaking a lot of media stuff like gallery. This will happen a lot on devices like pinephones where people usually have a secondary OS loaded on an SD card.
mediascanner-service-2.0[1232]: New file was created: /home/pterminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
Sep 21 18:23:46 ubuntu-phablet mediascanner-service-2.0[1232]: what(): filesystem error: directory iterator cannot open directory: Permission denied [/media/phablet/boot/lost+found]
Sep 21 18:23:46 ubuntu-phablet systemd[966]: mediascanner-2.0.service: Main process exited, code=killed, status=6/ABRT