mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 21:25:35 +03:00
performance: only do further processing if not a Nc app folder
This commit is contained in:
parent
c024df5602
commit
fa81cf7ec2
1 changed files with 15 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue