Marino Faggiana 7 lat temu
rodzic
commit
749512703b

+ 1 - 1
iOSClient/Database/NCManageDatabase.swift

@@ -1873,7 +1873,7 @@ class NCManageDatabase: NSObject {
         
         let realm = try! Realm()
 
-        let metadatas = realm.objects(tableMetadata.self).filter(NSPredicate(format: "account = %@ AND session = '' AND (typeFile = %@ OR typeFile = %@)", tableAccount.account, k_metadataTypeFile_image, k_metadataTypeFile_video)).sorted(byKeyPath: "date", ascending: false)
+        let metadatas = realm.objects(tableMetadata.self).filter(NSPredicate(format: "account = %@ AND NOT (session CONTAINS 'upload') AND (typeFile = %@ OR typeFile = %@)", tableAccount.account, k_metadataTypeFile_image, k_metadataTypeFile_video)).sorted(byKeyPath: "date", ascending: false)
             
         return Array(metadatas.map { tableMetadata.init(value:$0) })
     }

+ 1 - 18
iOSClient/Photos/CCPhotos.m

@@ -251,10 +251,6 @@
 
 - (void)getGeoLocationForSection:(NSInteger)section
 {
-    // test
-    if (_sectionDataSource.sections.count <= section)
-        return;
-    
     NSString *addLocation = @"";
     
     NSArray *fileIDsForKey = [_sectionDataSource.sectionArrayRow objectForKey:[_sectionDataSource.sections objectAtIndex:section]];
@@ -634,10 +630,6 @@
 
 - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
 {
-    // test
-    if (_sectionDataSource.sections.count <= section)
-        return 0;
-    
     return [[_sectionDataSource.sectionArrayRow objectForKey:[_sectionDataSource.sections objectAtIndex:section]] count];
 }
 
@@ -700,9 +692,6 @@
     UIImageView *checked = [cell viewWithTag:300];
     checked.image = [UIImage imageNamed:@"checked"];
 
-    if (_sectionDataSource.sections.count <= indexPath.section)
-        return cell;
-    
     NSArray *metadatasForKey = [_sectionDataSource.sectionArrayRow objectForKey:[_sectionDataSource.sections objectAtIndex:indexPath.section]];
     
     if ([metadatasForKey count] > indexPath.row) {
@@ -750,10 +739,6 @@
 
 - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
 {
-    // test
-    if (_sectionDataSource.sections.count <= indexPath.section)
-        return;
-    
     NSArray *metadatasForKey = [_sectionDataSource.sectionArrayRow objectForKey:[_sectionDataSource.sections objectAtIndex:indexPath.section]];
     
     if ([metadatasForKey count] > indexPath.row) {
@@ -778,9 +763,7 @@
     // test
     if (_cellEditing == NO)
         return;
-    if (_sectionDataSource.sections.count <= indexPath.section)
-        return;
-    
+   
     NSArray *metadatasForKey = [_sectionDataSource.sectionArrayRow objectForKey:[_sectionDataSource.sections objectAtIndex:indexPath.section]];
     
     if ([metadatasForKey count] > indexPath.row) {