fixed removal of predownloaded files

This commit is contained in:
LagradOst 2023-08-24 16:39:50 +02:00
parent 823ffd8708
commit 460b1be525

View file

@ -23,7 +23,7 @@ interface SafeFile {
// because UniFile sucks balls on Media we have to do this // because UniFile sucks balls on Media we have to do this
val absPath = file.absolutePath.removePrefix(File.separator) val absPath = file.absolutePath.removePrefix(File.separator)
for (value in MediaFileContentType.values()) { for (value in MediaFileContentType.values()) {
val prefixes = listOf(value.toAbsolutePath(), value.toPath()) val prefixes = listOf(value.toAbsolutePath(), value.toPath()).map { it.removePrefix(File.separator) }
for (prefix in prefixes) { for (prefix in prefixes) {
if (!absPath.startsWith(prefix)) continue if (!absPath.startsWith(prefix)) continue
return fromMedia( return fromMedia(