marinofaggiana 6 years ago
parent
commit
7317c4af44
2 changed files with 7 additions and 23 deletions
  1. 0 18
      iOSClient/Database/NCManageDatabase.swift
  2. 7 5
      iOSClient/Media/NCMedia.swift

+ 0 - 18
iOSClient/Database/NCManageDatabase.swift

@@ -1997,24 +1997,6 @@ class NCManageDatabase: NSObject {
         return Calendar.current.date(bySettingHour: 0, minute: 0, second: 0, of: Date())!
     }
     
-    @objc func deletePhotos(fileID: String) {
-        
-        let realm = try! Realm()
-        
-        realm.beginWrite()
-        
-        let results = realm.objects(tableMedia.self).filter("fileID = %@", fileID)
-        
-        realm.delete(results)
-        
-        do {
-            try realm.commitWrite()
-        } catch let error {
-            print("[LOG] Could not write to database: ", error)
-            return
-        }
-    }
-    
     //MARK: -
     //MARK: Table Photo Library
     

+ 7 - 5
iOSClient/Media/NCMedia.swift

@@ -119,8 +119,8 @@ class NCMedia: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
         autoUploadFileName = NCManageDatabase.sharedInstance.getAccountAutoUploadFileName()
         autoUploadDirectory = NCManageDatabase.sharedInstance.getAccountAutoUploadDirectory(appDelegate.activeUrl)
         
-        loadNetworkDatasource()
-        collectionViewReloadDataSource()
+        //loadNetworkDatasource()
+        selectSearchSections()
     }
     
     override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
@@ -395,7 +395,11 @@ class NCMedia: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
                 }
                 
                 self.collectionView?.reloadData()
-            }            
+                
+            }  else {
+                
+                self.collectionViewReloadDataSource()
+            }
         })
     }
     
@@ -467,13 +471,11 @@ class NCMedia: UIViewController ,UICollectionViewDataSource, UICollectionViewDel
     }
 
     public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
-        //caused by user
         selectSearchSections()
     }
     
     public func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
         if (!decelerate) {
-            //cause by user
             selectSearchSections()
         }
     }