|
@@ -121,6 +121,38 @@ extension NCCollectionViewCommon {
|
|
|
)
|
|
|
)
|
|
|
|
|
|
+ //
|
|
|
+ // OFFLINE
|
|
|
+ //
|
|
|
+ if !isFolderEncrypted {
|
|
|
+ actions.append(
|
|
|
+ NCMenuAction(
|
|
|
+ title: isOffline ? NSLocalizedString("_remove_available_offline_", comment: "") : NSLocalizedString("_set_available_offline_", comment: ""),
|
|
|
+ icon: UIImage(named: "offline")!.image(color: NCBrandColor.shared.icon, size: 50),
|
|
|
+ action: { menuAction in
|
|
|
+ if isOffline {
|
|
|
+ if metadata.directory {
|
|
|
+ NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, offline: false, account: self.appDelegate.account)
|
|
|
+ } else {
|
|
|
+ NCManageDatabase.shared.setLocalFile(ocId: metadata.ocId, offline: false)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if metadata.directory {
|
|
|
+ NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, offline: true, account: self.appDelegate.account)
|
|
|
+ NCOperationQueue.shared.synchronizationMetadata(metadata, selector: NCBrandGlobal.shared.selectorDownloadAllFile)
|
|
|
+ } else {
|
|
|
+ NCNetworking.shared.download(metadata: metadata, selector: NCBrandGlobal.shared.selectorLoadOffline) { (_) in }
|
|
|
+ if let metadataLivePhoto = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
|
|
|
+ NCNetworking.shared.download(metadata: metadataLivePhoto, selector: NCBrandGlobal.shared.selectorLoadOffline) { (_) in }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ self.reloadDataSource()
|
|
|
+ }
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
//
|
|
|
// DETAIL
|
|
|
//
|
|
@@ -202,38 +234,6 @@ extension NCCollectionViewCommon {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
- //
|
|
|
- // OFFLINE
|
|
|
- //
|
|
|
- if !isFolderEncrypted {
|
|
|
- actions.append(
|
|
|
- NCMenuAction(
|
|
|
- title: isOffline ? NSLocalizedString("_remove_available_offline_", comment: "") : NSLocalizedString("_set_available_offline_", comment: ""),
|
|
|
- icon: UIImage(named: "offline")!.image(color: NCBrandColor.shared.icon, size: 50),
|
|
|
- action: { menuAction in
|
|
|
- if isOffline {
|
|
|
- if metadata.directory {
|
|
|
- NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, offline: false, account: self.appDelegate.account)
|
|
|
- } else {
|
|
|
- NCManageDatabase.shared.setLocalFile(ocId: metadata.ocId, offline: false)
|
|
|
- }
|
|
|
- } else {
|
|
|
- if metadata.directory {
|
|
|
- NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, offline: true, account: self.appDelegate.account)
|
|
|
- NCOperationQueue.shared.synchronizationMetadata(metadata, selector: NCBrandGlobal.shared.selectorDownloadAllFile)
|
|
|
- } else {
|
|
|
- NCNetworking.shared.download(metadata: metadata, selector: NCBrandGlobal.shared.selectorLoadOffline) { (_) in }
|
|
|
- if let metadataLivePhoto = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
|
|
|
- NCNetworking.shared.download(metadata: metadataLivePhoto, selector: NCBrandGlobal.shared.selectorLoadOffline) { (_) in }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- self.reloadDataSource()
|
|
|
- }
|
|
|
- )
|
|
|
- )
|
|
|
- }
|
|
|
-
|
|
|
//
|
|
|
// OPEN IN
|
|
|
//
|