Skip to content

Commit

Permalink
restore limit
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
  • Loading branch information
marinofaggiana committed Sep 11, 2024
1 parent c9eb60d commit f55b965
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions iOSClient/Media/NCMediaDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ extension NCMedia {
else { return }
self.hasRun = true

var limit = 300
var lessDate = Date.distantFuture
var greaterDate = Date.distantPast
let firstMetadataDate = self.dataSource.getMetadatas().first?.date
Expand Down Expand Up @@ -89,15 +90,19 @@ extension NCMedia {
}
}

NextcloudKit.shared.nkCommonInstance.writeLog("[DEBUG] Start searchMedia with lessDate \(lessDate), greaterDate \(greaterDate)")
if collectionView.visibleCells.count + 100 > limit {
limit = collectionView.visibleCells.count + 100
}

NextcloudKit.shared.nkCommonInstance.writeLog("[DEBUG] Start searchMedia with lessDate \(lessDate), greaterDate \(greaterDate), limit \(limit)")

activityIndicator.startAnimating()

NextcloudKit.shared.searchMedia(path: tableAccount.mediaPath,
lessDate: lessDate,
greaterDate: greaterDate,
elementDate: "d:getlastmodified/",
limit: 300,
limit: limit,
showHiddenFiles: NCKeychain().showHiddenFiles,
account: self.session.account,
options: options) { account, files, _, error in
Expand Down

0 comments on commit f55b965

Please sign in to comment.