Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 6.2.3 #3274

Merged
merged 1,649 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1649 commits
Select commit Hold shift + click to select a range
af086ad
clean
Oct 19, 2024
9db3cb5
Merge branch 'develop' of https://github.com/nextcloud/ios into develop
Oct 19, 2024
e63858a
disable keep screen awake (conflict with VLC)
Oct 19, 2024
beb339c
Fix(l10n): Update translations from Transifex
nextcloud-bot Oct 20, 2024
e48d7b5
build 34
Oct 20, 2024
25e6621
Merge branch 'develop' of https://github.com/nextcloud/ios into develop
Oct 20, 2024
26a44cf
update nextcloudKit
Oct 20, 2024
a047a13
Fix(l10n): Update translations from Transifex
nextcloud-bot Oct 21, 2024
bd94633
Nextcloud x e2 ee signature (#3116)
Oct 21, 2024
07a937e
NCScan added check array
Oct 21, 2024
a4a8404
build 35
Oct 21, 2024
b6f6126
fixed showSourceCode for Brand
Oct 21, 2024
dc721df
Added internal option disable_source_code_in_settings
Oct 21, 2024
b6f6c0c
RESPONSE ERROR - CENTRALIZED
Oct 21, 2024
4e32cc1
comment
Oct 21, 2024
e84cae9
fix
Oct 21, 2024
b0fce75
Fix scrolling bug (#3117)
mpivchev Oct 21, 2024
dbe8e8e
Fix(l10n): Update translations from Transifex
nextcloud-bot Oct 22, 2024
1a5a281
Update localization
Oct 22, 2024
d99c1e7
Nextcloudkit 5.0
Oct 22, 2024
a7532a2
Fix polling timer not stopping
mpivchev Oct 22, 2024
900b187
Fix(l10n): Update translations from Transifex
nextcloud-bot Oct 23, 2024
c277bef
Test: In background max 2 upload otherwise iOS Termination Reason: RU…
Oct 23, 2024
4e55fd3
Fix(l10n): Update translations from Transifex
nextcloud-bot Oct 24, 2024
2f93550
Merge remote-tracking branch 'origin/master' into develop
Oct 24, 2024
4adbbbc
Fix(l10n): Update translations from Transifex
nextcloud-bot Oct 25, 2024
116f5e3
Quey metadata status hide in view (#3126)
Oct 25, 2024
48e4e89
V 6.0.1
Oct 25, 2024
959e715
added timing
Oct 25, 2024
6d2ef8b
DB normalized
Oct 25, 2024
901296f
cleaning code
Oct 25, 2024
61a6ebe
Improvements (#3127)
Oct 25, 2024
853171c
Ignore screen awake when media playing (#3128)
mpivchev Oct 25, 2024
a2a8e86
V 6.1.0
Oct 25, 2024
0f626fa
add option to sync favorites only (#3105)
sp00ktober Oct 25, 2024
d2d084d
lint
Oct 25, 2024
e20b799
code improved
Oct 25, 2024
ff5ef12
Fix(l10n): Update translations from Transifex
nextcloud-bot Oct 26, 2024
1fd097b
3097 make copy with copy button within same folder (#3130)
Oct 26, 2024
a0c85a0
Fix(l10n): Update translations from Transifex
nextcloud-bot Oct 27, 2024
14c8391
https://github.com/nextcloud/ios/issues/3131
Oct 27, 2024
11a47e4
https://github.com/nextcloud/ios/issues/3129
Oct 27, 2024
c5dd9e8
fix reload data source
Oct 27, 2024
61e821b
build 1
Oct 27, 2024
5627e3c
Select create folder (#3133)
Oct 28, 2024
9127141
build 2
Oct 28, 2024
0bc3d3f
Autoupload favorite (#3135)
Oct 28, 2024
e395dfb
3134 bug unable to share a document in offline mode (#3136)
Oct 28, 2024
7d96c24
Fix(l10n): Update translations from Transifex
nextcloud-bot Oct 29, 2024
b81a386
build 4 - closed
Oct 29, 2024
dbb7772
Merge remote-tracking branch 'origin/master' into develop
Oct 29, 2024
d227898
fix (#3141)
Oct 29, 2024
e283fe2
Version 6.1.1
Oct 29, 2024
97e3003
fix (#3142)
Oct 29, 2024
1060f80
fix e2ee share ext
Oct 29, 2024
2cf5bf1
fix E2EE create preview (#3143)
Oct 29, 2024
ea4affc
GUI fix - left menu (refresh)
Oct 29, 2024
f0e8a9b
Fix(l10n): Update translations from Transifex
nextcloud-bot Oct 30, 2024
a32f2ef
fix search
Oct 30, 2024
93f292f
Merge branch 'develop' of https://github.com/nextcloud/ios into develop
Oct 30, 2024
3c7db5c
Fix(l10n): Update translations from Transifex
nextcloud-bot Oct 31, 2024
7b869f0
build 1
Oct 31, 2024
f7a2338
Merge remote-tracking branch 'origin/master' into develop
Oct 31, 2024
bb45ba6
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 1, 2024
32609a7
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 2, 2024
a59c94a
fix (#3152)
Nov 2, 2024
3a94b4d
Merge remote-tracking branch 'origin/master' into develop
Nov 2, 2024
0fe8774
fix copy
Nov 2, 2024
4d46188
Merge remote-tracking branch 'origin/master' into develop
Nov 2, 2024
b791cd9
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 3, 2024
4077aa6
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 4, 2024
7432108
https://github.com/nextcloud/ios/issues/3147 (#3158)
Nov 4, 2024
f51d7f1
File provider extension offline (#3159)
Nov 4, 2024
5ca90c7
Merge remote-tracking branch 'origin/master' into develop
Nov 4, 2024
6e67bbd
Auto rename (#3118)
mpivchev Nov 4, 2024
8e86f12
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 5, 2024
f7e5bec
prj
Nov 5, 2024
22a30cd
Merge branch 'develop' of https://github.com/nextcloud/ios into develop
Nov 5, 2024
d71fd32
fix select all (#3165)
Nov 5, 2024
0e5c477
Warn when changing file extension / add "." in front (hidden file) (#…
mpivchev Nov 5, 2024
439b461
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 6, 2024
f3e01b7
new build
Nov 6, 2024
b23dd86
Tests (#3119)
Nov 6, 2024
4cf2e4f
Update README.md (#3171)
mpivchev Nov 6, 2024
542f6c3
fix (#3173)
Nov 6, 2024
aeb97b0
Fix assistant not showing (#3172)
mpivchev Nov 6, 2024
296d2ec
new version (#3174)
Nov 6, 2024
d81ba4a
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 7, 2024
dce8a8c
rollback (#3176)
Nov 7, 2024
d641dd5
auth (#3177)
Nov 7, 2024
4b2f5be
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 8, 2024
4213183
Gui fix improvements (#3178)
Nov 8, 2024
23c5cd3
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 9, 2024
e79bc6f
close build 1
Nov 9, 2024
bbe745e
Merge remote-tracking branch 'origin/master' into develop
Nov 9, 2024
0246a24
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 11, 2024
9b5a523
fix - rollback (#3181)
Nov 11, 2024
39d94d4
Fix black screen (#3182)
Nov 11, 2024
b8983f3
Build 1 - close
Nov 11, 2024
4ca62ad
Merge remote-tracking branch 'origin/master' into develop
Nov 11, 2024
6bfd6f0
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 12, 2024
d75422f
Fix upload conflict
mpivchev Nov 12, 2024
2ecd27a
Rollback string
mpivchev Nov 12, 2024
796de4b
localizable (#3188)
Nov 13, 2024
fb88fff
fix (#3190)
Nov 13, 2024
de9338d
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 14, 2024
982a54e
partial apply for closure #1 in NCManageDatabase.addMetadata(_:) (#3193)
Nov 14, 2024
37d28f2
v 6.1.7 (#3194)
Nov 14, 2024
1c8c76f
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 15, 2024
3654023
Db improvements (#3195)
Nov 15, 2024
83377ad
icon fix
Nov 15, 2024
23d2327
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 16, 2024
5c61597
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 17, 2024
c151500
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 18, 2024
e53c645
https://github.com/nextcloud/ios/issues/3197
Nov 18, 2024
f02efb0
https://github.com/nextcloud/ios/issues/3198
Nov 18, 2024
2465879
fix
Nov 18, 2024
003e7aa
https://github.com/nextcloud/ios/issues/3191
Nov 18, 2024
567888d
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 19, 2024
584d154
fix (#3199)
Nov 19, 2024
2e798a0
build 2
Nov 19, 2024
a12b490
Remove timer
mpivchev Nov 19, 2024
1961250
Merge branch 'develop' of https://github.com/nextcloud/ios into develop
mpivchev Nov 19, 2024
fd6dd98
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 20, 2024
0b7e015
Photo view enhanced (#3202)
Nov 20, 2024
516ce5f
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 21, 2024
6c816ae
build 3
Nov 21, 2024
2b87a21
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 22, 2024
067693e
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 23, 2024
8e0c11c
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 24, 2024
8c90376
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 25, 2024
cbc416c
2x download (#3205)
Nov 25, 2024
42d5adc
Push Notification (#3207)
Nov 25, 2024
22f2d61
Build 4 for TestFlight
Nov 25, 2024
1604c98
UI display issue on account info (#3209)
Nov 26, 2024
c65f610
Improved cache image (#3210)
Nov 26, 2024
858f3db
#2845: Web Fallback for Unified Search Results. (#3183)
i2h3 Nov 27, 2024
0c0caea
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 28, 2024
44c9413
build 6
Nov 28, 2024
57a65b5
Resolved some compiler warnings to reduce clutter in issue navigator.
i2h3 Nov 29, 2024
1a2dd16
Improved right-to-left support in files list layout.
i2h3 Nov 29, 2024
4d72cbd
Improved right-to-left support in files grid layout.
i2h3 Nov 29, 2024
0c15599
Enforce lock option for MDM (#3196)
mpivchev Nov 29, 2024
6e2b567
Fix(l10n): Update translations from Transifex
nextcloud-bot Nov 30, 2024
4cd927a
Merge pull request #3215 from nextcloud/rtl-improvements
i2h3 Nov 30, 2024
c572835
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 1, 2024
995914d
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 2, 2024
b5ed1dc
Fix crash ? (#3217)
Dec 2, 2024
729c962
Revert strings
mpivchev Dec 2, 2024
fd91ece
Build 8
Dec 2, 2024
a0e54a8
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 2, 2024
389e004
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 2, 2024
3ccf96d
added ctrl
Dec 2, 2024
61ecbe9
Merge branch 'develop' of https://github.com/nextcloud/ios into develop
Dec 2, 2024
3ee0cd6
Reinstated Slovenian localization.
i2h3 Dec 2, 2024
8a8cd70
Reinstated Croatian localization.
i2h3 Dec 2, 2024
2ef7074
Reinstated Lao localization.
i2h3 Dec 2, 2024
c81e9da
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 3, 2024
a2486d1
Merge pull request #3218 from nextcloud/additional-translations
i2h3 Dec 3, 2024
dd6aed9
Improved searchMediaUI (#3219)
Dec 3, 2024
1e86ec8
Improv tamp (#3220)
Dec 3, 2024
2f22637
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 4, 2024
10161bb
close min version.
Dec 4, 2024
1917136
Merge remote-tracking branch 'origin/master' into develop
Dec 4, 2024
b759203
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 5, 2024
c8380af
Provider file extension (#3224)
Dec 5, 2024
d2545f5
Mutual (#3225)
Dec 5, 2024
8c675d2
change NextcloudKit in develop
Dec 5, 2024
196850c
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 6, 2024
410cc1c
close version
Dec 6, 2024
24c89c8
Merge remote-tracking branch 'origin/master' into develop
Dec 6, 2024
dd2e225
cleaning
Dec 6, 2024
76c26e0
fix code
Dec 6, 2024
fa35100
version 6.1.9
Dec 6, 2024
4ccef47
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 7, 2024
078a48c
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 8, 2024
2956337
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 9, 2024
6de46bd
fix (#3232)
Dec 9, 2024
0667986
X-nc-paginate (#3233)
Dec 9, 2024
78e0efc
fix
Dec 9, 2024
d95cfbc
added semaphoreReloadDataSource
Dec 9, 2024
8c0269a
build 1
Dec 9, 2024
2f69aef
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 10, 2024
a2767a2
Terms of service (#3234)
Dec 11, 2024
15a53dd
File provider extension (#3236)
Dec 11, 2024
737d205
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 12, 2024
ba7534e
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 13, 2024
5265493
UI fix (#3238)
Dec 13, 2024
d273d49
build 3
Dec 13, 2024
cd858c5
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 14, 2024
a6c7df7
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 15, 2024
c2d5ca3
Preview media (#3240)
Dec 15, 2024
36cdd3e
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 16, 2024
97bb9c6
Merge remote-tracking branch 'origin/master' into develop
Dec 16, 2024
9f19384
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 18, 2024
0a92c36
Fix freeze (#3244)
Dec 18, 2024
5f704fa
deadlock protection
Dec 18, 2024
4a9ec35
comments added
Dec 18, 2024
8446e56
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 19, 2024
d67f4dc
#3184: Download Limit Support
i2h3 Nov 22, 2024
1965c6b
Updated NextcloudKit reference to files_downloadlimit branch.
i2h3 Nov 27, 2024
9fc3356
Merge remote-tracking branch 'origin/master' into develop
Dec 19, 2024
79127cf
Update iOSClient/Data/NCManageDatabase+DownloadLimit.swift
mpivchev Dec 19, 2024
8f151e4
replace semaphore with InProgress variable
Dec 19, 2024
9f9f6ac
new version
Dec 19, 2024
341c030
Updated NextcloudKit reference to develop branch.
i2h3 Dec 20, 2024
888a216
Merge pull request #3204 from nextcloud/3184-download-limit
i2h3 Dec 20, 2024
bcfb403
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 21, 2024
f152fb3
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 22, 2024
4c76525
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 23, 2024
cd2e24b
fix freezes (#3246)
Dec 23, 2024
41062f1
Add option for in-app browser log in (#3251)
mpivchev Dec 23, 2024
de181af
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 24, 2024
4a7ddc2
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 25, 2024
2ba8a4b
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 26, 2024
5c940d8
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 27, 2024
89ea013
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 28, 2024
70b657e
Fix(l10n): Update translations from Transifex
nextcloud-bot Dec 30, 2024
1c4bf38
3235 unable to copy link to shared item (#3254)
Dec 30, 2024
fad47e0
Recommended files (Test) API (#3256)
Jan 2, 2025
b79df3f
Fix(l10n): Update translations from Transifex
nextcloud-bot Jan 3, 2025
eaf35c7
Fix(l10n): Update translations from Transifex
nextcloud-bot Jan 4, 2025
d1e4f0d
recommended files (#3264)
Jan 10, 2025
110ddba
Fix(l10n): Update translations from Transifex
nextcloud-bot Jan 11, 2025
66cb58d
fix openURL (#3266)
Jan 11, 2025
0c69df6
Fix(l10n): Update translations from Transifex
nextcloud-bot Jan 12, 2025
ab4da1d
Fix(l10n): Update translations from Transifex
nextcloud-bot Jan 13, 2025
ac1f977
revert 3184-download-limit (#3270)
Jan 13, 2025
c1b05e8
Fix(l10n): Update translations from Transifex
nextcloud-bot Jan 14, 2025
af8d787
header (#3272)
Jan 14, 2025
503851d
Fix(l10n): Update translations from Transifex
nextcloud-bot Jan 15, 2025
1f338e3
https://github.com/nextcloud/ios/pull/3269/files
Jan 15, 2025
c164cb5
cell fixed
Jan 15, 2025
4eda09b
fix section
Jan 15, 2025
04254b7
color
Jan 15, 2025
b5d9867
clean
Jan 15, 2025
5f1859e
cod
Jan 15, 2025
9f25c3f
cod
Jan 15, 2025
6a715d7
cod
Jan 15, 2025
5c2511a
downloadPreview
Jan 15, 2025
c6cbd82
Fix(l10n): Update translations from Transifex
nextcloud-bot Jan 16, 2025
dea86a0
New version
Jan 16, 2025
c021fdb
Fix login poll timer not cancelling
mpivchev Jan 16, 2025
f859d50
E2EE force refresh after create dir
Jan 16, 2025
43fbd94
version 6.2.3
Jan 16, 2025
f663eab
Additional checks for timer
mpivchev Jan 16, 2025
7906689
Merge branch 'develop' of https://github.com/nextcloud/ios into develop
mpivchev Jan 16, 2025
4be292a
Fix(l10n): Update translations from Transifex
nextcloud-bot Jan 17, 2025
f0c7a2f
menu FIX
Jan 17, 2025
e5228a5
Merge remote-tracking branch 'origin/master' into develop
Jan 17, 2025
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
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ disabled_rules:
- type_name
- void_function_in_ternary
- switch_case_alignment
- unavailable_condition
excluded:
- Carthage
- Pods
Expand Down
2 changes: 1 addition & 1 deletion Brand/Database.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ import Foundation
// Database Realm
//
let databaseName = "nextcloud.realm"
let databaseSchemaVersion: UInt64 = 367
let databaseSchemaVersion: UInt64 = 370
1 change: 1 addition & 0 deletions Brand/NCBrand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ let userAgent: String = {
var doNotAskPasscodeAtStartup: Bool = false
var disable_source_code_in_settings: Bool = false
var enforce_passcode_lock = false
var use_in_app_browser_for_login = false

// (name: "Name 1", url: "https://cloud.nextcloud.com"),(name: "Name 2", url: "https://cloud.nextcloud.com")
var enforce_servers: [(name: String, url: String)] = []
Expand Down
68 changes: 56 additions & 12 deletions Nextcloud.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions iOSClient/Data/NCManageDatabase+Capabilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
let groupfolders: GroupFolders?
let securityguard: SecurityGuard?
let assistant: Assistant?
let recommendations: Recommendations?

enum CodingKeys: String, CodingKey {
case filessharing = "files_sharing"
Expand All @@ -110,6 +111,7 @@
case external, groupfolders
case securityguard = "security_guard"
case assistant
case recommendations
}

struct FilesSharing: Codable {
Expand Down Expand Up @@ -280,6 +282,10 @@
let enabled: Bool?
let version: String?
}

struct Recommendations: Codable {
let enabled: Bool?
}
}
}
}
Expand Down Expand Up @@ -383,6 +389,9 @@
capabilities.capabilityForbiddenFileNameCharacters = data.capabilities.files?.forbiddenFileNameCharacters ?? []
capabilities.capabilityForbiddenFileNameExtensions = data.capabilities.files?.forbiddenFileNameExtensions ?? []

// TODO: not yet available (IN TEST)

Check warning on line 392 in iOSClient/Data/NCManageDatabase+Capabilities.swift

View workflow job for this annotation

GitHub Actions / Lint

Todo Violation: TODOs should be resolved (not yet available (IN TEST)) (todo)

Check warning on line 392 in iOSClient/Data/NCManageDatabase+Capabilities.swift

View workflow job for this annotation

GitHub Actions / Lint

Todo Violation: TODOs should be resolved (not yet available (IN TEST)) (todo)
// capabilities.capabilityRecommendations = data.capabilities.recommendations?.enabled ?? false

NCCapabilities.shared.appendCapabilities(account: account, capabilities: capabilities)

return capabilities
Expand Down
71 changes: 71 additions & 0 deletions iOSClient/Data/NCManageDatabase+RecommendedFiles.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2024 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation
import RealmSwift
import NextcloudKit

class tableRecommendedFiles: Object {
@Persisted var account = ""
@Persisted var id = ""
@Persisted(primaryKey: true) var primaryKey = ""
@Persisted var timestamp: Date?
@Persisted var name: String = ""
@Persisted var directory: String = ""
@Persisted var extensionType: String = ""
@Persisted var mimeType: String = ""
@Persisted var hasPreview: Bool = false
@Persisted var reason: String = ""

convenience init(account: String, id: String, timestamp: Date?, name: String, directory: String, extensionType: String, mimeType: String, hasPreview: Bool, reason: String) {
self.init()

self.account = account
self.id = id
self.primaryKey = account + id
self.timestamp = timestamp
self.name = name
self.directory = directory
self.extensionType = extensionType
self.mimeType = mimeType
self.hasPreview = hasPreview
self.reason = reason
}
}

extension NCManageDatabase {
func createRecommendedFiles(account: String, recommendations: [NKRecommendation]) {
do {
let realm = try Realm()

try realm.write {
// Removed all objct for account
let results = realm.objects(tableRecommendedFiles.self).filter("account == %@", account)

realm.delete(results)

// Added the new recommendations
for recommendation in recommendations {
let recommendedFile = tableRecommendedFiles(account: account, id: recommendation.id, timestamp: recommendation.timestamp, name: recommendation.name, directory: recommendation.directory, extensionType: recommendation.extensionType, mimeType: recommendation.mimeType, hasPreview: recommendation.hasPreview, reason: recommendation.reason)
realm.add(recommendedFile)
}
}
} catch let error {
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not write to database: \(error)")
}
}

func getRecommendedFiles(account: String) -> [tableRecommendedFiles] {
do {
let realm = try Realm()
let results = realm.objects(tableRecommendedFiles.self).filter("account == %@", account)

return Array(results.map { tableRecommendedFiles.init(value: $0) })
} catch let error {
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Could not access database: \(error)")
}

return []
}
}
1 change: 1 addition & 0 deletions iOSClient/Data/NCManageDatabase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class NCManageDatabase: NSObject {
self.clearTable(tableTrash.self, account: account)
self.clearTable(tableUserStatus.self, account: account)
self.clearTable(tableVideo.self, account: account)
self.clearTable(tableRecommendedFiles.self, account: account)
}

func clearTablesE2EE(account: String?) {
Expand Down
40 changes: 40 additions & 0 deletions iOSClient/Extensions/UIButton+Extension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// UIButton+Extension.swift
// Nextcloud
//
// Created by Milen Pivchev on 17.12.24.
// Copyright © 2024 Marino Faggiana. All rights reserved.
//

extension UIButton {
func hideButtonAndShowSpinner(tint: UIColor = .white) {
self.isHidden = true

let spinnerTag = Int(bitPattern: Unmanaged.passUnretained(self).toOpaque())
if self.superview?.subviews.first(where: { view -> Bool in
return view.isKind(of: UIActivityIndicatorView.self) && view.tag == spinnerTag
}) != nil {
return
}

let spinner = UIActivityIndicatorView(style: .medium)
spinner.tag = spinnerTag
spinner.color = tint
spinner.startAnimating()
spinner.center = self.center
self.superview?.addSubview(spinner)
spinner.translatesAutoresizingMaskIntoConstraints = false
spinner.centerXAnchor.constraint(equalTo: self.centerXAnchor).isActive = true
spinner.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true
}

func hideSpinnerAndShowButton() {
let spinnerTag = Int(bitPattern: Unmanaged.passUnretained(self).toOpaque())
let spinner = self.superview?.subviews.first(where: { view -> Bool in
return view.isKind(of: UIActivityIndicatorView.self) && view.tag == spinnerTag
})

spinner?.removeFromSuperview()
self.isHidden = false
}
}
89 changes: 72 additions & 17 deletions iOSClient/Files/NCFiles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ import RealmSwift
import SwiftUI

class NCFiles: NCCollectionViewCommon {
internal var isRoot: Bool = true
internal var fileNameBlink: String?
internal var fileNameOpen: String?
internal var matadatasHash: String = ""
internal var reloadDataSourceInProgress: Bool = false
internal var semaphoreReloadDataSource = DispatchSemaphore(value: 1)

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
Expand All @@ -50,7 +49,14 @@ class NCFiles: NCCollectionViewCommon {
override func viewDidLoad() {
super.viewDidLoad()

if isRoot {
if self.serverUrl.isEmpty {

///
/// Set ServerURL when start (isEmpty)
///
self.serverUrl = utilityFileSystem.getHomeServer(session: session)
self.titleCurrentFolder = getNavigationTitle()

NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeUser), object: nil, queue: nil) { notification in

if let userInfo = notification.userInfo, let account = userInfo["account"] as? String {
Expand Down Expand Up @@ -88,10 +94,6 @@ class NCFiles: NCCollectionViewCommon {
}

override func viewWillAppear(_ animated: Bool) {
if isRoot {
serverUrl = utilityFileSystem.getHomeServer(session: session)
titleCurrentFolder = getNavigationTitle()
}
super.viewWillAppear(animated)

reloadDataSource()
Expand Down Expand Up @@ -122,12 +124,16 @@ class NCFiles: NCCollectionViewCommon {
// MARK: - DataSource

override func reloadDataSource() {
guard !isSearchingMode,
!reloadDataSourceInProgress
guard !isSearchingMode
else {
return super.reloadDataSource()
}
reloadDataSourceInProgress = true

// Watchdog: this is only a fail safe "dead lock", I don't think the timeout will ever be called but at least nothing gets stuck, if after 5 sec. (which is a long time in this routine), the semaphore is still locked
//
if self.semaphoreReloadDataSource.wait(timeout: .now() + 5) == .timedOut {
self.semaphoreReloadDataSource.signal()
}

var predicate = self.defaultPredicate
let predicateDirectory = NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, self.serverUrl)
Expand All @@ -145,14 +151,16 @@ class NCFiles: NCCollectionViewCommon {
self.dataSource = NCCollectionViewDataSource(metadatas: metadatas, layoutForView: layoutForView)

if metadatas.isEmpty {
reloadDataSourceInProgress = false
self.semaphoreReloadDataSource.signal()
return super.reloadDataSource()
}

self.dataSource.caching(metadatas: metadatas, dataSourceMetadatas: dataSourceMetadatas) { updated in
self.reloadDataSourceInProgress = false
if updated || self.isNumberOfItemsInAllSectionsNull || self.numberOfItemsInAllSections != metadatas.count {
super.reloadDataSource()
self.semaphoreReloadDataSource.signal()
DispatchQueue.main.async {
if updated || self.isNumberOfItemsInAllSectionsNull || self.numberOfItemsInAllSections != metadatas.count {
super.reloadDataSource()
}
}
}
}
Expand All @@ -178,6 +186,26 @@ class NCFiles: NCCollectionViewCommon {
return false
}

///
/// Recommended files
///
if self.serverUrl == self.utilityFileSystem.getHomeServer(session: self.session),
NCCapabilities.shared.getCapabilities(account: self.session.account).capabilityRecommendations {
let options = NKRequestOptions(queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)

NextcloudKit.shared.getRecommendedFiles(account: self.session.account, options: options) { _, recommendations, _, error in
if error == .success,
let recommendations,
!recommendations.isEmpty {
Task.detached {
await self.createRecommendations(recommendations)
}
} else {
NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadRecommendedFiles, userInfo: nil)
}
}
}

DispatchQueue.global().async {
self.networkReadFolder { metadatas, isChanged, error in
DispatchQueue.main.async {
Expand Down Expand Up @@ -340,6 +368,33 @@ class NCFiles: NCCollectionViewCommon {
}
}

private func createRecommendations(_ recommendations: [NKRecommendation]) async {
let home = self.utilityFileSystem.getHomeServer(session: self.session)
var recommendationsToInsert: [NKRecommendation] = []

for recommendation in recommendations {
var metadata = database.getResultMetadataFromFileId(recommendation.id)
if metadata == nil || metadata?.fileName != recommendation.name {
let serverUrlFileName = home + recommendation.directory + recommendation.name
let results = await NCNetworking.shared.readFileOrFolder(serverUrlFileName: serverUrlFileName, depth: "0", showHiddenFiles: NCKeychain().showHiddenFiles, account: session.account)

if results.error == .success, let file = results.files?.first {
let isDirectoryE2EE = self.utilityFileSystem.isDirectoryE2EE(file: file)
let metadataConverted = self.database.convertFileToMetadata(file, isDirectoryE2EE: isDirectoryE2EE)
metadata = metadataConverted

self.database.addMetadata(metadataConverted)
recommendationsToInsert.append(recommendation)
}
} else {
recommendationsToInsert.append(recommendation)
}
}

self.database.createRecommendedFiles(account: session.account, recommendations: recommendationsToInsert)
NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadRecommendedFiles, userInfo: nil)
}

// MARK: - NCAccountSettingsModelDelegate

override func accountSettingsDidDismiss(tableAccount: tableAccount?, controller: NCMainTabBarController?) {
Expand All @@ -349,9 +404,9 @@ class NCFiles: NCCollectionViewCommon {
appDelegate.openLogin(selector: NCGlobal.shared.introLogin)
} else if let account = tableAccount?.account, account != currentAccount {
NCAccount().changeAccount(account, userProfile: nil, controller: controller) { }
} else if isRoot {
titleCurrentFolder = getNavigationTitle()
navigationItem.title = titleCurrentFolder
} else if self.serverUrl == self.utilityFileSystem.getHomeServer(session: self.session) {
self.titleCurrentFolder = getNavigationTitle()
navigationItem.title = self.titleCurrentFolder
}

setNavigationLeftItems()
Expand Down
Loading
Loading