|
@@ -29,7 +29,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
|
|
|
@IBOutlet fileprivate weak var collectionView: UICollectionView!
|
|
|
|
|
|
var titleCurrentFolder = NSLocalizedString("_manage_file_offline_", comment: "")
|
|
|
- var directoryID = ""
|
|
|
+ var serverUrl = ""
|
|
|
|
|
|
private let appDelegate = UIApplication.shared.delegate as! AppDelegate
|
|
|
|
|
@@ -454,7 +454,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
|
|
|
var fileIDs = [String]()
|
|
|
sectionDatasource = CCSectionDataSourceMetadata()
|
|
|
|
|
|
- if directoryID == "" {
|
|
|
+ if serverUrl == "" {
|
|
|
|
|
|
if let directories = NCManageDatabase.sharedInstance.getTablesDirectory(predicate: NSPredicate(format: "account == %@ AND offline == true", appDelegate.activeAccount), sorted: "serverUrl", ascending: true) {
|
|
|
for directory: tableDirectory in directories {
|
|
@@ -475,7 +475,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- if let metadatas = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND directoryID == %@", appDelegate.activeAccount, directoryID), sorted: datasourceSorted, ascending: datasourceAscending) {
|
|
|
+ if let metadatas = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.activeAccount, serverUrl), sorted: datasourceSorted, ascending: datasourceAscending) {
|
|
|
|
|
|
sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: datasourceGroupBy, filterFileID: nil, filterTypeFileImage: false, filterTypeFileVideo: false, activeAccount: appDelegate.activeAccount)
|
|
|
}
|
|
@@ -647,11 +647,10 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
|
|
|
|
|
|
private func performSegueDirectoryWithControlPasscode(controlPasscode: Bool) {
|
|
|
|
|
|
- let serverUrlPush = CCUtility.stringAppendServerUrl(metadataPush!.serverUrl, addFileName: metadataPush!.fileName)
|
|
|
- guard let directoryIDPush = NCManageDatabase.sharedInstance.getDirectoryID(serverUrlPush, account: appDelegate.activeAccount) else {
|
|
|
+ guard let serverUrlPush = CCUtility.stringAppendServerUrl(metadataPush!.serverUrl, addFileName: metadataPush!.fileName) else {
|
|
|
return
|
|
|
}
|
|
|
- guard let directoryPush = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "directoryID == %@", directoryIDPush)) else {
|
|
|
+ guard let directoryPush = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.activeAccount, serverUrlPush)) else {
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -686,7 +685,7 @@ class NCOffline: UIViewController ,UICollectionViewDataSource, UICollectionViewD
|
|
|
|
|
|
let ncOffline:NCOffline = UIStoryboard(name: "NCOffline", bundle: nil).instantiateInitialViewController() as! NCOffline
|
|
|
|
|
|
- ncOffline.directoryID = directoryIDPush
|
|
|
+ ncOffline.serverUrl = serverUrlPush
|
|
|
ncOffline.titleCurrentFolder = metadataPush!.fileNameView
|
|
|
|
|
|
self.navigationController?.pushViewController(ncOffline, animated: true)
|