improve file signature by getting its name too

This commit is contained in:
tibbi 2018-04-12 20:50:02 +02:00
parent ce3ce0bec0
commit 51f0d87638

View file

@ -3,7 +3,10 @@ package com.simplemobiletools.gallery.extensions
import com.bumptech.glide.signature.ObjectKey import com.bumptech.glide.signature.ObjectKey
import java.io.File import java.io.File
fun String.getFileSignature() = ObjectKey(File(this).lastModified().toString()) fun String.getFileSignature(): ObjectKey {
val file = File(this)
return ObjectKey("${file.name}${file.lastModified()}")
}
fun String.isThisOrParentIncluded(includedPaths: MutableSet<String>) = includedPaths.any { startsWith(it, true) } fun String.isThisOrParentIncluded(includedPaths: MutableSet<String>) = includedPaths.any { startsWith(it, true) }