adding a comment related to removing irrelevant cached files

This commit is contained in:
tibbi 2021-10-23 22:04:54 +02:00
parent a6057f7fe4
commit c6640eaa9a

View file

@ -612,6 +612,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
try { try {
gotMedia(newMedia, false) gotMedia(newMedia, false)
// remove cached files that are no longer valid for whatever reason
val newPaths = newMedia.mapNotNull { it as? Medium }.map { it.path } val newPaths = newMedia.mapNotNull { it as? Medium }.map { it.path }
oldMedia.mapNotNull { it as? Medium }.filter { !newPaths.contains(it.path) }.forEach { oldMedia.mapNotNull { it as? Medium }.filter { !newPaths.contains(it.path) }.forEach {
if (mPath == FAVORITES && getDoesFilePathExist(it.path)) { if (mPath == FAVORITES && getDoesFilePathExist(it.path)) {