performance: only do further processing if not a Nc app folder

This commit is contained in:
AndyScherzinger 2017-01-10 22:47:07 +01:00
parent c024df5602
commit fa81cf7ec2
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -91,20 +91,22 @@ public class MediaProvider {
}
cursorImages.close();
// count images
Cursor count = contentResolver.query(
MEDIA_URI,
FILE_PROJECTION,
FILE_SELECTION + folderId,
null,
null);
if (count != null) {
mediaFolder.numberOfFiles = count.getCount();
count.close();
}
// only do further work if folder is not within the Nextcloud app itself
if (!mediaFolder.absolutePath.startsWith(dataPath)) {
// count images
Cursor count = contentResolver.query(
MEDIA_URI,
FILE_PROJECTION,
FILE_SELECTION + folderId,
null,
null);
if (count != null) {
mediaFolder.numberOfFiles = count.getCount();
count.close();
}
mediaFolders.add(mediaFolder);
}
}