Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
2 changes: 2 additions & 0 deletions iOSClient/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
if isUiTestingEnabled {
NCAccount().deleteAllAccounts()
}
UINavigationBar.appearance().tintColor = NCBrandColor.shared.customer
UIToolbar.appearance().tintColor = NCBrandColor.shared.customer
let utilityFileSystem = NCUtilityFileSystem()
let utility = NCUtility()
var levelLog = 0
Expand Down
28 changes: 28 additions & 0 deletions iOSClient/Data/NCManageDatabase+Metadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1269,4 +1269,32 @@ extension NCManageDatabase {
let concatenatedEtags = metadatas.map { $0.etag }.joined(separator: "-")
return sha256Hash(concatenatedEtags)
}

func getMediaMetadatas(predicate: NSPredicate, sorted: String? = nil, ascending: Bool = false) -> ThreadSafeArray<tableMetadata>? {

do {
let realm = try Realm()
if let sorted {
var results: [tableMetadata] = []
switch NCKeychain().mediaSortDate {
case "date":
results = realm.objects(tableMetadata.self).filter(predicate).sorted { ($0.date as Date) > ($1.date as Date) }
case "creationDate":
results = realm.objects(tableMetadata.self).filter(predicate).sorted { ($0.creationDate as Date) > ($1.creationDate as Date) }
case "uploadDate":
results = realm.objects(tableMetadata.self).filter(predicate).sorted { ($0.uploadDate as Date) > ($1.uploadDate as Date) }
default:
let results = realm.objects(tableMetadata.self).filter(predicate)
return ThreadSafeArray(results.map { tableMetadata.init(value: $0) })
}
return ThreadSafeArray(results.map { tableMetadata.init(value: $0) })
} else {
let results = realm.objects(tableMetadata.self).filter(predicate)
return ThreadSafeArray(results.map { tableMetadata.init(value: $0) })
}
} catch let error as NSError {
NextcloudKit.shared.nkCommonInstance.writeLog("Could not access database: \(error)")
}
return nil
}
}
12 changes: 6 additions & 6 deletions iOSClient/Media/NCMedia.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<device id="retina5_9" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -31,7 +31,7 @@
<outlet property="delegate" destination="EFX-fO-Oip" id="s3n-CL-8X2"/>
</connections>
</collectionView>
<view userInteractionEnabled="NO" alpha="0.0" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7rV-YL-aM7">
<view userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7rV-YL-aM7">
<rect key="frame" x="0.0" y="0.0" width="375" height="150"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
Expand All @@ -51,13 +51,13 @@
<rect key="frame" x="255" y="70" width="20" height="20"/>
<color key="color" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</activityIndicatorView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Enx-va-Bud">
<rect key="frame" x="269" y="65" width="56" height="30"/>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Enx-va-Bud">
<rect key="frame" x="235" y="65" width="90" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="90" id="N4t-Eb-vDt"/>
<constraint firstAttribute="height" constant="30" id="YfM-AZ-ws4"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<inset key="contentEdgeInsets" minX="13" minY="0.0" maxX="13" maxY="0.0"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Title"/>
<connections>
Expand Down
Loading