Fixed favourites shown twice.

This commit is contained in:
A117870935 2023-04-13 19:38:34 +05:30
parent 10034e6bf9
commit 4c1581131e

View file

@ -794,7 +794,18 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
}
if (!onlyMedia || MimeTypeUtil.isImage(ocFile) || MimeTypeUtil.isVideo(ocFile)) {
mFiles.add(ocFile);
//handling duplicacy for favorites section
if (mFiles.isEmpty()) {
mFiles.add(ocFile);
} else {
for (OCFile file : mFiles) {
if (file.getFileId() == ocFile.getFileId()) {
return;
}
}
mFiles.add(ocFile);
}
}
ContentValues cv = new ContentValues();