Make sure that only local files are displayed within the device folders

This commit is contained in:
Vishnu Mohandas 2020-10-29 21:51:51 +05:30
parent 25a78ee52b
commit e0000b6888

View file

@ -108,12 +108,14 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget> {
}
Future<CollectionItems> _getCollections() async {
final userID = Configuration.instance.getUserID();
final paths = await FilesDB.instance.getLocalPaths();
final folders = List<DeviceFolder>();
for (final path in paths) {
final files = List<File>();
for (File file in FileRepository.instance.files) {
if (file.deviceFolder == path) {
if ((file.ownerID == null || file.ownerID == userID) &&
file.deviceFolder == path) {
files.add(file);
}
}
@ -141,7 +143,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget> {
final collections = CollectionsService.instance.getCollections();
for (final c in collections) {
if (c.ownerID != Configuration.instance.getUserID()) {
if (c.ownerID != userID) {
continue;
}
final thumbnail = await FilesDB.instance.getLatestFileInCollection(c.id);